Copyright with current year in footer - automatic updating - suggestion.

312 views
Skip to first unread message

Rob_McC

unread,
Aug 4, 2012, 10:48:09 AM8/4/12
to web...@googlegroups.com
Still new to python and web2py - sure enjoying it,

I wonder if this is a good idea?
Automatic updating year of (c) notice of footer

i.e.
© 2012 Your Company Name

this is updated to the servers clock, automatically changes to 2013, when it is time.

Notes:
  1. I read it is better to use ©  rather than ©  just as the Welcome app used
  2. I removed the 
    {{=T('Copyright')}}
  3. I think the form "© year Your Company Name" is commonly used  (ref: twitter.com and see Google's © notice on web2py google groups). There is no standard format for (c) notices that I know of, and in most jurisdiction, they are optional, as your work is protected from the time you create it - but always a good idea to put on.
  4. I wasn't sure about the import statement or wether I should place a variable somewhere else, or of there are any drawback of this technique.
  5. I like this because it is one less string to translate, and one less thing to update each January. Sites with old  (c) notices look stale. 

Editing file: welcome/views/layout.html

  <div class="footer">
   
<div class="container">    
     
<div class="sixteen columns">
        {{block footer}}
<!-- this is default footer -->
       
<div class="footer-content clearfix">
         
         
<div class="copyright">&#169;
{{
# adds current year, no updating necessary
import datetime
now = datetime.datetime.now()
=" %d" % now.year
}}
          Your Company Name          
         
         
</div>          
           
         
<div style="float: right;">
           
<a href="http://www.web2py.com/">
           
<img style="padding-bottom: 0;" src="{{=URL('static','images/poweredby.png')}}"/>
           
</a>
         
</div>
       
</div>
        {{end}}
     
</div>
   
</div><!-- container -->
 
</div><!-- footer -->

Jonathan Lundell

unread,
Aug 4, 2012, 11:37:35 AM8/4/12
to web...@googlegroups.com
On 4 Aug 2012, at 7:48 AM, Rob_McC <mrmcc...@gmail.com> wrote:
Still new to python and web2py - sure enjoying it,

I wonder if this is a good idea?

Using © seems like a good idea, just on i18n grounds. Where did you see &#169; preferred? Sounds like advice for really old browsers (using IE4, anyone?). 

I question whether it's worth adding this overhead to every request. How likely is it that a design will not be refreshed for enough years to be out of date (and in such a case, an old copyright date is probably appropriate).

Finally, there's a legal argument for leaving it alone. The © date is the date of first publication, not necessarily the date of the last edit.

And a minor issue: with the server and client in different timezones, this logic will show © 2013 for as much as a day at the end of 2012. Easy enough to fix (subtract a day, or a month, from now()), but still, it seems to me that the best approach is to leave the year static and arrange so that it can be updated in one place as appropriate.


--
 
 
 


Rob_McC

unread,
Aug 4, 2012, 12:04:26 PM8/4/12
to web...@googlegroups.com
Thanks for insight...

Q: Where did you see &#169; preferred?
"However,... always use the  number code instead of the symbol code.... &#169;"
    (after examining the site, maybe not an authority? :)

Comment:
>Finally, there's a legal argument for leaving it alone. The © date is the date of first publication, not necessarily the date of the last edit.
. I know what you mean. I remember Micro$oft using a range of dates on software  (c) Microsoft 1996-2003  
  but, as I mentioned, notice is optional (at least in Can and USA) - and one would have to proof the date of creation if challenged.

>I question whether it's worth adding this overhead to every request
. I think I'll just hard code it, as I hope to have a very busy site someday.

Thanks
~Rob

Jonathan Lundell

unread,
Aug 4, 2012, 12:17:16 PM8/4/12
to web...@googlegroups.com
On 4 Aug 2012, at 9:04 AM, Rob_McC <mrmcc...@gmail.com> wrote:
Thanks for insight...

Q: Where did you see &#169; preferred?
"However,... always use the  number code instead of the symbol code.... &#169;"
    (after examining the site, maybe not an authority? :)

I think that site is pretty good, but that specific advice is perhaps a little stale. My rationale for sticking with &copy; is just for readability—and that's not a terribly strong argument, since it's fairly clear from context what &#169; must be...

Alec Taylor

unread,
Aug 4, 2012, 12:59:29 PM8/4/12
to web...@googlegroups.com
On a slightly unrelated note, can we update the copyright all over web2py.com and the layout.html that is shipped with newer web2py versions to 2012?

--
 
 
 

Massimo Di Pierro

unread,
Aug 5, 2012, 8:59:58 PM8/5/12
to web...@googlegroups.com
Right. Consider it done.

Annet

unread,
Aug 6, 2012, 1:26:02 AM8/6/12
to web...@googlegroups.com
Whether or not it's worth adding a copyright date like this:


{{
# adds current year, no updating necessary
import datetime
now = datetime.datetime.now()
=" %d" % now.year
}}

This is much shorter:

 {{=request.now.year}}


Annet.

Massimo Di Pierro

unread,
Aug 6, 2012, 8:25:42 AM8/6/12
to web...@googlegroups.com
I fixed this where possible,

Rob_McC

unread,
Aug 6, 2012, 9:08:10 AM8/6/12
to web...@googlegroups.com
Thanks Annett for one line solution. It worked.
Rob

Annet

unread,
Aug 6, 2012, 9:24:57 AM8/6/12
to web...@googlegroups.com

Thanks Annett for one line solution. It worked.

You're welcome.

Annet

Cliff Kachinske

unread,
Aug 6, 2012, 2:35:53 PM8/6/12
to web...@googlegroups.com
Sorry for hijacking this thread, but I feel there's an important point that needs to be made.

I've been following technology-related legal issues on groklaw.net since the SCO Group launched its infamous anti-Linux lawsuits.

If there's one thing I've learned, it's this:  if you want to know how to protect your work via copyright, talk to a lawyer.

This is especially true in an international forum like this because copyright law differs from country to country.

Katie Fairbank

unread,
Jan 1, 2014, 11:25:44 AM1/1/14
to web...@googlegroups.com
Annet - Would you be so kind as to advise me on what code i need (and where to add it) so that my copyright year will auto update?  I use google sites to post printer ready recipes (ie - https://sites.google.com/site/mkfairbank/coconutmacaroons). I would like to keep my current copyright format but add code replacing the current year so that it will auto update each year. 

many thanks.

黄祥

unread,
Jan 1, 2014, 11:35:27 AM1/1/14
to web...@googlegroups.com
i think you can achieve it with request.now.year
please check the web2py layout that ship with web2py welcome app. something like :
                <center><span>{{=T('Copyright')}} &#169; {{=request.now.year}}. 
                {{=T('All rights reserved.')}}

code above, i'd take from web2py welcome app.

best regards,
stifan

Jonathan Lundell

unread,
Jan 1, 2014, 12:12:21 PM1/1/14
to web2py
On 1 Jan 2014, at 8:25 AM, Katie Fairbank <mkfai...@gmail.com> wrote:
Annet - Would you be so kind as to advise me on what code i need (and where to add it) so that my copyright year will auto update?  I use google sites to post printer ready recipes (ie - https://sites.google.com/site/mkfairbank/coconutmacaroons). I would like to keep my current copyright format but add code replacing the current year so that it will auto update each year. 


In the US, at least, the copyright year is the year of first publication, even if changes are made: http://www.copyright.gov/circs/circ01.pdf
Reply all
Reply to author
Forward
0 new messages