View Full Version : use of php programming inside a template
fearfx
09-19-2008, 07:11 PM
Ok. When I go to the Admin CP and edit my templates. If I wanted to add some php programming to a template, how would I go about doing that.
For example: <?php echo 8 + 8; ?> won't work directly in a template. So how do I get it to work.
Gray Matter
09-20-2008, 04:18 AM
You can't execute PHP code within templates. Use a plugin instead.
Lynne
09-20-2008, 04:41 AM
Templates are for html, however there are a couple of php functions that will work in them. See the manual for some of them - Using PHP Functions in Template Conditionals (http://www.vbulletin.com/docs/html/functions_in_conditionals)
If you want to add php, the best way is through the use of plugins.
Dismounted
09-20-2008, 04:54 AM
You can utilise a little work around for your example in templates.
<if condition="$foo = 8 + 8">$foo</if>
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.