0
Welcome Guest! Login
0 items Join Now

Add Copyright {CurrentYear} to built in.

  • Add Copyright {CurrentYear} to built in.

    Posted 13 years 10 months ago
    • Hello,

      Copyright is one of those often used features that can be made so much better. My suggestion is to generate a replaceable field for the Gantry Copyright Field in the backend. {CurrentYear} which when processed would be replaced with the PHP date("Y") function.

      This would allow people to enter a copyright like this:

      Copyright © 2009-{CurrentYear} RocketTheme, LLC - All Rights Reserved

      Now, when January 1st comes around, you do not have to open up every website you have and update the copyright.

      I just thought this would be one of those nice things to do for people or for yourselves. Think of all the sites and demo templates you have to update manually. This could save you time.

      - Roger
    • morktron's Avatar
    • morktron
    • Jr. Rocketeer
    • Posts: 41
    • Thanks: 0

    Re: Add Copyright {CurrentYear} to built in.

    Posted 13 years 10 months ago
    • Great idea Roger, unless or until this is happens I'm just going to have to put in the copyright in the template as I don't want to manually update all my clients sites every year ;)
  • Re: Add Copyright {CurrentYear} to built in.

    Posted 13 years 10 months ago
    • I wish there was a RokCandy macro for this or the ability to add a little php code directly to the CustomHTML mod, but that didn't work. It would be great if RokCandy could be upgraded to support things like [CurrentYear] [UserName] [URL]. A whole bunch of short cuts could be created for that.

      I see that there is a custom PHP plug-in that may work:

      http://www.fijiwebdesign.com/products/joomla-php-plugin.html

      Using the example, we can use the On Prepare to effect a string replacement. Still editing the template is probably the easiest, it is just not modular so if someone updates the template directly, boom the custom edit is gone.

      - Roger
  • Re: Add Copyright {CurrentYear} to built in.

    Posted 13 years 9 months ago
    • Hello,

      I found the file to edit to make this happen. It is a bit of a hack since I would much rather put this in a larger global search and replace function.

      Here is the code:
      Edit /templates/<yourTemplate>/features/copyright.php

      find:
      <span class="copytext"><?php echo $this->get('text'); ?></span>

      and REPLACE it with:
      <?php echo str_replace('{copyY}',date('Y'),$this->get('text'));?></span>

      Then in your Copyright Field you can use {copyY} for the place where you want the current year:
      Copyright 1999 - {copyY} My Company - All Rights Reserved

      Now, when January 1st comes around, you do not have to update the copyright on all your websites.

      - Roger
    • The following users have thanked you: isherwood

    • morktron's Avatar
    • morktron
    • Jr. Rocketeer
    • Posts: 41
    • Thanks: 0

    Re: Add Copyright {CurrentYear} to built in.

    Posted 13 years 9 months ago
    • Excellent well done Roger, good work! thanks for posting it :)

Time to create page: 0.061 seconds