This has been described around the forum several times; either search or open your own thread, this is not related to the topic of this tutorial.
|
Hello everyone, is there any way to include for example this php:
cotw_func_contest_num.php?do=sotw As a variable in a plugin, then use it in a template? I also created this thread but am also posting here to see if anyone had any further ideas we could try. Any info would be very much appreciated. Thanks for your time everyone. |
I've been driven nuts. All I want to do is output $random_number using rand(1,99999) and I'm stuck.. why have they made this insanely difficult?
|
Quote:
Code:
$random_number = rand(1,99999); Then in the template put HTML Code:
{vb:raw random_number} |
Ok been banging my head on this for quite some time now and completely ready to throw in the towel. I dont know why vB had to make things so damn difficult! It used to be really easy and straight forward to extend vB but not so much now.
I just want to pull in my custom template for adding a value to the postbit userifo part using the template hook "postbit_userinfo_right_after_posts" The variable $post[field5] is already pulled in as I can do the eval like so to test it in the plugin... Code:
if ($post['field5']) If I hard code the template instead of creating it it works fine but I want it to be properly developed and not hacked. Thanks |
Because it's filled in your PHP script, but you never registered it for use in your template, and that's why it's empty there.
The tutorial does state (in bold red ;)) that you have to register every variable and array you want to use in your custom template. Try: Code:
if ($post['field5']) |
Thank You for the reply but I guess I will have to start over at square 1 to get a better understanding of the new vB4 architechure
Ok now I made that change and it work! So even though the variable/array is a standard vB one because I made a custom template I have to register the standard variables too it seems. I thought it was just our custom variables |
Quote:
Code:
ob_start(); Code:
{vb:raw insert_simple_php} actual page http://nycjdm.com/jdmgear.php any ideas? --------------- Added [DATE]1313595423[/DATE] at [TIME]1313595423[/TIME] --------------- Quote:
I have everything working now i just need to figure out how to intergrate it's login with vb4 if anyone could point me in the right direction that would be great. |
Ok, I'm probably overlooking something, or didn't do something right, or something lol, but this is my first time trying to include a custom template within another custom template on vB 4 (it was SO much easier on vB 3 :()
Anyway, this is where I'm at so far: Plugin Hook location: process_templates_complete PHP Code:
I'm calling my sidebar template in my template usml_military_ranks (and many others) by using: Code:
{vb:raw usml_military_ranks_sidebar} In the PHP file for usml_military_ranks I have: PHP Code:
|
You might try taking this line out of the php file:
PHP Code:
you don't need this and the PreRegister, and this line might actually be registering an undefined variable. |
All times are GMT. The time now is 01:35 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|