0
Welcome Guest! Login
0 items Join Now

How to automatically change the copyright year

    • IDesign's Avatar
    • IDesign
    • Hero Rocketeer
    • Posts: 414
    • Thanks: 0

    How to automatically change the copyright year

    Posted 15 years 11 months ago
    • Hello,


      Does anyone knows what is the code for automatic update of the copyright year ? here is what I mean. We all usually put in the bottom of our site a message like this:
      © 2008 Mysite.com - All rights reserved.

      Now here is the beauty: As you see in there there is a number 2008 which tells us the present year. When this year ends and obviously it will in a few weeks we all need to go back to some file and modify it manually to comply with the new year of 2009.

      Now my question I am sure is more clear to you: - Is there a code to attached to this message so that when 2009 comes in January 1 at midnight we don't need to manually change it but the code/script will do that for us automatically.


      Best regards,
      Indrit
    • Last Edit: 15 years 11 months ago by IDesign.
    • You never have a second chance to make a first impression !
    • Kat05's Avatar
    • Kat05
    • Preeminent Rocketeer
    • Posts: 25898
    • Thanks: 334

    Re: How to automatically change the copyright year

    Posted 15 years 11 months ago
    • Hi Indrit!

      I really think it will be more work to write a script and put it on your site, then just going to the copyright date manually and change the year. I actually think it is impossible to write a script for that, but I am not a pro.

      Maybe you have already put more effort into writing this post, than it will take you to change the date manually on dec 31.

      Kind regards, Kat :) :) :)
    • Kat05 / QA Lead & Support / Germany
    • IDesign's Avatar
    • IDesign
    • Hero Rocketeer
    • Posts: 414
    • Thanks: 0

    Re: How to automatically change the copyright year

    Posted 15 years 11 months ago
    • Thanks for the quick reply Kat, but I have seen it somewhere and I don't think it is too much work. I just can't find it today on the net.

      Don't you think it is one less item for us to do in each of our customers site?

      Cheers :)
    • You never have a second chance to make a first impression !
    • prim's Avatar
    • prim
    • Preeminent Rocketeer
    • Posts: 17290
    • Thanks: 217

    Re: How to automatically change the copyright year

    Posted 15 years 11 months ago
    • Try this code in the template's index.php (for Joomla 1.5):

      <div id="copyright">
      © Copyright <span class="year"><?php $now = &JFactory::getDate(); echo $now->toFormat('%Y'); ?></span>, All Rights Reserved
      </div>
    • Last Edit: 15 years 11 months ago by Kevin DuCommun.
    • Please reply with a direct link to the issue & create a new thread for each new issue.

      A template is only as good as the content that goes into it ;) - DanG
    • Enrico's Avatar
    • Enrico
    • Sr. Rocketeer
    • Posts: 234
    • Thanks: 0

    Re: How to automatically change the copyright year

    Posted 15 years 11 months ago
    • There's also a J1.5 module on JED:
      BROKEN LINK REMOVED
    • Last Edit: 8 years 11 months ago by Kat05.
    • Leckenby's Avatar
    • Leckenby
    • Elite Rocketeer
    • Posts: 714
    • Thanks: 0

    Re: How to automatically change the copyright year

    Posted 15 years 11 months ago
    • if your PHP is set to the right year etc etc, you could use:

      <?php echo date("Y"); ?>
    • prim's Avatar
    • prim
    • Preeminent Rocketeer
    • Posts: 17290
    • Thanks: 217

    Re: How to automatically change the copyright year

    Posted 15 years 11 months ago
    • Leckenby wrote:
      if your PHP is set to the right year etc etc, you could use:

      <?php echo date("Y"); ?>

      Yeah, would work in J! 1.0 :P
    • Please reply with a direct link to the issue & create a new thread for each new issue.

      A template is only as good as the content that goes into it ;) - DanG
    • Leckenby's Avatar
    • Leckenby
    • Elite Rocketeer
    • Posts: 714
    • Thanks: 0

    Re: How to automatically change the copyright year

    Posted 15 years 11 months ago
    • and 1.5 :P
  • Re: How to automatically change the copyright year

    Posted 15 years 11 months ago
    • Leckenby, I think that code is missing , time()

      <?php echo date("Y", time()); ?>
    • / Djamil Legato / Lead Developer /
    • Leckenby's Avatar
    • Leckenby
    • Elite Rocketeer
    • Posts: 714
    • Thanks: 0

    Re: How to automatically change the copyright year

    Posted 15 years 11 months ago
    • why do you need time to display the year?

Time to create page: 0.061 seconds