jasharen
09-02-2012, 10:07 PM
Its been a long time for me and I'm trying to get my forum back up and going.
I have upgraded to vb4.2 and am trying to get an old mod working again. Its pretty simple just one issue.
It uses fetch_template which I understand is deprecated. The new format is:
$templater = vB_Template::create('forumhome_event');
$templater->register('callink', $callink);
$templater->register('daysevents', $daysevents);
$templater->register('eventdate', $eventdate);
$templater->register('eventdates', $eventdates);
$upcomingevents = $templater->render();
My mod searchs for a BB element in a post and replaces it with the template using the hook postbit_display_complete:
eval('$newvaluetodisplay= "' . fetch_template("postbit_mytemplate") . '";');
It then does a search and replace on
$newpostmessage = preg_replace("@\[myelement$i\]@i", "$newvaluetodisplay", $post['message']);
I've temporarily fixed it by just by moving the contents of the template into the code itself but I'd like it to be cleaner. :)
Any suggestions?
I have upgraded to vb4.2 and am trying to get an old mod working again. Its pretty simple just one issue.
It uses fetch_template which I understand is deprecated. The new format is:
$templater = vB_Template::create('forumhome_event');
$templater->register('callink', $callink);
$templater->register('daysevents', $daysevents);
$templater->register('eventdate', $eventdate);
$templater->register('eventdates', $eventdates);
$upcomingevents = $templater->render();
My mod searchs for a BB element in a post and replaces it with the template using the hook postbit_display_complete:
eval('$newvaluetodisplay= "' . fetch_template("postbit_mytemplate") . '";');
It then does a search and replace on
$newpostmessage = preg_replace("@\[myelement$i\]@i", "$newvaluetodisplay", $post['message']);
I've temporarily fixed it by just by moving the contents of the template into the code itself but I'd like it to be cleaner. :)
Any suggestions?