Changeset 642
- Timestamp:
- Dec 12, 2004, 10:06:39 PM (19 years ago)
- Location:
- trunk
- Files:
-
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin.php
r631 r642 31 31 include_once( PHPWG_ROOT_PATH.'include/common.inc.php' ); 32 32 include_once( PHPWG_ROOT_PATH.'admin/include/isadmin.inc.php' ); 33 34 33 //--------------------------------------- validating page and creation of title 35 34 $page_valide = false; … … 86 85 { 87 86 $result = get_cat_info( $page['cat'] ); 88 $name = get_cat_display_name( $result['name'],' > ', '');87 $name = get_cat_display_name($result['name'], ''); 89 88 $title.= ' "'.$name.'"'; 90 89 } … … 203 202 'L_CAT_COMMENTS'=>$lang['comments'], 204 203 'L_CAT_VISIBLE'=>$lang['lock'], 205 'L_CAT_STATUS'=>$lang[' permissions'],204 'L_CAT_STATUS'=>$lang['admin_menu_cat_status'], 206 205 207 206 'U_CONFIG_GENERAL'=>add_session_id($conf_link.'general' ), -
trunk/admin/cat_list.php
r635 r642 60 60 if (!count($errors)) 61 61 { 62 $parent_id = !empty($_GET['parent_id'])?$_GET['parent_id']:'NULL'; 63 // As we don't create a virtual category every day, let's do (far) too 64 // much queries 62 $parent_id = !empty($_GET['parent_id'])?$_GET['parent_id']:'NULL'; 63 64 if ($parent_id != 'NULL') 65 { 66 $query = ' 67 SELECT id,uppercats,global_rank,visible,status 68 FROM '.CATEGORIES_TABLE.' 69 WHERE id = '.$parent_id.' 70 ;'; 71 $row = mysql_fetch_array(pwg_query($query)); 72 $parent = array('id' => $row['id'], 73 'uppercats' => $row['uppercats'], 74 'visible' => $row['visible'], 75 'status' => $row['status'], 76 'global_rank' => $row['global_rank']); 77 } 78 79 $insert = array(); 80 $insert{'name'} = $_POST['virtual_name']; 81 $insert{'rank'} = $_POST['rank']; 82 $insert{'commentable'} = $conf['newcat_default_commentable']; 83 $insert{'uploadable'} = $conf['newcat_default_uploadable']; 84 85 if (isset($parent)) 86 { 87 $insert{'id_uppercat'} = $parent{'id'}; 88 // at creation, must a category be visible or not ? Warning : if 89 // the parent category is invisible, the category is automatically 90 // create invisible. (invisible = locked) 91 if ('false' == $parent['visible']) 92 { 93 $insert{'visible'} = 'false'; 94 } 95 else 96 { 97 $insert{'visible'} = $conf['newcat_default_visible']; 98 } 99 // at creation, must a category be public or private ? Warning : 100 // if the parent category is private, the category is 101 // automatically create private. 102 if ('private' == $parent['status']) 103 { 104 $insert{'status'} = 'private'; 105 } 106 else 107 { 108 $insert{'status'} = $conf['newcat_default_status']; 109 } 110 } 111 else 112 { 113 $insert{'visible'} = $conf['newcat_default_visible']; 114 $insert{'status'} = $conf['newcat_default_status']; 115 } 116 117 $inserts = array($insert); 65 118 66 119 // we have then to add the virtual category 67 $query = ' 68 INSERT INTO '.CATEGORIES_TABLE.' 69 (name,id_uppercat,rank,site_id) 70 VALUES 71 (\''.$_POST['virtual_name'].'\','.$parent_id.','.$_POST['rank'].',NULL) 72 ;'; 73 pwg_query($query); 74 120 $dbfields = array('site_id','name','id_uppercat','rank','commentable', 121 'uploadable','visible','status'); 122 mass_inserts(CATEGORIES_TABLE, $dbfields, $inserts); 123 75 124 // And last we update the uppercats 76 125 $query = ' … … 79 128 ;'; 80 129 $my_id = array_pop(mysql_fetch_array(pwg_query($query))); 81 82 if ($parent_id != 'NULL') 83 { 84 $query = ' 85 SELECT uppercats, global_rank 86 FROM '.CATEGORIES_TABLE.' 87 WHERE id = '.$parent_id.' 88 ;'; 89 $result = pwg_query($query); 90 $row = mysql_fetch_array($result); 91 92 $parent_uppercats = $row['uppercats']; 93 $parent_global_rank = $row['global_rank']; 94 } 95 96 $query = ' 97 UPDATE '.CATEGORIES_TABLE.' 98 '; 99 if (!empty($parent_uppercats)) 100 { 101 $query.= " SET uppercats = CONCAT('".$parent_uppercats."',',',id)"; 130 131 $query = ' 132 UPDATE '.CATEGORIES_TABLE; 133 if (isset($parent)) 134 { 135 $query.= " 136 SET uppercats = CONCAT('".$parent['uppercats']."',',',id) 137 , global_rank = CONCAT('".$parent['global_rank']."','.',rank)"; 102 138 } 103 139 else 104 140 { 105 $query.= ' SET uppercats = id'; 106 } 107 if (!empty($parent_global_rank)) 108 { 109 $query.= " , global_rank = CONCAT('".$parent_global_rank."','.',rank)"; 110 } 111 else 112 { 113 $query.= ' , uppercats = id'; 141 $query.= ' 142 SET uppercats = id 143 , global_rank = id'; 114 144 } 115 145 $query.= ' … … 143 173 { 144 174 $categories[$row['rank']] = $row; 175 $categories[$row['rank']]['nb_subcats'] = 0; 145 176 } 146 177 // +-----------------------------------------------------------------------+ … … 149 180 if (isset($_GET['parent_id'])) 150 181 { 151 $separator = ' <span style="font-size:15px">→</span> ';152 182 $base_url = PHPWG_ROOT_PATH.'admin.php?page=cat_list'; 153 183 … … 155 185 $navigation.= $lang['home']; 156 186 $navigation.= '</a>'; 157 $navigation.= $ separator;187 $navigation.= $conf['level_separator']; 158 188 159 189 $current_category = get_cat_info($_GET['parent_id']); 160 190 $navigation.= get_cat_display_name($current_category['name'], 161 $separator,162 191 $base_url.'&parent_id=', 163 192 false); … … 338 367 // | Categories display | 339 368 // +-----------------------------------------------------------------------+ 340 while (list($id,$category) = each($categories)) 369 $ranks = array(); 370 foreach ($categories as $category) 371 { 372 $ranks[$category['id']] = $category['rank']; 373 } 374 375 $query = ' 376 SELECT id_uppercat, COUNT(*) AS nb_subcats 377 FROM '. CATEGORIES_TABLE.' 378 WHERE id_uppercat IN ('.implode(',', array_keys($ranks)).') 379 GROUP BY id_uppercat 380 ;'; 381 $result = pwg_query($query); 382 while ($row = mysql_fetch_array($result)) 383 { 384 $categories[$ranks[$row['id_uppercat']]]['nb_subcats'] = $row['nb_subcats']; 385 } 386 387 foreach ($categories as $category) 341 388 { 342 389 $images_folder = PHPWG_ROOT_PATH.'template/'; … … 357 404 else 358 405 { 359 // (Gweltas) May be should we have to introduce a computed field in the 360 // table to avoid this query -> (z0rglub) no because the number of 361 // sub-categories depends on permissions 362 $query = ' 363 SELECT COUNT(id) AS nb_sub_cats 364 FROM '. CATEGORIES_TABLE.' 365 WHERE id_uppercat = '.$category['id'].' 366 ;'; 367 $row = mysql_fetch_array(pwg_query($query)); 368 369 if ($row['nb_sub_cats'] > 0) 406 if ($category['nb_subcats'] > 0) 370 407 { 371 408 $image_src = $images_folder.'/icon_subfolder.gif'; -
trunk/admin/cat_modify.php
r635 r642 104 104 $url = PHPWG_ROOT_PATH.'admin.php?page=cat_list&parent_id='; 105 105 $navigation = '<a class="" href="'.add_session_id(PHPWG_ROOT_PATH.'admin.php?page=cat_list').'">'; 106 $navigation.= $lang['home'].'</a> <span style="font-size:15px">→</span>';106 $navigation.= $lang['home'].'</a>'.$conf['level_separator']; 107 107 108 108 $navigation.= get_cat_display_name_cache( 109 109 $category['uppercats'], 110 ' <span style="font-size:15px">→</span>',111 110 $url); 112 111 -
trunk/admin/group_perm.php
r593 r642 105 105 // category name 106 106 $cat_infos = get_cat_info( $row['id'] ); 107 $name = get_cat_display_name( $cat_infos['name'],' > ', 108 'font-weight:bold;' ); 107 $name = get_cat_display_name($cat_infos['name']); 109 108 $vtp->setVar( $sub, 'category.name', $name ); 110 109 // any subcat forbidden for this group ? -
trunk/admin/include/functions.php
r638 r642 789 789 { 790 790 $sub_dirs = array(); 791 791 792 792 if ( $opendir = opendir( $basedir ) ) 793 793 { -
trunk/admin/infos_images.php
r606 r642 249 249 $current_category = get_cat_info($_GET['cat_id']); 250 250 $url = PHPWG_ROOT_PATH.'admin.php?page=infos_images&cat_id='; 251 $category_path = get_cat_display_name($current_category['name'], 252 '->', 253 $url); 251 $category_path = get_cat_display_name($current_category['name'], $url); 254 252 255 253 $form_action = PHPWG_ROOT_PATH.'admin.php'; -
trunk/admin/picture_modify.php
r640 r642 163 163 $date = isset($_POST['date_creation']) && empty($errors) 164 164 ?$_POST['date_creation']:date_convert_back(@$row['date_creation']); 165 165 166 $url = PHPWG_ROOT_PATH.'admin.php?page=cat_modify&cat_id='; 166 167 $storage_category = get_cat_display_name_cache($row['uppercats'], 167 ' → ', 168 '', 168 $url, 169 169 false); 170 170 //----------------------------------------------------- template initialization -
trunk/admin/remote_site.php
r638 r642 177 177 function insert_remote_category($xml_content, $site_id, $id_uppercat, $level) 178 178 { 179 global $counts, $removes ;179 global $counts, $removes, $conf; 180 180 181 181 $uppercats = ''; … … 185 185 { 186 186 $query = ' 187 SELECT name,uppercats,dir187 SELECT id,name,uppercats,dir,status,visible 188 188 FROM '.CATEGORIES_TABLE.' 189 189 WHERE id = '.$id_uppercat.' 190 190 ;'; 191 191 $row = mysql_fetch_array(pwg_query($query)); 192 $parent = array('id' => $row['id'], 193 'name' => $row['name'], 194 'dir' => $row['dir'], 195 'uppercats' => $row['uppercats'], 196 'visible' => $row['visible'], 197 'status' => $row['status']); 192 198 193 $uppercats = $row['uppercats'];194 $name = $row['name'];195 196 199 insert_remote_element($xml_content, $id_uppercat); 197 200 } … … 225 228 $inserts = array(); 226 229 230 // calculate default value at category creation 231 $create_values = array(); 232 if (isset($parent)) 233 { 234 // at creation, must a category be visible or not ? Warning : if 235 // the parent category is invisible, the category is automatically 236 // create invisible. (invisible = locked) 237 if ('false' == $parent['visible']) 238 { 239 $create_values{'visible'} = 'false'; 240 } 241 else 242 { 243 $create_values{'visible'} = $conf['newcat_default_visible']; 244 } 245 // at creation, must a category be public or private ? Warning : 246 // if the parent category is private, the category is 247 // automatically create private. 248 if ('private' == $parent['status']) 249 { 250 $create_values{'status'} = 'private'; 251 } 252 else 253 { 254 $create_values{'status'} = $conf['newcat_default_status']; 255 } 256 } 257 else 258 { 259 $create_values{'visible'} = $conf['newcat_default_visible']; 260 $create_values{'status'} = $conf['newcat_default_status']; 261 } 262 227 263 foreach ($xml_dirs as $xml_dir) 228 264 { … … 240 276 $insert{'site_id'} = $site_id; 241 277 $insert{'uppercats'} = 'undef'; 242 if (is_numeric($id_uppercat)) 278 $insert{'commentable'} = $conf['newcat_default_commentable']; 279 $insert{'uploadable'} = 'false'; 280 $insert{'status'} = $create_values{'status'}; 281 $insert{'visible'} = $create_values{'visible'}; 282 if (isset($parent)) 243 283 { 244 $insert{'id_uppercat'} = $ id_uppercat;284 $insert{'id_uppercat'} = $parent['id']; 245 285 } 246 286 array_push($inserts, $insert); … … 252 292 { 253 293 // inserts all found categories 254 $dbfields = array('dir','name','site_id','uppercats','id_uppercat'); 294 $dbfields = array('dir','name','site_id','uppercats','id_uppercat', 295 'commentable','uploadable','status','visible'); 255 296 mass_inserts(CATEGORIES_TABLE, $dbfields, $inserts); 256 297 $counts{'new_categories'}+= count($inserts); … … 258 299 // updating uppercats field 259 300 $query = ' 260 UPDATE '.CATEGORIES_TABLE.' 261 SET uppercats = '; 262 if ($uppercats != '') 263 { 264 $query.= "CONCAT('".$uppercats."',',',id)"; 301 UPDATE '.CATEGORIES_TABLE; 302 if (isset($parent)) 303 { 304 $query.= " 305 SET uppercats = CONCAT('".$parent['uppercats']."',',',id) 306 WHERE id_uppercat = ".$id_uppercat; 265 307 } 266 308 else 267 309 { 268 $query.= 'id'; 269 } 270 $query.= ' 271 WHERE id_uppercat '; 272 if (!is_numeric($id_uppercat)) 273 { 274 $query.= 'IS NULL'; 275 } 276 else 277 { 278 $query.= '= '.$id_uppercat; 310 $query.= ' 311 SET uppercats = id 312 WHERE id_uppercat IS NULL'; 279 313 } 280 314 $query.= ' -
trunk/admin/update.php
r638 r642 48 48 if (is_numeric($id_uppercat)) 49 49 { 50 $query = 'SELECT name,uppercats,dir FROM '.CATEGORIES_TABLE; 51 $query.= ' WHERE id = '.$id_uppercat; 52 $query.= ';'; 53 $row = mysql_fetch_array( pwg_query( $query)); 54 $uppercats = $row['uppercats']; 55 $name = $row['name']; 56 $dir = $row['dir']; 57 58 $upper_array = explode( ',', $uppercats); 50 $query = ' 51 SELECT id,name,uppercats,dir,visible,status 52 FROM '.CATEGORIES_TABLE.' 53 WHERE id = '.$id_uppercat.' 54 ;'; 55 $row = mysql_fetch_array(pwg_query($query)); 56 $parent = array('id' => $row['id'], 57 'name' => $row['name'], 58 'dir' => $row['dir'], 59 'uppercats' => $row['uppercats'], 60 'visible' => $row['visible'], 61 'status' => $row['status']); 62 63 $upper_array = explode( ',', $parent['uppercats']); 59 64 60 65 $local_dir = ''; … … 62 67 $database_dirs = array(); 63 68 $query = ' 64 SELECT id,dir FROM '.CATEGORIES_TABLE.' 65 WHERE id IN ('.$uppercats.') 66 ;'; 67 $result = pwg_query( $query); 69 SELECT id,dir 70 FROM '.CATEGORIES_TABLE.' 71 WHERE id IN ('.$parent['uppercats'].') 72 ;'; 73 $result = pwg_query($query); 68 74 while ($row = mysql_fetch_array($result)) 69 75 { … … 79 85 // 1. display the category name to update 80 86 $output = '<ul class="menu">'; 81 $output.= '<li><strong>'.$ name.'</strong>';82 $output.= ' [ '.$ dir.' ]';87 $output.= '<li><strong>'.$parent['name'].'</strong>'; 88 $output.= ' [ '.$parent['dir'].' ]'; 83 89 $output.= '</li>'; 84 90 … … 95 101 $sub_category_dirs = array(); 96 102 $query = ' 97 SELECT id,dir FROM '.CATEGORIES_TABLE.' 103 SELECT id,dir 104 FROM '.CATEGORIES_TABLE.' 98 105 WHERE site_id = 1 99 106 '; … … 132 139 // array of new categories to insert 133 140 $inserts = array(); 141 142 // calculate default value at category creation 143 $create_values = array(); 144 if (isset($parent)) 145 { 146 // at creation, must a category be visible or not ? Warning : if 147 // the parent category is invisible, the category is automatically 148 // create invisible. (invisible = locked) 149 if ('false' == $parent['visible']) 150 { 151 $create_values{'visible'} = 'false'; 152 } 153 else 154 { 155 $create_values{'visible'} = $conf['newcat_default_visible']; 156 } 157 // at creation, must a category be public or private ? Warning : 158 // if the parent category is private, the category is 159 // automatically create private. 160 if ('private' == $parent['status']) 161 { 162 $create_values{'status'} = 'private'; 163 } 164 else 165 { 166 $create_values{'status'} = $conf['newcat_default_status']; 167 } 168 } 169 else 170 { 171 $create_values{'visible'} = $conf['newcat_default_visible']; 172 $create_values{'status'} = $conf['newcat_default_status']; 173 } 134 174 135 175 foreach ($fs_subdirs as $fs_subdir) … … 140 180 if (!is_numeric($category_id)) 141 181 { 182 $insert = array(); 183 142 184 if (preg_match('/^[a-zA-Z0-9-_.]+$/', $fs_subdir)) 143 185 { 144 186 $name = str_replace('_', ' ', $fs_subdir); 145 187 146 $value = "('".$fs_subdir."','".$name."',1"; 147 if (!is_numeric($id_uppercat)) 148 { 149 $value.= ',NULL'; 150 } 151 else 152 { 153 $value.= ','.$id_uppercat; 154 } 155 $value.= ",'undef'"; 156 $value.= ')'; 157 array_push($inserts, $value); 188 $insert{'dir'} = $fs_subdir; 189 $insert{'name'} = $name; 190 $insert{'site_id'} = 1; 191 $insert{'uppercats'} = 'undef'; 192 $insert{'commentable'} = $conf['newcat_default_commentable']; 193 $insert{'uploadable'} = $conf['newcat_default_uploadable']; 194 $insert{'status'} = $create_values{'status'}; 195 $insert{'visible'} = $create_values{'visible'}; 196 197 if (isset($parent)) 198 { 199 $insert{'id_uppercat'} = $parent['id']; 200 } 201 202 array_push($inserts, $insert); 158 203 } 159 204 else … … 168 213 if (count($inserts) > 0) 169 214 { 170 $query = ' 171 INSERT INTO '.CATEGORIES_TABLE.' 172 (dir,name,site_id,id_uppercat,uppercats) VALUES 173 '; 174 $query.= implode(',', $inserts); 175 $query.= ' 176 ;'; 177 pwg_query($query); 178 215 $dbfields = array( 216 'dir','name','site_id','id_uppercat','uppercats','commentable', 217 'uploadable','visible','status' 218 ); 219 mass_inserts(CATEGORIES_TABLE, $dbfields, $inserts); 220 179 221 $counts['new_categories']+= count($inserts); 180 222 // updating uppercats field 181 223 $query = ' 182 UPDATE '.CATEGORIES_TABLE.' 183 SET uppercats = '; 184 if ($uppercats != '') 185 { 186 $query.= "CONCAT('".$uppercats."',',',id)"; 224 UPDATE '.CATEGORIES_TABLE; 225 if (isset($parent)) 226 { 227 $query.= " 228 SET uppercats = CONCAT('".$parent['uppercats']."',',',id) 229 WHERE id_uppercat = ".$parent['id']; 187 230 } 188 231 else 189 232 { 190 $query.= 'id'; 191 } 192 $query.= ' 193 WHERE id_uppercat '; 194 if (!is_numeric($id_uppercat)) 195 { 196 $query.= 'IS NULL'; 197 } 198 else 199 { 200 $query.= '= '.$id_uppercat; 233 $query.= ' 234 SET uppercats = id 235 WHERE id_uppercat IS NULL'; 201 236 } 202 237 $query.= ' -
trunk/admin/user_perm.php
r629 r642 221 221 // category name 222 222 $cat_infos = get_cat_info( $row['id'] ); 223 $name = get_cat_display_name( $cat_infos['name'],' > ', 224 'font-weight:bold;' ); 223 $name = get_cat_display_name($cat_infos['name']); 225 224 $vtp->setVar( $sub, 'category.name', $name ); 226 225 // usergroups -
trunk/admin/user_search.php
r631 r642 103 103 $url = PHPWG_ROOT_PATH.'admin.php?page=cat_perm&cat_id='.$row['id']; 104 104 $cat_infos = get_cat_info( $row['id'] ); 105 $template->assign_block_vars('permission.category',array( 106 'CAT_NAME'=> get_cat_display_name($cat_infos['name'],' > ', 'font-weight:bold;' ), 107 'CAT_ID'=>$row['id'], 108 'AUTH_YES'=>!$is_user_allowed?'checked="checked"':'', 109 'AUTH_NO' =>$is_user_allowed?'checked="checked"':'', 110 'CAT_URL'=>add_session_id($url) 111 )); 112 105 $template->assign_block_vars( 106 'permission.category', 107 array( 108 'CAT_NAME'=> get_cat_display_name($cat_infos['name']), 109 'CAT_ID'=>$row['id'], 110 'AUTH_YES'=>!$is_user_allowed?'checked="checked"':'', 111 'AUTH_NO' =>$is_user_allowed?'checked="checked"':'', 112 'CAT_URL'=>add_session_id($url) 113 )); 114 113 115 // any subcat forbidden for this user ? 114 116 if ( $is_user_allowed == 2 ) -
trunk/admin/waiting.php
r593 r642 114 114 PHPWG_ROOT_PATH.get_complete_dir( $row['storage_category_id'] ); 115 115 $cat_names[$row['storage_category_id']]['display_name'] = 116 get_cat_display_name( $cat['name'], ' > ', 'font-weight:bold;');116 get_cat_display_name($cat['name']); 117 117 } 118 118 $preview_url = PHPWG_ROOT_PATH.$cat_names[$row['storage_category_id']]['dir'].$row['file']; -
trunk/comments.php
r607 r642 153 153 $cat_result = get_cat_info($subrow['cat_id']); 154 154 $array_cat_names[$subrow['cat_id']] = 155 get_cat_display_name($cat_result['name'], ' > ', '');155 get_cat_display_name($cat_result['name'], ''); 156 156 } 157 157 -
trunk/include/category_calendar.inc.php
r612 r642 364 364 elseif (isset($page['calendar_day'])) 365 365 { 366 $old_level_separator = $conf['level_separator']; 367 $conf['level_separator'] = '<br />'; 366 368 // for each category of this day, display a random picture 367 369 foreach ($calendar_categories as $calendar_category => $nb_pics) … … 374 376 { 375 377 $cat_infos = get_cat_info( $calendar_category ); 376 $name = get_cat_display_name($cat_infos['name'],'<br />','',false); 378 379 $name = get_cat_display_name($cat_infos['name'],'',false); 377 380 $name = '['.$name.']'; 378 381 } … … 427 430 } 428 431 } 432 $conf['level_separator'] = $old_level_separator; 429 433 } 430 434 ?> -
trunk/include/category_recent_cats.inc.php
r610 r642 60 60 } 61 61 62 $old_level_separator = $conf['level_separator']; 63 $conf['level_separator'] = '<br />'; 62 64 // for each category, we have to search a recent picture to display and 63 65 // the name to display … … 91 93 } 92 94 } 95 $conf['level_separator'] = $old_level_separator; 93 96 ?> -
trunk/include/config.inc.php
r602 r642 77 77 // top_number : number of element to display for "best rated" and "most 78 78 // visited" categories 79 $conf['top_number'] = 1 0;79 $conf['top_number'] = 15; 80 80 81 81 // anti-flood_time : number of seconds between 2 comments : 0 to disable … … 169 169 $conf['show_gt'] = true; 170 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. 171 // newcat_default_commentable : at creation, must a category be commentable 172 // or not ? 173 $conf['newcat_default_commentable'] = 'true'; 174 175 // newcat_default_uploadable : at creation, must a category be uploadable or 176 // not ? 177 $conf['newcat_default_uploadable'] = 'true'; 178 179 // newcat_default_visible : at creation, must a category be visible or not ? 180 // Warning : if the parent category is invisible, the category is 181 // automatically create invisible. (invisible = locked) 182 $conf['newcat_default_visible'] = 'true'; 183 184 // newcat_default_status : at creation, must a category be public or private 185 // ? Warning : if the parent category is private, the category is 186 // automatically create private. 187 $conf['newcat_default_status'] = 'public'; 188 189 // level_separator : character string used for separating a category level 190 // to the sub level 191 $conf['level_separator'] = ' / '; 185 192 ?> -
trunk/include/functions_category.inc.php
r641 r642 349 349 $page['title'] = 350 350 get_cat_display_name($page['cat_name'], 351 ' > ',352 351 'category.php?cat=', 353 352 false); … … 759 758 { 760 759 $option = get_cat_display_name_cache($category['uppercats'], 761 ' → ',762 760 '', 763 761 false); -
trunk/include/functions_html.inc.php
r614 r642 160 160 */ 161 161 function get_cat_display_name($cat_informations, 162 $separator,163 162 $url = 'category.php?cat=', 164 163 $replace_space = true) 165 164 { 165 global $conf; 166 166 167 $output = ''; 167 168 $is_first = true; … … 174 175 else 175 176 { 176 $output.= $ separator;177 $output.= $conf['level_separator']; 177 178 } 178 179 … … 206 207 * 207 208 * @param string uppercats 208 * @param string separator209 209 * @param string url 210 210 * @param boolean replace_space … … 212 212 */ 213 213 function get_cat_display_name_cache($uppercats, 214 $separator,215 214 $url = 'category.php?cat=', 216 215 $replace_space = true) 217 216 { 218 global $cat_names ;217 global $cat_names, $conf; 219 218 220 219 if (!isset($cat_names)) … … 243 242 else 244 243 { 245 $output.= $ separator;244 $output.= $conf['level_separator']; 246 245 } 247 246 -
trunk/include/functions_xml.inc.php
r593 r642 52 52 function getAttribute( $element, $attribute ) 53 53 { 54 // echo htmlentities($element).'<br /><br />'; 54 55 $regex = '/^<\w+[^>]*'.$attribute.'\s*=\s*"('.VAL_REG.')"/i'; 55 56 if ( preg_match( $regex, $element, $out ) ) return $out[1]; -
trunk/language/en_UK.iso-8859-1/admin.lang.php
r640 r642 352 352 $lang['represents'] = 'represents'; 353 353 $lang['doesnt_represent'] = 'doesn\'t represent'; 354 $lang['admin_menu_cat_status'] = 'Public / Private'; 354 355 ?> -
trunk/picture.php
r639 r642 349 349 if ( $conf['mail_notification'] ) 350 350 { 351 $cat_name = get_cat_display_name( $page['cat_name'], ' > ', '' ); 351 // locally, we change the $conf['level_separator'] 352 $conf_separator = $conf['level_separator']; 353 $conf['level_separator'] = ' > '; 354 $cat_name = get_cat_display_name($page['cat_name'], ''); 355 $conf['level_separator'] = $conf_separator; 356 352 357 $cat_name = strip_tags( $cat_name ); 353 358 notify( 'comment', $cat_name.' > '.$picture['current']['name']); … … 390 395 if (is_numeric( $page['cat'] )) 391 396 { 392 $title_img = replace_space(get_cat_display_name($page['cat_name'] ,' > '));397 $title_img = replace_space(get_cat_display_name($page['cat_name'])); 393 398 $n = $page['num'] + 1; 394 399 $title_nb = $n.'/'.$page['cat_nb_images']; … … 443 448 'WIDTH_IMG' => $picture_size[0], 444 449 'HEIGHT_IMG' => $picture_size[1], 450 451 'LEVEL_SEPARATOR' => $conf['level_separator'], 445 452 446 453 'L_HOME' => $lang['home'], … … 769 776 if (count($cat_array) > 3) 770 777 { 771 $cat_output .= get_cat_display_name_cache($category['uppercats'], 772 ' → '); 778 $cat_output .= get_cat_display_name_cache($category['uppercats']); 773 779 } 774 780 else 775 781 { 776 782 $cat_info = get_cat_info($category['category_id']); 777 $cat_output .= get_cat_display_name($cat_info['name'] , ' → ');783 $cat_output .= get_cat_display_name($cat_info['name']); 778 784 } 779 785 // the picture is commentable if it belongs at least to one category which -
trunk/template/default/picture.tpl
r588 r642 3 3 <!-- END information --> 4 4 <div class="titrePage"> 5 <div id="gauche"><a href="{U_HOME}">{L_HOME}</a> >{CATEGORY}</div>5 <div id="gauche"><a href="{U_HOME}">{L_HOME}</a>{LEVEL_SEPARATOR}{CATEGORY}</div> 6 6 <div id="centre" class="nameImage">{TITLE}</div> 7 7 <div id="droite">{PHOTO}</div> -
trunk/tools/create_listing_file.php
r619 r642 133 133 $value = str_replace(chr(0x00), ' ', $value); 134 134 135 return $value;135 return htmlentities($value); 136 136 } 137 137 -
trunk/upload.php
r607 r642 275 275 { 276 276 $advise_title = $lang['upload_advise']; 277 $advise_title.= get_cat_display_name( $page['cat_name'], ' - ');277 $advise_title.= get_cat_display_name($page['cat_name']); 278 278 } 279 279
Note: See TracChangeset
for help on using the changeset viewer.