Changeset 1763

Show
Ignore:
Timestamp:
01/28/07 21:56:10 (6 years ago)
Author:
vdigital
Message:

Issue 0000614: Display hits under thumbnails like comments counter

Location:
trunk
Files:
15 modified

Legend:

Unmodified
Added
Removed
  • trunk/admin/configuration.php

    r1748 r1763  
    233233    $show_yes = ($conf['show_nb_comments']==true)?'checked="checked"':''; 
    234234    $show_no = ($conf['show_nb_comments']==false)?'checked="checked"':''; 
     235    $hits_yes = ($conf['show_nb_hits']==true)?'checked="checked"':''; 
     236    $hits_no = ($conf['show_nb_hits']==false)?'checked="checked"':''; 
    235237    $expand_yes = ($conf['auto_expand']==true)?'checked="checked"':''; 
    236238    $expand_no  = ($conf['auto_expand']==false)?'checked="checked"':''; 
     
    248250        'EXPAND_NO'=>$expand_no, 
    249251        'SHOW_COMMENTS_YES'=>$show_yes, 
    250         'SHOW_COMMENTS_NO'=>$show_no 
     252        'SHOW_COMMENTS_NO'=>$show_no, 
     253        'SHOW_HITS_YES'=>$hits_yes, 
     254        'SHOW_HITS_NO'=>$hits_no, 
    251255        )); 
    252256 
  • trunk/admin/include/functions.php

    r1726 r1763  
    11581158      $insert['show_nb_comments'] = 
    11591159        boolean_to_string($conf['show_nb_comments']); 
     1160      $insert['show_nb_hits'] = 
     1161        boolean_to_string($conf['show_nb_hits']); 
    11601162      $insert['maxwidth'] = $conf['default_maxwidth']; 
    11611163      $insert['maxheight'] = $conf['default_maxheight']; 
  • trunk/admin/user_list.php

    r1753 r1763  
    343343    array('nb_image_line', 'nb_line_page', 'template', 'language', 
    344344          'recent_period', 'maxwidth', 'expand', 'show_nb_comments', 
    345           'maxheight', 'status', 'enabled_high'); 
    346  
    347   $true_false_fields = array('expand', 'show_nb_comments', 'enabled_high'); 
     345          'show_nb_hits', 'maxheight', 'status', 'enabled_high'); 
     346 
     347  $true_false_fields = array('expand', 'show_nb_comments',  
     348                       'show_nb_hits', 'enabled_high'); 
    348349  if ($conf['allow_adviser']) 
    349350  { 
     
    557558//   $user['expand'] = $conf['auto_expand']; 
    558559//   $user['show_nb_comments'] = $conf['show_nb_comments']; 
     560//   $user['show_nb_hits'] = $conf['show_nb_hits']; 
    559561// --- 
    560562 
     
    577579      'SHOW_NB_COMMENTS_NO' => 
    578580        'false' == $_POST['show_nb_comments'] ? 'checked="checked"' : '', 
     581      'SHOW_NB_HITS_YES' => 
     582        'true' == $_POST['show_nb_hits'] ? 'checked="checked"' : '', 
     583      'SHOW_NB_HITS_NO' => 
     584        'false' == $_POST['show_nb_hits'] ? 'checked="checked"' : '', 
    579585      'ENABLED_HIGH_YES' => 'true' == $_POST['enabled_high'] ? 'checked="checked"' : '', 
    580586      'ENABLED_HIGH_NO' => 'false' == $_POST['enabled_high'] ? 'checked="checked"' : '', 
  • trunk/include/category_default.inc.php

    r1677 r1763  
    105105      ) 
    106106    ); 
     107  if ($user['show_nb_hits'] 
     108      and isset($page['category'])  
     109      and $conf['show_nb_hits']) 
     110  { 
     111    $template->assign_block_vars( 
     112      'thumbnails.line.thumbnail.nb_hits', 
     113      array('HITS'=> l10n_dec('%d hit', '%d hits', $row['hit']))); 
     114  } 
    107115 
    108116  if ($conf['show_thumbnail_caption']) 
  • trunk/include/config_default.inc.php

    r1747 r1763  
    161161// bottom of each page ? 
    162162$conf['show_version'] = true; 
     163 
     164// show_nb_hits :       Show hits count under thumbnails 
     165// false = never... true = depending on profile... 
     166$conf['show_nb_hits'] = false; 
    163167 
    164168// links : list of external links to add in the menu. An example is the best 
  • trunk/include/functions_user.inc.php

    r1744 r1763  
    161161    $user['expand'] = $conf['auto_expand']; 
    162162    $user['show_nb_comments'] = $conf['show_nb_comments']; 
     163    $user['show_nb_hits'] = $conf['show_nb_hits']; 
    163164    $user['enabled_high'] = $conf['newuser_default_enabled_high']; 
    164165  } 
     
    776777      'expand' => boolean_to_string($conf['auto_expand']), 
    777778      'show_nb_comments' => boolean_to_string($conf['show_nb_comments']), 
     779      'show_nb_hits' => boolean_to_string($conf['show_nb_hits']), 
    778780      'maxwidth' => $conf['default_maxwidth'], 
    779781      'maxheight' => $conf['default_maxheight'], 
  • trunk/language/en_UK.iso-8859-1/common.lang.php

    r1754 r1763  
    300300$lang['%d new comment'] = '%d new comment'; 
    301301$lang['%d new comments'] = '%d new comments'; 
     302$lang['%d hit'] = '%d hit'; 
     303$lang['%d hits'] = '%d hits'; 
    302304$lang['%d new element'] = '%d new element'; 
    303305$lang['%d new elements'] = '%d new elements'; 
     
    571573$lang['set as category representative'] = 'set as category representative'; 
    572574$lang['show_nb_comments'] = 'Show number of comments'; 
     575$lang['show_nb_hits'] = 'Show hits count'; 
    573576$lang['slideshow'] = 'slideshow'; 
    574577$lang['slideshow_stop'] = 'stop the slideshow'; 
  • trunk/language/en_UK.iso-8859-1/help/configuration.html

    r1744 r1763  
    9494  for each picture on the thumbnails page. Resource consuming.</li> 
    9595 
     96  <li><strong>Show hits count</strong>: display hits observed on picture 
     97  just under its thumbnail on the thumbnails page.  
     98  Only when advanced configuration parameter is: <br /> 
     99  $conf['show_nb_hits'] = true; <br /> 
     100  Notice: it is false by default.</li> 
     101 
    96102  <li><strong>Maximum width of the pictures</strong>: maximum displayed 
    97103  width. If pictures are larger than this setting, they will be resized on 
  • trunk/language/fr_FR.iso-8859-1/common.lang.php

    r1754 r1763  
    300300$lang['%d new comment'] = '%d nouveau commentaire utilisateur'; 
    301301$lang['%d new comments'] = '%d nouveaux commentaires utilisateur'; 
     302$lang['%d hit'] = 'vue %d fois'; 
     303$lang['%d hits'] = 'vue %d fois'; 
    302304$lang['%d new element'] = '%d nouvel �l�ment'; 
    303305$lang['%d new elements'] = '%d nouveaux �l�ments'; 
     
    572574$lang['set as category representative'] = '�lire comme repr�sentant de cette cat�gorie'; 
    573575$lang['show_nb_comments'] = 'Montrer le nombre de commentaires'; 
     576$lang['show_nb_hits'] = 'Montrer le nombre de visualisations'; 
    574577$lang['slideshow'] = 'diaporama'; 
    575578$lang['slideshow_stop'] = 'arr�ter le diaporama'; 
  • trunk/language/fr_FR.iso-8859-1/help/configuration.html

    r1744 r1763  
    9999ressources.</li> 
    100100 
     101  <li><strong>Montrer le nombre de visualisations  </strong>: affiche les  
     102  � hits � relev�s sur une image sous sa miniature dans la page de miniatures. 
     103  Uniquement valable si le param�tre de configuration avanc�e est :<br /> 
     104  $conf['show_nb_hits'] = true; <br /> 
     105  N.B.: par defaut il est � false.</li> 
     106 
    101107  <li><strong>Largeur maximum des images</strong>: � l'affichage. Si l'image 
    102108est plus large que ce param�tre, alors elle sera redimensionn�e � 
  • trunk/profile.php

    r1753 r1763  
    173173    $fields = array( 
    174174      'nb_image_line', 'nb_line_page', 'language', 'maxwidth', 'maxheight', 
    175       'expand', 'show_nb_comments', 'recent_period', 'template' 
     175      'expand', 'show_nb_comments', 'show_nb_hits', 'recent_period', 'template' 
    176176      ); 
    177177 
     
    202202  $template->set_filename('profile_content', 'profile_content.tpl'); 
    203203 
    204   $expand = ($userdata['expand'] == 'true') ? 'EXPAND_TREE_YES':'EXPAND_TREE_NO'; 
     204  $expand = ($userdata['expand'] == 'true') ?  
     205            'EXPAND_TREE_YES':'EXPAND_TREE_NO'; 
    205206 
    206207  $nb_comments = 
    207     ($userdata['show_nb_comments'] == 'true') ? 'NB_COMMENTS_YES':'NB_COMMENTS_NO'; 
     208    ($userdata['show_nb_comments'] == 'true') ?  
     209               'NB_COMMENTS_YES':'NB_COMMENTS_NO'; 
     210 
     211  $nb_hits = 
     212    ($userdata['show_nb_hits'] == 'true') ?  
     213               'NB_HITS_YES':'NB_HITS_NO'; 
    208214 
    209215  $template->assign_vars( 
     
    220226      $expand=>'checked="checked"', 
    221227      $nb_comments=>'checked="checked"', 
     228      $nb_hits=>'checked="checked"', 
    222229   
    223230      'REDIRECT' => $url_redirect, 
  • trunk/template/yoga/admin/configuration.tpl

    r1744 r1763  
    195195 
    196196    <li> 
     197      <span class="property">{lang:show_nb_hits}</span> 
     198      <label><input type="radio" class="radio" name="show_nb_hits" value="true" {default.SHOW_HITS_YES} />{lang:Yes}</label> 
     199      <label><input type="radio" class="radio" name="show_nb_hits" value="false" {default.SHOW_HITS_NO} />{lang:No}</label> 
     200    </li> 
     201 
     202    <li> 
    197203      <span class="property"> 
    198204        <label for="default_maxwidth">{lang:Maximum width of the pictures}</label> 
  • trunk/template/yoga/admin/user_list.tpl

    r1753 r1763  
    269269 
    270270  <tr> 
     271    <td>{lang:show_nb_hits}</td> 
     272    <td> 
     273      <label><input type="radio" name="show_nb_hits" value="leave" checked="checked" /> {lang:leave}</label> 
     274      / {lang:set to} 
     275      <label><input type="radio" name="show_nb_hits" value="true" {SHOW_NB_HITS_YES} />{lang:yes}</label> 
     276      <label><input type="radio" name="show_nb_hits" value="false" {SHOW_NB_HITS_NO} />{lang:no}</label> 
     277    </td> 
     278  </tr> 
     279 
     280  <tr> 
    271281    <td>{lang:maxwidth}</td> 
    272282    <td> 
  • trunk/template/yoga/profile_content.tpl

    r1753 r1763  
    9292      </li> 
    9393      <li> 
     94        <span class="property">{lang:show_nb_hits}</span> 
     95        <label><input type="radio" name="show_nb_hits" value="true" {NB_HITS_YES}> {lang:yes}</label> 
     96        <label><input type="radio" name="show_nb_hits" value="false" {NB_HITS_NO}> {lang:no}</label> 
     97      </li> 
     98      <li> 
    9499        <span class="property"> 
    95100          <label for="maxwidth">{lang:maxwidth}</label> 
  • trunk/template/yoga/thumbnails.tpl

    r1385 r1763  
    2424      <br />{thumbnails.line.thumbnail.nb_comments.NB_COMMENTS} {lang:comments} 
    2525      <!-- END nb_comments --> 
     26      <!-- BEGIN nb_hits --> 
     27      <br />{thumbnails.line.thumbnail.nb_hits.HITS} 
     28      <!-- END nb_comments --> 
    2629      </span> 
    2730    </span>