Changeset 16104
- Timestamp:
- Jun 27, 2012, 9:19:07 PM (12 years ago)
- Location:
- extensions/SmartAlbums
- Files:
-
- 10 added
- 2 deleted
- 22 edited
- 5 moved
Legend:
- Unmodified
- Added
- Removed
-
extensions/SmartAlbums/admin.php
r11392 r16104 4 4 global $conf, $template, $page; 5 5 6 load_language('plugin.lang', SMART_PATH); 7 if (!is_array($conf['SmartAlbums'])) $conf['SmartAlbums'] = unserialize($conf['SmartAlbums']); 6 $page['tab'] = (isset($_GET['tab'])) ? $_GET['tab'] : $page['tab'] = 'cat_list'; 8 7 9 include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php'); 10 $page['tab'] = (isset($_GET['tab'])) ? $_GET['tab'] : $page['tab'] = 'albums'; 11 12 $tabsheet = new tabsheet(); 13 $tabsheet->add('albums', l10n('All SmartAlbums'), SMART_ADMIN.'-albums'); 14 $tabsheet->add('config', l10n('Configuration'), SMART_ADMIN.'-config'); 15 $tabsheet->select($page['tab']); 16 $tabsheet->assign(); 8 if ($page['tab'] == 'album') 9 { 10 include(SMART_PATH . 'admin/album.php'); 11 } 12 else 13 { 14 include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php'); 15 $tabsheet = new tabsheet(); 16 $tabsheet->add('cat_list', l10n('All SmartAlbums'), SMART_ADMIN.'-cat_list'); 17 $tabsheet->add('config', l10n('Configuration'), SMART_ADMIN.'-config'); 18 $tabsheet->select($page['tab']); 19 $tabsheet->assign(); 17 20 18 $template->assign(array(19 'SMART_PATH' => SMART_PATH,20 ));21 $template->assign(array( 22 'SMART_PATH' => SMART_PATH, 23 )); 21 24 22 include(SMART_PATH.'admin/'.$page['tab'].'.inc.php'); 23 $template->set_filename('SmartAlbums_content', dirname(__FILE__).'/admin/template/'.$page['tab'].'.tpl'); 25 include(SMART_PATH . 'admin/'.$page['tab'].'.php'); 26 } 27 28 $template->assign('SMART_PATH', SMART_PATH); 29 24 30 $template->assign_var_from_handle('ADMIN_CONTENT', 'SmartAlbums_content'); 25 31 -
extensions/SmartAlbums/admin/cat_list.php
r12863 r16104 11 11 // | initialization | 12 12 // +-----------------------------------------------------------------------+ 13 $base_url = get_root_url() .'admin.php?page=';14 $self_url = SMART_ADMIN .'-albums';13 $base_url = get_root_url() . 'admin.php?page='; 14 $self_url = SMART_ADMIN . '-cat_list'; 15 15 16 16 $categories = array(); 17 17 $query = ' 18 SELECT id, name, permalink, dir, rank, status 18 SELECT 19 id, 20 name, 21 permalink, 22 dir, 23 rank, 24 status 19 25 FROM '.CATEGORIES_TABLE.' AS cat 20 26 INNER JOIN '.CATEGORY_FILTERS_TABLE.' AS cf … … 50 56 { 51 57 $_SESSION['page_infos'] = array(l10n('SmartAlbum added')); 52 $redirect_url = $base_url.'cat_modify&cat_id='.$output_create['id'].'&new_smart';58 $redirect_url = SMART_ADMIN . '-album&cat_id='.$output_create['id'].'&new_smart'; 53 59 redirect($redirect_url); 54 60 } … … 57 63 else if (isset($_GET['smart_generate'])) 58 64 { 59 /* regenerate photo list | all (sub)categories */65 /* regenerate photo list | all categories */ 60 66 if ($_GET['smart_generate'] == 'all') 61 67 { … … 63 69 { 64 70 $associated_images = smart_make_associations($category['id']); 65 array_push( 66 $page['infos'], 67 sprintf( 68 l10n('%d photos associated to album %s'), 71 array_push($page['infos'], 72 sprintf(l10n('%d photos associated to album %s'), 69 73 count($associated_images), 70 '«'.trigger_event( 71 'render_category_name', 72 $category['name'], 73 'admin_cat_list' 74 ).'»' 74 '«'.trigger_event('render_category_name', $category['name'], 'admin_cat_list').'»' 75 75 ) 76 76 ); … … 81 81 { 82 82 $associated_images = smart_make_associations($_GET['smart_generate']); 83 array_push( 84 $page['infos'], 85 sprintf( 86 l10n('%d photos associated to album %s'), 83 array_push($page['infos'], 84 sprintf(l10n('%d photos associated to album %s'), 87 85 count($associated_images), 88 '«'.trigger_event( 89 'render_category_name', 90 $categories[$_GET['smart_generate']]['name'], 91 'admin_cat_list' 92 ).'»' 86 '«'.trigger_event('render_category_name', $categories[ $_GET['smart_generate'] ]['name'], 'admin_cat_list').'»' 93 87 ) 94 88 ); … … 122 116 { 123 117 array_push($page['warnings'], l10n('Only SmartAlbums are displayed on this page')); 124 array_push($page['warnings'], l10n('To order albums please go the main albums management page'));118 array_push($page['warnings'], sprintf(l10n('To order albums please go the main albums <a href="%s">management page</a>'), $base_url.'cat_list')); 125 119 array_push($page['warnings'], '<a href="'.$self_url.'&hide_messages">['.l10n('Don\'t show this message again').']</a>'); 126 120 } … … 147 141 $tpl_cat = 148 142 array( 149 'NAME' => get_cat_display_name_from_id($category['id'], $base_url.' cat_modify&cat_id='),143 'NAME' => get_cat_display_name_from_id($category['id'], $base_url.'album-'), 150 144 'ID' => $category['id'], 151 145 'RANK' => $category['rank']*10, … … 157 151 ), 158 152 159 'U_EDIT' => $base_url.' cat_modify&cat_id='.$category['id'],153 'U_EDIT' => $base_url.'album-'.$category['id'], 160 154 'U_DELETE' => $self_url.'&delete='.$category['id'].'&pwg_token='.get_pwg_token(), 161 155 'U_SMART' => $self_url.'&smart_generate='.$category['id'], … … 167 161 $base_url.'batch_manager&cat='.$category['id']; 168 162 } 169 170 if ('private' == $category['status'])171 {172 $tpl_cat['U_MANAGE_PERMISSIONS'] =173 $base_url.'cat_perm&cat='.$category['id'];174 }175 163 176 164 $template->append('categories', $tpl_cat); 177 165 } 178 166 167 $template->set_filename('SmartAlbums_content', dirname(__FILE__).'/template/cat_list.tpl'); 168 179 169 ?> -
extensions/SmartAlbums/admin/config.php
r12863 r16104 15 15 )); 16 16 17 $template->set_filename('SmartAlbums_content', dirname(__FILE__).'/template/config.tpl'); 18 17 19 ?> -
extensions/SmartAlbums/admin/index.php
r11392 r16104 1 1 <?php 2 // +-----------------------------------------------------------------------+3 // | Piwigo - a PHP based photo gallery |4 // +-----------------------------------------------------------------------+5 // | Copyright(C) 2008-2011 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 // Recursive call25 2 $url = '../'; 26 3 header( 'Request-URI: '.$url ); -
extensions/SmartAlbums/admin/template/cat_list.tpl
r12863 r16104 1 {footer_script require='jquery.ui.sortable'}{literal} 2 jQuery(document).ready(function(){ 3 jQuery("#addAlbumOpen").click(function(){ 4 jQuery("#createAlbum").toggle(); 5 jQuery("input[name=virtual_name]").focus(); 6 jQuery("#autoOrder").hide(); 7 }); 8 9 jQuery("#addAlbumClose").click(function(){ 10 jQuery("#createAlbum").hide(); 11 }); 12 }); 13 {/literal}{/footer_script} 14 15 {* è *} 16 1 17 <div class="titrePage"> 2 18 <h2>SmartAlbums</h2> 3 19 </div> 4 20 5 <h3> 6 <a href="{$F_ACTION}">{'All SmartAlbums'|@translate}</a> 7 {if count($categories)>9 } 8 <a href="#EoP" class="button" style="border:0;"> 9 <img src="{$themeconf.admin_icon_dir}/page_end.png" title="{'Page end'|@translate}" class="button" alt="page_end" style="margin-bottom:-0.6em;"></a> 10 {/if} 11 </h3> 21 <form id="categoryOrdering" action="{$F_ACTION}" method="post"> 22 <input type="hidden" name="pwg_token" value="{$PWG_TOKEN}"> 12 23 13 <form id="addVirtual" action="{$F_ACTION}" method="post"> 14 <fieldset> 15 <legend>{'Add a SmartAlbum'|@translate}</legend> 16 17 <input type="hidden" name="pwg_token" value="{$PWG_TOKEN}"> 18 {'Album name'|@translate} : <input type="text" name="virtual_name"> 19 {'Parent album'|@translate} : 24 <p class="showCreateAlbum"> 25 <span id="notManualOrder"> 26 <a href="#" id="addAlbumOpen">{'create a new SmartAlbum'|@translate}</a> 27 | <a href="{$F_ACTION}&smart_generate=all">{'Regenerate photos list of all SmartAlbums'|@translate}</a> 28 </span> 29 </p> 30 31 <fieldset id="createAlbum" style="display:none;"> 32 <legend>{'create a new SmartAlbum'|@translate}</legend> 33 <input type="hidden" name="pwg_token" value="{$PWG_TOKEN}"> 34 35 <p> 36 <strong>{'Album name'|@translate}</strong> : 37 <input type="text" name="virtual_name"> 38 </p> 39 <p> 40 <strong>{'Parent album'|@translate}</strong> : 20 41 <select class="categoryDropDown" name="parent_id"> 21 42 <option value="0">------------</option> 22 43 {html_options options=$category_options} 23 44 </select> 24 <input class="submit" type="submit" value="{'Submit'|@translate}" name="submitAdd"> 25 26 </fieldset> 27 </form> 45 </p> 46 <p class="actionButtons"> 47 <input class="submit" type="submit" value="{'Create'|@translate}" name="submitAdd"> 48 <a href="#" id="addAlbumClose">{'Cancel'|@translate}</a> 49 </p> 50 </fieldset> 28 51 29 52 {if count($categories) } 30 <form id="categoryOrdering" action="{$F_ACTION}" method="post">31 <input type="hidden" name="pwg_token" value="{$PWG_TOKEN}">32 53 33 54 <ul class="categoryUl"> … … 36 57 <li class="categoryLi virtual_cat" id="cat_{$category.ID}"> 37 58 <!-- category {$category.ID} --> 38 <ul class="categoryActions"> 39 {if cat_admin_access($category.ID)} 40 <li><a href="{$category.U_JUMPTO}" title="{'jump to album'|@translate}"><img src="{$themeconf.admin_icon_dir}/category_jump-to.png" class="button" alt="{'jump to album'|@translate}"></a></li> 41 {/if} 42 <li><a href="{$category.U_EDIT}" title="{'edit album'|@translate}"><img src="{$themeconf.admin_icon_dir}/category_edit.png" class="button" alt="{'edit'|@translate}"></a></li> 43 {if isset($category.U_MANAGE_ELEMENTS) } 44 <li><a href="{$category.U_MANAGE_ELEMENTS}" title="{'manage album photos'|@translate}"><img src="{$themeconf.admin_icon_dir}/category_elements.png" class="button" alt="{'Photos'|@translate}"></a></li> 45 {/if} 46 {if isset($category.U_MANAGE_PERMISSIONS) } 47 <li><a href="{$category.U_MANAGE_PERMISSIONS}" title="{'edit album permissions'|@translate}" ><img src="{$themeconf.admin_icon_dir}/category_permissions.png" class="button" alt="{'Permissions'|@translate}"></a></li> 48 {/if} 49 <li><a href="{$category.U_SMART}" title="{'Regenerate photos list of this SmartAlbum'|@translate}"><img src="{$themeconf.admin_icon_dir}/synchronize.png" class="button" alt="{'Regenerate photos list of this SmartAlbum'|@translate}"></a></li> 50 {if isset($category.U_DELETE) } 51 <li><a href="{$category.U_DELETE}" title="{'delete album'|@translate}" onclick="return confirm('{'Are you sure?'|@translate|@escape:javascript}');"><img src="{$themeconf.admin_icon_dir}/category_delete.png" class="button" alt="{'delete album'|@translate}"></a></li> 52 {/if} 53 </ul> 54 55 <p> 56 <strong>{$category.NAME}</strong> 59 <p class="albumTitle"> 60 <strong><a href="{$category.U_CHILDREN}" title="{'manage sub-albums'|@translate}">{$category.NAME}</a></strong> 61 <img src="{$SMART_PATH}admin/template/lightning.png"> 57 62 </p> 58 63 64 <p class="albumActions"> 65 <a href="{$category.U_EDIT}">{'Edit'|@translate}</a> 66 | <a href="{$category.U_SMART}">{'Regenerate photos list of this SmartAlbum'|@translate}</a> 67 {if isset($category.U_MANAGE_ELEMENTS) } 68 | <a href="{$category.U_MANAGE_ELEMENTS}">{'manage album photos'|@translate}</a> 69 {/if} 70 {if isset($category.U_DELETE) } 71 | <a href="{$category.U_DELETE}" onclick="return confirm('{'Are you sure?'|@translate|@escape:javascript}');">{'delete album'|@translate}</a> 72 {/if} 73 {if cat_admin_access($category.ID)} 74 | <a href="{$category.U_JUMPTO}">{'jump to album'|@translate} ?</a> 75 {/if} 76 </p> 59 77 </li> 60 78 {/foreach} 61 79 </ul> 80 {/if} 62 81 </form> 63 {/if}64 65 <form method="post" action="{$F_ACTION}&smart_generate=all">66 <input type="hidden" name="pwg_token" value="{$PWG_TOKEN}">67 <p><input class="submit" type="submit" value="{'Regenerate photos list of all SmartAlbums'|@translate}"></p>68 </form>69 70 <a name="EoP"></a> -
extensions/SmartAlbums/admin/template/config.tpl
r11451 r16104 11 11 <span class="property">{'Update albums on file upload'|@translate}</span> 12 12 <input type="checkbox" name="update_on_upload" value="true" {if $update_on_upload}checked="checked"{/if}/> 13 {'(can cause slowdowns on admin pages)'|@translate}13 {'(can cause slowdowns)'|@translate} 14 14 </label> 15 15 </li> -
extensions/SmartAlbums/admin/template/index.php
r11392 r16104 1 1 <?php 2 // +-----------------------------------------------------------------------+3 // | Piwigo - a PHP based photo gallery |4 // +-----------------------------------------------------------------------+5 // | Copyright(C) 2008-2011 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 // Recursive call25 2 $url = '../'; 26 3 header( 'Request-URI: '.$url ); -
extensions/SmartAlbums/include/cat_list.php
r12863 r16104 42 42 { 43 43 $associated_images = smart_make_associations($category['id']); 44 array_push( 45 $page['infos'], 46 sprintf( 47 l10n('%d photos associated to album %s'), 44 array_push($page['infos'], 45 sprintf(l10n('%d photos associated to album %s'), 48 46 count($associated_images), 49 '«'.trigger_event( 50 'render_category_name', 51 $category['name'], 52 'admin_cat_list' 53 ).'»' 47 '«'.trigger_event('render_category_name', $category['name'], 'admin_cat_list').'»' 54 48 ) 55 49 ); … … 60 54 { 61 55 $associated_images = smart_make_associations($_GET['smart_generate']); 62 array_push( 63 $page['infos'], 64 sprintf( 65 l10n('%d photos associated to album %s'), 56 array_push($page['infos'], 57 sprintf(l10n('%d photos associated to album %s'), 66 58 count($associated_images), 67 '«'.trigger_event( 68 'render_category_name', 69 $smart_cats[$_GET['smart_generate']]['name'], 70 'admin_cat_list' 71 ).'»' 59 '«'.trigger_event('render_category_name', $smart_cats[ $_GET['smart_generate'] ]['name'], 'admin_cat_list').'»' 72 60 ) 73 61 ); … … 99 87 global $smart_count; 100 88 101 $search[0] = '{if isset($category.U_ SYNC) }';102 $replacement[0] = '89 $search[0] = '{if isset($category.U_MANAGE_ELEMENTS) }'; 90 $replacement[0] = $search[0].' 103 91 {if isset($SMART_URL[$category.ID])} 104 <li><a href="{$SMART_URL[$category.ID]}" title="{\'Regenerate photos list of this SmartAlbum\'|@translate}"><img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/synchronize.png" class="button" alt="{\'Regenerate photos list of this SmartAlbum\'|@translate}"></a></li> 105 {/if}' 106 .$search[0]; 92 | <a href="{$SMART_URL[$category.ID]}">{\'Regenerate photos list of this SmartAlbum\'|@translate}</a> 93 {/if}'; 107 94 108 95 if ($smart_count > 0) 109 96 { 110 $search[1] = '</ul> 111 </form>'; 97 $search[1] = '<a href="#" id="autoOrderOpen">{\'apply automatic sort order\'|@translate}</a>'; 112 98 $replacement[1] = $search[1].' 113 <form method="post" action="{$SMART_URL.all}"> 114 <input type="hidden" name="pwg_token" value="{$PWG_TOKEN}"> 115 <p><input class="submit" type="submit" value="{\'Regenerate photos list of all SmartAlbums\'|@translate}"></p> 116 </form>'; 99 | <a href="{$SMART_URL.all}">{\'Regenerate photos list of all SmartAlbums\'|@translate}</a>'; 117 100 } 101 102 $search[2] = '{$category.NAME}</a></strong>'; 103 $replacement[2] = $search[2].' 104 {if isset($SMART_URL[$category.ID])} 105 <img src="'.SMART_PATH.'admin/template/lightning.png"> 106 {/if}'; 118 107 119 108 return str_replace($search, $replacement, $content); -
extensions/SmartAlbums/include/count_images.php
r11334 r16104 6 6 define('PHPWG_ROOT_PATH','./../../../'); 7 7 define('IN_ADMIN', true); 8 8 9 include_once(PHPWG_ROOT_PATH.'include/common.inc.php'); 10 11 if (!is_admin()) die('Hacking attempt!'); 12 9 13 include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); 10 14 include_once(SMART_PATH.'include/functions.inc.php'); 15 16 load_language('plugin.lang', SMART_PATH); 17 $conf['SmartAlbums'] = unserialize($conf['SmartAlbums']); 11 18 12 19 if (isset($_POST['filters'])) … … 22 29 array_push($filters, $filter); 23 30 } 31 else 32 { 33 echo '<span class="filter_error">'.$page['errors'][ count($page['errors'])-1 ].'</span>'; 34 exit; 35 } 24 36 } 25 37 … … 31 43 } 32 44 33 echo l10n_dec('%d photo', '%d photos', count($associated_images));45 echo '<span class="count_image">'.l10n_dec('%d photo', '%d photos', count($associated_images)).'</span>'; 34 46 35 47 ?> -
extensions/SmartAlbums/include/functions.inc.php
r12864 r16104 36 36 } 37 37 38 // repres antant, try to not overwrite if still in images list38 // representant, try to not overwrite if still in images list 39 39 $query = ' 40 40 SELECT representative_picture_id … … 46 46 if ( !in_array($rep_id, $images) ) 47 47 { 48 if (!function_exists('set_random_representant')) 49 { 50 include(PHPWG_ROOT_PATH.'admin/include/functions.php'); 51 } 48 include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); 52 49 set_random_representant(array($cat_id)); 53 50 } … … 64 61 { 65 62 global $conf; 66 67 if (!is_array($conf['SmartAlbums'])) $conf['SmartAlbums'] = unserialize($conf['SmartAlbums']);68 63 69 64 if ( defined('SMART_NOT_UPDATE') OR !$conf['SmartAlbums']['update_on_upload'] ) return; … … 94 89 95 90 /* get filters */ 96 if ($filters == null) 97 { 98 $filters = array(); 99 91 if ($filters === null) 92 { 100 93 $query = ' 101 94 SELECT * … … 106 99 $result = pwg_query($query); 107 100 108 if (!pwg_db_num_rows($result)) return $filters;101 if (!pwg_db_num_rows($result)) return array(); 109 102 103 $filters = array(); 110 104 while ($row = pwg_db_fetch_assoc($result)) 111 105 { … … 117 111 } 118 112 } 113 else if (!count($filters)) 114 { 115 return array(); 116 } 119 117 120 118 /* build constrains */ 121 119 ## generate 'join', 'where' arrays and 'limit' string to create the SQL query 122 ## inspired by PicsEngine by Michael Villar120 ## inspired by PicsEngine 3 by Michael Villar 123 121 $i_tags = 1; 124 122 foreach ($filters as $filter) 125 123 { 126 // tags 127 if ($filter['type'] == 'tags') 128 { 129 if($filter['cond'] == "all") 130 { 131 $tags_arr = explode(',', $filter['value']); 124 switch ($filter['type']) 125 { 126 // tags 127 case 'tags': 128 { 129 switch ($filter['cond']) 130 { 131 // search images which have all tags 132 case 'all': 133 { 134 $tags_arr = explode(',', $filter['value']); 135 foreach($tags_arr as $value) 136 { 137 $join[] = IMAGE_TAG_TABLE.' AS it'.$i_tags.' ON i.id = it'.$i_tags.'.image_id'; 138 $where[] = 'it'.$i_tags.'.tag_id = '.$value; 139 $i_tags++; 140 } 141 142 break; 143 } 144 // search images which tags are in the list 145 case 'one': 146 { 147 $join[] = IMAGE_TAG_TABLE.' AS it'.$i_tags.' ON i.id = it'.$i_tags.'.image_id'; 148 $where[] = 'it'.$i_tags.'.tag_id IN ('.$filter['value'].')'; 149 $i_tags++; 150 151 break; 152 } 153 // exclude images which tags are in the list 154 case 'none': 155 { 156 $sub_query = ' 157 SELECT it'.$i_tags.'.image_id 158 FROM '.IMAGE_TAG_TABLE.' AS it'.$i_tags.' 159 WHERE 160 it'.$i_tags.'.image_id = i.id AND 161 it'.$i_tags.'.tag_id IN ('.$filter['value'].') 162 GROUP BY it'.$i_tags.'.image_id 163 '; 164 $join[] = IMAGE_TAG_TABLE.' AS it'.$i_tags.' ON i.id = it'.$i_tags.'.image_id'; 165 $where[] = 'NOT EXISTS ('.$sub_query.')'; 166 $i_tags++; 167 168 break; 169 } 170 // exclude images which tags are not in the list and search images which have all tags 171 case 'only': 172 { 173 $sub_query = ' 174 SELECT it'.$i_tags.'.image_id 175 FROM '.IMAGE_TAG_TABLE.' AS it'.$i_tags.' 176 WHERE 177 it'.$i_tags.'.image_id = i.id AND 178 it'.$i_tags.'.tag_id NOT IN ('.$filter['value'].') 179 GROUP BY it'.$i_tags.'.image_id 180 '; 181 $join[] = IMAGE_TAG_TABLE.' AS it'.$i_tags.' ON i.id = it'.$i_tags.'.image_id'; 182 $where[] = 'NOT EXISTS ('.$sub_query.')'; 183 $i_tags++; 184 185 $tags_arr = explode(',', $filter['value']); 186 foreach($tags_arr as $value) 187 { 188 $join[] = IMAGE_TAG_TABLE.' AS it'.$i_tags.' ON i.id = it'.$i_tags.'.image_id'; 189 $where[] = 'it'.$i_tags.'.tag_id = '.$value; 190 $i_tags++; 191 } 192 193 break; 194 } 195 } 132 196 133 foreach($tags_arr as $value) 134 { 135 $join[] = IMAGE_TAG_TABLE.' AS it_'.$i_tags.' ON i.id = it_'.$i_tags.'.image_id'; 136 $where[] = 'it_'.$i_tags.'.tag_id = '.$value; 137 $i_tags++; 138 } 139 } 140 else if ($filter['cond'] == 'one') 141 { 142 $join[] = IMAGE_TAG_TABLE.' AS it_'.$i_tags.' ON i.id = it_'.$i_tags.'.image_id'; 143 $where[] = 'it_'.$i_tags.'.tag_id IN ('.$filter['value'].')'; 144 $i_tags++; 145 } 146 else if ($filter['cond'] == 'none') 147 { 148 $sub_query = ' 149 SELECT it_'.$i_tags.'.image_id 150 FROM '.IMAGE_TAG_TABLE.' AS it_'.$i_tags.' 151 WHERE 152 it_'.$i_tags.'.image_id = i.id AND 153 it_'.$i_tags.'.tag_id IN ('.$filter['value'].') 154 GROUP BY it_'.$i_tags.'.image_id 155 '; 156 $where[] = 'NOT EXISTS ('.$sub_query.')'; 157 $i_tags++; 158 } 159 else if ($filter['cond'] == 'only') 160 { 161 $sub_query = ' 162 SELECT it_'.$i_tags.'.image_id 163 FROM '.IMAGE_TAG_TABLE.' AS it_'.$i_tags.' 164 WHERE 165 it_'.$i_tags.'.image_id = i.id AND 166 it_'.$i_tags.'.tag_id NOT IN ('.$filter['value'].') 167 GROUP BY it_'.$i_tags.'.image_id 168 '; 169 $where[] = 'NOT EXISTS ('.$sub_query.')'; 197 break; 198 } 199 200 // date 201 case 'date': 202 { 203 switch ($filter['cond']) 204 { 205 case 'the_post': 206 $where[] = 'date_available BETWEEN "'.$filter['value'].' 00:00:00" AND "'.$filter['value'].' 23:59:59"'; 207 break; 208 case 'before_post': 209 $where[] = 'date_available < "'.$filter['value'].' 00:00:00"'; 210 break; 211 case 'after_post': 212 $where[] = 'date_available > "'.$filter['value'].' 23:59:59"'; 213 break; 214 case 'the_taken': 215 $where[] = 'date_creation BETWEEN "'.$filter['value'].' 00:00:00" AND "'.$filter['value'].' 23:59:59"'; 216 break; 217 case 'before_taken': 218 $where[] = 'date_creation < "'.$filter['value'].' 00:00:00"'; 219 break; 220 case 'after_taken': 221 $where[] = 'date_creation > "'.$filter['value'].' 23:59:59"'; 222 break; 223 } 224 225 break; 226 } 170 227 171 $i_tags++; 172 $tags_arr = explode(',', $filter['value']); 228 // name 229 case 'name': 230 { 231 switch ($filter['cond']) 232 { 233 case 'contain': 234 $where[] = 'name LIKE "%'.$filter['value'].'%"'; 235 break; 236 case 'begin': 237 $where[] = 'name LIKE "'.$filter['value'].'%"'; 238 break; 239 case 'end': 240 $where[] = 'name LIKE "%'.$filter['value'].'"'; 241 break; 242 case 'not_contain': 243 $where[] = 'name NOT LIKE "%'.$filter['value'].'%"'; 244 break; 245 case 'not_begin': 246 $where[] = 'name NOT LIKE "'.$filter['value'].'%"'; 247 break; 248 case 'not_end': 249 $where[] = 'name NOT LIKE "%'.$filter['value'].'"'; 250 break; 251 } 173 252 174 foreach($tags_arr as $value) 175 { 176 $join[] = IMAGE_TAG_TABLE.' AS it_'.$i_tags.' ON i.id = it_'.$i_tags.'.image_id'; 177 $where[] = 'it_'.$i_tags.'.tag_id = '.$value; 178 $i_tags++; 179 } 180 } 181 } 182 // date 183 else if ($filter['type'] == 'date') 184 { 185 switch ($filter['cond']) 186 { 187 case 'the': 188 $where[] = 'date_available BETWEEN "'.$filter['value'].' 00:00:00" AND "'.$filter['value'].' 23:59:59"'; 189 break; 190 case 'before': 191 $where[] = 'date_available < "'.$filter['value'].' 00:00:00"'; 192 break; 193 case 'after': 194 $where[] = 'date_available > "'.$filter['value'].' 23:59:59"'; 195 break; 196 case 'the_crea': 197 $where[] = 'date_creation BETWEEN "'.$filter['value'].' 00:00:00" AND "'.$filter['value'].' 23:59:59"'; 198 break; 199 case 'before_crea': 200 $where[] = 'date_creation < "'.$filter['value'].' 00:00:00"'; 201 break; 202 case 'after_crea': 203 $where[] = 'date_creation > "'.$filter['value'].' 23:59:59"'; 204 break; 205 } 206 } 207 // limit 208 else if ($filter['type'] == 'limit') 209 { 210 $limit = '0, '.$filter['value']; 253 break; 254 } 255 256 // author 257 case 'author': 258 { 259 switch ($filter['cond']) 260 { 261 case 'is': 262 if ($filter['value'] != 'NULL') $filter['value'] = '"'.$filter['value'].'"'; 263 $where[] = 'author = '.$filter['value'].''; 264 break; 265 case 'not_is': 266 if ($filter['value'] != 'NULL') $filter['value'] = '"'.$filter['value'].'"'; 267 $where[] = 'author != '.$filter['value'].''; 268 break; 269 case 'in': 270 $filter['value'] = '"'.str_replace(',', '","', $filter['value']).'"'; 271 $where[] = 'author IN('.$filter['value'].')'; 272 break; 273 case 'not_in': 274 $filter['value'] = '"'.str_replace(',', '","', $filter['value']).'"'; 275 $where[] = 'author NOT IN('.$filter['value'].')'; 276 break; 277 } 278 279 break; 280 } 281 282 // hit 283 case 'hit': 284 { 285 switch ($filter['cond']) 286 { 287 case 'less': 288 $where[] = 'hit < '.$filter['value'].''; 289 break; 290 case 'more': 291 $where[] = 'hit >= '.$filter['value'].''; 292 break; 293 } 294 295 break; 296 } 297 298 // level 299 case 'level': 300 { 301 $where[] = 'level = '.$filter['value'].''; 302 break; 303 } 304 305 // limit 306 case 'limit': 307 { 308 $limit = '0, '.$filter['value']; 309 break; 310 } 211 311 } 212 312 } … … 219 319 if (isset($join)) 220 320 { 221 foreach ($join as $query) 222 { 223 $MainQuery .= ' 224 LEFT JOIN '.$query; 225 } 321 $MainQuery.= ' 322 LEFT JOIN '.implode("\n LEFT JOIN ", $join); 226 323 } 227 324 if (isset($where)) 228 325 { 229 $MainQuery .= ' 230 WHERE'; 231 $i = 0; 232 foreach ($where as $query) 233 { 234 if ($i != 0) $MainQuery .= ' AND'; 235 $MainQuery .= ' 236 '.$query; 237 $i++; 238 } 239 } 240 241 $MainQuery .= ' 326 $MainQuery.= ' 327 WHERE 328 '.implode("\n AND ", $where); 329 } 330 331 $MainQuery.= ' 242 332 GROUP BY i.id 243 '.$conf['order_by'].'333 '.$conf['order_by'].' 244 334 '.(isset($limit) ? "LIMIT ".$limit : null).' 245 335 ;'; 246 336 337 // file_put_contents(SMART_PATH.'query.sql', $MainQuery); 247 338 return array_from_query($MainQuery, 'id'); 248 339 } … … 256 347 function smart_check_filter($filter) 257 348 { 258 global $ limit_is_set, $page;349 global $page, $limit_is_set, $level_is_set; 259 350 $error = false; 351 352 if (!isset($limit_is_set)) $limit_is_set = false; 353 if (!isset($level_is_set)) $level_is_set = false; 260 354 261 355 # tags … … 281 375 } 282 376 } 377 # name 378 else if ($filter['type'] == 'name') 379 { 380 if (empty($filter['value'])) 381 { 382 $error = true; 383 array_push($page['errors'], l10n('Name is empty')); 384 } 385 } 386 # author 387 else if ($filter['type'] == 'author') 388 { 389 if (empty($filter['value'])) 390 { 391 $error = true; 392 array_push($page['errors'], l10n('Author is empty')); 393 } 394 else 395 { 396 $filter['value'] = preg_replace('#([ ]?),([ ]?)#', ',', $filter['value']); 397 } 398 } 399 # hit 400 else if ($filter['type'] == 'hit') 401 { 402 if (!preg_match('#([0-9]{1,})#', $filter['value'])) 403 { 404 $error = true; 405 array_push($page['errors'], l10n('Hits must be an integer')); 406 } 407 } 408 # level 409 else if ($filter['type'] == 'level') 410 { 411 if ($level_is_set == true) // only one level is allowed, first is saved 412 { 413 $error = true; 414 array_push($page['errors'], l10n('You can\'t use more than one level filter')); 415 } 416 else 417 { 418 $level_is_set = true; 419 } 420 } 283 421 # limit 284 422 else if ($filter['type'] == 'limit') … … 292 430 { 293 431 $error = true; 294 array_push($page['errors'], l10n('You can\'t use more than one limit '));432 array_push($page['errors'], l10n('You can\'t use more than one limit filter')); 295 433 } 296 434 else … … 374 512 } 375 513 } 514 376 515 ?> -
extensions/SmartAlbums/include/index.php
r11380 r16104 1 1 <?php 2 // +-----------------------------------------------------------------------+3 // | Piwigo - a PHP based photo gallery |4 // +-----------------------------------------------------------------------+5 // | Copyright(C) 2008-2011 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 // Recursive call25 2 $url = '../'; 26 3 header( 'Request-URI: '.$url ); -
extensions/SmartAlbums/include/page_items.php
r12863 r16104 3 3 4 4 /** 5 * Remove form $page['items'] picture that musn't be displayed5 * Remove picture that musn't be displayed from $page['items'] 6 6 * 7 7 * here we get all pictures that current user could see -
extensions/SmartAlbums/index.php
r11380 r16104 1 1 <?php 2 // +-----------------------------------------------------------------------+3 // | Piwigo - a PHP based photo gallery |4 // +-----------------------------------------------------------------------+5 // | Copyright(C) 2008-2011 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 // Recursive call25 2 $url = '../'; 26 3 header( 'Request-URI: '.$url ); -
extensions/SmartAlbums/language/cs_CZ/index.php
r12982 r16104 1 1 <?php 2 // +-----------------------------------------------------------------------+3 // | Piwigo - a PHP based picture gallery |4 // +-----------------------------------------------------------------------+5 // | Copyright(C) 2008-2010 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 // Recursive call25 2 $url = '../'; 26 3 header( 'Request-URI: '.$url ); -
extensions/SmartAlbums/language/de_DE/index.php
r11690 r16104 1 1 <?php 2 // +-----------------------------------------------------------------------+3 // | Piwigo - a PHP based picture gallery |4 // +-----------------------------------------------------------------------+5 // | Copyright(C) 2008-2010 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 // Recursive call25 2 $url = '../'; 26 3 header( 'Request-URI: '.$url ); -
extensions/SmartAlbums/language/en_UK/index.php
r11290 r16104 1 1 <?php 2 // +-----------------------------------------------------------------------+3 // | Piwigo - a PHP based picture gallery |4 // +-----------------------------------------------------------------------+5 // | Copyright(C) 2008-2010 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 // Recursive call25 2 $url = '../'; 26 3 header( 'Request-URI: '.$url ); -
extensions/SmartAlbums/language/en_UK/plugin.lang.php
r11546 r16104 1 1 <?php 2 2 3 $lang['%d photos associated to album %s'] = '%d photos associated to album %s';4 3 $lang['No filter selected'] = 'No filter selected'; 5 $lang['No tag selected'] = 'No tag selected'; 6 $lang['Date string is malformed'] = 'Date string is malformed'; 7 $lang['Limit must be an integer'] = 'Limit must be an integer'; 8 $lang['You can\'t use more than one limit'] = 'You can\'t use more than one limit'; 4 $lang['%d photo'] = '%d photo'; 5 $lang['%d photos'] = '%d photos'; 9 6 $lang['All these tags'] = 'All these tags'; 10 7 $lang['One of these tags'] = 'One of these tags'; … … 14 11 $lang['Added before'] = 'Added before'; 15 12 $lang['Added after'] = 'Added after'; 16 $lang['Created on'] = 'Created on';17 13 $lang['Created before'] = 'Created before'; 18 14 $lang['Created after'] = 'Created after'; 19 $lang['%d photo'] = '%d photo'; 20 $lang['%d photos'] = '%d photos'; 21 $lang['tags filter'] = 'tags filter'; 22 $lang['date filter'] = 'date filter'; 23 $lang['limit filter'] = 'limit filter'; 24 $lang['Add filters here'] = 'Add filters here'; 25 $lang['This album is a SmartAlbum'] = 'This album is a SmartAlbum'; 26 $lang['Count'] = 'Count'; 27 $lang['Regenerate photos list of this SmartAlbum'] = 'Regenerate photos list of this SmartAlbum'; 28 $lang['Regenerate photos list of all SmartAlbums'] = 'Regenerate photos list of all SmartAlbums'; 29 $lang['Update albums on file upload'] = 'Update albums on file upload'; 30 $lang['(can cause slowdowns on admin pages)'] = '(can cause slowdowns on admin pages)'; 31 $lang['All SmartAlbums'] = 'All SmartAlbums'; 32 $lang['Add a SmartAlbum'] = 'Add a SmartAlbum'; 15 $lang['Contains'] = 'Contains'; 16 $lang['Begins with'] = 'Begins with'; 17 $lang['Ends with'] = 'Ends with'; 18 $lang['Doesn\'t contain'] = 'Doesn\'t contain'; 19 $lang['Doesn\'t begin with'] = 'Doesn\'t begin with'; 20 $lang['Doesn\'t end with'] = 'Doesn\'t end with'; 21 $lang['Is'] = 'Is'; 22 $lang['Is in'] = 'Is in'; 23 $lang['Is not'] = 'Is not'; 24 $lang['Is not in'] = 'Is not in'; 25 $lang['Bellow'] = 'Bellow'; 26 $lang['Above'] = 'Above'; 33 27 $lang['SmartAlbum deleted'] = 'SmartAlbum deleted'; 34 28 $lang['SmartAlbum added'] = 'SmartAlbum added'; 29 $lang['%d photos associated to album %s'] = '%d photos associated to album %s'; 35 30 $lang['Only SmartAlbums are displayed on this page'] = 'Only SmartAlbums are displayed on this page'; 36 $lang['To order albums please go the main albums management page'] = 'To order albums please go the main albums <a href="admin.php?page=cat_list">management page</a>';31 $lang['To order albums please go the main albums <a href="%s">management page</a>'] = 'To order albums please go the main albums <a href="%s">management page</a>'; 37 32 $lang['Don\'t show this message again'] = 'Don\'t show this message again'; 33 $lang['All SmartAlbums'] = 'All SmartAlbums'; 34 $lang['No tag selected'] = 'No tag selected'; 35 $lang['Date string is malformed'] = 'Date string is malformed'; 36 $lang['Name is empty'] = 'Name is empty'; 37 $lang['Author is empty'] = 'Author is empty'; 38 $lang['Hits must be an integer'] = 'Hits must be an integer'; 39 $lang['Limit must be an integer'] = 'Limit must be an integer'; 40 $lang['You can\'t use more than one limit filter'] = 'You can\'t use more than one limit filter'; 41 $lang['You can\'t use more than one level filter'] = 'You can\'t use more than one level filter'; 42 $lang['tags_filter'] = 'Tags'; 43 $lang['date_filter'] = 'Date'; 44 $lang['name_filter'] = 'Photo name'; 45 $lang['author_filter'] = 'Author'; 46 $lang['hit_filter'] = 'Hits'; 47 $lang['level_filter'] = 'Level'; 48 $lang['limit_filter'] = 'Max. number of photos'; 49 $lang['For "Is (not) in", separate each author by a comma'] = 'For "Is (not) in", separate each author by a comma'; 50 $lang['limit_filter'] = 'Max. number of photos'; 51 $lang['This album is a SmartAlbum'] = 'This album is a SmartAlbum'; 52 $lang['Add filters here'] = 'Add filters here'; 53 $lang['Count'] = 'Count'; 54 $lang['create a new SmartAlbum'] = 'create a new SmartAlbum'; 55 $lang['Regenerate photos list of all SmartAlbums'] = 'Regenerate photos list of all SmartAlbums'; 56 $lang['Regenerate photos list of this SmartAlbum'] = 'Regenerate photos list of this SmartAlbum'; 57 $lang['Update albums on file upload'] = 'Update albums on file upload'; 58 $lang['(can cause slowdowns)'] = '(can cause slowdowns)'; 38 59 39 60 ?> -
extensions/SmartAlbums/language/es_ES/index.php
r13129 r16104 1 1 <?php 2 // +-----------------------------------------------------------------------+3 // | Piwigo - a PHP based picture gallery |4 // +-----------------------------------------------------------------------+5 // | Copyright(C) 2008-2010 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 // Recursive call25 2 $url = '../'; 26 3 header( 'Request-URI: '.$url ); -
extensions/SmartAlbums/language/fr_FR/index.php
r11290 r16104 1 1 <?php 2 // +-----------------------------------------------------------------------+3 // | Piwigo - a PHP based picture gallery |4 // +-----------------------------------------------------------------------+5 // | Copyright(C) 2008-2010 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 // Recursive call25 2 $url = '../'; 26 3 header( 'Request-URI: '.$url ); -
extensions/SmartAlbums/language/fr_FR/plugin.lang.php
r12523 r16104 1 1 <?php 2 2 3 $lang['%d photos associated to album %s'] = '%d photos associées à l\'album %s';4 3 $lang['No filter selected'] = 'Aucun filtre sélectionné'; 5 $lang['No tag selected'] = 'Aucun tag sélectionné'; 6 $lang['Date string is malformed'] = 'La date n\'est pas correcte'; 7 $lang['Limit must be an integer'] = 'La limite doit être un entier'; 8 $lang['You can\'t use more than one limit'] = 'Vous ne pouvez utiliser qu\'une seule limite'; 4 $lang['%d photo'] = '%d photo'; 5 $lang['%d photos'] = '%d photos'; 9 6 $lang['All these tags'] = 'Tous les tags'; 10 7 $lang['One of these tags'] = 'Un des tags'; … … 14 11 $lang['Added before'] = 'Ajouté avant le'; 15 12 $lang['Added after'] = 'Ajouté après le'; 16 $lang['Created on'] = 'Créé le';17 13 $lang['Created before'] = 'Créé avant le'; 18 14 $lang['Created after'] = 'Créé après le'; 19 $lang['%d photo'] = '%d photo'; 20 $lang['%d photos'] = '%d photos'; 21 $lang['tags filter'] = 'filtrer par tags'; 22 $lang['date filter'] = 'filtrer par date'; 23 $lang['limit filter'] = 'nombre max. d\'éléments'; 24 $lang['Add filters here'] = 'Ajoutez des filtres ici'; 25 $lang['This album is a SmartAlbum'] = 'Cet album est un SmartAlbum'; 26 $lang['Count'] = 'Compter'; 27 $lang['Regenerate photos list of this SmartAlbum'] = 'Régénérer les photos de ce SmartAlbum'; 28 $lang['Regenerate photos list of all SmartAlbums'] = 'Régénérer les photos de tous les SmartAlbums'; 29 $lang['Update albums on file upload'] = 'Mettre à jour les albums après la mise en ligne d\'un fichier'; 30 $lang['(can cause slowdowns on admin pages)'] = '(peut causer des ralentissements)'; 31 $lang['All SmartAlbums'] = 'Tous les SmartAlbums'; 32 $lang['Add a SmartAlbum'] = 'Ajouter un SmartAlbum'; 15 $lang['Contains'] = 'Contient'; 16 $lang['Begins with'] = 'Commence par'; 17 $lang['Ends with'] = 'Fini par'; 18 $lang['Doesn\'t contain'] = 'Ne contient pas'; 19 $lang['Doesn\'t begin with'] = 'Ne commence pas par'; 20 $lang['Doesn\'t end with'] = 'Ne fini pas par'; 21 $lang['Is'] = 'Est'; 22 $lang['Is in'] = 'Est dans'; 23 $lang['Is not'] = 'N\'est pas'; 24 $lang['Is not in'] = 'N\'est pas dans'; 25 $lang['Bellow'] = 'Moins que'; 26 $lang['Above'] = 'Plus que'; 33 27 $lang['SmartAlbum deleted'] = 'SmartAlbum supprimé'; 34 28 $lang['SmartAlbum added'] = 'SmartAlbum ajouté'; 29 $lang['%d photos associated to album %s'] = '%d photos associées à l\'album %s'; 35 30 $lang['Only SmartAlbums are displayed on this page'] = 'Seuls les SmartAlbums sont affichés sur cette page'; 36 $lang['To order albums please go the main albums management page'] = 'Pour ordonner les albums veuillez vous rendre sur la page principale de <a href="admin.php?page=cat_list">gestion des albums</a>';31 $lang['To order albums please go the main albums <a href="%s">management page</a>'] = 'Pour trier les SmartAlbums veuillez vous rendre sur la page principale de <a href="%s">gestion des albums</a>'; 37 32 $lang['Don\'t show this message again'] = 'Ne plus afficher ce message'; 33 $lang['All SmartAlbums'] = 'AlTous les SmartAlbums'; 34 $lang['No tag selected'] = 'Aucun tag sélectionné'; 35 $lang['Date string is malformed'] = 'Date incorrecte'; 36 $lang['Name is empty'] = 'Le nom est vide'; 37 $lang['Author is empty'] = 'L\'auteur est vide'; 38 $lang['Hits must be an integer'] = 'Le nombre de vues doit être un entier'; 39 $lang['Limit must be an integer'] = 'La nombre d\'éléments doit être un entier'; 40 $lang['You can\'t use more than one limit filter'] = 'Vous ne pouvez choisir qu\'une seule limite de nombre d\'éléments'; 41 $lang['You can\'t use more than one level filter'] = 'Vous ne pouvez choisir qu\'un seul niveau de confidentialité'; 42 $lang['tags_filter'] = 'Tags'; 43 $lang['date_filter'] = 'Date'; 44 $lang['name_filter'] = 'Nom de la photo'; 45 $lang['author_filter'] = 'Auteur'; 46 $lang['hit_filter'] = 'Nombre de vues'; 47 $lang['level_filter'] = 'Niveau de confidentialité'; 48 $lang['limit_filter'] = 'Nombre max. d\'éléments'; 49 $lang['For "Is (not) in", separate each author by a comma'] = 'Pour "Est/N\'est pas dans", séparez chaque auteur par une virgule'; 50 $lang['This album is a SmartAlbum'] = 'Cet album est un SmartAlbum'; 51 $lang['Add filters here'] = 'Ajoutez des filtres ici'; 52 $lang['Count'] = 'Compter'; 53 $lang['create a new SmartAlbum'] = 'créer un nouveau SmartAlbum'; 54 $lang['Regenerate photos list of all SmartAlbums'] = 'Régénérer les photos de tous les SmartAlbums'; 55 $lang['Regenerate photos list of this SmartAlbum'] = 'Régénérer les photos de ce SmartAlbum'; 56 $lang['Update albums on file upload'] = 'Mettre à jour les albums après la mise en ligne d\'un fichier'; 57 $lang['(can cause slowdowns)'] = '(peut causer des ralentissements)'; 38 58 39 59 ?> -
extensions/SmartAlbums/language/index.php
r11290 r16104 1 1 <?php 2 // +-----------------------------------------------------------------------+3 // | Piwigo - a PHP based picture gallery |4 // +-----------------------------------------------------------------------+5 // | Copyright(C) 2008-2010 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 // Recursive call25 2 $url = '../'; 26 3 header( 'Request-URI: '.$url ); -
extensions/SmartAlbums/language/it_IT/index.php
r11529 r16104 1 1 <?php 2 // +-----------------------------------------------------------------------+3 // | Piwigo - a PHP based photo gallery |4 // +-----------------------------------------------------------------------+5 // | Copyright(C) 2008-2011 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 // Recursive call25 2 $url = '../'; 26 3 header( 'Request-URI: '.$url ); -
extensions/SmartAlbums/language/lv_LV/index.php
r11413 r16104 1 1 <?php 2 // +-----------------------------------------------------------------------+3 // | Piwigo - a PHP based picture gallery |4 // +-----------------------------------------------------------------------+5 // | Copyright(C) 2008-2010 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 // Recursive call25 2 $url = '../'; 26 3 header( 'Request-URI: '.$url ); -
extensions/SmartAlbums/language/nl_NL/index.php
r12965 r16104 1 1 <?php 2 // +-----------------------------------------------------------------------+3 // | Piwigo - a PHP based picture gallery |4 // +-----------------------------------------------------------------------+5 // | Copyright(C) 2008-2010 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 // Recursive call25 2 $url = '../'; 26 3 header( 'Request-URI: '.$url ); -
extensions/SmartAlbums/language/vi_VN/index.php
r13233 r16104 1 1 <?php 2 // +-----------------------------------------------------------------------+3 // | Piwigo - a PHP based picture gallery |4 // +-----------------------------------------------------------------------+5 // | Copyright(C) 2008-2010 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 // Recursive call25 2 $url = '../'; 26 3 header( 'Request-URI: '.$url ); -
extensions/SmartAlbums/main.inc.php
r11392 r16104 12 12 global $prefixeTable; 13 13 14 define('SMART_DIR', basename(dirname(__FILE__))); 15 define('SMART_PATH', PHPWG_PLUGINS_PATH.SMART_DIR.'/'); 16 define('CATEGORY_FILTERS_TABLE', $prefixeTable.'category_filters'); 17 define('SMART_ADMIN', get_root_url().'admin.php?page=plugin-' . SMART_DIR); 14 define('SMART_PATH', PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/'); 15 define('CATEGORY_FILTERS_TABLE', $prefixeTable . 'category_filters'); 16 define('SMART_ADMIN', get_root_url() . 'admin.php?page=plugin-' . basename(dirname(__FILE__))); 18 17 19 18 add_event_handler('invalidate_user_cache', 'smart_make_all_associations'); … … 23 22 { 24 23 add_event_handler('loc_end_section_init', 'smart_init_page_items'); 25 include_once(SMART_PATH.'include/ init_page_items.php');24 include_once(SMART_PATH.'include/page_items.php'); 26 25 } 27 26 else if (script_basename() == 'admin') 28 27 { 28 global $conf; 29 29 30 load_language('plugin.lang', SMART_PATH); 30 31 add_event_handler('loc_begin_cat_modify', 'smart_cat_modify'); 32 include_once(SMART_PATH.'include/init_cat_modify.php'); 33 31 $conf['SmartAlbums'] = unserialize($conf['SmartAlbums']); 32 34 33 add_event_handler('loc_begin_cat_list', 'smart_cat_list'); 35 include_once(SMART_PATH.'include/ init_cat_list.php');34 include_once(SMART_PATH.'include/cat_list.php'); 36 35 37 36 add_event_handler('get_admin_plugin_menu_links', 'smart_admin_menu'); 38 function smart_admin_menu($menu) 39 { 40 array_push($menu, array( 41 'NAME' => 'SmartAlbums', 42 'URL' => SMART_ADMIN, 43 ) 44 ); 45 return $menu; 46 } 37 function smart_admin_menu($menu) 38 { 39 array_push($menu, array( 40 'NAME' => 'SmartAlbums', 41 'URL' => SMART_ADMIN, 42 )); 43 return $menu; 44 } 45 46 add_event_handler('loc_begin_admin_page', 'smart_add_admin_album_tab'); 47 function smart_add_admin_album_tab() 48 { 49 global $page, $template; 50 if ($page['page'] != 'album') return; 51 52 $template->set_prefilter('tabsheet', 'smart_add_admin_album_tab_prefilter'); 53 } 54 function smart_add_admin_album_tab_prefilter($content) 55 { 56 $search = '{/foreach}'; 57 $add = ' 58 <li class="{if false}selected_tab{else}normal_tab{/if}"> 59 <a href="'.SMART_ADMIN.'-album&cat_id='.$_GET['cat_id'].'"><span>SmartAlbum</span></a> 60 </li>'; 61 return str_replace($search, $search.$add, $content); 62 } 47 63 } 48 64 -
extensions/SmartAlbums/maintain.inc.php
r11451 r16104 2 2 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 3 3 4 global $prefixeTable; 5 define('smart_table', $prefixeTable . 'category_filters'); 6 7 define('smart_default_config', serialize(array( 8 'update_on_upload' => false, 9 'show_list_messages' => true, 10 ))); 11 4 12 function plugin_install() 5 13 { 6 global $prefixeTable;7 8 14 /* create table to store filters */ 9 15 pwg_query( 10 'CREATE TABLE IF NOT EXISTS `' . $prefixeTable . 'category_filters` (16 'CREATE TABLE IF NOT EXISTS `' . smart_table . '` ( 11 17 `category_id` smallint(5) unsigned NOT NULL, 12 18 `type` varchar(16) NOT NULL, … … 20 26 21 27 /* config parameter */ 22 pwg_query(' 23 INSERT INTO `' . CONFIG_TABLE . '` 24 VALUES ( 25 \'SmartAlbums\', 26 \''.serialize(array( 27 'update_on_upload' => false, 28 'show_list_messages' => true, 29 ) 30 ).'\', 31 \'Configuration for SmartAlbums plugin\' 32 ) 33 ;'); 34 28 conf_update_param('SmartAlbums', smart_default_config); 35 29 } 36 30 … … 41 35 if (!isset($conf['SmartAlbums'])) 42 36 { 43 pwg_query(' 44 INSERT INTO `' . CONFIG_TABLE . '` 45 VALUES ( 46 \'SmartAlbums\', 47 \''.serialize(array( 48 'update_on_upload' => false, 49 'show_list_messages' => true, 50 ) 51 ).'\', 52 \'Configuration for SmartAlbums plugin\' 53 ) 54 ;'); 37 conf_update_param('SmartAlbums', smart_default_config); 38 } 39 40 /* some filters renamed in 1.2 */ 41 $name_changes = array( 42 'the' => 'the_post', 43 'before' => 'before_post', 44 'after' => 'after_post', 45 'the_crea' => 'the_taken', 46 'before_crea' => 'before_taken', 47 'after_crea' => 'after_taken', 48 ); 49 foreach ($name_changes as $old => $new) 50 { 51 pwg_query('UPDATE TABLE ' . smart_table . ' SET cond = "'.$new.'" WHERE cond = "'.$old.'";'); 55 52 } 56 53 } 57 54 58 55 function plugin_uninstall() 59 { 60 global $prefixeTable; 61 62 pwg_query('DROP TABLE `' . $prefixeTable . 'category_filters`;'); 56 { 57 pwg_query('DROP TABLE `' . smart_table . '`;'); 63 58 pwg_query('ALTER TABLE `' . IMAGE_CATEGORY_TABLE . '` DROP `smart`;'); 64 pwg_query('DELETE FROM `' . CONFIG_TABLE . '` WHERE param = \'SmartAlbums\' ;');59 pwg_query('DELETE FROM `' . CONFIG_TABLE . '` WHERE param = \'SmartAlbums\' LIMIT 1;'); 65 60 } 61 66 62 ?>
Note: See TracChangeset
for help on using the changeset viewer.