NathanLedet
05-18-2010, 11:12 PM
Are there any guides or anything that go over plugin development?
I'm trying to upgrade one of my plugins that uses code from vb3.8 and the error I'm getting is
Warning: fetch_template() calls should be replaced by the vB_Template class.
Where can I read up on the vB_Template Class?
--------------- Added 1274237155 at 1274237155 ---------------
OK I'm slowly starting to figure this out. I'm following along with this guide (http://www.vbulletin.com/forum/entry.php?2388-Using-custom-templates-within-your-own-vBulletin-4-based-files), but I'm only getting a blank screen.
First, I created a plugin, named Nates Tester (product ID: natestester)
Next, I went into the Style Manager, and created a new template in my theme: myCustomTemplate and placed the following code in it:
{vb:raw myScript_variable}
Next, I went to the Product Manager and created a new Product. For "Product" - I selected the plugin that I created earlier - "Nates Tester"
Hook Location - This is the part that confuses me, because I can't leave it blank, and I have no idea which hook to choose. For experiment's sake, I chose global_start - should I choose something different?
For the Title, I used the same as my plugin name - Nates Tester
Execution Order: 5
Plugin PHP Code: as per the guide
$myScript_variable = "Hello there";
$templater = vB_Template::create('myCustomTemplate');
print_output($templater->render());
Set the product to Active.
Then, I refresh the forum and I get a solid white screen. Not quite sure what I'm doing wrong here.
I'd appreciate the help :)
--------------- Added 1274237850 at 1274237850 ---------------
Oh poot. It looks like that guide I followed left out a critical piece of information :rolleyes:
I have to register the variable, with this chunk of code:
$templater->register('myScript_variable', $myScript_variable);
So my final code looks like this:
$templater = vB_Template::create('myCustomTemplate');
$templater->register('myScript_variable', $myScript_variable);
print_output($templater->render());
WORKS!! :D
But, the rest of the forum is gone. all i see is that printed variable. Still tinkin around but making progress :)
I'm trying to upgrade one of my plugins that uses code from vb3.8 and the error I'm getting is
Warning: fetch_template() calls should be replaced by the vB_Template class.
Where can I read up on the vB_Template Class?
--------------- Added 1274237155 at 1274237155 ---------------
OK I'm slowly starting to figure this out. I'm following along with this guide (http://www.vbulletin.com/forum/entry.php?2388-Using-custom-templates-within-your-own-vBulletin-4-based-files), but I'm only getting a blank screen.
First, I created a plugin, named Nates Tester (product ID: natestester)
Next, I went into the Style Manager, and created a new template in my theme: myCustomTemplate and placed the following code in it:
{vb:raw myScript_variable}
Next, I went to the Product Manager and created a new Product. For "Product" - I selected the plugin that I created earlier - "Nates Tester"
Hook Location - This is the part that confuses me, because I can't leave it blank, and I have no idea which hook to choose. For experiment's sake, I chose global_start - should I choose something different?
For the Title, I used the same as my plugin name - Nates Tester
Execution Order: 5
Plugin PHP Code: as per the guide
$myScript_variable = "Hello there";
$templater = vB_Template::create('myCustomTemplate');
print_output($templater->render());
Set the product to Active.
Then, I refresh the forum and I get a solid white screen. Not quite sure what I'm doing wrong here.
I'd appreciate the help :)
--------------- Added 1274237850 at 1274237850 ---------------
Oh poot. It looks like that guide I followed left out a critical piece of information :rolleyes:
I have to register the variable, with this chunk of code:
$templater->register('myScript_variable', $myScript_variable);
So my final code looks like this:
$templater = vB_Template::create('myCustomTemplate');
$templater->register('myScript_variable', $myScript_variable);
print_output($templater->render());
WORKS!! :D
But, the rest of the forum is gone. all i see is that printed variable. Still tinkin around but making progress :)