- Timestamp:
- Feb 27, 2007, 2:56:16 AM (18 years ago)
- Location:
- trunk
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/cat_list.php
r1755 r1861 3 3 // | PhpWebGallery - a PHP based picture gallery | 4 4 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | 5 // | Copyright (C) 2003-2005 PhpWebGallery Team - http://phpwebgallery.net | 6 // +-----------------------------------------------------------------------+ 7 // | branch : BSF (Best So Far) 8 // | file : $RCSfile$ 5 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | 6 // +-----------------------------------------------------------------------+ 7 // | file : $Id$ 9 8 // | last update : $Date$ 10 9 // | last modifier : $Author$ … … 173 172 $navigation.= $conf['level_separator']; 174 173 175 $current_category = get_cat_info($_GET['parent_id']); 176 177 $navigation.= get_cat_display_name( 178 $current_category['name'], 174 $navigation.= get_cat_display_name_from_id( 175 $_GET['parent_id'], 179 176 $base_url.'&parent_id=', 180 177 false … … 278 275 'U_JUMPTO' => make_index_url( 279 276 array( 280 'category' => $category['id'], 281 'cat_name' => $category['name'], 277 'category' => $category 282 278 ) 283 279 ), -
trunk/admin/cat_modify.php
r1609 r1861 3 3 // | PhpWebGallery - a PHP based picture gallery | 4 4 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | 5 // | Copyright (C) 2003-200 6PhpWebGallery Team - http://phpwebgallery.net |5 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | 6 6 // +-----------------------------------------------------------------------+ 7 // | branch : BSF (Best So Far) 8 // | file : $RCSfile$ 7 // | file : $Id$ 9 8 // | last update : $Date$ 10 9 // | last modifier : $Author$ … … 280 279 'U_JUMPTO' => make_index_url( 281 280 array( 282 'category' => $category['id'], 283 'cat_name' => $category['name'], 281 'category' => $category 284 282 ) 285 283 ), -
trunk/admin/element_set.php
r1831 r1861 3 3 // | PhpWebGallery - a PHP based picture gallery | 4 4 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | 5 // | Copyright (C) 2003-2005 PhpWebGallery Team - http://phpwebgallery.net | 6 // +-----------------------------------------------------------------------+ 7 // | branch : BSF (Best So Far) 8 // | file : $RCSfile$ 5 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | 6 // +-----------------------------------------------------------------------+ 7 // | file : $Id$ 9 8 // | last update : $Date$ 10 9 // | last modifier : $Author$ … … 110 109 if (is_numeric($_GET['cat'])) 111 110 { 112 $cat_infos = get_cat_info($_GET['cat']);113 111 $page['title'] = 114 get_cat_display_name (115 $ cat_infos['name'],112 get_cat_display_name_from_id( 113 $_GET['cat'], 116 114 PHPWG_ROOT_PATH.'admin.php?page=cat_modify&cat_id=', 117 115 false -
trunk/admin/picture_modify.php
r1815 r1861 254 254 255 255 'DESCRIPTION' => 256 isset($_POST['description']) ?257 stripslashes($_POST['description']) : @$row['comment'] ,256 htmlspecialchars( isset($_POST['description']) ? 257 stripslashes($_POST['description']) : @$row['comment'] ), 258 258 259 259 'F_ACTION' => … … 348 348 'image_id' => $_GET['image_id'], 349 349 'image_file' => $image_file, 350 'category' => $ _GET['cat_id'],350 'category' => $cache['cat_names'][ $_GET['cat_id'] ], 351 351 ) 352 352 ); … … 360 360 'image_id' => $_GET['image_id'], 361 361 'image_file' => $image_file, 362 'category' => $ca tegory,362 'category' => $cache['cat_names'][ $category ], 363 363 ) 364 364 ); -
trunk/admin/waiting.php
r1754 r1861 3 3 // | PhpWebGallery - a PHP based picture gallery | 4 4 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | 5 // | Copyright (C) 2003-2005 PhpWebGallery Team - http://phpwebgallery.net | 6 // +-----------------------------------------------------------------------+ 7 // | branch : BSF (Best So Far) 8 // | file : $RCSfile$ 5 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | 6 // +-----------------------------------------------------------------------+ 7 // | file : $Id$ 9 8 // | last update : $Date$ 10 9 // | last modifier : $Author$ … … 162 161 PHPWG_ROOT_PATH.get_complete_dir( $row['storage_category_id'] ); 163 162 $cat_names[$row['storage_category_id']]['display_name'] = 164 get_cat_display_name($cat[' name']);163 get_cat_display_name($cat['upper_names']); 165 164 } 166 165 $preview_url = PHPWG_ROOT_PATH.$cat_names[$row['storage_category_id']]['dir'].$row['file']; -
trunk/category.php
r1846 r1861 39 39 { 40 40 $url_params['section'] = 'categories'; 41 $url_params['category'] = $_GET['cat']; 42 $result = get_cat_info($url_params['category']); 41 $result = get_cat_info( $_GET['cat'] ); 43 42 if ( !empty($result) ) 44 $url_params['cat_name'] = $result['name']; 43 { 44 $url_params['category'] = $result; 45 } 45 46 } 46 47 elseif ( in_array($_GET['cat'], -
trunk/comments.php
r1849 r1861 206 206 207 207 $query = ' 208 SELECT id, name,uppercats,global_rank208 SELECT id, name, uppercats, global_rank 209 209 FROM '.CATEGORIES_TABLE.' 210 210 '.get_sql_condition_FandF … … 399 399 $url = make_picture_url( 400 400 array( 401 'category' => $comment['category_id'], 402 'cat_name' => $categories[ $comment['category_id']] ['name'], 401 'category' => $categories[ $comment['category_id'] ], 403 402 'image_id' => $comment['image_id'], 404 403 'image_file' => $elements[$comment['image_id']]['file'], -
trunk/include/category_cats.inc.php
r1851 r1861 36 36 $query = ' 37 37 SELECT 38 id, name, representative_picture_id, comment, nb_images, uppercats,38 id, name, representative_picture_id, comment, nb_images, uppercats, 39 39 date_last, max_date_last, count_images, count_categories, global_rank 40 40 FROM '.CATEGORIES_TABLE.' INNER JOIN '.USER_CACHE_CATEGORIES_TABLE.' … … 58 58 $query = ' 59 59 SELECT 60 id, name, representative_picture_id, comment, nb_images,60 id, name, representative_picture_id, comment, nb_images, 61 61 date_last, max_date_last, count_images, count_categories 62 62 FROM '.CATEGORIES_TABLE.' INNER JOIN '.USER_CACHE_CATEGORIES_TABLE.' 63 63 ON id = cat_id and user_id = '.$user['id'].' 64 64 WHERE id_uppercat '. 65 (!isset($page['category']) ? 'is NULL' : '= '.$page['category'] ).'65 (!isset($page['category']) ? 'is NULL' : '= '.$page['category']['id']).' 66 66 '.get_sql_condition_FandF 67 67 ( … … 207 207 'URL' => make_index_url( 208 208 array( 209 'category' => $category['id'], 210 'cat_name' => $category['name'], 209 'category' => $category 211 210 ) 212 211 ), … … 259 258 'U_IMG_LINK' => make_index_url( 260 259 array( 261 'category' => $category['id'], 262 'cat_name' => $category['name'], 260 'category' => $category 263 261 ) 264 262 ), -
trunk/include/category_default.inc.php
r1859 r1861 158 158 if ($user['show_nb_comments'] 159 159 and isset($page['category']) 160 and $page['cat _commentable'])160 and $page['category']['commentable']) 161 161 { 162 162 $query = ' -
trunk/include/functions.inc.php
r1846 r1861 5 5 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | 6 6 // +-----------------------------------------------------------------------+ 7 // | branch : BSF (Best So Far)8 7 // | file : $Id$ 9 8 // | last update : $Date$ … … 483 482 \''.$_SERVER['REMOTE_ADDR'].'\', 484 483 '.(isset($page['section']) ? "'".$page['section']."'" : 'NULL').', 485 '.(isset($page['category']) ? $page['category'] : 'NULL').',484 '.(isset($page['category']) ? $page['category']['id'] : 'NULL').', 486 485 '.(isset($image_id) ? $image_id : 'NULL').', 487 486 '.(isset($image_id) ? "'".$image_type."'" : 'NULL').', -
trunk/include/functions_calendar.inc.php
r1820 r1861 2 2 // +-----------------------------------------------------------------------+ 3 3 // | PhpWebGallery - a PHP based picture gallery | 4 // | Copyright (C) 2003-2006 PhpWebGallery Team - http://phpwebgallery.net | 5 // +-----------------------------------------------------------------------+ 6 // | branch : BSF (Best So Far) 7 // | file : $RCSfile$ 4 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | 5 // +-----------------------------------------------------------------------+ 6 // | file : $Id$ 8 7 // | last update : $Date$ 9 8 // | last modifier : $Author$ … … 35 34 $inner_sql = ' FROM ' . IMAGES_TABLE; 36 35 37 if ($page['section']=='categories' or 38 ( isset($page['category']) and is_numeric($page['category']) ) ) 36 if ($page['section']=='categories') 39 37 { // we will regenerate the items by including subcats elements 40 38 $page['items'] = array(); … … 42 40 INNER JOIN '.IMAGE_CATEGORY_TABLE.' ON id = image_id'; 43 41 44 if ( isset($page['category']) and is_numeric($page['category']))42 if ( isset($page['category']) ) 45 43 { 46 44 $sub_ids = array_diff( 47 get_subcat_ids(array($page['category'] )),45 get_subcat_ids(array($page['category']['id'])), 48 46 explode(',', $user['forbidden_categories']) 49 47 ); -
trunk/include/functions_category.inc.php
r1854 r1861 78 78 if (isset($page['category'])) 79 79 { 80 $query.= ' OR id_uppercat IN ('.$page[' uppercats'].')';80 $query.= ' OR id_uppercat IN ('.$page['category']['uppercats'].')'; 81 81 } 82 82 $query.= ')'; … … 112 112 } 113 113 114 return get_html_menu_category($cats );114 return get_html_menu_category($cats, @$page['category'] ); 115 115 } 116 116 … … 135 135 function get_cat_info( $id ) 136 136 { 137 $infos = array('nb_images','id_uppercat','comment','site_id'138 ,'dir','date_last','uploadable','status','visible'139 ,'representative_picture_id','uppercats','commentable'140 ,'image_order');141 142 137 $query = ' 143 SELECT '.implode(',', $infos).'138 SELECT * 144 139 FROM '.CATEGORIES_TABLE.' 145 140 WHERE id = '.$id.' 146 141 ;'; 147 $ row = mysql_fetch_array(pwg_query($query));148 if (empty($ row))142 $cat = mysql_fetch_assoc(pwg_query($query)); 143 if (empty($cat)) 149 144 return null; 150 145 151 $cat = array(); 152 foreach ($infos as $info) 153 { 154 if (isset($row[$info])) 155 { 156 $cat[$info] = $row[$info]; 157 } 158 else 159 { 160 $cat[$info] = ''; 161 } 146 foreach ($cat as $k => $v) 147 { 162 148 // If the field is true or false, the variable is transformed into a 163 149 // boolean value. 164 if ($cat[$ info] == 'true' or $cat[$info] == 'false')165 { 166 $cat[$ info] = get_boolean( $cat[$info] );150 if ($cat[$k] == 'true' or $cat[$k] == 'false') 151 { 152 $cat[$k] = get_boolean( $cat[$k] ); 167 153 } 168 154 } … … 171 157 preg_match('/<(div|br|img|script).*>/i', $cat['comment']) ) ) 172 158 { 173 $cat['comment'] = nl2br( $cat['comment']);159 $cat['comment'] = nl2br(@$cat['comment']); 174 160 } 175 161 176 162 $names = array(); 177 163 $query = ' 178 SELECT name,id164 SELECT id, name 179 165 FROM '.CATEGORIES_TABLE.' 180 166 WHERE id IN ('.$cat['uppercats'].') 181 167 ;'; 182 168 $result = pwg_query($query); 183 while($row = mysql_fetch_a rray($result))184 { 185 $names[$row['id']] = $row ['name'];169 while($row = mysql_fetch_assoc($result)) 170 { 171 $names[$row['id']] = $row; 186 172 } 187 173 188 174 // category names must be in the same order than uppercats list 189 $cat[' name'] = array();175 $cat['upper_names'] = array(); 190 176 foreach (explode(',', $cat['uppercats']) as $cat_id) 191 177 { 192 $cat[' name'][$cat_id] = $names[$cat_id];178 $cat['upper_names'][$cat_id] = $names[$cat_id]; 193 179 } 194 180 … … 346 332 foreach ($ids as $num => $category_id) 347 333 { 334 is_numeric($category_id) 335 or trigger_error( 336 'get_subcat_ids expecting numeric, not '.gettype($category_id), 337 E_USER_WARNING 338 ); 348 339 if ($num > 0) 349 340 { -
trunk/include/functions_html.inc.php
r1855 r1861 236 236 * categories string returned contains categories as given in the input 237 237 * array $cat_informations. $cat_informations array must be an association 238 * of {category_id => category_name}. If url input parameter is null,238 * of {category_id => array( id, name) }. If url input parameter is null, 239 239 * returns only the categories name without links. 240 240 * … … 252 252 $output = ''; 253 253 $is_first = true; 254 foreach ($cat_informations as $id => $name) 255 { 254 foreach ($cat_informations as $id => $cat) 255 { 256 is_array($cat) or trigger_error( 257 'get_cat_display_name wrong type for cat '.$id, E_USER_WARNING 258 ); 256 259 if ($is_first) 257 260 { … … 265 268 if ( !isset($url) ) 266 269 { 267 $output.= $ name;270 $output.= $cat['name']; 268 271 } 269 272 elseif ($url == '') … … 272 275 .make_index_url( 273 276 array( 274 'category'=>$id, 275 'cat_name'=>$name 277 'category' => $cat, 276 278 ) 277 279 ) 278 280 .'">'; 279 $output.= $ name.'</a>';281 $output.= $cat['name'].'</a>'; 280 282 } 281 283 else 282 284 { 283 285 $output.= '<a href="'.PHPWG_ROOT_PATH.$url.$id.'">'; 284 $output.= $ name.'</a>';286 $output.= $cat['name'].'</a>'; 285 287 } 286 288 } … … 312 314 $replace_space = true) 313 315 { 314 global $ca t_names, $conf;315 316 if (!isset($ca t_names))316 global $cache, $conf; 317 318 if (!isset($cache['cat_names'])) 317 319 { 318 320 $query = ' 319 SELECT id, name321 SELECT id, name 320 322 FROM '.CATEGORIES_TABLE.' 321 323 ;'; 322 324 $result = pwg_query($query); 323 while ($row = mysql_fetch_a rray($result))324 { 325 $ca t_names[$row['id']] = $row['name'];325 while ($row = mysql_fetch_assoc($result)) 326 { 327 $cache['cat_names'][$row['id']] = $row; 326 328 } 327 329 } … … 331 333 foreach (explode(',', $uppercats) as $category_id) 332 334 { 333 $ name = $cat_names[$category_id];335 $cat = $cache['cat_names'][$category_id]; 334 336 335 337 if ($is_first) … … 344 346 if ( !isset($url) ) 345 347 { 346 $output.= $ name;348 $output.= $cat['name']; 347 349 } 348 350 elseif ($url == '') … … 352 354 .make_index_url( 353 355 array( 354 'category'=>$category_id, 355 'cat_name'=>$name 356 'category' => $cat, 356 357 ) 357 358 ) 358 .'">'.$ name.'</a>';359 .'">'.$cat['name'].'</a>'; 359 360 } 360 361 else 361 362 { 362 363 $output.= ' 363 <a href="'.PHPWG_ROOT_PATH.$url.$category_id.'">'.$ name.'</a>';364 <a href="'.PHPWG_ROOT_PATH.$url.$category_id.'">'.$cat['name'].'</a>'; 364 365 } 365 366 } … … 385 386 * @return string 386 387 */ 387 function get_html_menu_category($categories )388 { 389 global $ page, $lang;388 function get_html_menu_category($categories, $selected_category) 389 { 390 global $lang; 390 391 391 392 $ref_level = 0; … … 393 394 $menu = ''; 394 395 395 // $page_cat value remains 0 for special sections396 $page_cat = 0;397 if (isset($page['category']))398 {399 $page_cat = $page['category'];400 }401 402 396 foreach ($categories as $category) 403 397 { … … 420 414 421 415 $menu.= "\n\n".'<li'; 422 if ($category['id'] == $page_cat)416 if ($category['id'] == @$selected_category['id']) 423 417 { 424 418 $menu.= ' class="selected"'; … … 428 422 $url = make_index_url( 429 423 array( 430 'category'=>$category['id'], 431 'cat_name'=>$category['name'] 424 'category' => $category 432 425 ) 433 426 ); 434 427 435 428 $menu.= "\n".'<a href="'.$url.'"'; 436 if ($ page_cat != 0437 and $category['id'] == $ page['cat_id_uppercat'])429 if ($selected_category!=null 430 and $category['id'] == $selected_category['id_uppercat']) 438 431 { 439 432 $menu.= ' rel="up"'; … … 510 503 { 511 504 $cat_info = get_cat_info($cat_id); 512 return get_cat_display_name($cat_info[' name'], $url, $replace_space);505 return get_cat_display_name($cat_info['upper_names'], $url, $replace_space); 513 506 } 514 507 -
trunk/include/functions_url.inc.php
r1800 r1861 4 4 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | 5 5 // +-----------------------------------------------------------------------+ 6 // | branch : BSF (Best So Far)7 6 // | file : $Id$ 8 7 // | last update : $Date$ … … 134 133 * and removes. 135 134 * 136 * duplicate_index_url(array('category' => 12), array('start')) will create 137 * an index URL on the current section (categories), but on a redefined 138 * category and without the start URL parameter. 135 * duplicate_index_url( array( 136 * 'category' => array('id'=>12, 'name'=>'toto'), 137 * array('start') 138 * ) will create an index URL on the current section (categories), but on 139 * a redefined category and without the start URL parameter. 139 140 * 140 141 * @param array redefined keys … … 326 327 else 327 328 { 328 $section_string.= '/category/'.$params['category']; 329 if ($conf['category_url_style']=='id-name' and isset($params['cat_name']) ) 329 is_array($params['category']) or trigger_error( 330 'make_section_in_url wrong type for category', E_USER_WARNING 331 ); 332 is_numeric($params['category']['id']) or trigger_error( 333 'make_section_in_url category id not numeric', E_USER_WARNING 334 ); 335 isset($params['category']['name']) or trigger_error( 336 'make_section_in_url category name not set', E_USER_WARNING 337 ); 338 339 $section_string.= '/category/'.$params['category']['id']; 340 if ( $conf['category_url_style']=='id-name' ) 330 341 { 331 if ( is_string($params['cat_name']) ) 332 { 333 $section_string.= '-'.str2url($params['cat_name']); 334 } 335 elseif ( is_array( $params['cat_name'] ) and 336 isset( $params['cat_name'][$params['category']] ) ) 337 { 338 $section_string.= '-' 339 .str2url($params['cat_name'][$params['category']]); 340 } 342 $section_string.= '-'.str2url($params['category']['name']); 341 343 } 342 344 } -
trunk/include/menubar.inc.php
r1815 r1861 5 5 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | 6 6 // +-----------------------------------------------------------------------+ 7 // | branch : BSF (Best So Far)8 7 // | file : $Id$ 9 8 // | last update : $Date$ … … 334 333 ); 335 334 336 if (isset($page['category']) and $page['cat _uploadable'] )335 if (isset($page['category']) and $page['category']['uploadable'] ) 337 336 { // upload a picture in the category 338 $url = get_root_url().'upload.php?cat='.$page['category'] ;337 $url = get_root_url().'upload.php?cat='.$page['category']['id']; 339 338 $template->assign_block_vars( 340 339 'upload', -
trunk/include/section_init.inc.php
r1852 r1861 35 35 */ 36 36 37 // "index.php?/category/12-foo/start-24 &action=fill_caddie" or38 // "index.php/category/12-foo/start-24 &action=fill_caddie"37 // "index.php?/category/12-foo/start-24" or 38 // "index.php/category/12-foo/start-24" 39 39 // must return : 40 40 // 41 41 // array( 42 42 // 'section' => 'categories', 43 // 'category' => 12,43 // 'category' => array('id'=>12, ...), 44 44 // 'start' => 24 45 // 'action' => 'fill_caddie'46 45 // ); 47 46 … … 88 87 $url = make_picture_url( array( 89 88 'section' => 'categories', 90 'category' => $_GET['cat'],89 'category' => get_cat_info($_GET['cat']), 91 90 'image_id' => $_GET['image_id'] 92 91 ) ); … … 361 360 array( 362 361 'comment' => $result['comment'], 363 'cat_dir' => $result['dir'], 364 'cat_name' => $result['name'], 365 'cat_site_id' => $result['site_id'], 366 'cat_uploadable' => $result['uploadable'], 367 'cat_commentable' => $result['commentable'], 368 'cat_id_uppercat' => $result['id_uppercat'], 369 'uppercats' => $result['uppercats'], 362 'category' => $result, 370 363 'title' => 371 get_cat_display_name($result[' name'], '', false),364 get_cat_display_name($result['upper_names'], '', false), 372 365 ) 373 366 ); … … 396 389 if ( isset($page['category']) ) 397 390 { 398 $subcat_ids = get_subcat_ids( array($page['category'] ) );391 $subcat_ids = get_subcat_ids( array($page['category']['id']) ); 399 392 $where_sql = 'category_id IN ('.implode(',',$subcat_ids).')'; 400 393 } … … 406 399 else 407 400 {// Normal mode 408 $where_sql = 'category_id = '.$page['category'] ;401 $where_sql = 'category_id = '.$page['category']['id']; 409 402 } 410 403 -
trunk/include/ws_functions.inc.php
r1853 r1861 387 387 $url = make_index_url( 388 388 array( 389 'category' => $cat_id, 390 'cat_name' => $cats[$cat_id]['name'], 389 'category' => $cats[$cat_id], 391 390 ) 392 391 ); 393 392 $page_url = make_picture_url( 394 393 array( 395 'category' => $cat_id, 396 'cat_name' => $cats[$cat_id]['name'], 394 'category' => $cats[$cat_id], 397 395 'image_id' => $row['id'], 398 396 'image_file' => $row['file'], … … 485 483 $row['url'] = make_index_url( 486 484 array( 487 'category' => $row['id'], 488 'cat_name' => $row['name'], 485 'category' => $row 489 486 ) 490 487 ); … … 600 597 //-------------------------------------------------------- related categories 601 598 $query = ' 602 SELECT id, name,uppercats,global_rank,commentable599 SELECT id, name, uppercats, global_rank, commentable 603 600 FROM '.IMAGE_CATEGORY_TABLE.' 604 601 INNER JOIN '.CATEGORIES_TABLE.' ON category_id = id … … 618 615 $row['url'] = make_index_url( 619 616 array( 620 'category' => $row['id'], 621 'cat_name' => $row['name'], 617 'category' => $row 622 618 ) 623 619 ); … … 627 623 'image_id' => $image_row['id'], 628 624 'image_file' => $image_row['file'], 629 'category' => $row['id'], 630 'cat_name' => $row['name'], 625 'category' => $row 631 626 ) 632 627 ); -
trunk/index.php
r1820 r1861 66 66 if (isset($page['category'])) 67 67 { 68 check_restrictions($page['category'] );68 check_restrictions($page['category']['id']); 69 69 } 70 70 … … 194 194 'URL' => 195 195 get_root_url().'admin.php?page=cat_modify' 196 .'&cat_id='.$page['category'] 196 .'&cat_id='.$page['category']['id'] 197 197 ) 198 198 ); -
trunk/picture.php
r1844 r1861 37 37 if (isset($page['category'])) 38 38 { 39 check_restrictions($page['category'] );39 check_restrictions($page['category']['id']); 40 40 } 41 41 … … 200 200 UPDATE '.CATEGORIES_TABLE.' 201 201 SET representative_picture_id = '.$page['image_id'].' 202 WHERE id = '.$page['category'] .'202 WHERE id = '.$page['category']['id'].' 203 203 ;'; 204 204 pwg_query($query); … … 421 421 $url_admin = 422 422 get_root_url().'admin.php?page=picture_modify' 423 .'&cat_id='.(isset($page['category']) ? $page['category'] : '')423 .'&cat_id='.(isset($page['category']) ? $page['category']['id'] : '') 424 424 .'&image_id='.$page['image_id'] 425 425 ; -
trunk/upload.php
r1850 r1861 133 133 { 134 134 check_restrictions( $page['category'] ); 135 $result = get_cat_info( $page['category'] ); 136 $page['cat_dir'] = get_complete_dir( $page['category'] ); 137 $page['cat_site_id'] = $result['site_id']; 138 $page['cat_name'] = $result['name']; 139 $page['cat_uploadable'] = $result['uploadable']; 140 141 if (url_is_remote($page['cat_dir']) or !$page['cat_uploadable']) 135 $category = get_cat_info( $page['category'] ); 136 $category['cat_dir'] = get_complete_dir( $page['category'] ); 137 138 if (url_is_remote($category['cat_dir']) or !$category['uploadable']) 142 139 { 143 140 die('Fatal: you take a wrong way, bye bye'); … … 155 152 if ( isset( $_POST['submit'] ) and !isset( $_GET['waiting_id'] ) ) 156 153 { 157 $path = $ page['cat_dir'].$_FILES['picture']['name'];154 $path = $category['cat_dir'].$_FILES['picture']['name']; 158 155 if ( @is_file( $path ) ) 159 156 { … … 242 239 $extension = get_extension( $_FILES['picture']['name'] ); 243 240 244 if (($path = mkget_thumbnail_dir($ page['cat_dir'], $error)) != false)241 if (($path = mkget_thumbnail_dir($category['cat_dir'], $error)) != false) 245 242 { 246 243 $path.= '/'.$conf['prefix_thumbnail'].$file.'.'.$extension; … … 286 283 { 287 284 $advise_title = l10n('upload_advise'); 288 $advise_title.= get_cat_display_name($ page['cat_name']);285 $advise_title.= get_cat_display_name($category['upper_names']); 289 286 } 290 287 … … 303 300 'F_ACTION' => $u_form, 304 301 305 'U_RETURN' => make_index_url(array('category' => $ page['category'])),302 'U_RETURN' => make_index_url(array('category' => $category)), 306 303 ) 307 304 );
Note: See TracChangeset
for help on using the changeset viewer.