TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 195,994
  • Total Topics: 21,325
  • Online today: 337
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 264
  • Total: 264

Copyright Notice Block w/auto year

Started by DFDuck, November 19, 2008, 02:38:36 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

DFDuck

I'm not a php coder so don't laugh (too hard).

Why spend the first days of the new year updating the copyright notices on your web site, let php do it.  This little snip works nicely for me as a Bottom Panel Block, the year displayed is always the current year.

phpbox:
echo '<div align="center" class="smalltext">Copyright © '.date("Y",mktime()).' Acme Midget Works, All Rights Reserved</div><br /><br />';


-- Duck

IchBin


Zetan

Sometimes the simplest ideas are the best ones. I'll probably use this, thanks.  :up:

blizz-craft

This block is soo awesome, Im posting so that this can be viewable to others once again!


blizz-craft

This sill works on other versions of tp and smf.

G6Cad

Have you tried it ?  When you have, let us know...

Lesmond

Yep works on smf 119 and tp v1.0 beta 4 in a lower panel  :up:


JPDeni

It's very simple code, using a very basic php command and no database access, so it should work in any php code.

I've been using something similar on my site for quite a while, except that I wanted to include the year we started as well as the current year and my site still uses TP .98, so my code is in the index.template.php file of the theme.


echo '<span class="smalltext">All material Ã,© 2002-' . date("Y") . ' morethanspike.com, unless otherwise noted.</span>';


blizz-craft

Sorry, I was gone for a while, so I couldnt reply... It works like a charm... It also works with other forum softwares such as VB, tested it on my friends site... Its an Outstanding code!

blizz-craft

Well, its very simple to add the year started off on the other code to:
echo '<div align="center" class="smalltext">Copyright Ã,© '.date("Y",mktime()).' Acme Midget Works, All Rights Reserved</div>

';

Year Added:
echo '<div align="center" class="smalltext">Copyright Ã,©2008 '.date("Y",mktime()).' Acme Midget Works, All Rights Reserved</div>

';


JPDeni

Absolutely. Although it can be a simpler than what you have. Instead of


date("Y",mktime())


you can use


date("Y")


It has exactly the same result.

This website is proudly hosted on Crocweb Cloud Website Hosting.