Licenses-Talk

Summary: Discussion of Licenses
Version: 20180415
Status: Stable
Maintainer: Petko (original author: Pm)
Categories: Markup PHP72

This is a talk page for improving Licenses.

These updates were contributed by other developers.

Easy 3.0 update + icons for the individual license conditions

in response to Lighans' suggestion below, a new recipe is not required in order update PM's current recipe - rather, one need only add their own up-to-date $LicenseTypeFmt array to their config before loading the licenses.php recipe. In fact, here's a version of $LicenseTypeFmt that includes the possibility of quickly changing the location, version, and size, and also includes the display of icons for the individual license conditions:

$LicenseDefault = 'by-sa-nc';
$LicenseLoc = "/us";  # location is not necessary - the following works without it
$LicenseSize = "88x31";	# regular size
#$LicenseSize = "80x15";  # smaller
$LicenseVersion = "3.0";  # change or update the version

$LicenseTypeFmt = array(
   # main licenses
   'by' => "[[http://creativecommons.org/licenses/by/$LicenseVersion/ | 
      http://i.creativecommons.org/l/by/$LicenseVersion$LicenseLoc/$LicenseSize.png\"Creative Commons License\"]]",
   'by-nd' => "[[http://creativecommons.org/licenses/by-nd/$LicenseVersion/ | 
      http://i.creativecommons.org/l/by-nd/$LicenseVersion$LicenseLoc/$LicenseSize.png\"Creative Commons License\"]]",
   'by-nc-nd' => "[[http://creativecommons.org/licenses/by-nc-nd/$LicenseVersion/ | 
      http://i.creativecommons.org/l/by-nc-nd/$LicenseVersion$LicenseLoc/$LicenseSize.png\"Creative Commons License\"]]",
   'by-nc' => "[[http://creativecommons.org/licenses/by-nc/$LicenseVersion/ | 
      http://i.creativecommons.org/l/by-nc/$LicenseVersion$LicenseLoc/$LicenseSize.png\"Creative Commons License\"]]",
   'by-nc-sa' => "[[http://creativecommons.org/licenses/by-nc-sa/$LicenseVersion/ | 
      http://i.creativecommons.org/l/by-nc-sa/$LicenseVersion$LicenseLoc/$LicenseSize.png\"Creative Commons License\"]]",
   'by-sa' => "[[http://creativecommons.org/licenses/by-sa/$LicenseVersion/ | 
      http://i.creativecommons.org/l/by-sa/$LicenseVersion$LicenseLoc/$LicenseSize.png\"Creative Commons License\"]]",
   'pd' => "[[http://creativecommons.org/licenses/publicdomain/ | 
      http://i.creativecommons.org/l/publicdomain/$LicenseSize.png\"Public Domain Dedication\"]]",

   # individual license condition icons
   'by-icon' => "[[http://creativecommons.org/about/licenses | 
      http://creativecommons.org/images/icons/attrib.gif\"Creative Commons - Attribution\"]]",
   'sa-icon' => "[[http://creativecommons.org/about/licenses | 
      http://creativecommons.org/images/icons/sharealike.gif\"Creative Commons - Share Alike\"]]",
   'nd-icon' => "[[http://creativecommons.org/about/licenses | 
      http://creativecommons.org/images/icons/nomod.gif\"Creative Commons - No Derivative Works\"]]",
   'nc-icon' => "[[http://creativecommons.org/about/licenses | 
      http://creativecommons.org/images/icons/noncomm.gif\"Creative Commons - Noncommercial\"]]",
   'pd-icon' => "[[http://creativecommons.org/about/licenses | 
      http://creativecommons.org/images/icons/pd.gif\"Creative Commons - Public Domain\"]]"
);
include_once("$FarmD/cookbook/licenses.php"); 

As a result, one can call (:license nc-icon:) and get the non-commercial icon to appear... overtones99 August 04, 2009, at 10:42 PM


An updated license recipe, incorporating all of the above!

licenses-2009-08-04.phpΔ - So, this may be a little too complex for such a simple recipe, but I went ahead and created another recipe that takes the modifications mentioned above - the ability to declare a location, to display a license-condition icon, to change the size - and makes them possible at the markup level. This only makes sense for a site where individual users may want to declare different creative commons licenses for different groups or pages; for sites that only need one site-wide license, I recommend just using the original licenses.php by PM.

To start, simply include the file:

include_once("$FarmD/cookbook/licenses-2009-08-04.php");

... and then use any of the following markup to indicate license-type, size, and location (optional):

(:license type=by-nc-nd size=large loc=us:)
or
(:license by-nc-nd size=small:)

This version of the license recipe also incorporates the individual license-condition icons for each aspect of a CC license, i.e. Share Alike, No Derivatives, etc. These are accessed the same as above, but without any size or location arguments, using one of the following arguments - by-icon, sa-icon, nc-icon, nd-icon, pd-icon - as in:

(:license by-icon:)
or
(:license type=by-icon:)

The recipe also permits the following default variables in config.php:

  • $LicenseDefault - i.e. 'by-nc-nd', 'by-icon', ... - used if no type is supplied
  • $LicenseLoc - not required - otherwise enter one of the following two-letter country codes: at, cz, de, ec, es, gr, gt, hk, hr, lu, nl, no, nz, ph, pl, pr, ro, rs, sg, th, us
  • $LicenseSizeDefault - 'large' or 'small' - determines which size license to post if no 'size' argument is provided
  • $LicenseSizeArray - defaults sizes for the two kinds of icons on the creativecommons site - 'large'=>'88x31', or 'small'=>'80x15' - this only applies to the main licenses, not the individual license-condition icons
  • $LicenseVersion - easily update the version your using - default is '3.0'
  • $LicenseBaseLinkURL - base link for most (not all) of the CC-deed link urls - default is http://creativecommons.org/licenses
  • $LicenseBaseImgURL - base link for most (not all) of the CC-image urls - default is http://i.creativecommons.org/l

overtones99 August 04, 2009, at 10:42 PM

History

  • 2009-08-04: added a new receipe, based on the original, that permits markup of the type: (:license type=by-nc-sa size=small loc=es:), along with markup to show individual license-condition icons.
  • 2009-08-04: added an example of a $LicenseTypeFmt array containing v.3.0 icons, PLUS the ability to display the various individual license-condition icons
  • 2007-03-07: This version is for the new creative license 3.0. It also ads nice 80X15px buttons when entering the code. Not sure if I could remove the other one. licenses30.phpΔ Lighans

You can also create a creative commons licence this way[1]

(:comment The default licence:)
[[#include]]
(:div179 class='frame' style='width:24em; font-size:x-small;':)
%rel="license" lfloat%[[http://creativecommons.org/licenses/by-nc-nd/3.0/nz/| http://i.creativecommons.org/l/by-nc-nd/3.0/nz/88x31.png"Creative Commons License"]]
These works are licensed under a Creative Commons %rel="license"%[[http://creativecommons.org/licenses/by-nc-nd/3.0/nz/ | Attribution-Noncommercial-No Derivative Works[[<<]]3.0 New Zealand License]].
(:div179end:)
[[#includeend]]

Creative Commons License

These works are licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works
3.0 New Zealand License
.

  • change licence link as required
  • include into wiki pages as required (possibly using a group footer)

I am looking into putting a more complete CC license into my wiki, which include several non-standard attributes that allow for Semantic web information. The license text if you get it from CC, looks as follows:

 <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/us/">
 <img alt="Creative Commons License" style="border-width:0" src="" /></a>
 <span xmlns:dc="http://purl.org/dc/elements/1.1/" href="http://purl.org/dc/dcmitype/Text" property="dc:title" 
 rel="dc:type">Tamara Temple’s Wiki</span> 
 by <a xmlns:cc="http://creativecommons.org/ns#" href="http://wiki.tamaratemple.com/?n=Profiles.tamara" 
 property="cc:attributionName" rel="cc:attributionURL">Tamara Temple</a> 
 is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/us/">
 Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License</a>.
 Based on a work at 
 <a xmlns:dc="http://purl.org/dc/elements/1.1/" href="http://wiki.tamaratemple.com" rel="dc:source">wiki.tamaratemple.com</a>.

As you can see, there are a few non-standard attributes:

In the first <span>, xmns:dc and property.

In the second <a>, xmlns:cc and property.

In the fourth and last <a>, xmlns:dc.

There are at least a couple of ways to go about this:

  1. Do like licenses.php does and provide a single markup expression that will gather the necessary information and build the html code:
    (:cclicense type=licensetype attribname="Tamara Temple" attriblink="http://wiki.tamaratemple.com/Profiles/Tamara" workname="wiki.tamaratemple.com" worklink="http://wiki.tamaratemple.com/":)
  1. Set up a wikistyle for links and spans and add the attributes for each to that, in a recipe or in config.php
    %xmlns:dc="http://purl.org/dc/elements/1.1/" href="http://purl.org/dc/dcmitype/Text" property="dc:title" 
rel="dc:type"% Tamara Temple&rsquo;s Wiki%% 
I have no idea if you can set an attribute for xmlns:dc via setting $WikiStyleCSS[]="xmlns:dc". It appears putting:
 ## Add WikiStyleCSS attributes for above:
 $WikiStyleCSS[]="xmlns:dc";
 $WikiStyleCSS[]="property";
 $WikiStyleCSS[]="href";
 $WikiStyleCSS[]="xmlns:cc";
into config.php does not do the trick, I'm guessing because of the ":" in xmlns:dc and xmlns:cc.

tamouse July 07, 2011, at 06:32 PM


Talk page for the Licenses recipe (users).