Recent Topics

1 Jan 12, 2005 08:46    

UPDATE: New version with metadata realeased. Same link, see [url=]notes below[/url].

I posted this in the "Feature Request" forum (because it was a request), but it belongs here too!

I have put together a [url=]Creative Commons Plugin.[/url]

It is a toolbar plugin aimed at adding a Creative Commons License to each post, not your blogs, skins, or anything else.

It adds the code to the bottom of your post, but that's the only way to keep this a plugin not a hack. :)

You select a License, then you have a choice between 3 display options:

Text Only
This just says "This post is licensed under a Creative Commons License." with a link to your license.

This adds the common "Some Rights Reserved" rectangular image to the text.
(or "No Rights Reserved" if you choose Public Domain)

This exchanges the standard image for the cool circular symbols, that fit your License.

I'd love to hear suggestions for other Display Options!

Unzip the file and you will find a php file and a directory called "cc_license". Place them both inside your blogs/plugins/toolbars/ directory. Then add the plugin you [url=]normally would[/url].

This has been tested against only so far.

Creative Commons' RDF metadata is not being used (yet). The b2e parser was giving me crap. I'll add it later, when I figure it out.

Other than that, consider this beta code. Tell me your problems, ideas, etc.!

2 Jan 12, 2005 15:16

Nice plug-in! But I need to change something to work.
in the file: _creativecommons.toolbar.php
line 72 and line 101
comment "echo '<form>';

//              echo '<form>';

                // Licenses
                echo ' <label>License:</label> <select id="ccLicense" name="ccLicense">' . "\n";

                foreach( $this->license as $curLicense )
                    // trim "Creative Commons - " off name to make Select shorter
                    if ( substr( $curLicense->name, 0, 19) == 'Creative Commons - ' )
                        $name = substr( $curLicense->name, 19);
                        $name = $curLicense->name;

                    echo '<option value="'.$curLicense->short_name.'">'.$name.'</option>' . "\n";

                echo '</select>';

                // Display choices
                echo ' <label>Display:</label> <select id="ccDisplay" name="ccDisplay">';
                    echo '<option value="text">Text Only</option>';
                    echo '<option value="standard">Standard</option>';
                    echo '<option value="circle" selected>Symbols</option>';
                    //echo '<option value="hidden">Hidden</option>';
                echo '</select>';

                // Add Button
                echo ' <input type="button" name="ccAdd" value="Add" onclick="javascript:cc_add();" />';

//              echo '</form>';

Thanks danielmorrison!

3 Jan 12, 2005 17:15


Good call.

I fixed it in the file.


4 Jan 12, 2005 21:31

I like it also very much :D, but...
I?m from Germany and wanted to translate your plugin.

As I searched for the German terms to exchange the English ones, i found out 2 or 3 things:

    Chosing a licence directly on moved me on a German page (at least using Firefox)[/list:u]
      The URL of any resulting licence created there ends with "/by/2.0/de/" instead of the "/by/1.0" found in your plugin [/list:u]
        Also a " rel="license" " is put into the link[/list:u] But then I found, which perhaps will help you to reconfigure your plugin (for internationalization)?! So what will we do now? Would you, as you know php and your own plugin more well than me, work on it, or should I try to translate it and, if I'll ever get it to work, post it here? :?: And btw: has anyone using CCL found those circular symbols with black background?

5 Jan 13, 2005 06:01

I've added the language code to the end of licenses. I take the code from the "Language" selector on the Post. (Use the previous download link)

This will pull up a translated version of the licenses if available, and the English version otherwise.

I also added the rel="license" code. Looks like a good idea.

mistake, The [url=]instructions you mentioned [/url] make it easy to use a popup window to select a license direct from CC. I chose to not use this, but what do people think? My method, or just have a link that brings up a popup and does the same thing? I'm open to suggestions.

6 Jan 13, 2005 06:16

Your method. Pulling direct from another website means depending on them being up. I'd opt for "if I'm up then I'm good to go".

I didn't peruse the code much, so I apologize if this is clearly covered in there. How hard would it be to select a default configuration? Like maybe I almost always want the 5th option in the big long window and the text only option in the 3-choice drop down, so could I set that in the plugin file? Basically make it 1 click instead of 3. Those two extra clicks are really tough, ya know?

7 Jan 13, 2005 06:24


The license list is generated on the fly, so I'll have to add some code, but I'll do it right now.

Also, I just realized that some of the links from the [url=]library[/url] I'm using are pointing to 1.0 CC licenses when they should be 2.0. Grrr.

Updates coming soon!

8 Jan 13, 2005 06:36

Oh hey no sweat on my account! Twas just a thought as I started looking earlier today. I thought "if I used this I'd probably have a typical pair of thingies I select so it'd be cool if it got used to me and came up knowing what I was going to pick". If it's not a 'oh yeah that's doable' I wouldn't sweat it that much. I mean, it's only two clicks...

9 Jan 13, 2005 06:53

Ok, one more update (same link). This time I've updated to 2.0 licenses (where appropriate) and allowed default values (near top of file).

* Defaults.  Change these if you wish!
var $defaultLicense = 'Attribution';  // name of License as displayed in popup
var $defaultDisplay = 'symbols';  // can be 'text' 'standard' or 'symbols'

EdB, you're a slave driver! ;)

10 Jan 21, 2005 06:38

I have a new version: 2.0. Use the original link.

This adds RDF metadata (invisible on your pages), and cleans up a few small bugs.

It is now two files and one directory of support files (cc_license). If you are upgrading, make sure you delete the old cc_license directory!

In order to get RDF inserted into the posts, I had to add the renderer plugin file. This has the added benefit of reducing the code inserted into your edit window.

- Put '_creativecommons.toolbar.php' into your 'blogs/plugins/toolbars/' directory.
- Put '_creativecommons.renderer.php' into your 'blogs/plugins/renderers/' directory.
- Put the 'cc_license' directory into your 'blogs/plugins/' directory.

You must have all three of these installed for the plugins to work correctly.

Try it out, report bugs, and think of enhancements!

UPDATE: Oh yeah, this version also wraps the license code inside <span class="cc_license"> so you can customize the display!

11 Jan 21, 2005 08:52

Well. It's about time!

I grabbed the zip but I won't be able to play with it for a while because it looks like a weekend of excessive recreational unpowered aviation. Nice to see the new class!

12 Jan 31, 2005 21:39

danielmorrison wrote:

I have a new version: 2.0. Use the original link.

You must have all three of these installed for the plugins to work correctly.

Try it out, report bugs, and think of enhancements!

Okay, everything is in place, the toolbar shows up, the renderer plugin is listed on the Write page greyed out and with the box checked (settings say that it works always).

When I choose a license from the toolbar, the code is added in the correct place in the post.

But when I publish my post... nothing, nada...

A quick check of the source of the page reveals the code for rendering still sitting there unrendered!!!!!!!!

Help! I really want this to work!

Thanks, Doug.

PS: b2evo:

14 Feb 01, 2005 21:03

Oops. It wiped out my xhtml validation. 21 errors, all due to the RDF stuff following the actual license. The corrective action was very simple and I'm sort of surprised it was the only required step. In _creativecommons.renderer.php find

$html .= $license->get_rdf();
$html .= '</span> <!-- /Creative Commons License -->';

and replace it with

$html .= "</span> <!-- /Creative Commons License -->\n";
$html .= "<!--\n";
$html .= $license->get_rdf();
$html .= "\n-->\n";

It's possible you don't need the \n thingies and could use

$html .= '</span> <!-- /Creative Commons License -->';
$html .= '<!-- ';
$html .= $license->get_rdf();
$html .= ' -->';

but I didn't go that way. I figured first get it out of the cc_license span then get it on it's own lines in the source code the way it's done on That's sort of what surprised me. I figured I would have to open cc_license/cc_license.php and put \ns on the end of each of the little rdf bits, again to match what I see in the org's source, but validation happened so I'm figuring it must be *perfect* now.

15 Feb 03, 2005 14:16

EdB wrote:

thurifer07 I don't know what went wrong for you. Have you also done ?

I just installed it and added a class and it seems to be working like it's supposed to. I haven't actually posted with it but a preview showed me the appropriate content.

Oops, just realised that nothing is rendering--no smilies, no auto p, no nothing!!

So its me and not the CC plugin... any advice on tracking down the problem?


16 Feb 08, 2005 04:50

EdB: Good catch. Thanks.

I updated the download file.

17 Feb 12, 2005 16:22

EdB wrote:

thurifer07 I don't know what went wrong for you. Have you also done ?

This was pretty useful for me - I didn't have the toolbar showing so followed the info on the above link - but didn't know what to put in the .php file... figured it out finally so for any dummies like me


find this or similar

function display()
		$this->init();	// Init if not done yet.


and add


to the end of the list

function display()
		$this->init();	// Init if not done yet.


work brilliantly now :D

18 Feb 15, 2005 17:46

works, but only with firefox not in ie6.0 on my laptop...

19 Feb 15, 2005 17:52

Check your security settings in IE. The plugin requires JavaScript to be enabled (for the menus).

20 Feb 15, 2005 17:55

i think its enabled. the normal toolbar works too. strange.

21 Mar 26, 2005 17:26

it is a great plugin! :D

but I have the same problem with nemster, an Javascript error was found in my page~ (IE 6.0 sp2)

the code in _creativecommons.toolbar.php

I check the code, in the line of "uri += '/deed.' + language;"
the error is that the object of uri is not found in javascript~

but it works well in Firefox @@...

		function cc_add() {
		    var myField;
		    if (document.getElementById('content') && document.getElementById('content').type == 'textarea') {
			    myField = document.getElementById('content');
		    else {
			    return false;

		    var license = document.getElementById('ccLicense').options[document.getElementById('ccLicense').selectedIndex].value;
			var display = document.getElementById('ccDisplay').options[document.getElementById('ccDisplay').selectedIndex].value; 
		    // get language from language select on post
		    var language = document.getElementById('post_locale').options[document.getElementById('post_locale').selectedIndex].value.substring(0,2);
		    if ( language != 'en' ) {
			uri += '/deed.' + language;  // add to uri, if not english.  nonsupported languages return english license
			if ( language == 'zh' )
			    uri += '_TW';  // add this for chinese!
			// Show license code		    
		    myField.value += '<!-- Creative Commons License ';
			myField.value += 'license:' + license + ' display:' + display;
		    myField.value += ' -->';



22 Jul 04, 2005 00:05

I've read every post two or three times, tried everything, copied, edited, pasted, deleted, screamed and cried. I can't get this to work. I'm using b2evo v I've placed everything in the proper folders...but I know nothing about coding so I just followed the directions in the posts.

Is there a guide out there to help those of us who are not programmers get this installed? Any help would be appreciated.


23 Jul 04, 2005 18:44


I'd be happy to help, but I need more info. Can you tell me what exactly is happening (or not happening) and what you've tried? Private message me, if you'd like, and I'll do my best to help.

24 Sep 14, 2005 20:08

o, man. if it wasn't for sunset I would still be knocking my head on the wall, trying to figure out what I did wrong. I heard EdB talking about adding a class but nobody ever said where we should do it (even in the install info it is missing) for a newbie like me this is important info, cannot be left out :D

25 Oct 07, 2005 02:39

I thought I read the instructions and followed them, but I am getting a fatal error after implementing this plugin.

I downloaded the plugin and unzipped it. I then put the toolbar php and the CC License folder in the plugin directory. I put the renderer php in the renderer directory. I have had to remove the changes because of the fatal area. I know this must be simple and I must be doing something wrong.

26 Feb 20, 2006 21:00

I got it installed and noticed that it defaults to always adding the license.

For the most part I don't have a problem with that, but was just wondering, since sometimes I may just ramble instead of creating an article that would be used for distribution, could there be a way to manually check if I want the CC license applied to a post or not?


27 Oct 16, 2006 13:55


I have uploaded the to my plugins folder, i'v read the information on this post, i really want it to work, but i wonder where is the file/folder B2evocore/_class_toolbar.php in the newest 1.8 version of Béevolution.

Thanks in advance for any help regarding this plugin :)


Ben b.

29 Nov 21, 2006 12:25


is this plugin available for 1.8.5 ?


30 Nov 21, 2006 15:05

The plugin in this thread won't but the version available from the plugins page will. I just tested it.

31 Apr 04, 2007 02:23

Any chance a CC version 3.0 update anytime soon?

I tried editing the files of the plugin but to no avail, it won't show the cc license anymore.

Form is loading...