aboutsummaryrefslogtreecommitdiffstats
path: root/picture.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2004-11-13 13:43:53 +0000
committerplegall <plg@piwigo.org>2004-11-13 13:43:53 +0000
commit88e4e1e60adf660651f9276ab2b19bffcc72d9d3 (patch)
treec5ee67d2ba4ee38b2864cf136787d187d12a2c07 /picture.php
parent234b7463520902a62e0c3e4e35c00a9e27f14278 (diff)
- admin/cat_options page added : manage options for the whole categories
tree (uploadable, commentable). status and visible will be soon added - admin.php : $conf_link var to avoid lines longer than 79 characters - config.upload_available configuration parameter disappear : it's simpler to manage with cat_options - config.show_comments idem : new column categories.commentable, each categories can be commentable or not - categories.site_id becomes a nullable column : a virtual category does belong to no site - function display_select_categories has a new argument : $CSS_classes array to optionnaly assign a CSS class to each category in the select field - added informations in include/config.inc.php for setting default value of : - categories.visible - categories.status - categories.uploadable - categories.commentable - 2 new indexes images_i3(average_rate) and images_i4(hit) : optimizes best rated and most visited categories git-svn-id: http://piwigo.org/svn/trunk@602 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'picture.php')
-rw-r--r--picture.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/picture.php b/picture.php
index 4335f2a23..171bc5e50 100644
--- a/picture.php
+++ b/picture.php
@@ -753,6 +753,7 @@ $query.= '
;';
$result = pwg_query($query);
$categories = '';
+$page['show_comments'] = false;
while ($row = mysql_fetch_array($result))
{
if ($categories != '')
@@ -761,6 +762,12 @@ while ($row = mysql_fetch_array($result))
}
$cat_info = get_cat_info($row['category_id']);
$categories .= get_cat_display_name($cat_info['name'], ' &gt;');
+ // the picture is commentable if it belongs at least to one category which
+ // is commentable
+ if ($cat_info['commentable'])
+ {
+ $page['show_comments'] = true;
+ }
}
$template->assign_block_vars(
'info_line',
@@ -920,7 +927,7 @@ SELECT rate
}
//---------------------------------------------------- users's comments display
-if ( $conf['show_comments'] )
+if ($page['show_comments'])
{
// number of comment for this picture
$query = 'SELECT COUNT(*) AS nb_comments';