![]() |
How using php/mysql in template into IF conditions
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? |
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.
|
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 Code:
<p>Plugin: $testoski</p> |
That should work. Have you turned on the Plugin System in vBulletin Options?
|
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 :) |
Now it works!
I hadn't active plugin/hook systems. Thanks. |
All times are GMT. The time now is 04:09 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|