Changeset 13 for trunk/include/functions_category.inc.php
- Timestamp:
- May 17, 2003, 1:42:03 PM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions_category.inc.php
r9 r13 17 17 function get_subcats_id( $cat_id ) 18 18 { 19 global $prefixeTable;20 21 19 $restricted_cat = array(); 22 20 $i = 0; 23 21 24 $query = "select id"; 25 $query.= " from $prefixeTable"."categories"; 26 $query.= " where id_uppercat = $cat_id;"; 22 $query = 'select id'; 23 $query.= ' from '.PREFIX_TABLE.'categories'; 24 $query.= ' where id_uppercat = '.$cat_id; 25 $query.= ';'; 27 26 $result = mysql_query( $query ); 28 27 while ( $row = mysql_fetch_array( $result ) ) … … 41 40 function check_restrictions( $category_id ) 42 41 { 43 global $user,$lang ,$prefixeTable;42 global $user,$lang; 44 43 45 44 if ( is_user_allowed( $category_id, $user['restrictions'] ) > 0 ) … … 58 57 function check_cat_id( $cat ) 59 58 { 60 global $page,$prefixeTable; 59 global $page; 60 61 61 unset( $page['cat'] ); 62 62 if ( isset( $cat ) ) … … 64 64 if ( is_numeric( $cat ) ) 65 65 { 66 $query = "select id from $prefixeTable"."categories where id = $cat;"; 66 $query = 'select id'; 67 $query.= ' from '.PREFIX_TABLE.'categories'; 68 $query.= ' where id = '.$cat; 69 $query. ';'; 67 70 $result = mysql_query( $query ); 68 71 if ( mysql_num_rows( $result ) != 0 ) … … 81 84 function display_cat( $id_uppercat, $indent, $restriction, $tab_expand ) 82 85 { 83 global $ prefixeTable,$user,$lang,$conf,$page,$vtp,$handle;86 global $user,$lang,$conf,$page,$vtp,$handle; 84 87 85 88 $query = 'select name,id,date_dernier,nb_images,dir'; 86 $query.= ' from '. $prefixeTable.'categories';89 $query.= ' from '.PREFIX_TABLE.'categories'; 87 90 $query.= ' where id_uppercat'; 88 91 if ( $id_uppercat == "" ) … … 202 205 function get_nb_subcats( $id ) 203 206 { 204 global $ prefixeTable,$user;207 global $user; 205 208 206 209 $query = 'select count(*) as count'; 207 $query.= ' from '. $prefixeTable.'categories';210 $query.= ' from '.PREFIX_TABLE.'categories'; 208 211 $query.= ' where id_uppercat = '.$id; 209 212 for ( $i = 0; $i < sizeof( $user['restrictions'] ); $i++ ) … … 219 222 function get_total_image( $id, $restriction ) 220 223 { 221 global $prefixeTable;222 223 224 $total = 0; 224 225 225 226 $query = 'select id,nb_images'; 226 $query.= ' from '. $prefixeTable.'categories';227 $query.= ' from '.PREFIX_TABLE.'categories'; 227 228 $query.= ' where id_uppercat'; 228 229 if ( !is_numeric( $id ) ) … … 260 261 function get_cat_info( $id ) 261 262 { 262 global $prefixeTable;263 264 263 $cat = array(); 265 264 $cat['name'] = array(); 266 265 267 266 $query = 'select nb_images,id_uppercat,comment,site_id,galleries_url,dir'; 268 $query.= ' from '. $prefixeTable.'categories as a';269 $query.= ', '. $prefixeTable.'sites as b';267 $query.= ' from '.PREFIX_TABLE.'categories as a'; 268 $query.= ', '.PREFIX_TABLE.'sites as b'; 270 269 $query.= ' where a.id = '.$id; 271 270 $query.= ' and a.site_id = b.id;'; … … 285 284 { 286 285 $query = 'select name,dir,id_uppercat'; 287 $query.= ' from '. $prefixeTable.'categories';286 $query.= ' from '.PREFIX_TABLE.'categories'; 288 287 $query.= ' where id = '.$row['id_uppercat'].';'; 289 288 $row = mysql_fetch_array( mysql_query( $query ) ); … … 360 359 function initialize_category( $calling_page = 'category' ) 361 360 { 362 global $p refixeTable,$page,$lang,$user,$conf;361 global $page,$lang,$user,$conf; 363 362 364 363 if ( isset( $page['cat'] ) ) … … 398 397 399 398 $query = 'select count(*) as nb_total_images'; 400 $query.= ' from '. $prefixeTable.'images';399 $query.= ' from '.PREFIX_TABLE.'images'; 401 400 $query.= $page['where']; 402 401 $query.= ';'; … … 409 408 $page['title'] = $lang['favorites']; 410 409 411 $page['where'] = ', '. $prefixeTable.'favorites';410 $page['where'] = ', '.PREFIX_TABLE.'favorites'; 412 411 $page['where'].= ' where user_id = '.$user['id']; 413 412 $page['where'].= ' and image_id = id'; 414 413 415 414 $query = 'select count(*) as nb_total_images'; 416 $query.= ' from '. $prefixeTable.'favorites';415 $query.= ' from '.PREFIX_TABLE.'favorites'; 417 416 $query.= ' where user_id = '.$user['id']; 418 417 $query.= ';'; … … 429 428 430 429 $query = 'select count(*) as nb_total_images'; 431 $query.= ' from '. $prefixeTable.'images';430 $query.= ' from '.PREFIX_TABLE.'images'; 432 431 $query.= $page['where']; 433 432 $query.= ';';
Note: See TracChangeset
for help on using the changeset viewer.