Ignore:
Timestamp:
Oct 23, 2004, 7:56:46 PM (20 years ago)
Author:
z0rglub
Message:
  • refactoring of comments.php
  • creation of function get_thumbnail_src used everywhere a thumbnail must be displayed
  • creation of function parse_comment_content (used in comments.php and picture.php)
  • concerning undefined index on arrays retrieved in database, instead of testing possibly unset values, use of @ operator (smarter...)
  • add pre tag in default.css stylesheet for debugging purpose (need to have left aligned text)
File:
1 edited

Legend:

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

    r510 r579  
    346346function get_complete_dir( $category_id )
    347347{
    348   return get_site_url( $category_id ).get_local_dir( $category_id );
     348  return get_site_url($category_id).get_local_dir($category_id);
    349349}
    350350
     
    384384    $database_dirs[$row['id']] = $row['dir'];
    385385  }
    386   foreach ( $upper_array as $id ) {
     386  foreach ($upper_array as $id)
     387  {
    387388    $local_dir.= $database_dirs[$id].'/';
    388389  }
     
    393394// retrieving the site url : "http://domain.com/gallery/" or
    394395// simply "./galleries/"
    395 function get_site_url( $category_id )
     396function get_site_url($category_id)
    396397{
    397398  global $page;
    398399
    399   $query = 'SELECT galleries_url';
    400   $query.= ' FROM '.SITES_TABLE.' AS s,'.CATEGORIES_TABLE.' AS c';
    401   $query.= ' WHERE s.id = c.site_id';
    402   $query.= ' AND c.id = '.$category_id;
    403   $query.= ';';
    404   $row = mysql_fetch_array( mysql_query( $query ) );
     400  $query = '
     401SELECT galleries_url
     402  FROM '.SITES_TABLE.' AS s,'.CATEGORIES_TABLE.' AS c
     403  WHERE s.id = c.site_id
     404    AND c.id = '.$category_id.'
     405;';
     406  $row = mysql_fetch_array(mysql_query($query));
    405407  return $row['galleries_url'];
    406408}
Note: See TracChangeset for help on using the changeset viewer.