Auto-Update Your Copyright for PhpLD
June 2nd, 2008This is no complicated hack, but it comes in handy because it such a small thing. I know I always forget about it.
Open init.php and find
[php]?>[/php]
Above Add
[php]//Auto Update Copyright
$start_year = ’2007′;
if($stary_year < date('Y')){
$copyright = $start_year . ' - ' . date('Y');
}else{
$copyright = $start_year;
}
$tpl->assign(‘copyright’, ‘Lobo Links Directory © ‘.$copyright);
//Auto Update Copyright[/php]
Open templates/your_template/footer.tpl and add where you want your copyright to show.
[php]{$copyright}[/php]
That is it. Wuwu!
Edit After some discussion on the DP Forums, Aubenry shared a way to do it with smarty.
[php]© Yourdomain.com {if $smarty.now|date_format:”%Y” gt 2007} 2007 – {$smarty.now|date_format:”%Y”} {else} 2007 {/if}All Rights Reserved[/php]
I think I could do a more fancy version, but that one is just too simple.
Related Post
- 10,000 Blogs removed from BlogRush - Thought I would share this email I got from the BlogRush team. Great to see they are trying quality control methods to improve the network. I really e ...
- Using the Linky FireFox Plugin to Speed Up Your Entrecard Drop Rate - Lately I been using a Firefox plugin called Linky to expedite the dropping process. It is not a method I came up with, but no harm in me continuing t ...
- A Very Beginner’s Guide to the Sphinn Network : Tips and Tricks - If you're interested in search engine optimization or trying to stay up to date with the latest buzz happening in the industry, Sphinn is your new hom ...

By Brian on Jun 2, 2008 | Reply
Very handy, I have lost count of the number of times that I have forgot to change mine. Thank for posting this.
By unblock on Jun 2, 2008 | Reply
Thanks for the hack – i got 12 directories and its a pain to change it everytime i do an update or theme change