Changeset 602
- Timestamp:
- Nov 13, 2004, 2:43:53 PM (19 years ago)
- Location:
- trunk
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin.php
r593 r602 133 133 break; 134 134 } 135 case 'cat_options' : 136 { 137 $title = $lang['title_cat_options']; 138 $page_valide = true; 139 break; 140 } 135 141 default: 136 142 $title = $lang['title_default']; break; … … 160 166 161 167 $link_start = PHPWG_ROOT_PATH.'admin.php?page='; 168 $conf_link = $link_start.'configuration&section='; 162 169 //----------------------------------------------------- template initialization 163 170 include(PHPWG_ROOT_PATH.'include/page_header.php'); … … 193 200 'L_AUTH'=>$lang['permissions'], 194 201 'L_UPDATE'=>$lang['update'], 202 'L_CAT_OPTIONS'=>$lang['cat_options_menu'], 195 203 196 'U_CONFIG_GENERAL'=>add_session_id($ link_start.'configuration&section=general' ),197 'U_CONFIG_COMMENTS'=>add_session_id($ link_start.'configuration&section=comments' ),198 'U_CONFIG_DISPLAY'=>add_session_id($ link_start.'configuration&section=default' ),199 'U_CONFIG_UPLOAD'=>add_session_id($ link_start.'configuration&section=upload' ),200 'U_CONFIG_SESSION'=>add_session_id($ link_start.'configuration&section=session' ),201 'U_CONFIG_METADATA'=>add_session_id($ link_start.'configuration&section=metadata' ),204 'U_CONFIG_GENERAL'=>add_session_id($conf_link.'general' ), 205 'U_CONFIG_COMMENTS'=>add_session_id($conf_link.'comments' ), 206 'U_CONFIG_DISPLAY'=>add_session_id($conf_link.'default' ), 207 'U_CONFIG_UPLOAD'=>add_session_id($conf_link.'upload' ), 208 'U_CONFIG_SESSION'=>add_session_id($conf_link.'session' ), 209 'U_CONFIG_METADATA'=>add_session_id($conf_link.'metadata' ), 202 210 'U_SITES'=>add_session_id($link_start.'remote_site'), 203 211 'U_PHPINFO'=>add_session_id($link_start.'admin_phpinfo' ), … … 212 220 'U_HISTORY'=>add_session_id($link_start.'stats' ), 213 221 'U_FAQ'=>add_session_id($link_start.'help' ), 222 'U_CAT_OPTIONS'=>add_session_id($link_start.'cat_options'), 214 223 'U_RETURN'=>add_session_id(PHPWG_ROOT_PATH.'category.php') 215 224 )); -
trunk/admin/cat_list.php
r593 r602 41 41 // | virtual categories management | 42 42 // +-----------------------------------------------------------------------+ 43 // request to adda virtual category43 // request to delete a virtual category 44 44 if (isset($_GET['delete']) and is_numeric($_GET['delete'])) 45 45 { … … 49 49 array_push($infos, $lang['cat_list_virtual_category_deleted']); 50 50 } 51 // request to deletea virtual category51 // request to add a virtual category 52 52 else if (isset($_POST['submit'])) 53 53 { … … 76 76 $query = ' 77 77 INSERT INTO '.CATEGORIES_TABLE.' 78 (name,id_uppercat,rank )78 (name,id_uppercat,rank,site_id) 79 79 VALUES 80 (\''.$_POST['virtual_name'].'\','.$parent_id.','.$_POST['rank'].' )80 (\''.$_POST['virtual_name'].'\','.$parent_id.','.$_POST['rank'].',NULL) 81 81 ;'; 82 82 pwg_query($query); -
trunk/admin/configuration.php
r593 r602 200 200 case 'comments' : 201 201 { 202 $show_yes = ($conf['show_comments']=='true')?'checked="checked"':'';203 $show_no = ($conf['show_comments']=='false')?'checked="checked"':'';204 202 $all_yes = ($conf['comments_forall']=='true')?'checked="checked"':''; 205 203 $all_no = ($conf['comments_forall']=='false')?'checked="checked"':''; … … 211 209 array( 212 210 'L_CONF_TITLE'=>$lang['conf_comments_title'], 213 'L_CONF_SHOW_COMMENTS'=>$lang['conf_show_comments'],214 'L_CONF_SHOW_COMMENTS_INFO'=>$lang['conf_show_comments_info'],215 211 'L_CONF_COMMENTS_ALL'=>$lang['conf_comments_forall'], 216 212 'L_CONF_COMMENTS_ALL_INFO'=>$lang['conf_comments_forall_info'], … … 221 217 222 218 'NB_COMMENTS_PAGE'=>$conf['nb_comment_page'], 223 'SHOW_COMMENTS_YES'=>$show_yes,224 'SHOW_COMMENTS_NO'=>$show_no,225 219 'COMMENTS_ALL_YES'=>$all_yes, 226 220 'COMMENTS_ALL_NO'=>$all_no, … … 271 265 case 'upload' : 272 266 { 273 $upload_yes = ($conf['upload_available']=='true')?'checked="checked"':'';274 $upload_no = ($conf['upload_available']=='false')?'checked="checked"':'';275 276 267 $template->assign_block_vars( 277 268 'upload', 278 269 array( 279 270 'L_CONF_TITLE'=>$lang['conf_upload_title'], 280 'L_CONF_UPLOAD'=>$lang['conf_authorize_upload'],281 'L_CONF_UPLOAD_INFO'=>$lang['conf_authorize_upload_info'],282 271 'L_CONF_MAXSIZE'=>$lang['conf_upload_maxfilesize'], 283 272 'L_CONF_MAXSIZE_INFO'=>$lang['conf_upload_maxfilesize_info'], … … 296 285 'TN_UPLOAD_MAXWIDTH'=>$conf['upload_maxwidth_thumbnail'], 297 286 'TN_UPLOAD_MAXHEIGHT'=>$conf['upload_maxheight_thumbnail'], 298 'UPLOAD_YES'=>$upload_yes,299 'UPLOAD_NO'=>$upload_no300 287 )); 301 288 break; -
trunk/admin/remote_site.php
r593 r602 485 485 // +-----------------------------------------------------------------------+ 486 486 $template->set_filenames(array('remote_site'=>'admin/remote_site.tpl')); 487 488 $action = PHPWG_ROOT_PATH.'admin.php?page=remote_site';489 487 490 488 $template->assign_vars( -
trunk/admin/update.php
r593 r602 604 604 ' ', 605 605 array(), 606 'introduction.category_option'); 606 'introduction.category_option', 607 array()); 607 608 } 608 609 // +-----------------------------------------------------------------------+ -
trunk/category.php
r593 r602 296 296 { 297 297 // upload a picture in the category 298 if ( is_numeric( $page['cat'])299 300 and $conf['upload_available']301 and $page['cat_uploadable'])298 if (is_numeric($page['cat']) 299 and $page['cat_site_id'] == 1 300 and $page['cat_dir'] != '' 301 and $page['cat_uploadable']) 302 302 { 303 303 $url = PHPWG_ROOT_PATH.'upload.php?cat='.$page['cat']; -
trunk/include/category_default.inc.php
r593 r602 121 121 ); 122 122 123 if ($conf['show_comments'] and $user['show_nb_comments']) 123 if ($user['show_nb_comments'] 124 and is_numeric($page['cat']) 125 and $page['cat_commentable']) 124 126 { 125 127 $query = ' -
trunk/include/config.inc.php
r601 r602 168 168 // show_gt : display generation time at the bottom of each page 169 169 $conf['show_gt'] = true; 170 171 // Default options for new categories. 172 // 173 // Some options for categories (commentable, uploadable, status, visible) 174 // must be set directly in the database by changing the corresponding 175 // default values of the column. Examples : 176 // 177 // ALTER TABLE phpwebgallery_categories ALTER visible SET DEFAULT 'true'; 178 // ALTER TABLE phpwebgallery_categories ALTER status SET DEFAULT 'private'; 179 // ALTER TABLE phpwebgallery_categories ALTER uploadable SET DEFAULT 'true'; 180 // ALTER TABLE phpwebgallery_categories ALTER commentable SET DEFAULT 'false'; 181 // 182 // MySQL default values are used when inserting a row and that no value is 183 // given for the column. In PhpWebGallery, the above columns are not valued 184 // during categories insertion, so default values are important. 170 185 ?> -
trunk/include/functions_category.inc.php
r593 r602 309 309 $infos = array( 'nb_images','id_uppercat','comment','site_id','galleries_url' 310 310 ,'dir','date_last','uploadable','status','visible' 311 ,'representative_picture_id','uppercats' );311 ,'representative_picture_id','uppercats','commentable' ); 312 312 313 313 $query = 'SELECT '.implode( ',', $infos ); … … 455 455 $page['cat_site_id'] = $result['site_id']; 456 456 $page['cat_uploadable'] = $result['uploadable']; 457 $page['cat_commentable'] = $result['commentable']; 457 458 $page['uppercats'] = $result['uppercats']; 458 459 $page['title'] = get_cat_display_name( $page['cat_name'],' - ','',false); … … 912 913 $indent, 913 914 $selecteds, 914 $blockname) 915 $blockname, 916 $CSS_classes) 915 917 { 916 918 global $template,$user; … … 924 926 { 925 927 $selected = ' selected="selected"'; 928 } 929 930 $class = ''; 931 foreach (array_keys($CSS_classes) as $CSS_class) 932 { 933 if (in_array($category['id'], $CSS_classes[$CSS_class])) 934 { 935 $class = $CSS_class; 936 } 926 937 } 927 938 … … 930 941 array('SELECTED'=>$selected, 931 942 'VALUE'=>$category['id'], 943 'CLASS'=>$class, 932 944 'OPTION'=>$indent.'- '.$category['name'] 933 945 )); … … 936 948 $indent.str_repeat(' ',3), 937 949 $selecteds, 938 $blockname); 950 $blockname, 951 $CSS_classes); 939 952 } 940 953 } -
trunk/install/config.sql
r555 r602 6 6 INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('default_template','default','Default gallery style'); 7 7 INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('access','free','access type to your gallery (free|restricted)'); 8 INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('show_comments','true','display the users comments');9 8 INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('nb_comment_page','10','number of comments to display on each page'); 10 INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('upload_available','false','authorizing the upload of pictures by users');11 9 INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('upload_maxfilesize','150','maximum filesize for the uploaded pictures'); 12 10 INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('upload_maxwidth','800','maximum width authorized for the uploaded images'); -
trunk/install/dbscheme.txt
r573 r602 26 26 column:rank table:categories type:tinyint nullable:Y length:3 signed:N 27 27 column:status table:categories type:enum('public','private') nullable:N 28 column:site_id table:categories type:tinyint nullable: Nlength:4 signed:N28 column:site_id table:categories type:tinyint nullable:Y length:4 signed:N 29 29 column:visible table:categories type:enum('true','false') nullable:N 30 30 column:uploadable table:categories type:enum('true','false') nullable:N 31 31 column:representative_picture_id table:categories type:mediumint nullable:Y length:8 signed:N 32 32 column:uppercats table:categories type:varchar nullable:N length:255 binary:N 33 column:commentable table:categories type:enum('true','false') nullable:N 33 34 column:id table:comments type:int nullable:N length:11 signed:N 34 35 column:image_id table:comments type:mediumint nullable:N length:8 signed:N … … 46 47 column:id table:groups type:smallint nullable:N length:5 signed:N 47 48 column:name table:groups type:varchar nullable:N length:255 binary:N 48 column:date table:history type: int nullable:N length:11 signed:Y49 column:date table:history type:datetime nullable:N 49 50 column:login table:history type:varchar nullable:Y length:15 binary:N 50 51 column:IP table:history type:varchar nullable:N length:50 binary:N … … 117 118 PK:group_access_pk table:group_access column:cat_id 118 119 PK:groups_pk table:groups column:id 120 PK:history_pk table:history column:date 119 121 PK:image_category_pk table:image_category column:image_id 120 122 PK:image_category_pk table:image_category column:category_id … … 136 138 index:images_i2 table:images column:date_available 137 139 index:images_i1 table:images column:storage_category_id 140 index:images_i3 table:images column:average_rate 141 index:images_i4 table:images column:hit 138 142 index:sites_ui1 table:sites column:galleries_url 139 143 index:users_ui1 table:users column:username -
trunk/install/phpwebgallery_structure.sql
r537 r602 20 20 rank tinyint(3) unsigned default NULL, 21 21 status enum('public','private') NOT NULL default 'public', 22 site_id tinyint(4) unsigned NOT NULLdefault '1',22 site_id tinyint(4) unsigned default '1', 23 23 visible enum('true','false') NOT NULL default 'true', 24 24 uploadable enum('true','false') NOT NULL default 'false', 25 25 representative_picture_id mediumint(8) unsigned default NULL, 26 26 uppercats varchar(255) NOT NULL default '', 27 commentable enum('true','false') NOT NULL default 'true', 27 28 PRIMARY KEY (id), 28 29 KEY categories_i2 (id_uppercat) … … 101 102 file varchar(50) default NULL, 102 103 picture varchar(150) default NULL, 103 PRIMARY KEY `date` (`date`)104 PRIMARY KEY (date) 104 105 ) TYPE=MyISAM; 105 106 … … 142 143 PRIMARY KEY (id), 143 144 KEY images_i2 (date_available), 144 KEY images_i1 (storage_category_id) 145 KEY images_i1 (storage_category_id), 146 KEY images_i3 (average_rate), 147 KEY images_i4 (hit) 145 148 ) TYPE=MyISAM; 146 149 -
trunk/language/en_UK.iso-8859-1/admin.lang.php
r593 r602 109 109 $lang['title_default'] = 'PhpWebGallery administration'; 110 110 $lang['title_waiting'] = 'Pictures waiting for validation'; 111 $lang['title_cat_options'] = 'Categories options'; 111 112 112 113 //Error messages … … 134 135 // Configuration -> comments 135 136 $lang['conf_comments_title'] = 'Users comments'; 136 $lang['conf_show_comments'] = 'Show users comments';137 $lang['conf_show_comments_info'] = 'Display the users comments under each picture ?';138 137 $lang['conf_comments_forall'] = 'Comments for all ?'; 139 138 $lang['conf_comments_forall_info'] = 'Even guest not registered can post comments'; … … 156 155 // Configuration -> upload 157 156 $lang['conf_upload_title'] = 'Users upload'; 158 $lang['conf_authorize_upload'] = 'Authorize upload of pictures';159 $lang['conf_authorize_upload_info'] = '';160 157 $lang['conf_upload_maxfilesize'] = 'Maximum filesize'; 161 158 $lang['conf_upload_maxfilesize_info'] = 'Maximum filesize for the uploaded pictures. Must be a number between 10 and 1000 KB.'; … … 326 323 $lang['cat_list_virtual_category_added'] = 'virtual category added'; 327 324 $lang['cat_list_virtual_category_deleted'] = 'virtual category deleted'; 325 326 $lang['cat_options_menu'] = 'Options'; 327 $lang['cat_options_menu_upload'] = 'upload'; 328 $lang['cat_options_menu_visible'] = 'lock'; 329 $lang['cat_options_menu_comments'] = 'comments'; 330 $lang['cat_options_menu_status'] = 'access'; 331 $lang['cat_options_upload_true'] = 'authorize upload'; 332 $lang['cat_options_upload_false'] = 'forbid upload'; 333 $lang['cat_options_upload_info'] = '(multi)select categories to make them uploadable or not. Upload is not applicable to virtual categories and to categories from a remote site.'; 334 $lang['cat_options_comments_true'] = 'authorize comments'; 335 $lang['cat_options_comments_false'] = 'forbid comments'; 336 $lang['cat_options_comments_info'] = '(multi)select categories to make them commentable or not. By inheritance, an element is commentable if it belongs at least to one commentable category.'; 328 337 ?> -
trunk/language/fr_FR.iso-8859-1/admin.lang.php
r593 r602 136 136 // Configuration -> comments 137 137 $lang['conf_comments_title'] = 'Configuration des commentaires'; 138 $lang['conf_show_comments'] = 'Commentaires utilisateurs';139 $lang['conf_show_comments_info'] = 'Afficher les commentaires utilisateurs sous chaque images ?';140 138 $lang['conf_comments_forall'] = 'Autoriser pour tous ?'; 141 139 $lang['conf_comments_forall_info'] = 'Même les invités non enregistrés peuvent déposer les messages'; … … 160 158 // Configuration -> upload 161 159 $lang['conf_upload_title'] = 'Configuration de l\'envoi d\'images par les utilisateurs'; 162 $lang['conf_authorize_upload'] = 'Autoriser l\'ajout d\'images';163 $lang['conf_authorize_upload_info'] = 'Autoriser l\'ajout d\'image par les utilisateurs dans les catégories du site (pas sur un site distant). Ceci est un paramètre général, il est nécessaire pour autoriser l\'upload catégorie par catégorie.';164 160 $lang['conf_upload_maxfilesize'] = 'Poids maximum'; 165 161 $lang['conf_upload_maxfilesize_info'] = 'Poids maximum autorisé pour les images uploadées. Celui-ci doit être un entier compris entre 10 et 1000, en Ko.'; -
trunk/picture.php
r598 r602 754 754 $result = pwg_query($query); 755 755 $categories = ''; 756 $page['show_comments'] = false; 756 757 while ($row = mysql_fetch_array($result)) 757 758 { … … 762 763 $cat_info = get_cat_info($row['category_id']); 763 764 $categories .= get_cat_display_name($cat_info['name'], ' >'); 765 // the picture is commentable if it belongs at least to one category which 766 // is commentable 767 if ($cat_info['commentable']) 768 { 769 $page['show_comments'] = true; 770 } 764 771 } 765 772 $template->assign_block_vars( … … 921 928 922 929 //---------------------------------------------------- users's comments display 923 if ( $conf['show_comments'])930 if ($page['show_comments']) 924 931 { 925 932 // number of comment for this picture -
trunk/search.php
r593 r602 353 353 ' ', 354 354 $selecteds, 355 'category_option'); 355 'category_option', 356 array()); 356 357 357 358 $categories_selected = ''; -
trunk/template/default/admin.tpl
r589 r602 39 39 <li><a class="adminMenu" href="{U_CATEGORIES}">{L_MANAGE}</a></li> 40 40 <li><a class="adminMenu" href="{U_UPLOAD}">{L_UPLOAD}</a></li> 41 <li><a class="adminMenu" href="{U_CAT_OPTIONS}">{L_CAT_OPTIONS}</a></li> 41 42 </ul> 42 43 </div> -
trunk/template/default/admin/configuration.tpl
r555 r602 52 52 </tr> 53 53 <tr> 54 <td width="70%"><strong>{comments.L_CONF_SHOW_COMMENTS} :</strong><br /><span class="small">{comments.L_CONF_SHOW_COMMENTS_INFO}</span></td> 55 <td class="row1"><input type="radio" class="radio" name="show_comments" value="true" {comments.SHOW_COMMENTS_YES} />{L_YES} 56 <input type="radio" class="radio" name="show_comments" value="false" {comments.SHOW_COMMENTS_NO} />{L_NO}</td> 57 </tr> 58 <tr> 59 <td><strong>{comments.L_CONF_COMMENTS_ALL} :</strong><br /><span class="small">{comments.L_CONF_COMMENTS_ALL_INFO}</span></td> 54 <td width="70%"><strong>{comments.L_CONF_COMMENTS_ALL} :</strong><br /><span class="small">{comments.L_CONF_COMMENTS_ALL_INFO}</span></td> 60 55 <td class="row1"><input type="radio" class="radio" name="comments_forall" value="true" {comments.COMMENTS_ALL_YES} />{L_YES} 61 56 <input type="radio" class="radio" name="comments_forall" value="false" {comments.COMMENTS_ALL_NO} />{L_NO}</td> … … 117 112 </tr> 118 113 <tr> 119 <td width="70%"><strong>{upload.L_CONF_UPLOAD} :</strong><br /><span class="small">{upload.L_CONF_UPLOAD_INFO}</span></td> 120 <td class="row1"><input type="radio" class="radio" name="upload_available" value="true" {upload.UPLOAD_YES} />{L_YES} 121 <input type="radio" class="radio" name="upload_available" value="false" {upload.UPLOAD_NO} />{L_NO}</td> 122 </tr> 123 <tr> 124 <td><strong>{upload.L_CONF_MAXSIZE} :</strong><br /><span class="small">{upload.L_CONF_MAXSIZE_INFO}</span></td> 114 <td width="70%"><strong>{upload.L_CONF_MAXSIZE} :</strong><br /><span class="small">{upload.L_CONF_MAXSIZE_INFO}</span></td> 125 115 <td class="row1"><input type="text" size="4" maxlength="4" name="upload_maxfilesize" value="{upload.UPLOAD_MAXSIZE}" /></td> 126 116 </tr> -
trunk/template/default/default.css
r579 r602 426 426 text-align:left; 427 427 } 428 429 .confMenu { 430 background-color:#444444; 431 text-align:center; 432 } 433 434 .confMenu a { 435 padding:2px; 436 border:1px solid gray; 437 background-color:#505050; 438 color:#fff48e; 439 color:lightgray; 440 } 441 442 .confMenu a:hover { 443 color:orange; 444 text-decoration:none; 445 } 446 447 .confMenu a.opened { 448 background-color:gray; 449 color:white; 450 text-decoration:none; 451 } 452 453 .optionTrue { 454 color:lightgreen; 455 } 456 457 .optionFalse { 458 color:#ffe1e1; 459 }
Note: See TracChangeset
for help on using the changeset viewer.