PDA

View Full Version : Can someone teach me how to create variables...


koolfire
05-18-2008, 02:26 AM
Please anyone? I am really intrested in learning how to create variables.. I am pretty excited about it..

Thanks

veenuisthebest
05-18-2008, 02:47 AM
$variable = "Is this what you are looking for ??";

Dismounted
05-18-2008, 10:40 AM
I suggest reading some material on PHP.

Opserty
05-18-2008, 12:35 PM
Go learn the php basics. There are hundreds or thousands of tutorials around on the web, just Google "PHP Basics" or else browse the php.net documentation.

koolfire
05-18-2008, 05:37 PM
No guys this aint it..

Alright so there should be a template where here is perfect example

the "navbar" template however you modify it you jus goota write $navbar whereever you want to display it and it will displauy contents of navbar template..

so just 1 variable will do that..

i dont awnt to do this via PHP or anything.

nothing4me
05-18-2008, 08:49 PM
Create a template, remember the name.
Then put $NAME.OF.TEMPLATE wherever you want. Walla! :)

koolfire
05-19-2008, 12:06 AM
:O wholi let me try

Edit Not working! I created a template named cricket and wrote "wow i can do this!!!!! i am great" and then i put $cricket at bottom of navbar i refreshed my site and no change.......

Dismounted
05-19-2008, 10:58 AM
That is still PHP ;).

koolfire
05-19-2008, 01:52 PM
ok so in a random php file i write $variable = "something here";

and it will start working in vbulletin?

Opserty
05-19-2008, 01:56 PM
Create a Plugin (AdminCP > Plugins & Products > Add New Plugin) with the PHP code:
eval('$customvar = "'. fetch_template('customtemplate') .'";');

Choose an appropriate hook location like global_start or something.

Then use $customvar where you want.

koolfire
05-19-2008, 02:08 PM
Thanks alot!!!! It worked

Dismounted
05-20-2008, 06:38 AM
Make sure you add the template to the cache.