1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Auto Copyright - Set It Forget It

Discussion in 'White Hat SEO' started by popzzz, Nov 18, 2011.

  1. popzzz

    popzzz Supreme Member

    Joined:
    Apr 12, 2009
    Messages:
    1,337
    Likes Received:
    13,699
    Location:
    Don't touch the REP!

    Add this code to your footers (or bottom of page) once and forget it.
    It's good forever. (or until 2038 LOL)

    Works with HTML or PHP.

    Edit the highlighted to your beginning date and domain and it will appear like below and will auto-update each year.

    Example:
    Copyright © 2007-2011, yourdomain, All WorldWide Rights Reserved

    Code:
    <!-- begin Auto Copyright Script  -->
    <center>
    <script language=javascript type="text/javascript">
    <!--
    today=new Date();
    y0=today.getFullYear();
    document.write('<span style="font: 8pt arial,sans-serif">Copyright © 2007-'+y0+', <a href="http://yourdomain"><b>yourdomain</B></a>, All WorldWide Rights Reserved</span>');
    //--> 
    </script>
    </center>
    <!-- end Auto Copyright Script  -->
    
    Enjoy ..... :cool2:
     
    • Thanks Thanks x 5
    Last edited: Nov 18, 2011
  2. charmol

    charmol Junior Member

    Joined:
    Oct 7, 2011
    Messages:
    173
    Likes Received:
    84
    Location:
    ~| TrOpiCaL PaRaDiSe |~
    Nice piece of code, but can I ask, and this may seem like an uber noob question, but anyways...


    Why is it only good until 2034?

    ~|ChaRoN|~
     
    • Thanks Thanks x 1
  3. onlinewealth

    onlinewealth Junior Member

    Joined:
    Mar 13, 2007
    Messages:
    157
    Likes Received:
    101
    Occupation:
    Direct marketing working at home.
    Location:
    "In a State of Corruption"
    Thanks Popzzz, I was just thinking the other day, there must be a script around that will do this. To have to update many sites can be a pain in the ass, and so not all sites get updated. Perfect timing for me!
     
    • Thanks Thanks x 1
  4. popzzz

    popzzz Supreme Member

    Joined:
    Apr 12, 2009
    Messages:
    1,337
    Likes Received:
    13,699
    Location:
    Don't touch the REP!

    It's not 2034 but 2038 after thinking about it and the answer would be an ulta uber geek answer LOL!

    It's the Unix Millennium Bug, Y2K38 or Y2.038K.

    See more info at: wikipedia.org

    Enjoy ..... :cool2:


     
    • Thanks Thanks x 1
  5. charmol

    charmol Junior Member

    Joined:
    Oct 7, 2011
    Messages:
    173
    Likes Received:
    84
    Location:
    ~| TrOpiCaL PaRaDiSe |~
    hehe, well, i do consider myself an uber geek, even if I'm not quite up to the standards of some on the forum, I'ts just way over my head ;) especially coding and programming, but its something I want to get into.

    Thanks for the link, and I shall read with gusto :)

    ~|ChaRoN|~

    EDIT: It seems that the 2038 issue is much more serious than it sounds lol :eek: Theyre gonna need to find a solution or it looks like theres gonna be some serious mayhem lol
     
    • Thanks Thanks x 1
    Last edited: Nov 18, 2011
  6. upl8t

    upl8t Regular Member

    Joined:
    Apr 9, 2008
    Messages:
    475
    Likes Received:
    84
    Location:
    New Scotland
    Here's a version using php. Should work forever. Just move the function to the top or into an include page and paste the copyright code anywhere you want. Maintainance free.

    Code:
    <?php 
    
    function copyright()
    {
    	$startYear = '2001'; # set this for the start year of the copyright, the current year will update automatically
    	$thisYear = date('Y');
    	if($startYear == $thisYear) 
    	{
    	    return $startYear; 
    	}
    	else 
    	{
    	    return $startYear.' - '.$thisYear; 
    	}
    }
    
    echo 'Copyright ' . copyright() . ' YOUR SITE NAME<br />' . PHP_EOL;
    
    ?>
    
     
  7. popzzz

    popzzz Supreme Member

    Joined:
    Apr 12, 2009
    Messages:
    1,337
    Likes Received:
    13,699
    Location:
    Don't touch the REP!

    I was only kidding about the year 2038 thing (not sure) but if it is affected your PHP version will be affected as well because they both use the system 'Date ()'.

    My version will work on ANY page not just PHP.

    Enjoy ..... :cool2:


     
    • Thanks Thanks x 1
    Last edited: Nov 18, 2011