vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   fetch_template() calls should be replaced fix (https://vborg.vbsupport.ru/showthread.php?t=322581)

regitbull 05-09-2016 04:44 PM

fetch_template() calls should be replaced fix
 
Hello,

I upgraded to vbulletin 4 and i want to install a old plugin that was made for vb3.
I fixed most problems but the last step left is to fix the fetch_template() calls should be replaced error.

I tried to edit it myself after reading some articles but no luck.
Could any of you guys edit the fetch_template line to make it work with vb4?


This is my code:
Code:

        function generate_form_html($hash, $cost, $currency, $subinfo, $userinfo, $timeinfo)
        {
                global $vbphrase, $vbulletin, $stylevar, $show;

                $item = $hash;
                $currency = strtoupper($currency);

                $form['action'] = 'payment_gateway.php?method=rbspoint';
                $form['method'] = 'post';

                // load settings into array so the template system can access them
                $settings =& $this->settings;
               
                eval('$form[\'hiddenfields\'] .= "' . fetch_template('subscription_payment_rbspoint') . '";');
                return $form;
        }

Thanks

squidsk 05-09-2016 05:41 PM

Replace:
PHP Code:

eval('$form[\'hiddenfields\'] .= "' fetch_template('subscription_payment_rbspoint') . '";'); 

with:

PHP Code:

$templater vB_Template::create('subscription_payment_rbspoint');
form['hiddenfields'] .= $templater->render(); 

You may need to register some variables for the template to make use of them, the parameters would be the ones to look at. That message is a warning and not an error, so you could leave it as is.

regitbull 05-09-2016 06:10 PM

thank you for your help.


All times are GMT. The time now is 03:58 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01047 seconds
  • Memory Usage 1,715KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete