[SPIP Zone] r4328 - in /_plugins_/_contenu_editorial_/FpipR: exec/flickr_bookmarklet_photo.php inc/flickr_api.php lang/fpipr_en.php lang/fpipr_fr.php

Author: pierre.andrews@gmail.com
Date: Mon Jul 31 20:24:46 2006
New Revision: 4328

Log:
plein de warning sur la visibilite et les licenses des photos

Modified:
    _plugins_/_contenu_editorial_/FpipR/exec/flickr_bookmarklet_photo.php
    _plugins_/_contenu_editorial_/FpipR/inc/flickr_api.php
    _plugins_/_contenu_editorial_/FpipR/lang/fpipr_en.php
    _plugins_/_contenu_editorial_/FpipR/lang/fpipr_fr.php

Modified: _plugins_/_contenu_editorial_/FpipR/exec/flickr_bookmarklet_photo.php

--- _plugins_/_contenu_editorial_/FpipR/exec/flickr_bookmarklet_photo.php (original)
+++ _plugins_/_contenu_editorial_/FpipR/exec/flickr_bookmarklet_photo.php Mon Jul 31 20:24:46 2006
@@ -40,9 +40,32 @@
   gros_titre(_T('fpipr:ajouter_une_photo'));

- echo '<div>';
- echo '<img style="float:right;" src="'.$photo_details->source('m').'"/>';
- echo '<span>'._T('fpipr:ajouter_une_photo_info',array('title'=>$photo_details->title,'owner'=>$photo_details->owner_username)).'</span>';
+ echo '<div style="margin:.5em;">';
+ echo '<img style="float:right;margin:.5em;" src="'.$photo_details->source('m').'"/>';
+ echo '<h3>'._T('fpipr:ajouter_une_photo_info',array('title'=>$photo_details->title,'owner'=>$photo_details->owner_username)).'</h3>';
+ if(!$photo_details->ispublic) {
+ echo '<div style="margin:.5em;">';
+ if($photo_details->isfriend && $photo_details->isfamily) {
+ echo _T('fpipr:warning_family_friend');
+ } else if($photo_details->isfamily) {
+ echo _T('fpipr:warning_family');
+ } else if($photo_details->isfriend) {
+ echo _T('fpipr:waring_friend');
+ }
+ echo '</div>';
+ }
+ echo '<div style="margin:.5em;">';
+ if(($w = _T('fpipr:warning_copyright_'.$photo_details->license)) != 'warning copyright '.$photo_details->license) {
+ echo $w;
+ } else {
+ $licenses = flickr_photos_licenses_getInfo();
+ if($l = $licenses[$photo_details->license]) {
+ echo _T('fpipr:warning_copyright_general',array('name'=>$l->name,'url'=>$l->url));
+ } else {
+ echo _T('fpipr:warning_copyright_0');
+ }
+ }
+ echo '</div>';
   echo '</div>';
   echo '<br clear="both"/>';

Modified: _plugins_/_contenu_editorial_/FpipR/inc/flickr_api.php

--- _plugins_/_contenu_editorial_/FpipR/inc/flickr_api.php (original)
+++ _plugins_/_contenu_editorial_/FpipR/inc/flickr_api.php Mon Jul 31 20:24:46 2006
@@ -194,6 +194,12 @@

}

+class License {
+ var $url;
+ var $name;
+ var $id;
+}
+
//======================================================================

function flickr_photos_search(
@@ -396,6 +402,37 @@
   */
}

+function flickr_photos_licenses_getInfo() {
+ $licenses = flickr_check_error(flickr_api_call('flickr.photos.licenses.getInfo',array()));
+ $larray = array();
+ if($licenses = $licenses['licenses']) {
+ foreach(array_keys($licenses[0]) as $l) {
+ if(preg_match_all('#(name|url|id)="(.*?)"#',$l,$matches,PREG_SET_ORDER)) {
+ $lic = new License;
+ foreach($matches as $m) {
+ $lic->$m[1] = $m[2];
+ }
+ $larray[$lic->id] = $lic;
+ }
+ }
+ }
+ return $larray;
+ /*<licenses>
+ <license id="4" name="Attribution License"
+ url="http://creativecommons.org/licenses/by/2.0/" />
+ <license id="6" name="Attribution-NoDerivs License"
+ url="http://creativecommons.org/licenses/by-nd/2.0/" />
+ <license id="3" name="Attribution-NonCommercial-NoDerivs License"
+ url="http://creativecommons.org/licenses/by-nc-nd/2.0/" />
+ <license id="2" name="Attribution-NonCommercial License"
+ url="http://creativecommons.org/licenses/by-nc/2.0/" />
+ <license id="1" name="Attribution-NonCommercial-ShareAlike License"
+ url="http://creativecommons.org/licenses/by-nc-sa/2.0/" />
+ <license id="5" name="Attribution-ShareAlike License"
+ url="http://creativecommons.org/licenses/by-sa/2.0/" />
+ </licenses>*/
+}
+
//======================================================================

function flickr_bookmarklet_info() {

Modified: _plugins_/_contenu_editorial_/FpipR/lang/fpipr_en.php

--- _plugins_/_contenu_editorial_/FpipR/lang/fpipr_en.php (original)
+++ _plugins_/_contenu_editorial_/FpipR/lang/fpipr_en.php Mon Jul 31 20:24:46 2006
@@ -32,7 +32,20 @@
                      'ajouter_une_photo' => 'Add a photo',
                      'ajouter_une_photo_info' => 'Add the photo "@title@" by @owner@',
                      'choisir_un_article' => 'Choose an article',
- 'par' => '@title@ by <a href="@url@">@user@</a>'
+ 'par' => '@title@ by <a href="@url@">@user@</a>',
+
+ 'warning_family_friend' => 'Beware, this photo is only <strong>visible to familly and friends</strong>. If you add it to one of your article, it might be visible to everyone. Ask the authorisation to the author of the photo before continuing',
+ 'warning_family' => 'Beware, this photo is only <strong>visible to familly</strong>. If you add it to one of your article, it might be visible to everyone. Ask the authorisation to the author of the photo before continuing',
+ 'warning_friend' => 'Beware, this photo is only <strong>visible to friends</strong>. If you add it to one of your article, it might be visible to everyone. Ask the authorisation to the author of the photo before continuing',
+
+ 'warning_copyright_general' => 'Beware, this photo is protected by a license: <strong><a href="@url@">"@name@"</a></strong>. Get more information and ask the author of the photo before posting on this site.',
+ 'warning_copyright_0' => 'Beware, this photo is protected by <strong>copyright</strong>. You need to ask the author of the photo before posting it on this site.',
+ 'warning_copyright_1' => 'Beware, this photo is protected by a license: <strong><a href="http://creativecommons.org/licenses/by-nc-sa/2.0/">"CC Attribution - NonCommercial - ShareAlike"</a></strong>. Get more information and ask the author of the photo if needed.',
+ 'warning_copyright_2' => 'Beware, this photo is protected by a license: <strong><a href="http://creativecommons.org/licenses/by-nc/2.0/">"CC Attribution - NonCommercial"<a></strong>. Get more information and ask the author of the photo if needed.',
+ 'warning_copyright_3' => 'Beware, this photo is protected by a license: <strong><a href="http://creativecommons.org/licenses/by-nc-nd/2.0/">"CC Attribution - NonCommercial - NoDerivs"</a></strong>. Get more information and ask the author of the photo if needed.',
+ 'warning_copyright_4' => 'Beware, this photo is protected by a license: <strong><a href="http://creativecommons.org/licenses/by/2.0/">"Attribution"</a></strong>. Get more information and ask the author of the photo if needed.',
+ 'warning_copyright_5' => 'Beware, this photo is protected by a license: <strong><a href="http://creativecommons.org/licenses/by-sa/2.0/">"Attribution - ShareAlike"</a></strong>. Get more information and ask the author of the photo if needed.',
+ 'warning_copyright_6' => 'Beware, this photo is protected by a license: <strong><a href="http://creativecommons.org/licenses/by-nd/2.0/">"CC Attribution - NoDerivs"</a></strong>. Get more information and ask the author of the photo if needed.',
);

?>

Modified: _plugins_/_contenu_editorial_/FpipR/lang/fpipr_fr.php

--- _plugins_/_contenu_editorial_/FpipR/lang/fpipr_fr.php (original)
+++ _plugins_/_contenu_editorial_/FpipR/lang/fpipr_fr.php Mon Jul 31 20:24:46 2006
@@ -32,7 +32,18 @@
                      'ajouter_une_photo' => 'Ajouter une photo',
                      'ajouter_une_photo_info' => 'Ajoutez la photo "@title@" par @owner@',
                      'choisir_un_article' => 'Choisir un article',
- 'par' => '@title@ par <a href="@url@">@user@</a>'
+ 'par' => '@title@ par <a href="@url@">@user@</a>',
+ 'warning_family_friend' => 'Attention, cette photo n\'est <strong>visible qu\'aux amis et à la famille</strong>. En l\'attachant &agrave; l\'un de vos articles, elle pourrait &ecirc;tre visible de tous. Demandez l\'autorisation &agrave; l\'auteur de la photo avant de continuer.',
+ 'warning_family' => 'Attention, cette photo n\'est <strong>visible qu\'Ã la famille</strong>. En l\'attachant &agrave; l\'un de vos articles, elle pourrait &ecirc;tre visible de tous. Demandez l\'autorisation &agrave; l\'auteur de la photo avant de continuer.',
+ 'warning_friend' => 'Attention, cette photo n\'est <strong>visible qu\'aux amis</strong>. En l\'attachant &agrave; l\'un de vos articles, elle pourrait &ecirc;tre visible de tous. Demandez l\'autorisation &agrave; l\'auteur de la photo avant de continuer.',
+ 'warning_copyright_general' => 'Attention, cette photo est prot&eacute;g&eacute;e par une license: <strong><a href="@url@">"@name@"</a></strong>.Informez-vous et demandez l\'autorisation &agrave; son auteur avant de la poster sur le site.',
+ 'warning_copyright_0' => 'Attention, cette photo est prot&eacute;g&eacute;e par un <strong>copyright</strong>. Demandez l\'autorisation &agrave; son auteur avant de la poster sur le site.',
+ 'warning_copyright_1' => 'Attention, cette photo est prot&eacute;g&eacute;e par une license: <strong><a href="http://creativecommons.org/licenses/by-nc-sa/2.0/deed.fr">"CC Paternité - Pas d\'Utilisation Commerciale - Partage des Conditions Initiales à l\'Identique 2.0</a>"</strong>. Avant de poster la photo sur ce site, verifiez de bien respecter cette license et demander l\'autorisation &agrave; l\'auteur si besoin.',

[... 9 lines stripped ...]