How to put php code in wrapper

Various mods to change or add features.

How to put php code in wrapper

Postby Astroman » 2010-06-19 10:08 am

Can someone show be how I put a simple php code, echo date ('Y'); for instance, into the wrapper template file?

I know you can't put it straight in there, that I'd have to put a template code in like {$my_date} in the file, but I don't undertsand how to achieve the other part of the system?

It seems similar to smarty, but there's no tpl files etc. Does this type of system have a name so I can learn how to use it?
Astroman
Newbie
 
Posts: 8
Joined: 2007-12-25 09:46 pm

Re: How to put php code in wrapper

Postby Basti » 2010-06-19 11:15 am

open up sources/misc/skin.php

i usually put all my php code right above
Code: Select all
// Featured Member


Code: Select all
$TMPL['test'] = "test";

and {$test} in wrapper outputs "test"

to use something like date function use this
Code: Select all
$TMPL['date'] = date("F j, Y, g:i a");

wrapper = {$date}

this outputs June 19, 2010, 9:15 am


skin.php works sidewide, while rankings.php only work for the ranking page, or stats.php only on the stats page
Basti
Advanced Member
 
Posts: 1619
Joined: 2004-06-20 06:17 pm
Location: Germany

Re: How to put php code in wrapper

Postby Astroman » 2010-07-14 06:30 am

Thanks, that's great.
Astroman
Newbie
 
Posts: 8
Joined: 2007-12-25 09:46 pm


Return to Mods

Who is online

Users browsing this forum: No registered users and 4 guests

cron