Changeset 31465
- Timestamp:
- Mar 19, 2016, 9:01:52 PM (8 years ago)
- Location:
- extensions/Photo_add_by
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Photo_add_by/admin.php
r30514 r31465 1 1 <?php 2 // +-----------------------------------------------------------------------+ 3 // | Photo added by plugin for Piwigo | 4 // +-----------------------------------------------------------------------+ 5 // | Copyright(C) 2012-2016 ddtddt http://temmii.com/piwigo/ | 6 // +-----------------------------------------------------------------------+ 7 // | This program is free software; you can redistribute it and/or modify | 8 // | it under the terms of the GNU General Public License as published by | 9 // | the Free Software Foundation | 10 // | | 11 // | This program is distributed in the hope that it will be useful, but | 12 // | WITHOUT ANY WARRANTY; without even the implied warranty of | 13 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 14 // | General Public License for more details. | 15 // | | 16 // | You should have received a copy of the GNU General Public License | 17 // | along with this program; if not, write to the Free Software | 18 // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | 19 // | USA. | 20 // +-----------------------------------------------------------------------+ 21 2 22 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 3 23 global $template, $conf, $user; … … 20 40 21 41 $tabsheet = new tabsheet(); 22 $tabsheet->add('gestion', 23 l10n('Configuration'), 24 PAB_ADMIN.'-gestion'); 42 $tabsheet->add('gestion',l10n('Configuration'),PAB_ADMIN.'-gestion'); 25 43 $tabsheet->select($page['tab']); 26 44 $tabsheet->assign(); -
extensions/Photo_add_by/index.php
r16859 r31465 1 1 <?php 2 // +-----------------------------------------------------------------------+3 // | Piwigo - a PHP based picture gallery |4 // +-----------------------------------------------------------------------+5 // | Copyright(C) 2008-2009 Piwigo Team http://piwigo.org |6 // | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |7 // | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |8 // +-----------------------------------------------------------------------+9 // | This program is free software; you can redistribute it and/or modify |10 // | it under the terms of the GNU General Public License as published by |11 // | the Free Software Foundation |12 // | |13 // | This program is distributed in the hope that it will be useful, but |14 // | WITHOUT ANY WARRANTY; without even the implied warranty of |15 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |16 // | General Public License for more details. |17 // | |18 // | You should have received a copy of the GNU General Public License |19 // | along with this program; if not, write to the Free Software |20 // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |21 // | USA. |22 // +-----------------------------------------------------------------------+23 24 2 // Recursive call 25 3 $url = '../'; -
extensions/Photo_add_by/initpicture.php
r30404 r31465 1 1 <?php 2 // +-----------------------------------------------------------------------+ 3 // | Photo added by plugin for Piwigo | 4 // +-----------------------------------------------------------------------+ 5 // | Copyright(C) 2012-2016 ddtddt http://temmii.com/piwigo/ | 6 // +-----------------------------------------------------------------------+ 7 // | This program is free software; you can redistribute it and/or modify | 8 // | it under the terms of the GNU General Public License as published by | 9 // | the Free Software Foundation | 10 // | | 11 // | This program is distributed in the hope that it will be useful, but | 12 // | WITHOUT ANY WARRANTY; without even the implied warranty of | 13 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 14 // | General Public License for more details. | 15 // | | 16 // | You should have received a copy of the GNU General Public License | 17 // | along with this program; if not, write to the Free Software | 18 // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | 19 // | USA. | 20 // +-----------------------------------------------------------------------+ 2 21 3 22 //Ajout du prefiltre … … 32 51 add_event_handler('loc_begin_picture', 'pab'); 33 52 34 function pab() 35 { 53 function pab(){ 36 54 global $conf, $page, $template; 37 55 load_language('plugin.lang', PAB_PATH); 38 56 load_language('lang', PHPWG_ROOT_PATH.PWG_LOCAL_DIR, array('no_fallback'=>true, 'local'=>true) ); 39 57 40 if ( !empty($page['image_id']) ) 41 { 42 43 $query = ' 44 select added_by 45 FROM ' . IMAGES_TABLE . ' 46 WHERE id = \''.$page['image_id'].'\' 47 ;'; 48 $result = pwg_query($query); 49 $row = pwg_db_fetch_assoc($result); 50 $userab=$row['added_by']; 51 52 $query = ' 53 select '.$conf['user_fields']['username'].' AS username 54 FROM ' . USERS_TABLE . ' 55 WHERE '.$conf['user_fields']['id'].' = \''.$userab.'\' 56 ;'; 57 $result = pwg_query($query); 58 $row = pwg_db_fetch_assoc($result); 59 $pab=$row['username']; 60 61 $PASPBY = pwg_db_fetch_assoc(pwg_query("SELECT state FROM " . PLUGINS_TABLE . " WHERE id = 'see_photos_by_user';")); 62 $showpab = $conf['Photo_add_by_show']; 63 if($showpab == 1 and $PASPBY['state'] == 'active') 64 { 65 $query2 = ' 66 SELECT UT.id, UT.username, COUNT(DISTINCT(IT.id)) AS PBU 67 FROM ' . USERS_TABLE . ' as UT 68 INNER JOIN '.IMAGES_TABLE.' AS IT ON IT.added_by = UT.id 69 INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON IT.id = ic.image_id 70 '.get_sql_condition_FandF 71 ( 72 array 73 ( 74 'forbidden_categories' => 'category_id', 75 'visible_categories' => 'category_id', 76 'visible_images' => 'id' 77 ), 78 'WHERE' 79 ).' 80 GROUP BY IT.added_by 81 HAVING PBU >'.$conf['see_photos_by_user_nbphotos'].' 82 ORDER BY '.$conf['see_photos_by_user_order'].' 83 LIMIT '.$conf['see_photos_by_user_limit'].';'; 84 85 $result2 = pwg_query($query2); 86 87 $userok = array(); 88 while ($row2 = pwg_db_fetch_assoc($result2)) 89 { 90 $userok[] = $row2['username']; 91 } 92 if(in_array($pab, $userok) and $showpab == 1 and $PASPBY['state'] == 'active') 93 { 94 $urlpab = get_root_url().'index.php?/user-'.$userab.'-'.$pab; 95 $pab2 ='<a href="'.$urlpab.'">'.$pab.'</a>'; 96 } 97 else 98 { 99 $pab2=$pab; 100 } 101 } 102 else 103 { 104 $pab2=$pab; 105 } 106 $template->assign(array('PAB' => $pab2,)); 107 58 if ( !empty($page['image_id']) ){ 59 $query = 'select added_by FROM ' . IMAGES_TABLE . ' WHERE id = \''.$page['image_id'].'\';'; 60 $result = pwg_query($query); 61 $row = pwg_db_fetch_assoc($result); 62 $userab=$row['added_by']; 63 64 $query = 'select '.$conf['user_fields']['username'].' AS username FROM ' . USERS_TABLE . ' WHERE '.$conf['user_fields']['id'].' = \''.$userab.'\';'; 65 $result = pwg_query($query); 66 $row = pwg_db_fetch_assoc($result); 67 $pab=$row['username']; 68 69 $PASPBY = pwg_db_fetch_assoc(pwg_query("SELECT state FROM " . PLUGINS_TABLE . " WHERE id = 'see_photos_by_user';")); 70 $showpab = $conf['Photo_add_by_show']; 71 if($showpab == 1 and $PASPBY['state'] == 'active'){ 72 $query2 = 'SELECT UT.id, UT.username, COUNT(DISTINCT(IT.id)) AS PBU 73 FROM ' . USERS_TABLE . ' as UT 74 INNER JOIN '.IMAGES_TABLE.' AS IT ON IT.added_by = UT.id 75 INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON IT.id = ic.image_id 76 '.get_sql_condition_FandF 77 ( 78 array 79 ( 80 'forbidden_categories' => 'category_id', 81 'visible_categories' => 'category_id', 82 'visible_images' => 'id' 83 ), 84 'WHERE' 85 ).' 86 GROUP BY IT.added_by 87 HAVING PBU >'.$conf['see_photos_by_user_nbphotos'].' 88 ORDER BY '.$conf['see_photos_by_user_order'].' 89 LIMIT '.$conf['see_photos_by_user_limit'].';'; 90 $result2 = pwg_query($query2); 91 $userok = array(); 92 while ($row2 = pwg_db_fetch_assoc($result2)){ 93 $userok[] = $row2['username']; 94 } 95 if(in_array($pab, $userok) and $showpab == 1 and $PASPBY['state'] == 'active'){ 96 $urlpab = get_root_url().'index.php?/user-'.$userab.'-'.$pab; 97 $pab2 ='<a href="'.$urlpab.'">'.$pab.'</a>'; 98 }else{ 99 $pab2=$pab; 100 } 101 }else{ 102 $pab2=$pab; 103 } 104 $template->assign(array('PAB' => $pab2,)); 108 105 } 109 106 } -
extensions/Photo_add_by/language/en_UK/index.php
r16859 r31465 1 1 <?php 2 // +-----------------------------------------------------------------------+3 // | Piwigo - a PHP based picture gallery |4 // +-----------------------------------------------------------------------+5 // | Copyright(C) 2008-2009 Piwigo Team http://piwigo.org |6 // | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |7 // | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |8 // +-----------------------------------------------------------------------+9 // | This program is free software; you can redistribute it and/or modify |10 // | it under the terms of the GNU General Public License as published by |11 // | the Free Software Foundation |12 // | |13 // | This program is distributed in the hope that it will be useful, but |14 // | WITHOUT ANY WARRANTY; without even the implied warranty of |15 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |16 // | General Public License for more details. |17 // | |18 // | You should have received a copy of the GNU General Public License |19 // | along with this program; if not, write to the Free Software |20 // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |21 // | USA. |22 // +-----------------------------------------------------------------------+23 24 2 // Recursive call 25 3 $url = '../'; -
extensions/Photo_add_by/language/en_UK/plugin.lang.php
r27458 r31465 1 1 <?php 2 // +-----------------------------------------------------------------------+ 3 // | Photo added by plugin for Piwigo | 4 // +-----------------------------------------------------------------------+ 5 // | Copyright(C) 2012-2016 ddtddt http://temmii.com/piwigo/ | 6 // +-----------------------------------------------------------------------+ 7 // | This program is free software; you can redistribute it and/or modify | 8 // | it under the terms of the GNU General Public License as published by | 9 // | the Free Software Foundation | 10 // | | 11 // | This program is distributed in the hope that it will be useful, but | 12 // | WITHOUT ANY WARRANTY; without even the implied warranty of | 13 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 14 // | General Public License for more details. | 15 // | | 16 // | You should have received a copy of the GNU General Public License | 17 // | along with this program; if not, write to the Free Software | 18 // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | 19 // | USA. | 20 // +-----------------------------------------------------------------------+ 2 21 $lang['Photo added by'] = 'Photo added by'; 3 22 $lang['Add information before'] = 'Add information before'; -
extensions/Photo_add_by/language/fr_FR/index.php
r16859 r31465 1 1 <?php 2 // +-----------------------------------------------------------------------+3 // | Piwigo - a PHP based picture gallery |4 // +-----------------------------------------------------------------------+5 // | Copyright(C) 2008-2009 Piwigo Team http://piwigo.org |6 // | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |7 // | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |8 // +-----------------------------------------------------------------------+9 // | This program is free software; you can redistribute it and/or modify |10 // | it under the terms of the GNU General Public License as published by |11 // | the Free Software Foundation |12 // | |13 // | This program is distributed in the hope that it will be useful, but |14 // | WITHOUT ANY WARRANTY; without even the implied warranty of |15 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |16 // | General Public License for more details. |17 // | |18 // | You should have received a copy of the GNU General Public License |19 // | along with this program; if not, write to the Free Software |20 // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |21 // | USA. |22 // +-----------------------------------------------------------------------+23 24 2 // Recursive call 25 3 $url = '../'; -
extensions/Photo_add_by/language/fr_FR/plugin.lang.php
r27458 r31465 1 1 <?php 2 // +-----------------------------------------------------------------------+ 3 // | Photo added by plugin for Piwigo | 4 // +-----------------------------------------------------------------------+ 5 // | Copyright(C) 2012-2016 ddtddt http://temmii.com/piwigo/ | 6 // +-----------------------------------------------------------------------+ 7 // | This program is free software; you can redistribute it and/or modify | 8 // | it under the terms of the GNU General Public License as published by | 9 // | the Free Software Foundation | 10 // | | 11 // | This program is distributed in the hope that it will be useful, but | 12 // | WITHOUT ANY WARRANTY; without even the implied warranty of | 13 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 14 // | General Public License for more details. | 15 // | | 16 // | You should have received a copy of the GNU General Public License | 17 // | along with this program; if not, write to the Free Software | 18 // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | 19 // | USA. | 20 // +-----------------------------------------------------------------------+ 2 21 $lang['Photo added by'] = 'Photo Ajoutée par'; 3 22 $lang['Add information before'] = 'Ajouter l\'information avant'; -
extensions/Photo_add_by/main.inc.php
r30431 r31465 6 6 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=621 7 7 Author: ddtddt 8 Author URI: 8 Author URI: http://temmii.com/piwigo/ 9 9 */ 10 11 // +-----------------------------------------------------------------------+ 12 // | Photo added by plugin for Piwigo | 13 // +-----------------------------------------------------------------------+ 14 // | Copyright(C) 2012-2016 ddtddt http://temmii.com/piwigo/ | 15 // +-----------------------------------------------------------------------+ 16 // | This program is free software; you can redistribute it and/or modify | 17 // | it under the terms of the GNU General Public License as published by | 18 // | the Free Software Foundation | 19 // | | 20 // | This program is distributed in the hope that it will be useful, but | 21 // | WITHOUT ANY WARRANTY; without even the implied warranty of | 22 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 23 // | General Public License for more details. | 24 // | | 25 // | You should have received a copy of the GNU General Public License | 26 // | along with this program; if not, write to the Free Software | 27 // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | 28 // | USA. | 29 // +-----------------------------------------------------------------------+ 10 30 11 31 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); … … 17 37 define('PAB_ADMIN',get_root_url().'admin.php?page=plugin-'.PAB_DIR); 18 38 39 add_event_handler('loading_lang', 'Photo_added_by_loading_lang'); 40 function Photo_added_by_loading_lang(){ 41 load_language('plugin.lang', PAB_ADMIN); 42 } 43 19 44 // Plugin on picture page 20 if (script_basename() == 'picture') 21 { 45 if (script_basename() == 'picture'){ 22 46 include_once(dirname(__FILE__).'/initpicture.php'); 23 47 } … … 25 49 // menu admin 26 50 add_event_handler('get_admin_plugin_menu_links', 'PAB_admin_menu'); 27 function PAB_admin_menu($menu) 28 { 29 load_language('plugin.lang', PAB_PATH); 30 31 $menu[] = array( 51 function PAB_admin_menu($menu){ 52 $menu[] = array( 32 53 'NAME' => l10n('Photo added by'), 33 54 'URL' => PAB_ADMIN, 34 55 ); 35 56 return $menu; 36 57 } -
extensions/Photo_add_by/maintain.class.php
r30431 r31465 1 1 <?php 2 // +-----------------------------------------------------------------------+ 3 // | Photo added by plugin for Piwigo | 4 // +-----------------------------------------------------------------------+ 5 // | Copyright(C) 2012-2016 ddtddt http://temmii.com/piwigo/ | 6 // +-----------------------------------------------------------------------+ 7 // | This program is free software; you can redistribute it and/or modify | 8 // | it under the terms of the GNU General Public License as published by | 9 // | the Free Software Foundation | 10 // | | 11 // | This program is distributed in the hope that it will be useful, but | 12 // | WITHOUT ANY WARRANTY; without even the implied warranty of | 13 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 14 // | General Public License for more details. | 15 // | | 16 // | You should have received a copy of the GNU General Public License | 17 // | along with this program; if not, write to the Free Software | 18 // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | 19 // | USA. | 20 // +-----------------------------------------------------------------------+ 2 21 defined('PHPWG_ROOT_PATH') or die('Hacking attempt!'); 3 22
Note: See TracChangeset
for help on using the changeset viewer.