TinyPortal

Development => Block Codes => Topic started by: DFDuck on November 19, 2008, 02:38:36 PM

Title: Copyright Notice Block w/auto year
Post by: DFDuck on November 19, 2008, 02:38:36 PM
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
Title: Re: Copyright Notice Block w/auto year
Post by: IchBin on November 19, 2008, 03:05:34 PM
What a great idea DFDuck. Thanks!
Title: Re: Copyright Notice Block w/auto year
Post by: Zetan on November 19, 2008, 03:12:57 PM
Sometimes the simplest ideas are the best ones. I'll probably use this, thanks.  :up:
Title: Re: Copyright Notice Block w/auto year
Post by: blizz-craft on June 17, 2009, 02:38:52 AM
This block is soo awesome, Im posting so that this can be viewable to others once again!
Title: Re: Copyright Notice Block w/auto year
Post by: jdvarner on June 27, 2009, 01:45:38 AM
Awesome!
Title: Re: Copyright Notice Block w/auto year
Post by: blizz-craft on June 27, 2009, 12:33:29 PM
This sill works on other versions of tp and smf.
Title: Re: Copyright Notice Block w/auto year
Post by: G6Cad on June 28, 2009, 12:26:38 PM
Have you tried it ?  When you have, let us know...
Title: Re: Copyright Notice Block w/auto year
Post by: Lesmond on June 28, 2009, 02:52:21 PM
Yep works on smf 119 and tp v1.0 beta 4 in a lower panel  :up:

(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fi41.tinypic.com%2F157yzns.gif&hash=08f7e1c4188b6e8eb652cefcdc981062573a2ee8)
Title: Re: Copyright Notice Block w/auto year
Post by: JPDeni on June 28, 2009, 03:11:16 PM
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>';

Title: Re: Copyright Notice Block w/auto year
Post by: blizz-craft on July 02, 2009, 12:43:38 PM
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!
Title: Re: Copyright Notice Block w/auto year
Post by: blizz-craft on July 21, 2009, 03:48:36 AM
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>

';

Title: Re: Copyright Notice Block w/auto year
Post by: JPDeni on July 21, 2009, 04:34:57 AM
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.