Changeset 16924


Ignore:
Timestamp:
07/23/12 11:37:14 (7 years ago)
Author:
mistic100
Message:

add rating_score filter

Location:
extensions/SmartAlbums
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • extensions/SmartAlbums/admin/album.php

    r16104 r16924  
    134134 
    135135/* select options, for html_options */ 
    136 $template->assign( 
    137   'options',  
    138   array( 
    139     'tags' => array( 
     136$options = array( 
     137  'tags' => array( 
     138    'name' => l10n('Tags'), 
     139    'options' => array( 
    140140      'all'   => l10n('All these tags'), 
    141141      'one'   => l10n('One of these tags'), 
     
    143143      'only'  => l10n('Only these tags'), 
    144144      ), 
    145     'date' => array( 
     145    ), 
     146  'date' => array( 
     147    'name' => l10n('Date'), 
     148    'options' => array( 
    146149      'the_post'      => l10n('Added on'), 
    147150      'before_post'   => l10n('Added before'), 
     
    151154      'after_taken'   => l10n('Created after'), 
    152155      ), 
    153      
    154     'name' => array( 
     156    ), 
     157  'name' => array( 
     158    'name' => l10n('Photo name'), 
     159    'options' => array( 
    155160      'contain'     => l10n('Contains'), 
    156161      'begin'       => l10n('Begins with'), 
     
    160165      'not_end'     => l10n('Doesn\'t end with'), 
    161166      ), 
    162     'author' => array( 
     167    ), 
     168  'author' => array( 
     169    'name' => l10n('Author'), 
     170    'options' => array( 
    163171      'is'      => l10n('Is'), 
    164172      'in'      => l10n('Is in'), 
     
    166174      'not_in'  => l10n('Is not in'), 
    167175      ), 
    168     'hit' => array( 
     176    ), 
     177  'hit' => array( 
     178    'name' => l10n('Hits'), 
     179    'options' => array( 
    169180      'less' => l10n('Bellow'), 
    170181      'more' => l10n('Above'), 
    171182      ), 
    172     'level' => array('level' => 'level'), // second filter not used 
    173     'limit' => array('limit' => 'limit'), // second filter not used 
    174     ) 
     183    ), 
     184  'rating_score' => array( 
     185    'name' => l10n('Rating score'), 
     186    'options' => array( 
     187      'less' => l10n('Bellow'), 
     188      'more' => l10n('Above'), 
     189      ), 
     190    ), 
     191  'level' => array( 
     192    'name' => l10n('Privacy level'), 
     193    'options' => array(), 
     194    ), 
     195  'limit' => array( 
     196    'name' => l10n('Max. number of photos'), 
     197    'options' => array(), 
     198    ), 
    175199  ); 
     200$template->assign('options', $options); 
    176201 
    177202/* get filters for this album */ 
     
    205230    'COND' => $filter['cond'], 
    206231    'VALUE' => $filter['value'], 
     232    'CAPTION' => $options[ $filter['type'] ]['name'], 
    207233  )); 
    208234} 
  • extensions/SmartAlbums/admin/template/album.tpl

    r16104 r16924  
    88 
    99{foreach from=$options item=details key=mode} 
    10   lang['{$mode}_filter'] = '{$mode|cat:'_filter'|@translate|escape:javascript}'; 
    11   {capture assign="option_content"}{html_options options=$details}{/capture} 
     10  lang['{$mode}_filter'] = '{$details.name|escape:javascript}'; 
     11  {capture assign="option_content"}{html_options options=$details.options}{/capture} 
    1212  options['{$mode}'] = "{$option_content|escape:javascript}"; 
    1313{/foreach} 
     
    144144            <a href="#" class="removeFilter" title="{'remove this filter'|@translate}"><span>[x]</span></a> 
    145145            <input type="hidden" name="filters[{$i}][type]" value="{$filter.TYPE}"/> 
    146             {$filter.TYPE|cat:'_filter'|@translate} 
     146            {$filter.CAPTION} 
    147147          </span> 
    148148           
    149149          <span class="filter-cond"> 
    150150            <select name="filters[{$i}][cond]"> 
    151               {html_options options=$options[$filter.TYPE] selected=$filter.COND} 
     151              {html_options options=$options[$filter.TYPE].options selected=$filter.COND} 
    152152            </select> 
    153153          </span> 
     
    182182          <option value="-1">{'Add a filter'|@translate}</option> 
    183183          <option disabled="disabled">------------------</option> 
    184           <option value="tags">{'tags_filter'|@translate}</option> 
    185           <option value="date">{'date_filter'|@translate}</option> 
    186           <option value="name">{'name_filter'|@translate}</option> 
    187           <option value="author">{'author_filter'|@translate}</option> 
    188           <option value="hit">{'hit_filter'|@translate}</option> 
    189           <option value="level">{'level_filter'|@translate}</option> 
    190           <option value="limit">{'limit_filter'|@translate}</option> 
     184          <option value="tags">{'Tags'|@translate}</option> 
     185          <option value="date">{'Date'|@translate}</option> 
     186          <option value="name">{'Photo name'|@translate}</option> 
     187          <option value="author">{'Author'|@translate}</option> 
     188          <option value="hit">{'Hits'|@translate}</option> 
     189          <option value="rating_score">{'Rating score'|@translate}</option> 
     190          <option value="level">{'Privacy level'|@translate}</option> 
     191          <option value="limit">{'Max. number of photos'|@translate}</option> 
    191192        </select> 
    192193        <a id="removeFilters">{'Remove all filters'|@translate}</a> 
  • extensions/SmartAlbums/include/functions.inc.php

    r16104 r16924  
    296296      } 
    297297       
     298      // rating_score 
     299      case 'rating_score': 
     300      { 
     301        switch ($filter['cond']) 
     302        { 
     303          case 'less': 
     304            $where[] = 'rating_score < '.$filter['value'].''; 
     305            break; 
     306          case 'more': 
     307            $where[] = 'rating_score >= '.$filter['value'].''; 
     308            break; 
     309        } 
     310         
     311        break; 
     312      } 
     313       
    298314      // level 
    299315      case 'level': 
     
    404420      $error = true; 
    405421      array_push($page['errors'], l10n('Hits must be an integer')); 
     422    } 
     423  } 
     424  # rating_score 
     425  else if ($filter['type'] == 'rating_score') 
     426  { 
     427    if (!preg_match('#([0-9]{1,})#', $filter['value'])) 
     428    { 
     429      $error = true; 
     430      array_push($page['errors'], l10n('Rating score must be an integer')); 
    406431    } 
    407432  } 
  • extensions/SmartAlbums/language/cs_CZ/plugin.lang.php

    r16421 r16924  
    5252$lang['author_filter'] = 'Autor'; 
    5353$lang['create a new SmartAlbum'] = 'Vytvořit nové SmartAlbum'; 
    54 $lang['date_filter'] = 'Datum'; 
    55 $lang['hit_filter'] = 'Počet návštěv'; 
    56 $lang['level_filter'] = 'Úroveň'; 
    57 $lang['limit_filter'] = 'Max. počet fotek'; 
    58 $lang['name_filter'] = 'Název fotky'; 
    59 $lang['tags_filter'] = 'Tagy'; 
     54$lang['Hits'] = 'Počet návštěv'; 
     55$lang['Max. number of photos'] = 'Max. počet fotek'; 
    6056?> 
  • extensions/SmartAlbums/language/de_DE/plugin.lang.php

    r16234 r16924  
    5252$lang['author_filter'] = 'Autor'; 
    5353$lang['create a new SmartAlbum'] = 'Neues Smart Album erstellen'; 
    54 $lang['date_filter'] = 'Datum'; 
    55 $lang['hit_filter'] = 'Zugriffe'; 
    56 $lang['level_filter'] = 'Ebene'; 
    57 $lang['limit_filter'] = 'Max. Anzahl Bilder'; 
    58 $lang['name_filter'] = 'Bild Name'; 
    59 $lang['tags_filter'] = 'Schlagwörter'; 
     54$lang['Hits'] = 'Zugriffe'; 
     55$lang['Max. number of photos'] = 'Max. Anzahl Bilder'; 
    6056?> 
  • extensions/SmartAlbums/language/el_GR/plugin.lang.php

    r16399 r16924  
    7070$lang['author_filter'] = 'Δημιουργός'; 
    7171$lang['create a new SmartAlbum'] = 'δημιουργήστε ένα νέο SmartAlbum'; 
    72 $lang['date_filter'] = 'Ημερομηνία'; 
    73 $lang['hit_filter'] = 'Επισκέψεις'; 
    74 $lang['level_filter'] = 'Επίπεδο'; 
    75 $lang['limit_filter'] = 'Μέγιστος αριθμός εικόνων'; 
    76 $lang['name_filter'] = 'Όνομα φωτογραφίας '; 
    77 $lang['tags_filter'] = 'Ετικέτες'; 
     72$lang['Hits'] = 'Επισκέψεις'; 
     73$lang['Max. number of photos'] = 'Μέγιστος αριθμός εικόνων'; 
    7874$lang['Filters'] = 'Φίλτρα'; 
    7975?> 
  • extensions/SmartAlbums/language/en_UK/plugin.lang.php

    r16126 r16924  
    3838$lang['Hits must be an integer'] = 'Hits must be an integer'; 
    3939$lang['Limit must be an integer'] = 'Limit must be an integer'; 
     40$lang['Rating score must be an integer'] = 'Rating score must be an integer'; 
    4041$lang['You can\'t use more than one limit filter'] = 'You can\'t use more than one limit filter'; 
    4142$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'; 
     43$lang['Hits'] = 'Hits'; 
     44$lang['Max. number of photos'] = 'Max. number of photos'; 
    4945$lang['For "Is (not) in", separate each author by a comma'] = 'For "Is (not) in", separate each author by a comma'; 
    5046$lang['limit_filter'] = 'Max. number of photos'; 
  • extensions/SmartAlbums/language/es_ES/plugin.lang.php

    r16250 r16924  
    5252$lang['author_filter'] = 'Autor'; 
    5353$lang['create a new SmartAlbum'] = 'Crear un nuevo álbum inteligente'; 
    54 $lang['date_filter'] = 'Fecha'; 
    55 $lang['hit_filter'] = 'Visitas'; 
    56 $lang['level_filter'] = 'Nivel'; 
    57 $lang['limit_filter'] = 'Número máximo de fotos'; 
    58 $lang['name_filter'] = 'Nombre de la foto'; 
    59 $lang['tags_filter'] = 'Etiquetas'; 
     54$lang['Hits'] = 'Visitas'; 
     55$lang['Max. number of photos'] = 'Número máximo de fotos'; 
    6056?> 
  • extensions/SmartAlbums/language/fr_FR/plugin.lang.php

    r16126 r16924  
    3838$lang['Hits must be an integer'] = 'Le nombre de vues doit être un entier'; 
    3939$lang['Limit must be an integer'] = 'La nombre d\'éléments doit être un entier'; 
     40$lang['Rating score must be an integer'] = 'Le score doit être un entier'; 
    4041$lang['You can\'t use more than one limit filter'] = 'Vous ne pouvez choisir qu\'une seule limite de nombre d\'éléments'; 
    4142$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'; 
     43$lang['Hits'] = 'Nombre de vues'; 
     44$lang['Max. number of photos'] = 'Nombre max. d\'éléments'; 
    4945$lang['For "Is (not) in", separate each author by a comma'] = 'Pour "Est/N\'est pas dans", séparez chaque auteur par une virgule'; 
    5046$lang['This album is a SmartAlbum'] = 'Cet album est un SmartAlbum'; 
  • extensions/SmartAlbums/language/hu_HU/plugin.lang.php

    r16841 r16924  
    7171$lang['author_filter'] = 'Szerző'; 
    7272$lang['create a new SmartAlbum'] = 'Új dinamikus album létrehozása'; 
    73 $lang['date_filter'] = 'Dátum'; 
    74 $lang['hit_filter'] = 'Találatok száma'; 
    75 $lang['level_filter'] = 'Hozzáférési szint'; 
    76 $lang['limit_filter'] = 'Képek max. száma'; 
    77 $lang['name_filter'] = 'Kép neve'; 
    78 $lang['tags_filter'] = 'Címkék'; 
     73$lang['Hits'] = 'Találatok száma'; 
     74$lang['Max. number of photos'] = 'Képek max. száma'; 
    7975?> 
  • extensions/SmartAlbums/language/it_IT/plugin.lang.php

    r16782 r16924  
    4040$lang['You can\'t use more than one limit filter'] = 'Potete scegliere un solo limite per il numero di elementi'; 
    4141$lang['You can\'t use more than one level filter'] = 'Potete scegliere un solo livello di privacy'; 
    42 $lang['tags_filter'] = 'Tag'; 
    43 $lang['date_filter'] = 'Data'; 
    44 $lang['name_filter'] = 'Nome della foto'; 
    45 $lang['author_filter'] = 'Autore'; 
    46 $lang['hit_filter'] = 'Numero di visite'; 
    47 $lang['level_filter'] = 'Livello di confidenzialità'; 
    48 $lang['limit_filter'] = 'Numero massimo di elementi'; 
     42$lang['Hits'] = 'Numero di visite'; 
     43$lang['Max. number of photos'] = 'Numero massimo di elementi'; 
    4944$lang['For "Is (not) in", separate each author by a comma'] = 'Per "È/Non è nel", separare ogni autore da una virgola'; 
    5045$lang['This album is a SmartAlbum'] = 'Questo album è uno SmartAlbum'; 
  • extensions/SmartAlbums/language/lv_LV/plugin.lang.php

    r16499 r16924  
    5252$lang['author_filter'] = 'Autors'; 
    5353$lang['create a new SmartAlbum'] = 'izveidot jaunu ViedoAlbumu (SmartAlbum)'; 
    54 $lang['date_filter'] = 'Datums'; 
    55 $lang['hit_filter'] = 'Skatījumi'; 
    56 $lang['level_filter'] = 'Līmenis'; 
    57 $lang['limit_filter'] = 'Foto maksimālais skaits'; 
    58 $lang['name_filter'] = 'Foto nosaukums'; 
    59 $lang['tags_filter'] = 'Cilnes (tegi)'; 
     54$lang['Hits'] = 'Skatījumi'; 
     55$lang['Max. number of photos'] = 'Foto maksimālais skaits'; 
    6056?> 
  • extensions/SmartAlbums/language/nl_NL/plugin.lang.php

    r16154 r16924  
    5252$lang['author_filter'] = 'Auteur'; 
    5353$lang['create a new SmartAlbum'] = 'maak een nieuwe SmartAlbum'; 
    54 $lang['date_filter'] = 'Datum'; 
    55 $lang['hit_filter'] = 'Hits'; 
    56 $lang['level_filter'] = 'Niveau'; 
    57 $lang['limit_filter'] = 'Max. aantal foto\'s'; 
    58 $lang['name_filter'] = 'Foto naam'; 
    59 $lang['tags_filter'] = 'Tags'; 
     54$lang['Hits'] = 'Hits'; 
     55$lang['Max. number of photos'] = 'Max. aantal foto\'s'; 
    6056?> 
  • extensions/SmartAlbums/language/pl_PL/plugin.lang.php

    r16533 r16924  
    7171$lang['author_filter'] = 'Autor'; 
    7272$lang['create a new SmartAlbum'] = 'stwórz nowy SmartAlbum'; 
    73 $lang['date_filter'] = 'Data'; 
    74 $lang['hit_filter'] = 'Wyświetlenia'; 
    75 $lang['level_filter'] = 'Poziom'; 
    76 $lang['limit_filter'] = 'Maksymalna liczba zdjęć'; 
    77 $lang['name_filter'] = 'Nazwa zdjęcia'; 
    78 $lang['tags_filter'] = 'Tagi'; 
     73$lang['Hits'] = 'Wyświetlenia'; 
     74$lang['Max. number of photos'] = 'Maksymalna liczba zdjęć'; 
    7975?> 
  • extensions/SmartAlbums/language/pt_PT/plugin.lang.php

    r16221 r16924  
    7272$lang['author_filter'] = 'Autor'; 
    7373$lang['create a new SmartAlbum'] = 'Criar um novo SmartAlbum'; 
    74 $lang['date_filter'] = 'Data'; 
    75 $lang['hit_filter'] = 'Número de vistas '; 
    76 $lang['level_filter'] = 'Nível '; 
    77 $lang['limit_filter'] = 'Número máximo de fotos'; 
    78 $lang['name_filter'] = 'Nome da fotografia '; 
    79 $lang['tags_filter'] = 'Tags'; 
     74$lang['Hits'] = 'Número de vistas '; 
     75$lang['Max. number of photos'] = 'Número máximo de fotos'; 
    8076?> 
  • extensions/SmartAlbums/language/ru_RU/plugin.lang.php

    r16584 r16924  
    7070$lang['author_filter'] = 'Автор'; 
    7171$lang['create a new SmartAlbum'] = 'создать новый Умный Альбом'; 
    72 $lang['date_filter'] = 'Дата'; 
    73 $lang['hit_filter'] = 'Просмотры'; 
    74 $lang['level_filter'] = 'Уровень'; 
    75 $lang['limit_filter'] = 'Максимальное число фотографий'; 
    76 $lang['name_filter'] = 'Название фото'; 
    77 $lang['tags_filter'] = 'Тэги'; 
     72$lang['Hits'] = 'Просмотры'; 
     73$lang['Max. number of photos'] = 'Максимальное число фотографий'; 
    7874$lang['Filters'] = 'Фильтры'; 
    7975?> 
  • extensions/SmartAlbums/language/sk_SK/plugin.lang.php

    r16342 r16924  
    7171$lang['author_filter'] = 'Autor'; 
    7272$lang['create a new SmartAlbum'] = 'vytvor nov&yacute; SmartAlbum'; 
    73 $lang['date_filter'] = 'D&aacute;tum'; 
    74 $lang['hit_filter'] = 'Pr&iacute;stupov'; 
    75 $lang['level_filter'] = '&Uacute;rove&#328;'; 
    76 $lang['limit_filter'] = 'Max. po&#269;et fotiek'; 
    77 $lang['name_filter'] = 'N&aacute;zov fotky'; 
    78 $lang['tags_filter'] = 'Tagov'; 
     73$lang['Hits'] = 'Pr&iacute;stupov'; 
     74$lang['Max. number of photos'] = 'Max. po&#269;et fotiek'; 
    7975?> 
  • extensions/SmartAlbums/language/tr_TR/plugin.lang.php

    r16556 r16924  
    7171$lang['author_filter'] = 'Yazar'; 
    7272$lang['create a new SmartAlbum'] = 'yeni bir SmartAlbum yarat'; 
    73 $lang['date_filter'] = 'Tarih'; 
    74 $lang['hit_filter'] = 'Tıklanma sayısı'; 
    75 $lang['level_filter'] = 'Seviye'; 
    76 $lang['limit_filter'] = 'Maks. fotoğraf sayısı'; 
    77 $lang['name_filter'] = 'Fotoğraf ismi'; 
    78 $lang['tags_filter'] = 'Etiketler'; 
     73$lang['Hits'] = 'Tıklanma sayısı'; 
     74$lang['Max. number of photos'] = 'Maks. fotoğraf sayısı'; 
    7975?> 
  • extensions/SmartAlbums/language/vi_VN/plugin.lang.php

    r16133 r16924  
    5151$lang['author_filter'] = 'Tác giả'; 
    5252$lang['create a new SmartAlbum'] = 'Tạo SmartAlbum'; 
    53 $lang['date_filter'] = 'Ngày'; 
    54 $lang['hit_filter'] = 'Số lần truy cập'; 
    55 $lang['level_filter'] = 'Cấp'; 
    56 $lang['limit_filter'] = 'Số hình tối đa'; 
    57 $lang['name_filter'] = 'Tên hình (ảnh)'; 
    58 $lang['tags_filter'] = 'Thẻ'; 
     53$lang['Hits'] = 'Số lần truy cập'; 
     54$lang['Max. number of photos'] = 'Số hình tối đa'; 
    5955?> 
Note: See TracChangeset for help on using the changeset viewer.