Ignore:
Timestamp:
May 17, 2003, 1:42:03 PM (21 years ago)
Author:
z0rglub
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/functions_category.inc.php

    r9 r13  
    1717function get_subcats_id( $cat_id )
    1818{
    19   global $prefixeTable;
    20                
    2119  $restricted_cat = array();
    2220  $i = 0;
    2321               
    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.= ';';
    2726  $result = mysql_query( $query );
    2827  while ( $row = mysql_fetch_array( $result ) )
     
    4140function check_restrictions( $category_id )
    4241{
    43   global $user,$lang,$prefixeTable;
     42  global $user,$lang;
    4443
    4544  if ( is_user_allowed( $category_id, $user['restrictions'] ) > 0 )
     
    5857function check_cat_id( $cat )
    5958{
    60   global $page,$prefixeTable;
     59  global $page;
     60
    6161  unset( $page['cat'] );
    6262  if ( isset( $cat ) )
     
    6464    if ( is_numeric( $cat ) )
    6565    {
    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. ';';
    6770      $result = mysql_query( $query );
    6871      if ( mysql_num_rows( $result ) != 0 )
     
    8184function display_cat( $id_uppercat, $indent, $restriction, $tab_expand )
    8285{
    83   global $prefixeTable,$user,$lang,$conf,$page,$vtp,$handle;
     86  global $user,$lang,$conf,$page,$vtp,$handle;
    8487 
    8588  $query = 'select name,id,date_dernier,nb_images,dir';
    86   $query.= ' from '.$prefixeTable.'categories';
     89  $query.= ' from '.PREFIX_TABLE.'categories';
    8790  $query.= ' where id_uppercat';
    8891  if ( $id_uppercat == "" )
     
    202205function get_nb_subcats( $id )
    203206{
    204   global $prefixeTable,$user;
     207  global $user;
    205208               
    206209  $query = 'select count(*) as count';
    207   $query.= ' from '.$prefixeTable.'categories';
     210  $query.= ' from '.PREFIX_TABLE.'categories';
    208211  $query.= ' where id_uppercat = '.$id;
    209212  for ( $i = 0; $i < sizeof( $user['restrictions'] ); $i++ )
     
    219222function get_total_image( $id, $restriction )
    220223{
    221   global $prefixeTable;
    222                
    223224  $total = 0;
    224225               
    225226  $query = 'select id,nb_images';
    226   $query.= ' from '.$prefixeTable.'categories';
     227  $query.= ' from '.PREFIX_TABLE.'categories';
    227228  $query.= ' where id_uppercat';
    228229  if ( !is_numeric( $id ) )
     
    260261function get_cat_info( $id )
    261262{
    262   global $prefixeTable;
    263                
    264263  $cat = array();
    265264  $cat['name'] = array();
    266265               
    267266  $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';
    270269  $query.= ' where a.id = '.$id;
    271270  $query.= ' and a.site_id = b.id;';
     
    285284  {
    286285    $query = 'select name,dir,id_uppercat';
    287     $query.= ' from '.$prefixeTable.'categories';
     286    $query.= ' from '.PREFIX_TABLE.'categories';
    288287    $query.= ' where id = '.$row['id_uppercat'].';';
    289288    $row = mysql_fetch_array( mysql_query( $query ) );
     
    360359function initialize_category( $calling_page = 'category' )
    361360{
    362   global $prefixeTable,$page,$lang,$user,$conf;
     361  global $page,$lang,$user,$conf;
    363362 
    364363  if ( isset( $page['cat'] ) )
     
    398397
    399398        $query = 'select count(*) as nb_total_images';
    400         $query.= ' from '.$prefixeTable.'images';
     399        $query.= ' from '.PREFIX_TABLE.'images';
    401400        $query.= $page['where'];
    402401        $query.= ';';
     
    409408        $page['title'] = $lang['favorites'];
    410409
    411         $page['where'] = ', '.$prefixeTable.'favorites';
     410        $page['where'] = ', '.PREFIX_TABLE.'favorites';
    412411        $page['where'].= ' where user_id = '.$user['id'];
    413412        $page['where'].= ' and image_id = id';
    414413     
    415414        $query = 'select count(*) as nb_total_images';
    416         $query.= ' from '.$prefixeTable.'favorites';
     415        $query.= ' from '.PREFIX_TABLE.'favorites';
    417416        $query.= ' where user_id = '.$user['id'];
    418417        $query.= ';';
     
    429428
    430429        $query = 'select count(*) as nb_total_images';
    431         $query.= ' from '.$prefixeTable.'images';
     430        $query.= ' from '.PREFIX_TABLE.'images';
    432431        $query.= $page['where'];
    433432        $query.= ';';
Note: See TracChangeset for help on using the changeset viewer.