Changeset 12887
- Timestamp:
- Jan 14, 2012, 11:29:10 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin.php
r12820 r12887 190 190 'U_ADD_PHOTOS' => $link_start.'photos_add', 191 191 'U_CHANGE_THEME' => $change_theme_url, 192 'U_PENDING_COMMENTS' => $link_start.'comments',193 192 'U_UPDATES' => $link_start.'updates', 194 193 ) 195 194 ); 195 196 if ($conf['activate_comments']) 197 { 198 $template->assign('U_PENDING_COMMENTS', $link_start.'comments'); 199 } 196 200 197 201 // +-----------------------------------------------------------------------+ -
trunk/admin/cat_modify.php
r12796 r12887 49 49 'id' => $_GET['cat_id'], 50 50 'name' => @$_POST['name'], 51 'commentable' => isset($_POST['commentable'])?$_POST['commentable']:'false',52 51 'comment' => 53 52 $conf['allow_html_descriptions'] ? 54 53 @$_POST['comment'] : strip_tags(@$_POST['comment']), 55 54 ); 55 56 if ($conf['activate_comments']) 57 { 58 $data['commentable'] = isset($_POST['commentable'])?$_POST['commentable']:'false'; 59 } 56 60 57 61 mass_updates( … … 223 227 'CAT_STATUS' => $category['status'], 224 228 'CAT_VISIBLE' => boolean_to_string($category['visible']), 225 'CAT_COMMENTABLE' => boolean_to_string($category['commentable']),226 229 227 230 'U_JUMPTO' => make_index_url( … … 239 242 ) 240 243 ); 244 245 if ($conf['activate_comments']) 246 { 247 $template->assign('CAT_COMMENTABLE', boolean_to_string($category['commentable'])); 248 } 241 249 242 250 -
trunk/admin/cat_options.php
r8728 r12887 143 143 $tabsheet->add('status', l10n('Public / Private'), $opt_link.'status'); 144 144 $tabsheet->add('visible', l10n('Lock'), $opt_link.'visible'); 145 $tabsheet->add('comments', l10n('Comments'), $opt_link.'comments'); 145 if ($conf['activate_comments']) 146 { 147 $tabsheet->add('comments', l10n('Comments'), $opt_link.'comments'); 148 } 146 149 if ($conf['allow_random_representative']) 147 150 { -
trunk/admin/configuration.php
r12879 r12887 67 67 68 68 $comments_checkboxes = array( 69 'activate_comments', 69 70 'comments_forall', 70 71 'comments_validation', -
trunk/admin/intro.php
r11839 r12887 185 185 ;'; 186 186 list($nb_groups) = pwg_db_fetch_row(pwg_query($query)); 187 188 $query = '189 SELECT COUNT(*)190 FROM '.COMMENTS_TABLE.'191 ;';192 list($nb_comments) = pwg_db_fetch_row(pwg_query($query));193 187 194 188 $query = ' … … 219 213 'DB_USERS' => l10n_dec('%d user', '%d users', $nb_users), 220 214 'DB_GROUPS' => l10n_dec('%d group', '%d groups', $nb_groups), 221 'DB_COMMENTS' => l10n_dec('%d comment', '%d comments', $nb_comments),222 215 'DB_RATES' => sprintf('%d rates', $nb_rates), 223 216 'U_CHECK_UPGRADE' => PHPWG_ROOT_PATH.'admin.php?action=check_upgrade', … … 227 220 ) 228 221 ); 222 223 if ($conf['activate_comments']) 224 { 225 $query = ' 226 SELECT COUNT(*) 227 FROM '.COMMENTS_TABLE.' 228 ;'; 229 list($nb_comments) = pwg_db_fetch_row(pwg_query($query)); 230 $template->assign('DB_COMMENTS', l10n_dec('%d comment', '%d comments', $nb_comments)); 231 232 // unvalidated comments 233 $query = ' 234 SELECT COUNT(*) 235 FROM '.COMMENTS_TABLE.' 236 WHERE validated=\'false\' 237 ;'; 238 list($nb_comments) = pwg_db_fetch_row(pwg_query($query)); 239 240 if ($nb_comments > 0) 241 { 242 $template->assign( 243 'unvalidated', 244 array( 245 'URL' => PHPWG_ROOT_PATH.'admin.php?page=comments', 246 'INFO' => sprintf(l10n('%d waiting for validation'), $nb_comments) 247 ) 248 ); 249 } 250 } 229 251 230 252 if ($nb_elements > 0) … … 248 270 } 249 271 250 // unvalidated comments251 $query = '252 SELECT COUNT(*)253 FROM '.COMMENTS_TABLE.'254 WHERE validated=\'false\'255 ;';256 list($nb_comments) = pwg_db_fetch_row(pwg_query($query));257 258 if ($nb_comments > 0)259 {260 $template->assign(261 'unvalidated',262 array(263 'URL' => PHPWG_ROOT_PATH.'admin.php?page=comments',264 'INFO' => sprintf(l10n('%d waiting for validation'), $nb_comments)265 )266 );267 }268 269 272 // graphics library 270 273 switch (pwg_image::get_library()) -
trunk/admin/themes/default/template/admin.tpl
r12829 r12887 75 75 {/if} 76 76 <li><a href="{$U_MAINTENANCE}">{'Maintenance'|@translate}</a></li> 77 {if isset($U_PENDING_COMMENTS)} 77 78 <li><a href="{$U_PENDING_COMMENTS}">{'Pending Comments'|@translate}</a></li> 79 {/if} 78 80 <li><a href="{$U_UPDATES}">{'Updates'|@translate}</a></li> 79 81 </ul> -
trunk/admin/themes/default/template/cat_modify.tpl
r12681 r12887 83 83 </td> 84 84 </tr> 85 {if isset($CAT_COMMENTABLE)} 85 86 <tr> 86 87 <td><strong>{'Comments'|@translate}</strong> … … 89 90 </td> 90 91 </tr> 92 {/if} 91 93 </table> 92 94 </fieldset> -
trunk/admin/themes/default/template/configuration.tpl
r12879 r12887 184 184 <li> 185 185 <label> 186 <span class="property">{'Activate comments'|@translate}</span> 187 <input type="checkbox" name="activate_comments" id="activate_comments"{if ($comments.activate_comments)}checked="checked"{/if}> 188 </label> 189 </li> 190 </ul> 191 192 <ul id="comments_param_warp"{if not ($comments.activate_comments)} style="display:none;"{/if}> 193 <li> 194 <label> 186 195 <span class="property">{'Comments for all'|@translate}</span> 187 196 <input type="checkbox" name="comments_forall" {if ($comments.comments_forall)}checked="checked"{/if}> … … 244 253 </ul> 245 254 </fieldset> 255 {footer_script}{literal} 256 $(document).ready(function(){ 257 $("#activate_comments").change(function(){ 258 if ($(this).attr('checked')) { 259 $("#comments_param_warp").css('display', ''); 260 } else { 261 $("#comments_param_warp").css('display', 'none'); 262 } 263 }); 264 }); 265 {/literal}{/footer_script} 246 266 {/if} 247 267 -
trunk/admin/themes/default/template/intro.tpl
r12427 r12887 73 73 <li>{$DB_USERS}</li> 74 74 <li>{$DB_GROUPS}</li> 75 {if isset($DB_COMMENTS)} 75 76 <li> 76 77 {$DB_COMMENTS} … … 79 80 {/if} 80 81 </li> 82 {/if} 81 83 <li>{$DB_RATES}</li> 82 84 </ul> -
trunk/admin/themes/default/template/profile_content.tpl
r12882 r12887 48 48 <input type="text" size="4" maxlength="3" name="nb_image_page" id="nb_image_page" value="{$NB_IMAGE_PAGE}"> 49 49 </li> 50 {if not $SPECIAL_USER}50 {if not $SPECIAL_USER} 51 51 <li> 52 52 <span class="property"> … … 61 61 {html_options id=language name=language options=$language_options selected=$language_selection} 62 62 </li> 63 {/if}63 {/if} 64 64 <li> 65 65 <span class="property"> … … 72 72 {html_radios name='expand' options=$radio_options selected=$EXPAND} 73 73 </li> 74 {if $ACTIVATE_COMMENTS} 74 75 <li> 75 76 <span class="property">{'Show number of comments'|@translate}</span> 76 77 {html_radios name='show_nb_comments' options=$radio_options selected=$NB_COMMENTS} 77 78 </li> 79 {/if} 78 80 <li> 79 81 <span class="property">{'Show number of hits'|@translate}</span> -
trunk/admin/themes/default/template/user_list.tpl
r12886 r12887 236 236 </tr> 237 237 238 {if $ACTIVATE_COMMENTS} 238 239 <tr> 239 240 <td>{'Show number of comments'|@translate}</td> … … 245 246 </td> 246 247 </tr> 248 {/if} 247 249 248 250 <tr> -
trunk/admin/user_list.php
r12886 r12887 416 416 $dbfields = array('primary' => array('user_id'), 'update' => array()); 417 417 418 $formfields = 419 array('nb_image_page', 'theme', 'language', 420 'recent_period', 'expand', 'show_nb_comments', 421 'show_nb_hits', 'status', 'enabled_high', 422 'level'); 423 424 $true_false_fields = array('expand', 'show_nb_comments', 425 'show_nb_hits', 'enabled_high'); 418 $formfields = array( 419 'nb_image_page', 'theme', 'language', 420 'recent_period', 'expand', 'show_nb_hits', 421 'status', 'enabled_high', 'level' 422 ); 423 424 $true_false_fields = array('expand', 'show_nb_hits', 'enabled_high'); 425 426 if ($conf['activate_comments']) 427 { 428 array_push($formfields, 'show_nb_comments'); 429 array_push($true_false_fields, 'show_nb_comments'); 430 } 426 431 427 432 foreach ($formfields as $formfield) … … 556 561 'F_ADD_ACTION' => $base_url, 557 562 'F_USERNAME' => @htmlentities($_GET['username'], ENT_COMPAT, 'UTF-8'), 558 'F_FILTER_ACTION' => get_root_url().'admin.php' 563 'F_FILTER_ACTION' => get_root_url().'admin.php', 564 565 'ACTIVATE_COMMENTS' => $conf['activate_comments'], 559 566 )); 560 567 -
trunk/comments.php
r12796 r12887 28 28 include_once(PHPWG_ROOT_PATH.'include/common.inc.php'); 29 29 include_once(PHPWG_ROOT_PATH.'include/functions_comment.inc.php'); 30 31 if (!$conf['activate_comments']) 32 { 33 page_not_found(null); 34 } 30 35 31 36 // +-----------------------------------------------------------------------+ -
trunk/include/category_default.inc.php
r12796 r12887 75 75 ); 76 76 77 if ($ user['show_nb_comments'])77 if ($conf['activate_comments'] and $user['show_nb_comments']) 78 78 { 79 79 $query = ' -
trunk/include/menubar.inc.php
r8728 r12887 258 258 ); 259 259 260 // comments link 261 $block->data['comments'] = 262 array( 263 'TITLE'=>l10n('display last user comments'), 264 'NAME'=>l10n('Comments'), 265 'URL'=> get_root_url().'comments.php', 266 ); 260 if ($conf['activate_comments']) 261 { 262 // comments link 263 $block->data['comments'] = 264 array( 265 'TITLE'=>l10n('display last user comments'), 266 'NAME'=>l10n('Comments'), 267 'URL'=> get_root_url().'comments.php', 268 ); 269 } 267 270 268 271 // about link -
trunk/install/config.sql
r12879 r12887 1 1 -- initial configuration for Piwigo 2 2 3 INSERT INTO piwigo_config (param,value,comment) VALUES ('activate_comments','true','Global parameter for usage of comments system'); 3 4 INSERT INTO piwigo_config (param,value,comment) VALUES ('nb_comment_page','10','number of comments to display on each page'); 4 5 INSERT INTO piwigo_config (param,value,comment) VALUES ('log','true','keep an history of visits on your website'); -
trunk/language/en_UK/admin.lang.php
r12886 r12887 102 102 $lang['Activate Navigation Bar'] = 'Activate navigation bar'; 103 103 $lang['Activate Navigation Thumbnails'] = 'Activate navigation thumbnails'; 104 $lang['Activate comments'] = 'Activate comments'; 104 105 $lang['Activate'] = "Activate"; 105 106 $lang['Active Languages'] = 'Active Languages'; -
trunk/language/fr_CA/admin.lang.php
r12886 r12887 846 846 $lang['Piwigo cannot retrieve upgrade file from server'] = 'Piwigo ne peut pas récupérer le fichier de mise à jour depuis le serveur'; 847 847 $lang['Send connection settings by email'] = 'Envoyer les identifiants par email'; 848 $lang['Activate comments'] = 'Activate comments'; 848 849 849 850 ?> -
trunk/language/fr_FR/admin.lang.php
r12886 r12887 845 845 $lang['Original Size'] = 'Taille originale'; 846 846 $lang['Send connection settings by email'] = 'Envoyer les identifiants par email'; 847 $lang['Activate comments'] = 'Activate comments'; 847 848 848 849 ?> -
trunk/picture.php
r12855 r12887 966 966 967 967 include(PHPWG_ROOT_PATH.'include/picture_rate.inc.php'); 968 include(PHPWG_ROOT_PATH.'include/picture_comment.inc.php'); 968 if ($conf['activate_comments']) 969 { 970 include(PHPWG_ROOT_PATH.'include/picture_comment.inc.php'); 971 } 969 972 if ($metadata_showable and pwg_get_session_var('show_metadata') <> null ) 970 973 { -
trunk/profile.php
r12884 r12887 257 257 $fields = array( 258 258 'nb_image_page', 'language', 259 'expand', 'show_nb_ comments', 'show_nb_hits', 'recent_period', 'theme'259 'expand', 'show_nb_hits', 'recent_period', 'theme' 260 260 ); 261 262 if ($conf['activate_comments']) 263 { 264 array_push($fields, 'show_nb_comments'); 265 } 261 266 262 267 $data = array(); … … 301 306 'EMAIL'=>get_email_address_as_display_text(@$userdata['email']), 302 307 'ALLOW_USER_CUSTOMIZATION'=>$conf['allow_user_customization'], 308 'ACTIVATE_COMMENTS'=>$conf['activate_comments'], 303 309 'NB_IMAGE_PAGE'=>$userdata['nb_image_page'], 304 310 'RECENT_PERIOD'=>$userdata['recent_period'], -
trunk/themes/default/template/profile_content.tpl
r12882 r12887 71 71 {html_radios name='expand' options=$radio_options selected=$EXPAND} 72 72 </li> 73 {if $ACTIVATE_COMMENTS} 73 74 <li> 74 75 <span class="property">{'Show number of comments'|@translate}</span> 75 76 {html_radios name='show_nb_comments' options=$radio_options selected=$NB_COMMENTS} 76 77 </li> 78 {/if} 77 79 <li> 78 80 <span class="property">{'Show number of hits'|@translate}</span>
Note: See TracChangeset
for help on using the changeset viewer.