aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions_category.inc.php
diff options
context:
space:
mode:
authorz0rglub <z0rglub@piwigo.org>2004-10-23 17:56:46 +0000
committerz0rglub <z0rglub@piwigo.org>2004-10-23 17:56:46 +0000
commit98b65edb831e95695cc840692ab8ad294478f80d (patch)
tree2b1ffe5ba3c8bc1fcdb209e8f8d793bd18e9dd1d /include/functions_category.inc.php
parent60ac6f180e9500c6fea0c872277f107f05d7d26d (diff)
- 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) git-svn-id: http://piwigo.org/svn/trunk@579 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--include/functions_category.inc.php20
1 files changed, 11 insertions, 9 deletions
diff --git a/include/functions_category.inc.php b/include/functions_category.inc.php
index c9485d17b..6171b562c 100644
--- a/include/functions_category.inc.php
+++ b/include/functions_category.inc.php
@@ -345,7 +345,7 @@ function get_cat_info( $id )
// get_complete_dir(22) returns "./galleries/pets/rex/1_year_old/"
function get_complete_dir( $category_id )
{
- return get_site_url( $category_id ).get_local_dir( $category_id );
+ return get_site_url($category_id).get_local_dir($category_id);
}
// get_local_dir returns an array with complete path without the site url
@@ -383,7 +383,8 @@ function get_local_dir( $category_id )
{
$database_dirs[$row['id']] = $row['dir'];
}
- foreach ( $upper_array as $id ) {
+ foreach ($upper_array as $id)
+ {
$local_dir.= $database_dirs[$id].'/';
}
@@ -392,16 +393,17 @@ function get_local_dir( $category_id )
// retrieving the site url : "http://domain.com/gallery/" or
// simply "./galleries/"
-function get_site_url( $category_id )
+function get_site_url($category_id)
{
global $page;
- $query = 'SELECT galleries_url';
- $query.= ' FROM '.SITES_TABLE.' AS s,'.CATEGORIES_TABLE.' AS c';
- $query.= ' WHERE s.id = c.site_id';
- $query.= ' AND c.id = '.$category_id;
- $query.= ';';
- $row = mysql_fetch_array( mysql_query( $query ) );
+ $query = '
+SELECT galleries_url
+ FROM '.SITES_TABLE.' AS s,'.CATEGORIES_TABLE.' AS c
+ WHERE s.id = c.site_id
+ AND c.id = '.$category_id.'
+;';
+ $row = mysql_fetch_array(mysql_query($query));
return $row['galleries_url'];
}