Browse Source

on bouge

master
ben.spip@gmail.com 14 years ago
commit
bd5716fb4b
  1. 182
      .gitattributes
  2. 134
      FpipR.php
  3. BIN
      FpipR.png
  4. 5
      FpipR_create/flickr_contacts_getlist.php
  5. 5
      FpipR_create/flickr_contacts_getpubliclist.php
  6. 5
      FpipR_create/flickr_favorites_getlist.php
  7. 5
      FpipR_create/flickr_favorites_getpubliclist.php
  8. 5
      FpipR_create/flickr_groups_getinfo.php
  9. 5
      FpipR_create/flickr_groups_pools_getgroups.php
  10. 5
      FpipR_create/flickr_groups_pools_getphotos.php
  11. 6
      FpipR_create/flickr_interestingness_getlist.php
  12. 5
      FpipR_create/flickr_people_getinfo.php
  13. 5
      FpipR_create/flickr_people_getpublicgroups.php
  14. 5
      FpipR_create/flickr_photos_comments_getlist.php
  15. 5
      FpipR_create/flickr_photos_getallcontexts.php
  16. 5
      FpipR_create/flickr_photos_getcontactsphotos.php
  17. 5
      FpipR_create/flickr_photos_getcontactspublicphotos.php
  18. 5
      FpipR_create/flickr_photos_getexif.php
  19. 8
      FpipR_create/flickr_photos_getinfo.php
  20. 5
      FpipR_create/flickr_photos_getnotinset.php
  21. 5
      FpipR_create/flickr_photos_getrecent.php
  22. 6
      FpipR_create/flickr_photos_getuntagged.php
  23. 5
      FpipR_create/flickr_photos_getwithgeodata.php
  24. 6
      FpipR_create/flickr_photos_getwithoutgeodata.php
  25. 5
      FpipR_create/flickr_photos_recentlyupdated.php
  26. 5
      FpipR_create/flickr_photos_search.php
  27. 5
      FpipR_create/flickr_photosets_comments_getlist.php
  28. 5
      FpipR_create/flickr_photosets_getinfo.php
  29. 5
      FpipR_create/flickr_photosets_getlist.php
  30. 6
      FpipR_create/flickr_photosets_getphotos.php
  31. 5
      FpipR_create/flickr_tags_gethotlist.php
  32. 6
      FpipR_create/flickr_tags_getlistphoto.php
  33. 5
      FpipR_create/flickr_tags_getlistuser.php
  34. 5
      FpipR_create/flickr_tags_getlistuserpopular.php
  35. 6
      FpipR_create/flickr_tags_getlistuserraw.php
  36. 7
      FpipR_create/flickr_tags_getrelated.php
  37. 5
      FpipR_create/flickr_urls_lookupgroup.php
  38. 6
      FpipR_create/flickr_urls_lookupuser.php
  39. 22
      FpipR_fill/flickr_contacts_getlist.php
  40. 19
      FpipR_fill/flickr_contacts_getpubliclist.php
  41. 11
      FpipR_fill/flickr_favorites_getlist.php
  42. 13
      FpipR_fill/flickr_favorites_getpubliclist.php
  43. 14
      FpipR_fill/flickr_groups_getinfo.php
  44. 10
      FpipR_fill/flickr_groups_pools_getgroups.php
  45. 14
      FpipR_fill/flickr_groups_pools_getphotos.php
  46. 11
      FpipR_fill/flickr_interestingness_getlist.php
  47. 15
      FpipR_fill/flickr_people_getinfo.php
  48. 7
      FpipR_fill/flickr_people_getpublicgroups.php
  49. 8
      FpipR_fill/flickr_photos_comments_getlist.php
  50. 18
      FpipR_fill/flickr_photos_getallcontexts.php
  51. 12
      FpipR_fill/flickr_photos_getcontactsphotos.php
  52. 12
      FpipR_fill/flickr_photos_getcontactspublicphotos.php
  53. 20
      FpipR_fill/flickr_photos_getexif.php
  54. 44
      FpipR_fill/flickr_photos_getinfo.php
  55. 14
      FpipR_fill/flickr_photos_getnotinset.php
  56. 11
      FpipR_fill/flickr_photos_getrecent.php
  57. 14
      FpipR_fill/flickr_photos_getuntagged.php
  58. 15
      FpipR_fill/flickr_photos_getwithgeodata.php
  59. 16
      FpipR_fill/flickr_photos_getwithoutgeodata.php
  60. 11
      FpipR_fill/flickr_photos_recentlyupdated.php
  61. 19
      FpipR_fill/flickr_photos_search.php
  62. 7
      FpipR_fill/flickr_photosets_comments_getlist.php
  63. 15
      FpipR_fill/flickr_photosets_getinfo.php
  64. 16
      FpipR_fill/flickr_photosets_getlist.php
  65. 15
      FpipR_fill/flickr_photosets_getphotos.php
  66. 18
      FpipR_fill/flickr_tags_gethotlist.php
  67. 12
      FpipR_fill/flickr_tags_getlistphoto.php
  68. 18
      FpipR_fill/flickr_tags_getlistuser.php
  69. 18
      FpipR_fill/flickr_tags_getlistuserpopular.php
  70. 21
      FpipR_fill/flickr_tags_getlistuserraw.php
  71. 18
      FpipR_fill/flickr_tags_getrelated.php
  72. 16
      FpipR_fill/flickr_urls_lookupgroup.php
  73. 16
      FpipR_fill/flickr_urls_lookupuser.php
  74. 77
      FpipR_fonctions.php
  75. 340
      FpipR_options.php
  76. 340
      LICENCE
  77. 544
      LISEZMOI
  78. 105
      TODO
  79. 55
      _REGLES_DE_COMMIT.txt
  80. 135
      action/flickr_ajouter_documents.php
  81. 22
      action/flickr_authenticate_end.php
  82. 22
      action/flickr_revoke_auth.php
  83. 9
      balise/accuracy.php
  84. 18
      balise/flickr_grand_total.php
  85. 7
      balise/flickr_photo_id.php
  86. 7
      balise/flickr_photo_secret.php
  87. 13
      balise/flickr_token.php
  88. 6
      balise/fpipr_exists.php
  89. 12
      balise/height_photo.php
  90. 11
      balise/id_group.php
  91. 11
      balise/id_photoset.php
  92. 8
      balise/isfamily.php
  93. 9
      balise/isfriend.php
  94. 8
      balise/ispublic.php
  95. 8
      balise/latitude.php
  96. 9
      balise/logo_contact.php
  97. 8
      balise/logo_group.php
  98. 19
      balise/logo_nextphoto.php
  99. 10
      balise/logo_owner.php
  100. 16
      balise/logo_photo.php
  101. Some files were not shown because too many files have changed in this diff Show More

182
.gitattributes vendored

@ -0,0 +1,182 @@
* text=auto !eol
/FpipR.php -text
/FpipR.png -text
FpipR_create/flickr_contacts_getlist.php -text
FpipR_create/flickr_contacts_getpubliclist.php -text
FpipR_create/flickr_favorites_getlist.php -text
FpipR_create/flickr_favorites_getpubliclist.php -text
FpipR_create/flickr_groups_getinfo.php -text
FpipR_create/flickr_groups_pools_getgroups.php -text
FpipR_create/flickr_groups_pools_getphotos.php -text
FpipR_create/flickr_interestingness_getlist.php -text
FpipR_create/flickr_people_getinfo.php -text
FpipR_create/flickr_people_getpublicgroups.php -text
FpipR_create/flickr_photos_comments_getlist.php -text
FpipR_create/flickr_photos_getallcontexts.php -text
FpipR_create/flickr_photos_getcontactsphotos.php -text
FpipR_create/flickr_photos_getcontactspublicphotos.php -text
FpipR_create/flickr_photos_getexif.php -text
FpipR_create/flickr_photos_getinfo.php -text
FpipR_create/flickr_photos_getnotinset.php -text
FpipR_create/flickr_photos_getrecent.php -text
FpipR_create/flickr_photos_getuntagged.php -text
FpipR_create/flickr_photos_getwithgeodata.php -text
FpipR_create/flickr_photos_getwithoutgeodata.php -text
FpipR_create/flickr_photos_recentlyupdated.php -text
FpipR_create/flickr_photos_search.php -text
FpipR_create/flickr_photosets_comments_getlist.php -text
FpipR_create/flickr_photosets_getinfo.php -text
FpipR_create/flickr_photosets_getlist.php -text
FpipR_create/flickr_photosets_getphotos.php -text
FpipR_create/flickr_tags_gethotlist.php -text
FpipR_create/flickr_tags_getlistphoto.php -text
FpipR_create/flickr_tags_getlistuser.php -text
FpipR_create/flickr_tags_getlistuserpopular.php -text
FpipR_create/flickr_tags_getlistuserraw.php -text
FpipR_create/flickr_tags_getrelated.php -text
FpipR_create/flickr_urls_lookupgroup.php -text
FpipR_create/flickr_urls_lookupuser.php -text
FpipR_fill/flickr_contacts_getlist.php -text
FpipR_fill/flickr_contacts_getpubliclist.php -text
FpipR_fill/flickr_favorites_getlist.php -text
FpipR_fill/flickr_favorites_getpubliclist.php -text
FpipR_fill/flickr_groups_getinfo.php -text
FpipR_fill/flickr_groups_pools_getgroups.php -text
FpipR_fill/flickr_groups_pools_getphotos.php -text
FpipR_fill/flickr_interestingness_getlist.php -text
FpipR_fill/flickr_people_getinfo.php -text
FpipR_fill/flickr_people_getpublicgroups.php -text
FpipR_fill/flickr_photos_comments_getlist.php -text
FpipR_fill/flickr_photos_getallcontexts.php -text
FpipR_fill/flickr_photos_getcontactsphotos.php -text
FpipR_fill/flickr_photos_getcontactspublicphotos.php -text
FpipR_fill/flickr_photos_getexif.php -text
FpipR_fill/flickr_photos_getinfo.php -text
FpipR_fill/flickr_photos_getnotinset.php -text
FpipR_fill/flickr_photos_getrecent.php -text
FpipR_fill/flickr_photos_getuntagged.php -text
FpipR_fill/flickr_photos_getwithgeodata.php -text
FpipR_fill/flickr_photos_getwithoutgeodata.php -text
FpipR_fill/flickr_photos_recentlyupdated.php -text
FpipR_fill/flickr_photos_search.php -text
FpipR_fill/flickr_photosets_comments_getlist.php -text
FpipR_fill/flickr_photosets_getinfo.php -text
FpipR_fill/flickr_photosets_getlist.php -text
FpipR_fill/flickr_photosets_getphotos.php -text
FpipR_fill/flickr_tags_gethotlist.php -text
FpipR_fill/flickr_tags_getlistphoto.php -text
FpipR_fill/flickr_tags_getlistuser.php -text
FpipR_fill/flickr_tags_getlistuserpopular.php -text
FpipR_fill/flickr_tags_getlistuserraw.php -text
FpipR_fill/flickr_tags_getrelated.php -text
FpipR_fill/flickr_urls_lookupgroup.php -text
FpipR_fill/flickr_urls_lookupuser.php -text
/FpipR_fonctions.php -text
/FpipR_options.php -text
/LICENCE -text
/LISEZMOI -text
/TODO -text
/_REGLES_DE_COMMIT.txt -text
action/flickr_ajouter_documents.php -text
action/flickr_authenticate_end.php -text
action/flickr_revoke_auth.php -text
balise/accuracy.php -text
balise/flickr_grand_total.php -text
balise/flickr_photo_id.php -text
balise/flickr_photo_secret.php -text
balise/flickr_token.php -text
balise/fpipr_exists.php -text
balise/height_photo.php -text
balise/id_group.php -text
balise/id_photoset.php -text
balise/isfamily.php -text
balise/isfriend.php -text
balise/ispublic.php -text
balise/latitude.php -text
balise/logo_contact.php -text
balise/logo_group.php -text
balise/logo_nextphoto.php -text
balise/logo_owner.php -text
balise/logo_photo.php -text
balise/logo_photoset.php -text
balise/logo_prevphoto.php -text
balise/longitude.php -text
balise/nextphoto_id.php -text
balise/nextphoto_secret.php -text
balise/nextphoto_server.php -text
balise/nextphoto_thumb.php -text
balise/nextphoto_title.php -text
balise/pagination_flickr.php -text
balise/photos_count.php -text
balise/prevphoto_id.php -text
balise/prevphoto_secret.php -text
balise/prevphoto_server.php -text
balise/prevphoto_thumb.php -text
balise/prevphoto_title.php -text
balise/url_group.php -text
balise/url_nextphoto.php -text
balise/url_owner.php -text
balise/url_photo.php -text
balise/url_photoset.php -text
balise/url_prevphoto.php -text
balise/url_userphotos.php -text
balise/url_userprofile.php -text
balise/width_photo.php -text
base/FpipR_db.php -text
base/FpipR_upgrade.php -text
boucle/flickr_contacts_getlist.php -text
boucle/flickr_contacts_getpubliclist.php -text
boucle/flickr_favorites_getlist.php -text
boucle/flickr_favorites_getpubliclist.php -text
boucle/flickr_groups_getinfo.php -text
boucle/flickr_groups_pools_getgroups.php -text
boucle/flickr_groups_pools_getphotos.php -text
boucle/flickr_interestingness_getlist.php -text
boucle/flickr_people_getinfo.php -text
boucle/flickr_people_getpublicgroups.php -text
boucle/flickr_photo_notes.php -text
boucle/flickr_photo_tags.php -text
boucle/flickr_photo_urls.php -text
boucle/flickr_photos_comments_getlist.php -text
boucle/flickr_photos_getallcontexts.php -text
boucle/flickr_photos_getcontactsphotos.php -text
boucle/flickr_photos_getcontactspublicphotos.php -text
boucle/flickr_photos_getexif.php -text
boucle/flickr_photos_getinfo.php -text
boucle/flickr_photos_getnotinset.php -text
boucle/flickr_photos_getrecent.php -text
boucle/flickr_photos_getuntagged.php -text
boucle/flickr_photos_getwithgeodata.php -text
boucle/flickr_photos_getwithoutgeodata.php -text
boucle/flickr_photos_recentlyupdated.php -text
boucle/flickr_photos_search.php -text
boucle/flickr_photosets_comments_getlist.php -text
boucle/flickr_photosets_getinfo.php -text
boucle/flickr_photosets_getlist.php -text
boucle/flickr_photosets_getphotos.php -text
boucle/flickr_tags_gethotlist.php -text
boucle/flickr_tags_getlistphoto.php -text
boucle/flickr_tags_getlistuser.php -text
boucle/flickr_tags_getlistuserpopular.php -text
boucle/flickr_tags_getlistuserraw.php -text
boucle/flickr_tags_getrelated.php -text
boucle/flickr_urls_lookupgroup.php -text
boucle/flickr_urls_lookupuser.php -text
/demo_fpipr.html -text
exec/flickr_bookmarklet_photo.php -text
exec/flickr_choix_photos.php -text
exec/flickr_choix_sets.php -text
fonds/cfg_fpipr.html -text
/fpipr.gif -text
/fpipr_bookmarklet.js -text
inc/FpipR_boucle_utils.php -text
inc/flickr_api.php -text
lang/fpipr_en.php -text
lang/fpipr_fr.php -text
modeles/fpiprbox.html -text
modeles/fpiprinfo.html -text
modeles/fpiprsetbox.html -text
modeles/fpiprsetinfo.html -text
/plugin.xml -text
/styles.css -text
/test_fpipr.html -text

134
FpipR.php

@ -0,0 +1,134 @@
<?php
function FpipR_affiche_milieu($flux) {
if(function_exists('lire_config')) {
$api_key = lire_config('fpipr/api_key','');
$api_secret = lire_config('fpipr/api_secret','');
if(!$api_key) $api_key = $GLOBALS['FLICKR_API_KEY'];
if(!$api_secret) $api_secret = $GLOBALS['FLICKR_SECRET'];
} else {
$api_key = $GLOBALS['FLICKR_API_KEY'];
$api_secret = $GLOBALS['FLICKR_SECRET'];
}
if(!isset($api_key) && !isset($api_secret)) return $flux;
if($flux['args']['exec'] == 'auteur_infos') {
global $table_prefix, $connect_id_auteur;
include_spip('base/abstract_sql');
if($connect_id_auteur == $flux['args']['id_auteur']) {
include_spip('inc/presentation');
$html = '<div>&nbsp;</div>';
$html .= '<div style="margin-top: 14px;" class="cadre-r">
<div style="position: relative;">
<div style="position: absolute; top: -16px; left: 10px;">
<img src="'.find_in_path('fpipr.gif').'"/>
</div>
</div>
<div style="overflow: hidden;" class="cadre-padding">';
$html .= '<h3>'._T('fpipr:autorisation_titre').'</h3>';
include_spip('inc/flickr_api');
$from = array('spip_auteurs');
$select = array('flickr_token','flickr_nsid');
$where = array('id_auteur='.$flux['args']['id_auteur']);
$rez = spip_abstract_select($select,$from,$where);
$row = spip_abstract_fetch($rez);
$wrong = false;
if($row['flickr_nsid'] != '' && $row['flickr_token'] != '') {
$check = flickr_auth_checkToken($row['flickr_token']);
if($check) {
$html .= _T('fpipr:identifie_ok',array('user_id'=>'<a href="http://www.flickr.com/photos/'.$row['flickr_nsid'].'">'.$row['flickr_nsid'].'</a>'));
$html .= _T('fpipr:revoke_info');
$html .= generer_action_auteur('flickr_revoke_auth',$infos['frob'], generer_url_ecrire('auteur_infos','id_auteur='.$connect_id_auteur,true),'<button type="submit">'._T('fpipr:revoke').'</button>');
$html .= flickr_bookmarklet_info();
} else {
include_spip('base/abstract_sql');
global $table_prefix;
spip_query("UPDATE ".$table_prefix."_auteurs SET flickr_nsid = '', flickr_token = '' WHERE id_auteur=$connect_id_auteur");
$wrong = true;
}
} else $wrong = true;
if($wrong){
$infos = flickr_authenticate_get_frob();
$html .= '<ol><li>'.
_T('fpipr:identifie_etape1',array('url'=>$infos['url'])).
'</li>
<li>'.
_T('fpipr:identifie_etape2',array('form'=>generer_action_auteur('flickr_authenticate_end',$infos['frob'], generer_url_ecrire('auteur_infos','id_auteur='.$connect_id_auteur,true),'<button type="submit">'._T('fpipr:terminer').'</button>'))).
'</li></ol>';
}
if ($rez) spip_abstract_free($rez);
$html .= fin_cadre_relief(true);
$flux['data'].=$html;
}
}
return $flux;
}
function FpipR_affiche_gauche($flux) {
global $connect_id_auteur;
if(function_exists('lire_config')) {
$api_key = lire_config('fpipr/api_key',$GLOBALS['FLICKR_API_KEY']);
$api_secret = lire_config('fpipr/api_secret',$GLOBALS['FLICKR_SECRET']);
} else {
$api_key = $GLOBALS['FLICKR_API_KEY'];
$api_secret = $GLOBALS['FLICKR_SECRET'];
}
if(!isset($api_key) && !isset($api_secret)) return $flux;
//Verifier les droits des auteurs
if((($flux['args']['exec'] == 'articles') && ($GLOBALS['meta']["documents_articles"] != 'non')) || (($flux['args']['exec'] == 'naviguer')&& ($GLOBALS['meta']["documents_rubriques"] != 'non')) || (($flux['args']['exec'] == 'breves_edit')&& ($GLOBALS['meta']["documents_breves"] != 'non'))) {
include_spip('base/abstract_sql');
if($flux['args']['exec'] == 'articles') {
$type = 'article';
$id = intval(_request('id_article'));
$row = spip_abstract_fetsel(array('statut','id_rubrique'),array('spip_articles'),array("id_article=$id"));
$cnt = spip_abstract_fetsel(array('count(*) as cnt'),array('spip_auteurs_articles'),array("id_article=$id",'id_auteur='.$connect_id_auteur));
$acces = autoriser('publierdans','rubrique',$row['id_rubrique']) || acces_restreint_rubrique($row['id_rubrique']) || (($row['statut'] == 'prepa' || $row['statut'] == 'prop' || $row['statut'] == 'poubelle') && $cnt['cnt'] > 0);
} else if($flux['args']['exec'] == 'naviguer') {
$type = 'rubrique';
$id = intval(_request('id_rubrique'));
$acces = autoriser('publierdans','rubrique',$id_rubrique);
} /*else if($flux['args']['exec'] == 'breves_edit') {
$type = 'breve';
$id = _request('id_breve');
$row = spip_abstract_fetsel(array('statut','id_rubrique'),array('spip_breves'), array('id_breve='.$flux['args']['id_breve']));
$acces = true; //si on est arrivé là c'est qu'on a le droit de faire les modifs
}*/
if($acces) {
$to_ret = '<div>&nbsp;</div>';
$to_ret .='
<div style="z-index: 1;" class="bandeau_rubriques">
<div style="position: relative;">
<div style="position: absolute; top: -12px; left: 3px;">
<font size="1" face="Verdana,Arial,Sans,sans-serif">
<img alt="article-24" src="'.find_in_path('fpipr.gif').'"/>
</font>
</div>
<div class="verdana2" style="border-bottom: 1px solid rgb(68, 68, 68); padding: 3px 3px 3px 30px; background-color: white; color: black;">
<font size="1" face="Verdana,Arial,Sans,sans-serif">
<b>'._T('fpipr:Flickr').'</b>
</font>
</div>
</div>';
$to_ret .= '<div class="plan-articles">';
$to_ret .= '<a class="thickbox" href="'.generer_url_ecrire('flickr_choix_photos',"type=$type&id=$id",true).'">'._T('fpipr:ajouter_photos').'</a>';
$to_ret .= '<a class="thickbox" href="'.generer_url_ecrire('flickr_choix_sets',"type=$type&id=$id",true).'">'._T('fpipr:ajouter_sets').'</a>';
$to_ret .= '</div>';
$to_ret .= '</div>';
$flux['data'] .= $to_ret;
}
}
return $flux;
}
?>

BIN
FpipR.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

5
FpipR_create/flickr_contacts_getlist.php

@ -0,0 +1,5 @@
<?php
function FpipR_create_flickr_contacts_getlist_dist() {
FpipR_make_table('spip_fpipr_people');
}
?>

5
FpipR_create/flickr_contacts_getpubliclist.php

@ -0,0 +1,5 @@
<?php
function FpipR_create_flickr_contacts_getpubliclist_dist() {
FpipR_make_table('spip_fpipr_people');
}
?>

5
FpipR_create/flickr_favorites_getlist.php

@ -0,0 +1,5 @@
<?php
function FpipR_create_flickr_favorites_getList_dist() {
FpipR_make_table('spip_fpipr_photos');
}
?>

5
FpipR_create/flickr_favorites_getpubliclist.php

@ -0,0 +1,5 @@
<?php
function FpipR_create_flickr_favorites_getpubliclist_dist() {
FpipR_make_table('spip_fpipr_photos');
}
?>

5
FpipR_create/flickr_groups_getinfo.php

@ -0,0 +1,5 @@
<?php
function FpipR_create_flickr_groups_getinfo_dist() {
FpipR_make_table('spip_fpipr_groups');
}
?>

5
FpipR_create/flickr_groups_pools_getgroups.php

@ -0,0 +1,5 @@
<?php
function FpipR_create_flickr_groups_pools_getgroups_dist() {
FpipR_make_table('spip_fpipr_groups');
}
?>

5
FpipR_create/flickr_groups_pools_getphotos.php

@ -0,0 +1,5 @@
<?php
function FpipR_create_flickr_groups_pools_getphotos_dist() {
FpipR_make_table('spip_fpipr_photos');
}
?>

6
FpipR_create/flickr_interestingness_getlist.php

@ -0,0 +1,6 @@
<?php
function FpipR_create_flickr_interestingness_getlist_dist() {
FpipR_make_table('spip_fpipr_photos');
}
?>

5
FpipR_create/flickr_people_getinfo.php

@ -0,0 +1,5 @@
<?php
function FpipR_create_flickr_people_getinfo_dist() {
FpipR_make_table('spip_fpipr_people');
}
?>

5
FpipR_create/flickr_people_getpublicgroups.php

@ -0,0 +1,5 @@
<?php
function FpipR_create_flickr_people_getpublicgroups_dist() {
FpipR_make_table('spip_fpipr_groups');
}
?>

5
FpipR_create/flickr_photos_comments_getlist.php

@ -0,0 +1,5 @@
<?php
function FpipR_create_flickr_photos_comments_getlist_dist() {
FpipR_make_table('spip_fpipr_comments');
}
?>

5
FpipR_create/flickr_photos_getallcontexts.php

@ -0,0 +1,5 @@
<?php
function FpipR_create_flickr_photos_getallcontexts_dist() {
FpipR_make_table('spip_fpipr_contextes');
}
?>

5
FpipR_create/flickr_photos_getcontactsphotos.php

@ -0,0 +1,5 @@
<?php
function FpipR_create_flickr_photos_getcontactsphotos_dist() {
FpipR_make_table('spip_fpipr_photos');
}
?>

5
FpipR_create/flickr_photos_getcontactspublicphotos.php

@ -0,0 +1,5 @@
<?php
function FpipR_create_flickr_photos_getcontactspublicphotos_dist() {
FpipR_make_table('spip_fpipr_photos');
}
?>

5
FpipR_create/flickr_photos_getexif.php

@ -0,0 +1,5 @@
<?php
function FpipR_create_flickr_photos_getexif_dist() {
FpipR_make_table('spip_fpipr_exif');
}
?>

8
FpipR_create/flickr_photos_getinfo.php

@ -0,0 +1,8 @@
<?php
function FpipR_create_flickr_photos_getinfo_dist() {
FpipR_make_table('spip_fpipr_photo_details');
FpipR_make_table('spip_fpipr_tags');
FpipR_make_table('spip_fpipr_notes');
FpipR_make_table('spip_fpipr_urls');
}
?>

5
FpipR_create/flickr_photos_getnotinset.php

@ -0,0 +1,5 @@
<?php
function FpipR_create_flickr_photos_getnotinset_dist() {
FpipR_make_table('spip_fpipr_photos');
}
?>

5
FpipR_create/flickr_photos_getrecent.php

@ -0,0 +1,5 @@
<?php
function FpipR_create_flickr_photos_getrecent_dist() {
FpipR_make_table('spip_fpipr_photos');
}
?>

6
FpipR_create/flickr_photos_getuntagged.php

@ -0,0 +1,6 @@
<?php
function FpipR_create_flickr_photos_getuntagged_dist() {
FpipR_make_table('spip_fpipr_photos');
}
?>

5
FpipR_create/flickr_photos_getwithgeodata.php

@ -0,0 +1,5 @@
<?php
function FpipR_create_flickr_photos_getwithgeodata_dist() {
FpipR_make_table('spip_fpipr_photos');
}
?>

6
FpipR_create/flickr_photos_getwithoutgeodata.php

@ -0,0 +1,6 @@
<?php
function FpipR_create_flickr_photos_getwithoutgeodata_dist() {
FpipR_make_table('spip_fpipr_photos');
}
?>

5
FpipR_create/flickr_photos_recentlyupdated.php

@ -0,0 +1,5 @@
<?php
function FpipR_create_flickr_photos_recentlyupdated_dist() {
FpipR_make_table('spip_fpipr_photos');
}
?>

5
FpipR_create/flickr_photos_search.php

@ -0,0 +1,5 @@
<?php
function FpipR_create_flickr_photos_search_dist() {
FpipR_make_table('spip_fpipr_photos');
}
?>

5
FpipR_create/flickr_photosets_comments_getlist.php

@ -0,0 +1,5 @@
<?php
function FpipR_create_flickr_photosets_comments_getlist_dist() {
FpipR_make_table('spip_fpipr_comments');
}
?>

5
FpipR_create/flickr_photosets_getinfo.php

@ -0,0 +1,5 @@
<?php
function FpipR_create_flickr_photosets_getinfo_dist() {
FpipR_make_table('spip_fpipr_photosets');
}
?>

5
FpipR_create/flickr_photosets_getlist.php

@ -0,0 +1,5 @@
<?php
function FpipR_create_flickr_photosets_getlist_dist() {
FpipR_make_table('spip_fpipr_photosets');
}
?>

6
FpipR_create/flickr_photosets_getphotos.php

@ -0,0 +1,6 @@
<?php
function FpipR_create_flickr_photosets_getphotos_dist() {
FpipR_make_table('spip_fpipr_photos');
}
?>

5
FpipR_create/flickr_tags_gethotlist.php

@ -0,0 +1,5 @@
<?php
function FpipR_create_flickr_tags_gethotlist_dist() {
FpipR_make_table('spip_fpipr_tags');
}
?>

6
FpipR_create/flickr_tags_getlistphoto.php

@ -0,0 +1,6 @@
<?php
function FpipR_create_flickr_tags_getlistphoto_dist() {
FpipR_make_table('spip_fpipr_tags');
}
?>

5
FpipR_create/flickr_tags_getlistuser.php

@ -0,0 +1,5 @@
<?php
function FpipR_create_flickr_tags_getlistuser_dist() {
FpipR_make_table('spip_fpipr_tags');
}
?>

5
FpipR_create/flickr_tags_getlistuserpopular.php

@ -0,0 +1,5 @@
<?php
function FpipR_create_flickr_tags_getlistuserpopular_dist() {
FpipR_make_table('spip_fpipr_tags');
}
?>

6
FpipR_create/flickr_tags_getlistuserraw.php

@ -0,0 +1,6 @@
<?php
function FpipR_create_flickr_tags_getlistuserraw_dist() {
FpipR_make_table('spip_fpipr_tags');
}
?>

7
FpipR_create/flickr_tags_getrelated.php

@ -0,0 +1,7 @@
<?php
function FpipR_create_flickr_tags_getrelated_dist() {
FpipR_make_table('spip_fpipr_tags');
}
?>

5
FpipR_create/flickr_urls_lookupgroup.php

@ -0,0 +1,5 @@
<?php
function FpipR_create_flickr_urls_lookupgroup_dist() {
FpipR_make_table('spip_fpipr_groups');
}
?>

6
FpipR_create/flickr_urls_lookupuser.php

@ -0,0 +1,6 @@
<?php
function FpipR_create_flickr_urls_lookupuser_dist() {
FpipR_make_table('spip_fpipr_people');
}
?>

22
FpipR_fill/flickr_contacts_getlist.php

@ -0,0 +1,22 @@
<?php
function FpipR_fill_flickr_contacts_getlist_dist($arguments) {
include_spip('inc/flickr_api');
$contacts = flickr_contacts_getList($arguments['nsid'],$arguments['filter'],$arguments['page'],$arguments['per_page'],$arguments['auth_token']);
$query = "DELETE FROM spip_fpipr_people";
spip_query($query);
if($contacts = $contacts['contacts']) {
foreach($contacts['contact'] as $c) {
sql_insert('spip_fpipr_people',
'(user_id,username,iconserver,ignored,friend,family,realname)',
'('._q($c['nsid']).','._q($c['username']).','._q($c['iconserver']).','._q($c['ignored']).
','._q($c['friend']).','._q($c['family']).','._q($c['realname']).')'
);
}
return $contacts['total'];
}
return 0;
}
?>

19
FpipR_fill/flickr_contacts_getpubliclist.php

@ -0,0 +1,19 @@
<?php
function FpipR_fill_flickr_contacts_getpubliclist_dist($arguments) {
include_spip('inc/flickr_api');
$contacts = flickr_contacts_getPublicList($arguments['nsid'],$arguments['page'],$arguments['per_page'],$arguments['auth_token']);
$query = "DELETE FROM spip_fpipr_people";
spip_query($query);
if($contacts = $contacts['contacts']) {
foreach($contacts['contact'] as $c) {
sql_insert('spip_fpipr_people',
'(user_id,username,iconserver,ignored)',
'('._q($c['nsid']).','._q($c['username']).','._q($c['iconserver']).','._q($c['ignored']).')'
);
}
return $contacts['total'];
}
return 0;
}
?>

11
FpipR_fill/flickr_favorites_getlist.php

@ -0,0 +1,11 @@
<?php
function FpipR_fill_flickr_favorites_getList_dist($arguments) {
include_spip('inc/flickr_api');
$photos = flickr_favorites_getList($arguments['nsid'],
$arguments['extras'],
$arguments['per_page'],
$arguments['page'],$arguments['auth_token']);
FpipR_fill_photos_table($photos->photos);
return $photos->total;
}
?>

13
FpipR_fill/flickr_favorites_getpubliclist.php

@ -0,0 +1,13 @@
<?php
function FpipR_fill_flickr_favorites_getPublicList_dist($arguments) {
include_spip('inc/flickr_api');
$photos = flickr_favorites_getPublicList($arguments['nsid'],
$arguments['extras'],
$arguments['per_page'],
$arguments['page'],$arguments['auth_token']);
FpipR_fill_photos_table($photos->photos);
return $photos->total;
}
?>

14
FpipR_fill/flickr_groups_getinfo.php

@ -0,0 +1,14 @@
<?php
function FpipR_fill_flickr_groups_getinfo_dist($arguments) {
include_spip('inc/flickr_api');
$group = flickr_groups_getInfo($arguments['id_group'],$arguments['auth_token']);
$query = "DELETE FROM spip_fpipr_groups";
spip_query($query);
if($group = $group['group']) {
sql_insert('spip_fpipr_groups',
'(id_group,iconserver,name,description,members,privacy,throttle_count,throttle_mode,throttle_remaining)',
'('._q($group['id']).','._q($group['iconserver']).','._q($group['name']['_content']).','._q($group['description']['_content']).','._q($group['members']['_content']).','._q($group['privacy']['_content']).','._q($group['throttle']['count']).','._q($group['throttle']['mode']).','._q($group['throttle']['remaining']).')'
);
}
}
?>

10
FpipR_fill/flickr_groups_pools_getgroups.php

@ -0,0 +1,10 @@
<?php
function FpipR_fill_flickr_groups_pools_getgroups_dist($arguments) {
include_spip('inc/flickr_api');
$groups = flickr_groups_pools_getGroups($arguments['page'],$arguments['per_page'],$arguments['auth_token']);
FpipR_fill_groups_table($groups,'groups');
return $groups['groups']['total'];
}
?>

14
FpipR_fill/flickr_groups_pools_getphotos.php

@ -0,0 +1,14 @@
<?php
function FpipR_fill_flickr_groups_pools_getphotos_dist($arguments) {
include_spip('inc/flickr_api');
$photos = flickr_groups_pools_getPhotos($arguments['id_group'],
$arguments['tags'],
$arguments['user_id'],
$arguments['extras'],
$arguments['per_page'],
$arguments['page'],$arguments['auth_token']);
FpipR_fill_photos_table($photos->photos,array('id_group'=>$arguments['id_group']));
return $photos->total;
}
?>

11
FpipR_fill/flickr_interestingness_getlist.php

@ -0,0 +1,11 @@
<?php
function FpipR_fill_flickr_interestingness_getlist_dist($arguments) {
include_spip('inc/flickr_api');
$photos = flickr_interestingness_getList($arguments['date'],
$arguments['extras'],
$arguments['per_page'],
$arguments['page'],$arguments['auth_token']);
FpipR_fill_photos_table($photos->photos);
return $photos->total;
}
?>

15
FpipR_fill/flickr_people_getinfo.php

@ -0,0 +1,15 @@
<?php
function FpipR_fill_flickr_people_getinfo_dist($arguments) {
include_spip('inc/flickr_api');
$person = flickr_people_getInfo($arguments['user_id'],$arguments['auth_token']);
$query = "DELETE FROM spip_fpipr_people";
spip_query($query);
if($person = $person['person']) {
sql_insert('spip_fpipr_people',
'(user_id,isadmin,ispro,iconserver,username,realname,location,url_photos,url_profile,date_firstphoto,date_taken_firstphoto,photos_count)',
'('._q($person['nsid']).','._q($person['isadmin']).','._q($person['ispro']).','._q($person['iconserver']).','._q($person['username']['_content']).','._q($person['realname']['_content']).','._q($person['location']['_content']).','._q($person['photosurl']['_content']).','._q($person['profileurl']['_content']).','._q(date('Y-m-d H:i:s',$person['photos']['firstdate']['_content'])).','._q($person['photos']['firstdatetaken']['_content']).','._q($person['photos']['count']['_content']).')'
);
}
}
?>

7
FpipR_fill/flickr_people_getpublicgroups.php

@ -0,0 +1,7 @@
<?php
function FpipR_fill_flickr_people_getpublicgroups_dist($arguments) {
include_spip('inc/flickr_api');
$groups = flickr_people_getPublicGroups($arguments['user_id'],$arguments['auth_token']);
FpipR_fill_groups_table($groups,'groups',array('user_id'=>$arguments['user_id']));
}
?>

8
FpipR_fill/flickr_photos_comments_getlist.php

@ -0,0 +1,8 @@
<?php
function FpipR_fill_flickr_photos_comments_getlist_dist($arguments) {
include_spip('inc/flickr_api');
$comments = flickr_photos_comments_getList($arguments['id_photo'],$arguments['auth_token']);
FpipR_fill_comments_table($comments);
}
?>

18
FpipR_fill/flickr_photos_getallcontexts.php

@ -0,0 +1,18 @@
<?php
function FpipR_fill_flickr_photos_getallcontexts_dist($arguments) {
include_spip('inc/flickr_api');
$query = "DELETE FROM spip_fpipr_contextes";
spip_query($query);
$id_photo = $arguments['id_photo'];
$contextes = flickr_photos_getAllContexts($id_photo,$arguments['auth_token']);
foreach($contextes as $type => $cont) {
if(($type == 'set' || $type == 'pool') && is_array($cont))
foreach ($cont as $c) {
sql_insert('spip_fpipr_contextes',
'(id_contexte,title,type,id_photo)',
'('._q($c['id']).','._q($c['title']).','._q($type).','._q($id_photo).')'
);
}
}
}
?>

12
FpipR_fill/flickr_photos_getcontactsphotos.php

@ -0,0 +1,12 @@
<?php
function FpipR_fill_flickr_photos_getcontactsphotos_dist($arguments) {
include_spip('inc/flickr_api');
$photos = flickr_photos_getContactsPhotos(
$arguments['count'],
$arguments['just_friends'],
$arguments['single_photo'],
$arguments['include_self'],
$arguments['extras'],$arguments['auth_token']);
FpipR_fill_photos_table($photos->photos);
}
?>

12
FpipR_fill/flickr_photos_getcontactspublicphotos.php

@ -0,0 +1,12 @@
<?php
function FpipR_fill_flickr_photos_getcontactspublicphotos_dist($arguments) {
include_spip('inc/flickr_api');
$photos = flickr_photos_getContactsPublicPhotos($arguments['nsid'],
$arguments['count'],
$arguments['just_friends'],
$arguments['single_photo'],
$arguments['include_self'],
$arguments['extras'],$arguments['auth_token']);
FpipR_fill_photos_table($photos->photos);
}
?>

20
FpipR_fill/flickr_photos_getexif.php

@ -0,0 +1,20 @@
<?php
function FpipR_fill_flickr_photos_getexif_dist($arguments) {
include_spip('inc/flickr_api');
$photo = flickr_photos_getExif($arguments['id_photo'],$arguments['secret'],$arguments['auth_token']);
$query = "DELETE FROM spip_fpipr_exif";
spip_query($query);
if($photo = $photo['photo']) {
$id = _q($photo['id']);
$secret = _q($photo['secret']);
$server = _q($photo['server']);
foreach($photo['exif'] as $e) {
sql_insert('spip_fpipr_exif',
'(id_photo,secret,server,tagspace,tagspaceid,tag,label,raw,clean)',
'('.$id.','.$secret.','.$server.','._q($e['tagspace']).','._q($e['tagspaceid']).','._q($e['tag']).','._q($e['label']).','._q($e['raw']['_content']).','._q($e['clean']['_content']).')'
);
}
}
}
?>

44
FpipR_fill/flickr_photos_getinfo.php

@ -0,0 +1,44 @@
<?php
function FpipR_fill_flickr_photos_getinfo_dist($arguments) {
include_spip('inc/flickr_api');
$details = flickr_photos_getInfo($arguments['id_photo'],$arguments['secret'],$arguments['auth_token']);
$id_photo = intval($details->id);
if($id_photo) {
//on vide les tables
$query = "DELETE FROM spip_fpipr_photo_details";
spip_query($query);
$query = "DELETE FROM spip_fpipr_tags";
spip_query($query);
$query = "DELETE FROM spip_fpipr_notes";
spip_query($query);
$query = "DELETE FROM spip_fpipr_urls";
spip_query($query);
//on insere la ligne unique de detail
sql_insert('spip_fpipr_photo_details',
'(id_photo,secret,server,isfavorite,license,rotation,originalformat,user_id,owner_username,owner_realname,owner_location,title,description,ispublic,isfriend,isfamily,date_posted,date_taken,date_lastupdate,comments,latitude,longitude,accuracy)',
'('._q($details->id).','._q($details->secret).','._q($details->server).','._q($details->isfavorite).','._q($details->license).','._q($details->rotation).','._q($details->originalformat).','._q($details->owner_nsid).','._q($details->owner_username).','._q($details->owner_realname).','._q($details->owner_location).','._q($details->title).','._q($details->description).','._q($details->visibility_ispublic).','._q($details->visibility_isfriend).','._q($details->visibility_isfamily).','._q(date('Y-m-d H:i:s',$details->date_posted+0)).','._q($details->date_taken).','._q(date('Y-m-d H:i:s',$details->date_lastupdate+0)).','._q($details->comments).','._q($details->location_latitude).','._q($details->location_longitude).','._q($details->location_accuracy).')'
);
//on insere les tags
foreach($details->tags as $tag) {
sql_insert('spip_fpipr_tags',
'(id_tag,author,raw,safe,id_photo)',
'('._q($tag->id).','._q($tag->author).','._q($tag->raw).','._q($tag->safe).','._q($id_photo).')'
);
}
//on insere les notes
foreach($details->notes as $n) {
sql_insert('spip_fpipr_notes',
'(id_note,id_photo,author,authorname,x,y,width,height,texte)',
'('._q($n['id']).','._q($id_photo).','._q($n['author']).','._q($n['authorname']).','._q($n['x']).','._q($n['y']).','._q($n['w']).','._q($n['h']).','._q($n['_content']).')'
);
}
//on insere les urls
foreach($details->urls as $k=>$u) {
sql_insert('spip_fpipr_urls',
'(type,id_photo,url)',
'('._q($k).','._q($id_photo).','._q($u).')'
);
}
}
}
?>

14
FpipR_fill/flickr_photos_getnotinset.php

@ -0,0 +1,14 @@
<?php
function FpipR_fill_flickr_photos_getnotinset_dist($arguments) {
include_spip('inc/flickr_api');
$photos = flickr_photos_getNotInSet(
$arguments['per_page'],$arguments['page'],
$arguments['min_upload_date'],
$arguments['max_upload_date'], $arguments['min_taken_date'],
$arguments['max_taken_date'], $arguments['privacy_filter'],
$arguments['extras'],
$arguments['auth_token']);
FpipR_fill_photos_table($photos->photos);
return $photos->total;
}
?>

11
FpipR_fill/flickr_photos_getrecent.php

@ -0,0 +1,11 @@
<?php
function FpipR_fill_flickr_photos_getrecent_dist($arguments) {
include_spip('inc/flickr_api');
$photos = flickr_photos_getRecent(
$arguments['per_page'],$arguments['page'],
$arguments['extras'],
$arguments['auth_token']);
FpipR_fill_photos_table($photos->photos);
return $photos->total;
}
?>

14
FpipR_fill/flickr_photos_getuntagged.php

@ -0,0 +1,14 @@
<?php
function FpipR_fill_flickr_photos_getuntagged_dist($arguments) {
include_spip('inc/flickr_api');
$photos = flickr_photos_getUntagged(
$arguments['per_page'],$arguments['page'],
$arguments['min_upload_date'],
$arguments['max_upload_date'], $arguments['min_taken_date'],
$arguments['max_taken_date'], $arguments['privacy_filter'],
$arguments['extras'],
$arguments['auth_token']);
FpipR_fill_photos_table($photos->photos);
return $photos->total;
}
?>

15
FpipR_fill/flickr_photos_getwithgeodata.php

@ -0,0 +1,15 @@
<?php
function FpipR_fill_flickr_photos_getwithgeodata_dist($arguments) {
include_spip('inc/flickr_api');
$photos = flickr_photos_getWithGeoData(
$arguments['per_page'],$arguments['page'],
$arguments['min_upload_date'],
$arguments['max_upload_date'], $arguments['min_taken_date'],
$arguments['max_taken_date'],
$arguments['sort'], $arguments['privacy_filter'],
$arguments['extras'],
$arguments['auth_token']);
FpipR_fill_photos_table($photos->photos);
return $photos->total;
}
?>

16
FpipR_fill/flickr_photos_getwithoutgeodata.php

@ -0,0 +1,16 @@
<?php
function FpipR_fill_flickr_photos_getwithoutgeodata_dist($arguments) {
include_spip('inc/flickr_api');
$photos = flickr_photos_getWithoutGeoData(
$arguments['per_page'],$arguments['page'],
$arguments['min_upload_date'],
$arguments['max_upload_date'], $arguments['min_taken_date'],
$arguments['max_taken_date'],
$arguments['sort'], $arguments['privacy_filter'],
$arguments['extras'],
$arguments['auth_token']);
FpipR_fill_photos_table($photos->photos);
return $photos->total;
}
?>

11
FpipR_fill/flickr_photos_recentlyupdated.php

@ -0,0 +1,11 @@
<?php
function FpipR_fill_flickr_photos_recentlyupdated_dist($arguments) {
include_spip('inc/flickr_api');
$photos = flickr_photos_recentlyUpdated( $arguments['per_page'], $arguments['page'],
$arguments['min_date'],
$arguments['extras'],
$arguments['auth_token']);
FpipR_fill_photos_table($photos->photos);
return $photos->total;
}
?>

19
FpipR_fill/flickr_photos_search.php

@ -0,0 +1,19 @@
<?php
function FpipR_fill_flickr_photos_search_dist($arguments) {
include_spip('inc/flickr_api');
$photos = flickr_photos_search(
$arguments['per_page'],$arguments['page'],
$arguments['user_id'], $arguments['tags'], $arguments['tag_mode'],
$arguments['text'], $arguments['min_upload_date'],
$arguments['max_upload_date'], $arguments['min_taken_date'],
$arguments['max_taken_date'], $arguments['license'],
$arguments['sort'], $arguments['privacy_filter'],
$arguments['extras'],
$arguments['safe_search'],$arguments['content_type'],
$arguments['machine_tags'],$arguments['machine_tag_mode'],
$arguments['bbox'],$arguments['accuracy'],
$arguments['auth_token']);
FpipR_fill_photos_table($photos->photos);
return $photos->total;
}
?>

7
FpipR_fill/flickr_photosets_comments_getlist.php

@ -0,0 +1,7 @@
<?php
function FpipR_fill_flickr_photosets_comments_getlist_dist($arguments) {
include_spip('inc/flickr_api');
$comments = flickr_photosets_comments_getList($arguments['id_photoset'],$arguments['auth_token']);
FpipR_fill_comments_table($comments);
}
?>

15
FpipR_fill/flickr_photosets_getinfo.php

@ -0,0 +1,15 @@
<?php
function FpipR_fill_flickr_photosets_getinfo_dist($arguments) {
include_spip('inc/flickr_api');
//on vide les tables
$query = "DELETE FROM spip_fpipr_photosets";
spip_query($query);
$set = flickr_photosets_getInfo($arguments['id_photoset'],$arguments['auth_token']);
sql_insert('spip_fpipr_photosets',
'(id_photoset,user_id,primary_photo,secret,server,photos,title,description,farm)',
'('._q($set->id).','._q($set->owner).','._q($set->primary).','._q($set->secret).','._q($set->server).','._q($set->photos).','._q($set->title).','._q($set->description).','.intval($set->farm).')'
);
}
?>

16
FpipR_fill/flickr_photosets_getlist.php

@ -0,0 +1,16 @@
<?php
function FpipR_fill_flickr_photosets_getlist_dist($arguments) {
include_spip('inc/flickr_api');
//on vide les tables
$query = "DELETE FROM spip_fpipr_photosets";
spip_query($query);
$photosets = flickr_photosets_getList($arguments['user_id'],$arguments['auth_token']);
foreach($photosets as $set) {
sql_insert('spip_fpipr_photosets',
'(id_photoset,user_id,primary_photo,secret,server,photos,title,description,farm)',
'('._q($set->id).','._q($set->owner).','._q($set->primary).','._q($set->secret).','._q($set->server).','._q($set->photos).','._q($set->title).','._q($set->description).','.intval($set->farm).')'
);
}
}
?>

15
FpipR_fill/flickr_photosets_getphotos.php

@ -0,0 +1,15 @@
<?php
function FpipR_fill_flickr_photosets_getphotos_dist($arguments) {
include_spip('inc/flickr_api');
$photos = flickr_photosets_getPhotos($arguments['id_photoset'],
$arguments['extras'],
$arguments['per_page'],
$arguments['page'],
$arguments['privacy_filter'],$arguments['auth_token']);
FpipR_fill_photos_table($photos->photos,array(
'id_photoset' => $arguments['id_photoset']
));
return $photos->total;
}
?>

18
FpipR_fill/flickr_tags_gethotlist.php

@ -0,0 +1,18 @@
<?php
function FpipR_fill_flickr_tags_gethotlist_dist($arguments) {
include_spip('inc/flickr_api');
$who = flickr_tags_getHotList($arguments['period'],$arguments['count'],$arguments['auth_token']);
$query = "DELETE FROM spip_fpipr_tags";
spip_query($query);
$fake_id = 0;
if($who = $who['hottags']) {
foreach($who['tag'] as $t) {
sql_insert('spip_fpipr_tags',
'(id_tag,score,safe)',
'('._q($fake_id++).','._q($t['score']).','._q($t['_content']).')'
);
}
}
}
?>

12
FpipR_fill/flickr_tags_getlistphoto.php

@ -0,0 +1,12 @@
<?php
function FpipR_fill_flickr_tags_getlistphoto_dist($arguments) {
include_spip('inc/flickr_api');
$tags = flickr_tags_getListPhoto($arguments['id_photo'],$arguments['auth_token']);
foreach($tags as $tag) {
sql_insert('spip_fpipr_tags',
'(id_tag,author,raw,safe,id_photo)',
'('._q($tag->id).','._q($tag->author).','._q($tag->raw).','._q($tag->safe).','._q($arguments['id_photo']).')'
);
}
}
?>

18
FpipR_fill/flickr_tags_getlistuser.php

@ -0,0 +1,18 @@
<?php
function FpipR_fill_flickr_tags_getlistuser_dist($arguments) {
include_spip('inc/flickr_api');
$who = flickr_tags_getListUser($arguments['author'],$arguments['auth_token']);
$query = "DELETE FROM spip_fpipr_tags";
spip_query($query);
$fake_id = 0;
if($who = $who['who']['tags']) {
foreach($who['tag'] as $t) {
sql_insert('spip_fpipr_tags',
'(id_tag,author,safe)',
'('._q($fake_id++).','._q($arguments['author']).','._q($t['_content']).')'
);
}
}
}
?>

18
FpipR_fill/flickr_tags_getlistuserpopular.php

@ -0,0 +1,18 @@
<?php
function FpipR_fill_flickr_tags_getlistuserpopular_dist($arguments) {
include_spip('inc/flickr_api');
$who = flickr_tags_getListUserPopular($arguments['author'],$arguments['count'],$arguments['auth_token']);
$query = "DELETE FROM spip_fpipr_tags";
spip_query($query);
$fake_id = 0;
if($who = $who['who']['tags']) {
foreach($who['tag'] as $t) {
sql_insert('spip_fpipr_tags',
'(id_tag,author,safe,count)',
'('._q($fake_id++).','._q($arguments['author']).','._q($t['_content']).','._q($t['count']).')'
);
}
}
}
?>

21
FpipR_fill/flickr_tags_getlistuserraw.php

@ -0,0 +1,21 @@
<?php
function FpipR_fill_flickr_tags_getlistuserraw_dist($arguments) {
include_spip('inc/flickr_api');
$who = flickr_tags_getListUserRaw($arguments['tag'],$arguments['auth_token']);
$query = "DELETE FROM spip_fpipr_tags";
spip_query($query);
$fake_id = 0;
$user_id = $who['who']['id'];
if($who = $who['who']['tags']) {
foreach($who['tag'] as $t) {
foreach($t['raw'] as $r) {
sql_insert('spip_fpipr_tags',
'(id_tag,author,raw,safe)',
'('._q($fake_id++).','._q($user_id).','._q($r['_content']).','._q($t['clean']).')'
);
}
}
}
}
?>

18
FpipR_fill/flickr_tags_getrelated.php

@ -0,0 +1,18 @@
<?php
function FpipR_fill_flickr_tags_getrelated_dist($arguments) {
include_spip('inc/flickr_api');
$who = flickr_tags_getRelated($arguments['tag'],$arguments['auth_token']);
$query = "DELETE FROM spip_fpipr_tags";
spip_query($query);
$fake_id = 0;
if($who = $who['tags']) {
foreach($who['tag'] as $r) {
sql_insert('spip_fpipr_tags',
'(id_tag,author,safe)',
'('._q($fake_id++).','._q($user_id).','._q($r['_content']).')'
);
}
}
}
?>

16
FpipR_fill/flickr_urls_lookupgroup.php

@ -0,0 +1,16 @@
<?php
function FpipR_fill_flickr_urls_lookupgroup_dist($arguments) {
include_spip('inc/flickr_api');
$group = flickr_urls_lookupGroup($arguments['url'],$arguments['auth_token']);
$query = "DELETE FROM spip_fpipr_groups";
spip_query($query);
if($group = $group['group']) {
sql_insert('spip_fpipr_groups',
'(id_group,name)',
'('._q($group['id']).','._q($group['groupname']['_content']).')'
);
}
}
?>

16
FpipR_fill/flickr_urls_lookupuser.php

@ -0,0 +1,16 @@
<?php
function FpipR_fill_flickr_urls_lookupuser_dist($arguments) {
include_spip('inc/flickr_api');
$user = flickr_urls_lookupUser($arguments['url'],$arguments['auth_token']);
$query = "DELETE FROM spip_fpipr_people";
spip_query($query);
if($user = $user['user']) {
sql_insert('spip_fpipr_groups',
'(user_id,username)',
'('._q($group['id']).','._q($group['username']['_content']).')'
);
}
}
?>

77
FpipR_fonctions.php

@ -0,0 +1,77 @@
<?php
/*
* BOUCLEs Flickr API
*
* Auteur: Mortimer (Pierre Andrews)
* (c) 2006 - Distribue sous license GNU/GPL
*/
include_spip('base/FpipR_db');
function boucle_DEFAUT($id_boucle, &$boucles) {
$boucle = &$boucles[$id_boucle];
$type = $boucle->type_requete;
$f=charger_fonction($type, 'boucle', true);
if($f)
return $f($id_boucle,$boucles);
return boucle_DEFAUT_dist($id_boucle,$boucles);
}
function critere_tags_dist($idb, &$boucles, $crit) {
}
function critere_tag_mode_dist($idb, &$boucles, $crit) {
}
function critere_machine_tags_dist($idb, &$boucles, $crit) {
}
function critere_machine_tag_mode_dist($idb, &$boucles, $crit) {
}
function critere_text_dist($idb, &$boucles, $crit) {
}
function critere_privacy_filter_dist($idb, &$boucles, $crit) {
}
function critere_save_search_dist($idb, &$boucles, $crit) {
}
function critere_content_type_dist($idb, &$boucles, $crit) {
}
function critere_bbox_dist($idb, &$boucles, $crit) {
}
function critere_accuracy_dist($idb, &$boucles, $crit) {
}
function critere_min_date_dist($idb, &$boucles, $crit) {
}
//ici, on utilise un critere nsid different pour specifier de qui on veut les contacts
function critere_nsid_dist($idb, &$boucles, $crit) {
}
function critere_just_friends_dist($idb, &$boucles, $crit) {
}
function critere_single_photo_dist($idb, &$boucles, $crit) {
}
function critere_include_self_dist($idb, &$boucles, $crit) {
}
function critere_url_dist($idb, &$boucles, $crit) {
}
function critere_tag_dist($idb, &$boucles, $crit) {
}
function critere_period_dist($idb, &$boucles, $crit) {
}
?>

340
FpipR_options.php

@ -0,0 +1,340 @@
<?php
//
function generer_url_document_flickr($id_document, $statut='') {
if (intval($id_document) <= 0)
return '';
$row = @spip_fetch_array(spip_query("SELECT fichier,distant FROM spip_documents WHERE id_document = $id_document"));
if ($row) {
if ($row['distant'] == 'oui') {
if(preg_match('#http://(farm[0-9].)?static.flickr.com/(.*?)/(.*?)_(.*?)(_[stmbo])\.(jpg|gif|png)#',$row['fichier'],$matches)) {
$id = $matches[3];
$secret = $matches[4];
include_spip('inc/flickr_api');
$details = flickr_photos_getInfo($id,$secret);
if($details->urls['photopage']) return $details->urls['photopage'];
if($details->owner_nsid)
return "http://www.flickr.com/photos/".$details->owner_nsid."/$id/";
else return $row['fichier'];
} else
return $row['fichier'];
} else {
if (($GLOBALS['meta']["creer_htaccess"]) != 'oui')
return _DIR_RACINE . ($row['fichier']);
else return generer_url_action('autoriser', "arg=$id_document");
}
}
}
//on ne peut plus utiliser ce truc pour avoir l'url de la page flickr comme url_document
// parce que le modele emb utilise url_document pour inclure l'image.
/*if (!_DIR_RESTREINT) {
if (!function_exists('generer_url_document')) {
function generer_url_document($id, $stat='')
{ return generer_url_document_flickr($id, $stat);}
}
}
function balise_URL_DOCUMENT($p) {
$_id_document = '';
if ($p->param && !$p->param[0][0]){
$_id_document = calculer_liste($p->param[0][1],
$p->descr,
$p->boucles,
$p->id_boucle);
}
if (!$_id_document)
$_id_document = champ_sql('id_document',$p);
$p->code = "generer_url_document_flickr($_id_document)";
$p->interdire_scripts = false;
return $p;
}*/
/***********************************************************************
* Pour les boucles Flickr *
***********************************************************************/
/*Copie du plugin boucles_xml*/
function FpipR_fill_table_boucle($method,$arguments){
include_spip('base/FpipR_db');
FpipR_creer_tables($method);
$arguments['auth_token'] = FpipR_getAuthToken();
return FpipR_fill_table($method,$arguments);
}
function FpipR_traiter_argument($key, $val){
$val = str_replace("'",'',$val);
if(!$val) $val = '0';
if($key == 'bbox')
$val = str_replace(':',',',$val);
else if(strpos($key,'min_date') !== false || strpos($key,'upload_date') !== false) {
return strtotime($val);
}
return $val;
}
function FpipR_logo_owner($user_id,$server = '') {
$url = 'http://www.flickr.com/images/buddyicon.jpg';
if($server) {
$url ="http://static.flickr.com/$server/buddyicons/$user_id.jpg";
}
return '<img src="'.$url.'" width="48" height="48" />';
}
function FpipR_logo_photo($id_photo,$server,$secret,$taille='',$originalformat='jpg',$farm='') {
if($id_photo) {
$w = ($taille=='s')?75:FpipR_taille_photo($id_photo,$taille,'width');
$h = ($taille=='s')?75:FpipR_taille_photo($id_photo,$taille,'height');
if($server) {
return '<img src="http://'.($farm?('farm'.$farm.'.'):'').'static.flickr.com/'.$server."/".$id_photo."_".$secret.($taille?"_$taille":'').'.'.(($taille=='o')?$originalformat:'jpg').'" width="'.$w.'" height="'.$h.'" style="width:'.$w.';height:'.$h.'" />';
} else {
$src = FpipR_taille_photo($id_photo,$taille,'source');
return '<img src="'.$src.'" width="'.$w.'" height="'.$h.'" style="width:'.$w.';height:'.$h.'" />';
}
}
return NULL;
}
function FpipR_generer_url_photo($user_id,$id_photo) {
if($user_id && $id_photo)
return "http://www.flickr.com/photos/$user_id/$id_photo/";
else if($id_photo)
return "http://www.flickr.com/photo.gne?id=$id_photo";
return NULL;
}
function FpipR_generer_url_owner($user_id,$type) {
if($user_id) {
$auth_token = FpipR_getAuthToken();
switch($type) {
case 1: //photos
include_spip('inc/flickr_api');
$url = flickr_urls_getUserPhotos($user_id,$auth_token);
if($url) return $url['user']['url'];
case 2: //profile
include_spip('inc/flickr_api');
$url = flickr_urls_getUserProfile($user_id,$auth_token);
include_spip('inc/flickr_api');
if($url) return $url['user']['url'];
case 0:
default:
return 'http://www.flickr.com/photos/'.$user_id.'/';
}
}
return NULL;
}
function FpipR_generer_url_photoset($user_id,$id_photoset) {
if($user_id && $id_photoset)
return 'http://www.flickr.com/photos/'.$user_id.'/sets/'.$id_photoset.'/';
return NULL;
}
function FpipR_generer_url_group($id) {
if($id) {
$auth_token = FpipR_getAuthToken();
include_spip('inc/flickr_api');
$url = flickr_urls_getGroup($id,$auth_token);
if($url)return $url['group']['url'];
return 'http://www.flickr.com/groups/'.$id;
}
return NULL;
}
function FpipR_taille_photo($id_photo,$taille='',$type) {
static $tailles = array();
if(!$tailles[$id_photo]) {
$auth_token = FpipR_getAuthToken();
$tailles[$id_photo] = flickr_photos_getSizes($id_photo,$auth_token);
}
/*
s small square 75x75
t thumbnail, 100 on longest side
m small, 240 on longest side
- medium, 500 on longest side
b large, 1024 on longest side (only exists for very large original images)
o original image, either a jpg, gif or png, depending on source format
*/
switch($taille) {
case 's':
$t = 'Square';
break;
case 't':
$t = 'Thumbnail';
break;
case 'm':
$t = 'Small';
break;
case 'b':
$t = 'Large';
break;
case 'o':
$t = 'Original';
break;
default:
$t = 'Medium';
}
if(is_array($tailles[$id_photo]))
foreach($tailles[$id_photo]['sizes']['size'] as $size) {
if($size['label'] == $t) {
return $size[$type];
}
}
return '';
}
function FpipR_photos_getContext($id_photo,$id_photoset='',$id_group='',$tag,$attr) {
static $contexts = array();
if($id_photoset) {
if(!$contexts["$id_photo-$id_photoset"]) {
include_spip('inc/flickr_api');