Commit ca2ec031 authored by lucha's avatar lucha Committed by lechuck

Changing name to french-creative-commons-license-widget, and removing hotlinking of images

parent 36486c65
<?php
/****************************************************************************
Plugin Name: creative commons license widget
Plugin URI: www.flext.net/fcclw
Author: Florent Gallaire <fgallaire@gmail.com> (french translation)
Author URI: fgallaire.flext.net
Contributors: lcflores, Gyo (italian translation - http://gyo.ilbello.com), Sergi Barros (catalan translation)
Donate link: http://www.xperimentos.com/2007/05/11/creative-commons-license-widget-for-wordpress/
Author URI: http://www.xperimentos.com/2007/05/11/creative-commons-license-widget-for-wordpress/
Tags: license, creative commons
Tags: license, creative commons, licence, french, français
Requires at least: 2.0.2
Tested up to: 2.5
Stable tag: 0.7
Version: 0.7
Creation time: 12/05/2007
Last updated: 22/07/2008
Description: Adds a sidebar widget to display creative commons license (supports all 3.0 licenses)
Tested up to: 2.9.2
Stable tag: 0.2
Version: 0.2
Creation time: 25/02/2010
Last updated: 25/02/2010
Description: Adds a sidebar widget to display creative commons license (supports all 3.0 licenses), with various translation.
****************************************************************************/
// This gets called at the plugins_loaded action
function widget_ccLicense_init() {
// check for sidebar existance
if ( !function_exists('register_sidebar_widget') || !function_exists('register_widget_control') )
return;
......@@ -36,18 +37,19 @@ function widget_ccLicense_init() {
}
?>
<p style="text-align:left;">
<label for="ccLicense-title" style="line-height:25px;display:block;"><?php _e('Title:', 'widgets'); ?>
<label for="ccLicense-title" style="line-height:25px;display:block;"><?php _e('Title:', 'widgets'); ?>
<input type="text" id="ccLicense-title" name="ccLicense-title" value="<?php echo wp_specialchars($options['title'], true); ?>" />
</label>
<label for="ccLicense-language" style="line-height:25px;display:block;"><?php _e('Language:', 'widgets'); ?>
<label for="ccLicense-language" style="line-height:25px;display:block;"><?php _e('Language:', 'widgets'); ?>
<select id="ccLicense-language" name="ccLicense-language">
<option value="English" <?php if ($options['language']=='English') {echo "selected=\"selected\""; }?> >English</option>
<option value="English" <?php if ($options['language']=='English') {echo "selected=\"selected\""; }?> >English</option>
<option value="Spanish" <?php if ($options['language']=='Spanish') {echo "selected=\"selected\""; }?> >Spanish</option>
<option value="Franais" <?php if ($options['language']=='Franais') {echo "selected=\"selected\""; }?> >Franais</option>
<option value="Italian" <?php if ($options['language']=='Italian') {echo "selected=\"selected\""; }?> >Italian</option>
<option value="Catalan" <?php if ($options['language']=='Catalan') {echo "selected=\"selected\""; }?> >Catalan</option>
<option value="Catalan" <?php if ($options['language']=='Catalan') {echo "selected=\"selected\""; }?> >Catalan</option>
</select>
</label>
<label for="ccLicense-type" style="line-height:25px;display:block;"><?php _e('License:', 'widgets'); ?>
<label for="ccLicense-type" style="line-height:25px;display:block;"><?php _e('License:', 'widgets'); ?>
<select id="ccLicense-type" name="ccLicense-type">
<option value="Attribution" <?php if ($options['type']=='Attribution') {echo "selected=\"selected\""; }?> >Attribution</option>
<option value="Attribution-NoDerivs" <?php if ($options['type']=='Attribution-NoDerivs') {echo "selected=\"selected\""; }?> >Attribution-NoDerivs</option>
......@@ -76,17 +78,17 @@ function widget_ccLicense_init() {
$title = $options['title'];
$language = $options['language'];
$type = $options['type'];
$image = $options['image'];
$image = $options['image'];
// Creates widget configuration
$text = '';
$licenseText = '';
$imageUrl = '';
$imageUrl = plugins_url('images',__FILE__) . '/';
$licenseUrl = '';
$url = '';
$licenseText = 'Creative Commons ' . $type . ' 3.0 License';
switch ($language) {
case 'Spanish':
$text = 'Blog bajo licencia';
......@@ -104,12 +106,15 @@ function widget_ccLicense_init() {
$text = 'Blog sota llicncia';
$licenseUrl = 'deed.ca';
break;
case 'Franais':
$text = 'Site sous licence';
$licenseUrl = 'deed.fr';
break;
default:
$text = 'Blog under the';
$licenseUrl = '';
break;
}
switch ($type) {
case 'Attribution':
$url = 'by';
......@@ -134,19 +139,19 @@ function widget_ccLicense_init() {
break;
}
$licenseUrl = 'http://creativecommons.org/licenses/' . $url . '/3.0/' . $licenseUrl;
switch ($image) {
case 'somerights20':
$imageUrl = 'http://creativecommons.org/images/public/somerights20.png';
$imageUrl = $imageUrl . 'somerights20.png';
break;
case '80x15':
$imageUrl = 'http://i.creativecommons.org/l/' . $url . '/3.0/80x15.png';
$imageUrl = $imageUrl . $url . '-80x15.png';
break;
case '88x31':
$imageUrl = 'http://i.creativecommons.org/l/' . $url . '/3.0/88x31.png';
break;
$imageUrl = $imageUrl . $url . '-88x31.png';
break;
default:
$imageUrl = 'http://creativecommons.org/images/public/somerights20.png';
$imageUrl = $imageUrl . 'somerights20.png';
break;
}
......@@ -156,7 +161,7 @@ function widget_ccLicense_init() {
<!--Creative Commons License-->
<div style="text-align: center; font-size: xx-small;">
<?php echo $text; ?>
<a rel="license" target="_blank" href="<?php echo $licenseUrl; ?>"> <?php echo $licenseText; ?><br/>
<a rel="license" target="_blank" href="<?php echo $licenseUrl; ?>"> <?php echo $licenseText; ?><br/>
<img alt="Creative Commons License" border="0" src="<?php echo $imageUrl; ?>"/></a>
</div>
<!--/Creative Commons License-->
......
=== creative commons license widget ===
=== french creative commons license widget ===
Plugin Name: creative commons license widget
Contributors: lcflores, Gyo (italian translation), Sergi Barros (catalan translation)
Donate link: http://www.xperimentos.com/2007/05/11/creative-commons-license-widget-for-wordpress/
Author URI: http://www.xperimentos.com/2007/05/11/creative-commons-license-widget-for-wordpress/
Tags: license, creative commons
Plugin Name: french creative commons license widget
Contributors: Florent Gallaire <fgallaire@gmail.com> (french translation), lcflores, Gyo (italian translation), Sergi Barros (catalan translation)
Tags: license, creative commons, french, français, licence
Requires at least: 2.0.2
Tested up to: 2.5
Stable tag: 0.7
Version: 0.7
Creation time: 12/05/2007
Last updated: 22/07/2008
Adds a sidebar widget to display creative commons license (supports all 3.0 licenses)
Tested up to: 2.9.2
Stable tag: 0.2
Version: 0.2
Creation time: 25/02/2010
Last updated: 25/02/2010
Adds a sidebar widget to display creative commons license (supports all 3.0 licenses), with various translations available.
== Description ==
Adds a sidebar widget to display creative commons license:
Four languages:
Five languages:
* French
* English
* Spanish
* Italian
......@@ -49,4 +48,4 @@ Three images types
2. Copy "ccLicense.php" to your plugins folder, "/wp-content/plugins/widgets/"
3. Click the "Activate" link for "creative commons license widget" on your Plugins page (in the WordPress admin interface)
4. Go to Themes->Sidebar Widgets and drag and drop the widget to wherever you want to show it.
5. Use the configuration menu to customise the widget.
\ No newline at end of file
5. Use the configuration menu to customise the widget.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment