Changeset 17677 for extensions/SmartAlbums
- Timestamp:
- Aug 31, 2012, 12:58:56 PM (12 years ago)
- Location:
- extensions/SmartAlbums
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/SmartAlbums/admin/album.php
r16938 r17677 162 162 ), 163 163 ), 164 'album' => array( 165 'name' => l10n('Album'), 166 'options' => array( 167 'all' => l10n('All these albums'), 168 'one' => l10n('One of these albums'), 169 'none' => l10n('None of these albums'), 170 'only' => l10n('Only these albums'), 171 ), 172 ), 164 173 'author' => array( 165 174 'name' => l10n('Author'), … … 220 229 ;'; 221 230 $filter['value'] = get_taglist($query); 231 } 232 else if ($filter['type'] == 'album') 233 { 234 $filter['value'] = explode(',', $filter['value']); 222 235 } 223 236 … … 237 250 FROM '.TAGS_TABLE.' 238 251 ;'; 239 $all_tags = get_taglist($query); 252 $template->assign('all_tags', get_taglist($query)); 253 254 /* all albums */ 255 $query = ' 256 SELECT 257 id, 258 name, 259 uppercats, 260 global_rank 261 FROM '.CATEGORIES_TABLE.' 262 ;'; 263 display_select_cat_wrapper($query, array(), 'all_albums'); 240 264 241 265 /* get image number */ … … 254 278 } 255 279 280 281 /* template vars */ 256 282 if (isset($_GET['new_smart'])) 257 283 { … … 261 287 $template->assign(array( 262 288 'COUNT_SCRIPT_URL' => SMART_PATH.'include/count_images.php', 263 'all_tags' => $all_tags,264 289 'level_options' => get_privacy_level_options(), 265 290 'F_ACTION' => $self_url, -
extensions/SmartAlbums/admin/template/album.tpl
r16924 r17677 1 1 {combine_css path=$SMART_PATH|@cat:"admin/template/style.css"} 2 2 3 {include file='include/datepicker.inc.tpl'} 3 4 {combine_script id='jquery.tokeninput' load='async' require='jquery' path='themes/default/js/plugins/jquery.tokeninput.js'} 4 5 5 {footer_script require='jquery.tokeninput'} 6 {combine_css path="themes/default/js/plugins/chosen.css"} 7 {combine_script id='jquery.chosen' load='footer' path='themes/default/js/plugins/chosen.jquery.min.js'} 8 9 {footer_script require='jquery.tokeninput,jquery.chosen'} 6 10 var lang = new Array(); 7 11 var options = new Array(); … … 13 17 {/foreach} 14 18 19 lang['Select albums...'] = '{'Select albums...'|@translate}'; 15 20 lang['For "Is (not) in", separate each author by a comma'] = '{'For "Is (not) in", separate each author by a comma'|@translate|escape:javascript}'; 16 21 lang['remove this filter'] = '{'remove this filter'|@translate|escape:javascript}'; 17 22 {capture assign="option_content"}{html_options options=$level_options selected=0}{/capture} 18 23 options['level_options'] = "{$option_content|escape:javascript}"; 24 {capture assign="option_content"}{html_options options=$all_albums selected=0}{/capture} 25 options['album_options'] = "{$option_content|escape:javascript}"; 19 26 20 27 {literal} … … 58 65 ' <span class="filter-value">'; 59 66 60 if (type == 'tags') 67 if (type == 'tags') { 61 68 content+= ' <select name="filters['+ i +'][value]" class="tagSelect"></select>'; 62 else if (type == 'level') 69 } 70 else if (type == 'album') { 71 content+= ' <select name="filters['+ i +'][value][]" class="albumSelect" multiple="multiple" data-placeholder="'+ lang['Select albums...'] +'">'+ options['album_options'] +'</select>'; 72 } 73 else if (type == 'level') { 63 74 content+= ' <select name="filters['+ i +'][value]">'+ options['level_options'] +'</select>'; 64 else 75 } 76 else { 65 77 content+= ' <input type="text" name="filters['+ i +'][value]" size="30"/>'; 66 67 if (type == 'author') 78 } 79 80 if (type == 'author') { 68 81 content+= ' <i>'+ lang['For "Is (not) in", separate each author by a comma'] +'</i>'; 82 } 69 83 70 84 content+= '</span>'; … … 100 114 } 101 115 ); 116 117 jQuery(".albumSelect").chosen(); 102 118 } 103 119 … … 160 176 {/foreach} 161 177 </select> 178 {elseif $filter.TYPE == 'album'} 179 <select name="filters[{$i}][value][]" class="albumSelect" multiple="multiple" data-placeholder="{'Select albums...'|@translate}"> 180 {html_options options=$all_albums selected=$filter.VALUE} 181 </select> 162 182 {elseif $filter.TYPE == 'level'} 163 183 <select name="filters[{$i}][value]"> … … 185 205 <option value="date">{'Date'|@translate}</option> 186 206 <option value="name">{'Photo name'|@translate}</option> 207 <option value="album">{'Album'|@translate}</option> 187 208 <option value="author">{'Author'|@translate}</option> 188 209 <option value="hit">{'Hits'|@translate}</option> -
extensions/SmartAlbums/admin/template/style.css
r16104 r17677 60 60 border-radius:4px; 61 61 } 62 63 .albumSelect { 64 width:600px; 65 } 66 .chzn-container { 67 font-size:12px !important; 68 } 69 .chzn-choices li { 70 margin-bottom:1px !important; 71 padding: 3px 20px 3px 5px !important; 72 border-bottom-style:solid !important; 73 } 74 .search-field { 75 border-width:0px !important; 76 } 77 .chzn-choices .search-field input { 78 padding-bottom:1px !important; 79 } -
extensions/SmartAlbums/include/count_images.php
r16104 r17677 11 11 if (!is_admin()) die('Hacking attempt!'); 12 12 13 include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');14 include_once(SMART_PATH.'include/functions.inc.php');15 16 load_language('plugin.lang', SMART_PATH);17 $conf['SmartAlbums'] = unserialize($conf['SmartAlbums']);18 13 19 14 if (isset($_POST['filters'])) -
extensions/SmartAlbums/include/functions.inc.php
r17013 r17677 254 254 } 255 255 256 // album 257 case 'album': 258 { 259 switch ($filter['cond']) 260 { 261 // search images existing in all albums 262 case 'all': 263 { 264 $albums_arr = explode(',', $filter['value']); 265 foreach($albums_arr as $value) 266 { 267 $sub_query = ' 268 SELECT image_id 269 FROM '.IMAGE_CATEGORY_TABLE.' 270 WHERE category_id = '.$value.' 271 '; 272 $where[] = 'i.id IN ('.$sub_query.')'; 273 } 274 275 break; 276 } 277 // search images existing in one of these albums 278 case 'one': 279 { 280 $sub_query = ' 281 SELECT image_id 282 FROM '.IMAGE_CATEGORY_TABLE.' 283 WHERE category_id IN('.$filter['value'].') 284 '; 285 $where[] = 'i.id IN ('.$sub_query.')'; 286 287 break; 288 } 289 // exclude images existing in one of these albums 290 case 'none': 291 { 292 $sub_query = ' 293 SELECT image_id 294 FROM '.IMAGE_CATEGORY_TABLE.' 295 WHERE category_id IN('.$filter['value'].') 296 '; 297 $where[] = 'i.id NOT IN ('.$sub_query.')'; 298 299 break; 300 } 301 // exclude images existing on other albums, and search images existing in all albums 302 case 'only': 303 { 304 $sub_query = ' 305 SELECT image_id 306 FROM '.IMAGE_CATEGORY_TABLE.' 307 WHERE category_id NOT IN('.$filter['value'].') 308 '; 309 $where[] = 'i.id NOT IN ('.$sub_query.')'; 310 311 $albums_arr = explode(',', $filter['value']); 312 foreach($albums_arr as $value) 313 { 314 $sub_query = ' 315 SELECT image_id 316 FROM '.IMAGE_CATEGORY_TABLE.' 317 WHERE category_id = '.$value.' 318 '; 319 $where[] = 'i.id IN ('.$sub_query.')'; 320 } 321 322 break; 323 } 324 } 325 326 break; 327 } 328 256 329 // author 257 330 case 'author': … … 398 471 $error = true; 399 472 array_push($page['errors'], l10n('Name is empty')); 473 } 474 } 475 # album 476 else if ($filter['type'] == 'album') 477 { 478 if (@$filter['value'] == null) 479 { 480 $error = true; 481 array_push($page['errors'], l10n('No album selected')); 482 } 483 else 484 { 485 $filter['value'] = implode(',', $filter['value']); 400 486 } 401 487 } -
extensions/SmartAlbums/language/en_UK/plugin.lang.php
r16939 r17677 8 8 $lang['None of these tags'] = 'None of these tags'; 9 9 $lang['Only these tags'] = 'Only these tags'; 10 $lang['All these albums'] = 'All these albums'; 11 $lang['One of these albums'] = 'One of these albums'; 12 $lang['None of these albums'] = 'None of these albums'; 13 $lang['Only these albums'] = 'Only these albums'; 10 14 $lang['Added on'] = 'Added on'; 11 15 $lang['Added before'] = 'Added before'; … … 33 37 $lang['All SmartAlbums'] = 'All SmartAlbums'; 34 38 $lang['No tag selected'] = 'No tag selected'; 39 $lang['No album selected'] = 'No album selected'; 35 40 $lang['Date string is malformed'] = 'Date string is malformed'; 36 41 $lang['Name is empty'] = 'Name is empty'; -
extensions/SmartAlbums/language/fr_FR/plugin.lang.php
r16939 r17677 8 8 $lang['None of these tags'] = 'Aucun des tags'; 9 9 $lang['Only these tags'] = 'Seulement les tags'; 10 $lang['All these albums'] = 'Tous les albums'; 11 $lang['One of these albums'] = 'Un des albums'; 12 $lang['None of these albums'] = 'Aucun des albums'; 13 $lang['Only these albums'] = 'Seulement les albums'; 10 14 $lang['Added on'] = 'Ajouté le'; 11 15 $lang['Added before'] = 'Ajouté avant le'; … … 33 37 $lang['All SmartAlbums'] = 'Tous les SmartAlbums'; 34 38 $lang['No tag selected'] = 'Aucun tag sélectionné'; 39 $lang['No album selected'] = 'Aucun album sélectionné'; 35 40 $lang['Date string is malformed'] = 'Date incorrecte'; 36 41 $lang['Name is empty'] = 'Le nom est vide';
Note: See TracChangeset
for help on using the changeset viewer.