PDA

View Full Version : PHP on template


Favourtism
05-27-2009, 03:03 AM
I got some PHP I need on a template so I made a plugin in parse_templates with;

// Do not edit this lol.

$time = date('G'); //return current hour (server time)

if($time < 7 || $time > 21) echo 'theme/header1.png'; // 9;00pm -> 6:00am
else echo 'theme/header.png'; //7am ->8pm

On forumhome at the top, it shows theme/header.png in clear text. I need to get the theme/header.png or header.png (depending on what the code produces) to be inside a div tag in the header template.

How do i do this

Lynne
05-27-2009, 03:10 AM
You should assign the results to a variable ($my_variable = 'theme/header1.phg';) and then spit the variable out in the template.