View Full Version : Need to add some code but do not know where
Diablotic
05-01-2011, 07:43 AM
I have received following instructions in order to add link exchange script but I do not know how to add it to vB:
1. Add this code to your script (in bootstrap or in each php file):
<?php include_once('prolink.php'); ?>
2. Add this code to your template (under menu or in footer)
<?php prolink_getLinks(); ?>
Point 2 is easy, I will add it to the footer or something but what do I do with number 1?
Disasterpiece
05-01-2011, 01:57 PM
1) Easiest way would be to create a plugin with hook @ global start (or similar, not sure how it's exactly called) and insert the code there, so you could make sure that the inclusion is available throughout the whole script call.
2) This code won't work in template files, you can't use php code. A plugin which works with template-hooks seems to be the easiest way to realize this without modifying vb core files.
Diablotic
05-02-2011, 08:29 AM
I was also given this instructions:
In includes/class_bootstrap.php after:
$templater = vB_Template::create("footer");
add
ob_start();
include("prolink.php");
prolink_getLinks();
$prolink = ob_get_clean();
$templater->register("prolink", $prolink);
And in footer add:
{vb:raw prolink}
It appears to work only on my main page but it does not work on any of the thread pages nor forum lists.
Does this code look OK?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.