WP plugin: Blog Copyright

posted on July 15, 2005  (Update: February 2, 2006)

Blog Copyright is a WordPress plugin that displays a dated copyright mark. When displayed on general, category, search and author queries it provides a range of dates (first-last post years); on single posts, Pages and archive queries the year for the content will be used. Name, copyright term and reservation of rights text can be fully customized through tag parameters, or completely overridden with a custom field.

Blog Copyright is not so much a new plugin for me as a collection of code I’ve been using for a while, just now wrapped up in plugin clothing. So those who might be concerned I’m not driving on towards the finish line for a certain other project, rest assured this was little more than a pit stop.

To install the plugin, download the zip file, extract blog-copyright.php, upload this to your wp-content/plugins/ directory, and activate Blog Copyright in WordPress under Plugins. To use, the template tag <?php blog_copyright(); ?> can be placed anywhere in your theme templates.

Usage:

<?php blog_copyright(owner, author, 'idmode', 'customkey', 'before', 'after', 'copyterm', 'rights', in_loop, display); ?>
~or~
<?php szub_blog_copyright('args'); ?>

Parameters*:

owner
(integer -or- string) User ID of copyright holder. Set to 0 (zero) to use the blog name as holder (this is the default). Provide a string to override value and use a custom name for holder: ‘Joe aka The Bloggermeister’.
author
(boolean) Use post or Page author as copyright holder. Set to FALSE (0) to use ‘owner’ (blog name if ‘owner’ set to 0). Default is TRUE (1).
idmode
(enum) Set format for copyright holder’s name. Default is display option set under their user profile. Options:

  • ‘login’ - login name
  • ‘nickname’ - nickname only
  • ‘firstname’ - first name only
  • ‘lastname’ - last name only
  • ‘namefl’ - name in format “firstname lastname”
  • ‘namelf’ - name in format “lastname firstname”
  • ‘namenl’ - name in format “nickname lastname”
customkey
(string) Copyright custom field key expected when using a custom field for individual post or Page copyright information. Example: ‘cc’ (for say a Creative Commons license). Default is ‘copyright’. Using a custom field for copyright info overrides all other parameter values (except ‘before’ and ‘after’)
before
(string) Text or HTML displayed before copyright. Default is ‘<p>’.
after
(string) Text or HTML displayed after copyright. Default is ‘</p>’.
copyterm
(string) Text displayed for copyright term. Default is ‘Copyright&#169;’.
rights
(string) Text displayed for “reservation of rights,” which comes after the copyright holder’s name. Example: ‘All Rights Reserved’. There is no default.
in_loop
(boolean) Whether function is run within The Loop . Set to TRUE (1) if it is. Default is FALSE (0).
display
(boolean) Whether to display copyright notice or return it for use in other code. Set it to FALSE (0) to return only. Default is TRUE (1).

* For boolean parameters, use only the value in parentheses (1 or 0) with szub_blog_copyright().

Examples:

<?php blog_copyright('Bob &amp; Alice Jones', TRUE, 'namefl', '', '<div class="copyright">', '</div>', '', 'All Rights Reserved'); ?>

Display “Bob & Alice Jones” for copyright holder; use author as copyright holder on posts/Pages; firstname lastname for name format; default custom field key; “<div class=”copyright”>” and “</div>” as before and after text (HTML tags); default copyright term; “All Rights Reserved” for reservation of rights text.

<?php szub_blog_copyright('owner=2&author=0&customkey=commons&before=&after='); ?>

Display user #2 for copyright owner; do not use author as copyright holder for posts/Pages; ‘commons’ used for custom field key; no before and after text, defaults for name format, copyright term and reservation of rights.

<?php blog_copyright(); ?>
~or~
<?php szub_blog_copyright(); ?>

Display defaults: blog name as copyright holder; use author as copyright holder on posts/Pages; profile display option for name format; ‘copyright’ used for custom field key; ‘<p>’ and ‘</p>’ for before and after text; default copyright term (Copyright©); no reservation of rights text.

Copyright Resources:

I’m hardly an expert in this (or just about any) area of law, so for information on issues of copyright and intellectual property, check out these sites:

Update [Jul-15-2005] Throwing R1.0.1 out quick. It deals with a small logic problem in how R1 handled the author parameter. Another “bug” I’m aware of but left for now occurs when using <?php blog_copyright(); ?> in The Loop—it displays the range of dates for copyright instead of the year of the current post. I’m currently looking over how to resolve it (or just leave it as is).
Update [Jan-08-2006] R2 - WordPress 2.0 *adjustments*. Dealt with the “another “bug”" mentioned in the previous update by adding the $in_loop parameter. Also slipped in a wrapper function which accepts query string style parameters, and at nine parameters the plugin was begging for it. So if you only need to customize one parameter but it’s buried deep in blog_copyright()’s parameter list, try szub_blog_copyright() instead. All info above reflects these changes.
Update [Feb-02-2006] R2.1 - Just a little addition of the display parameter. Nothing else. Pinky swear.

Author: Kaf Oseo
Categories: WordPress
Comments: (14) · Leave a comment · Comments RSS2 · Trackback URL

TechGnome
Comment » July 15, 2005 @ 1:46 am

Dude! You rock! That is one sweet plugin. Took me all of three minutes to download it and get it tweaked as I wanted. Woo-Hoo!

Tg

Kaf
Comment » July 15, 2005 @ 1:57 am

Glad you like it Tg. Yours is the kind of support comment I’ve always preferred. Surprising, huh?

Craig
Comment » July 16, 2005 @ 7:08 pm

This is awesome, Kaf. Just to add more work onto you by way of a suggestion, it would sure be nice, and a lot easier for dumb moose, to be able to set this up using the Options Panel in the WP backend. :)

Thanks for putting this out, dude. I can’t wait to figure out how to set PHP variables! LMAO!

Chaz
Comment » May 3, 2006 @ 3:51 pm

Hi,

I have several wordpress blogs that I am running with multiple authors. I’d like to give proper credit/copyrights for each author’s post, but this plug in only didplays my display name as the author in any given post.

What am I doing wrong with the plug in such that the sorrect author’s name does not display?

You can view one of the pages here to look at the source code:

http://www.eternalsky.us/Bonegrinder

Thanks!

Ken Savage
Comment » July 8, 2006 @ 12:40 am

Thank you very much. Much easier than editting the footer in Wordpress too often.

Ringo
Comment » February 8, 2007 @ 11:20 pm

Sorry, got a newbie question here…
I’m having trouble working out how to upload this file… all the FAQs on Wordpress seem to say they don’t permit plug-ins!
Can somebody help me out, tad confused here. :)
cheers

Garry
Comment » May 4, 2007 @ 8:11 am

Ringo, use FTP manager to upload files. And than activate plugin in WP admin area.

Jamie
Comment » July 9, 2007 @ 8:35 am

Hi Kaf, firstly thanks for doing this plugin. I use it in my article meta. However, I also use your Post Updated plugin. In situations where an article’s original post year and updated post year are different, is it possible to modify Blog Copyright to give the year range rather than the year it was first posted?

Here’s what I get now:
Posted: 18-Dec-04, 04:12 GMT [+0000] Edit
Updated: 09-Jul-07, 09:30 BST [+0100]
Copyright © 2004 A N Other. All Rights Reserved.

What I’d like to see is this:
Posted: 18-Dec-04, 04:12 GMT [+0000] Edit
Updated: 09-Jul-07, 09:30 BST [+0100]
Copyright © 2004-2007 A N Other. All Rights Reserved.

Is this an easy mod?

Best Regards,
Jamie

Michael
Comment » September 18, 2007 @ 4:04 am

Thanks for the plugin. I run an article directory together with some friends and it was always a problem to add the right copyright at the end. But with this plugin it is so easy. Thanks again.

 

* Required field (e-mail is not published). Breaks and paragraphs are automatic. HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>