The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
I have read this manual:
https://vborg.vbsupport.ru/showthread.php?t=98009 How can I insert php code and mysql queries into the forum template? For example, how can I print this: <? if ($aaa = 345) { echo "<p>hello to world</p>"; } ?> in the homepage page? |
#2
|
||||
|
||||
![]()
You use PHP code in plugins and assign data to variables in those plugins. Then you use the variables in your template. PHP code can not be directly run in templates.
|
#3
|
|||
|
|||
![]()
Many thanks Dismounted.
Where can I find a simple example/tutorial that explain to me how can I do waht you have explain to me? --------------- Added [DATE]1204380066[/DATE] at [TIME]1204380066[/TIME] --------------- I have create this plugin Code:
Product: vBulletin Hook Location: showthread_complete Title: Helloworld Plugin PHP Code: $testoski = 'hello world'; Plugin is Active: Yes Code:
<p>Plugin: $testoski</p> |
#4
|
||||
|
||||
![]()
That should work. Have you turned on the Plugin System in vBulletin Options?
|
#5
|
||||
|
||||
![]()
also, keep in mind that your variable is ONLY going to show up in showthread.php AFTER the last postbit (per-page), considering the hook location.
if you're trying to run that plugin in the header, navbar, footer, etc.. it's not going to work unless you change the location to global_start ![]() |
#6
|
|||
|
|||
![]()
Now it works!
I hadn't active plugin/hook systems. Thanks. |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|