PDA

View Full Version : How to use custom php in templates?


Xarwin
09-05-2015, 10:50 AM
Okay,

I'm going to throw up this new thread because of this (https://vborg.vbsupport.ru/showpost.php?p=2554253&postcount=4) and I still have some other php scripts I want to use.

Could someone inform me how to use custom php in vBulletin templates?

Honestly, I've been searching a lot and I can't find a proper guide or explanation to it :(.

HM666
09-06-2015, 07:54 AM
Er, your post does not really help us out much. Need to know what you are trying to do because there maybe a mod already created for what you are doing and you cannot just randomly stick PHP into the HTML templates without great difficulties.

cellarius
09-06-2015, 08:30 PM
You can't use php in templates. Roughly said, templates contain HTML plus variables that vB fills in. PHP goes into plugins, which in turn can save their output into variables, which need to be properly registered and then can be accessed in templates.

Xarwin
09-13-2015, 09:11 PM
Hi,

thanks for the replies.
I kind of got the idea how vBulletin works because of Scandal's work for me.

I generally wanted to know how it would work to pull something out of the database and for example how to call it as {vb:raw example} on a page.

HM666
09-13-2015, 11:16 PM
I'm not 100% sure but you would probably need a plugin at least for that. You have to have code to tell the database what it is pulling out and what to do with it, you can do that with PHP code and a plugin would probably be your best bet.

ozzy47
09-13-2015, 11:33 PM
You would also need to register the variable.

HM666
09-14-2015, 12:53 AM
You would also need to register the variable.

Yeah pretty much what I thought. Its more complicated than just calling one thing.