Changeset 12894
- Timestamp:
- Jan 15, 2012, 6:05:30 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/configuration.php
r12887 r12894 420 420 array( 421 421 'NB_COMMENTS_PAGE'=>$conf['nb_comment_page'], 422 )); 422 'comments_order'=>$conf['comments_order'], 423 'comments_order_options'=> $sort_directions 424 ) 425 ); 423 426 424 427 foreach ($comments_checkboxes as $checkbox) -
trunk/admin/themes/default/template/configuration.tpl
r12892 r12894 204 204 <input type="text" size="3" maxlength="4" name="nb_comment_page" id="nb_comment_page" value="{$comments.NB_COMMENTS_PAGE}"> 205 205 </li> 206 207 <li> 208 <span class="property">{'Default comments order'|@translate}</span> 209 <select name="comments_order"> 210 {html_options options=$comments.comments_order_options selected=$comments.comments_order} 211 </select> 212 </li> 206 213 207 214 <li> -
trunk/include/picture_comment.inc.php
r12767 r12894 126 126 if ($row['nb_comments'] > 0) 127 127 { 128 // comments order (get, session, conf) 129 if (!empty($_GET['comments_order'])) 130 { 131 if (in_array(strtoupper($_GET['comments_order']), array('ASC', 'DESC'))) 132 { 133 $comments_order = $_GET['comments_order']; 134 pwg_set_session_var('comments_order', $comments_order); 135 } 136 else 137 { 138 $comments_order = $conf['comments_order']; 139 } 140 } 141 else if (pwg_get_session_var('comments_order') !== null) 142 { 143 $comments_order = pwg_get_session_var('comments_order'); 144 } 145 else 146 { 147 $comments_order = $conf['comments_order']; 148 } 149 $template->assign(array( 150 'COMMENTS_ORDER_URL' => duplicate_picture_url().'&comments_order='.($comments_order == 'ASC' ? 'DESC' : 'ASC'), 151 'COMMENTS_ORDER_TITLE' => $comments_order == 'ASC' ? l10n('ascending') : l10n('descending'), 152 )); 153 128 154 $query = ' 129 155 SELECT … … 141 167 WHERE image_id = '.$page['image_id'].' 142 168 '.$validated_clause.' 143 ORDER BY date ASC169 ORDER BY date '.$comments_order.' 144 170 LIMIT '.$conf['nb_comment_page'].' OFFSET '.$page['start'].' 145 171 ;'; -
trunk/install/config.sql
r12887 r12894 6 6 INSERT INTO piwigo_config (param,value,comment) VALUES ('comments_validation','false','administrators validate users comments before becoming visible'); 7 7 INSERT INTO piwigo_config (param,value,comment) VALUES ('comments_forall','false','even guest not registered can post comments'); 8 INSERT INTO piwigo_config (param,value,comment) VALUES ('comments_order','ASC','comments order on picture page and cie'); 8 9 INSERT INTO piwigo_config (param,value,comment) VALUES ('user_can_delete_comment','false','administrators can allow user delete their own comments'); 9 10 INSERT INTO piwigo_config (param,value,comment) VALUES ('user_can_edit_comment','false','administrators can allow user edit their own comments'); -
trunk/language/en_UK/admin.lang.php
r12887 r12894 224 224 $lang['Deactivate all'] = "Deactivate all"; 225 225 $lang['Deactivate'] = "Deactivate"; 226 $lang['Default comments order'] = 'Default comments order'; 226 227 $lang['Default display'] = "Default display"; 227 228 $lang['Default photos order'] = "Default photos order"; -
trunk/language/fr_CA/admin.lang.php
r12888 r12894 847 847 $lang['Send connection settings by email'] = 'Envoyer les identifiants par email'; 848 848 $lang['Activate comments'] = 'Activer les commentaires'; 849 $lang['Default comments order'] = 'Ordre par défaut des commentaires'; 849 850 850 851 ?> -
trunk/language/fr_FR/admin.lang.php
r12888 r12894 846 846 $lang['Send connection settings by email'] = 'Envoyer les identifiants par email'; 847 847 $lang['Activate comments'] = 'Activer les commentaires'; 848 $lang['Default comments order'] = 'Ordre par défaut des commentaires'; 848 849 849 850 ?> -
trunk/local
- Property svn:ignore
-
old new 1 GThumb 2 combined 3 i 1 4 personal
-
- Property svn:ignore
-
trunk/themes/default/template/picture.tpl
r12881 r12894 275 275 276 276 {if isset($COMMENT_COUNT)} 277 <a name="comments"></a> 277 278 <div id="comments"> 278 279 {if $COMMENT_COUNT > 0} 279 280 <h3>{$pwg->l10n_dec('%d comment', '%d comments',$COMMENT_COUNT)}</h3> 280 281 {/if} 282 {if $COMMENT_COUNT > 2} 283 {'Sort order'|@translate} : <a href="{$COMMENTS_ORDER_URL}#comments">{$COMMENTS_ORDER_TITLE}</a> 284 {/if} 281 285 {if !empty($navbar)}{include file='navigation_bar.tpl'|@get_extent:'navbar'}{/if} 282 286
Note: See TracChangeset
for help on using the changeset viewer.