Log in

View Full Version : How to call a plugin via a template?


Joe
12-13-2006, 10:15 PM
A friend of mine created a simple plugin so i can sell some ads on my site, but I cant figure out how i call the plugin in a template.

The template I'm dealing with is the postbit_legacy template in vb 3.5.4, so I set the hook location as postbit_display_start and named my plugin 'forum ad'

Here is my plugin php code:

switch ($forum[forumid]) {

case "1":
$forumad = "this ad will show up in forum #1";
break;

case "2":
$forumad = "this ad will show up in forum #2";
break;

default:
$forumad = "this is my default ad";
break;
}


Lame question time: What do i put in my template to call this plugin?

Thanks in advance,

evenmonkeys
12-14-2006, 02:37 AM
Try changing your plugin to this:ob_start();
switch ($forum[forumid]) {

case "1":
$forumad = "this ad will show up in forum #1";
break;

case "2":
$forumad = "this ad will show up in forum #2";
break;

default:
$forumad = "this is my default ad";
break;
}
ob_end_clean();Just make sure the hook location is postbit_display_start and then you'll put $forumad wherever you want it to be within your postbit_legacy template.

Joe
12-14-2006, 04:51 PM
Thanks Austin,

That worked just fine. :D

- Joe