Llama!
Junior Member
Posts: 87
|
Post by Llama! on Sept 9, 2005 15:43:39 GMT
Hello all. Thiss is part 2 of TPL power. This is a verry short one for adding copyright with automatic date. Open up your index.php wich you made in the first tut about TPL power. <?php include("parser.php");
$tpl = new TemplatePower("tpl/layout.tpl"); $tpl->assignInclude("page", "tpl/index.tpl");
$tpl->prepare();
$tpl->assign("title", "Site Title");
$tpl->printToScreen(); ?> That is then what you have right? Now let's add the date part. We need to know the year it is now and when you started. We need to assign that the same as the title. <?php include("parser.php");
$tpl = new TemplatePower("tpl/layout.tpl"); $tpl->assignInclude("page", "tpl/index.tpl");
$tpl->prepare();
$date = date("Y"); $tpl->assign("title", "Site Title"); $tpl->assign("site", "Site name"); //site name, use {site} $tpl->assign("c_now", $date); // date now, use {c_now} $tpl->assign("c_start", "2001"); //date started site, use {c_start}
$tpl->printToScreen(); ?> Now open Index.tpl. Which should have this: This is the main page then. Then we need to add the copyright: This is the main page then. <br><br> ©Copyright {site}, {c_start} - {c_now} Save all and open Hope you understand! Have Fun!
|
|