aboutsummaryrefslogtreecommitdiffstats
path: root/admin/comments.php
diff options
context:
space:
mode:
authorz0rglub <z0rglub@piwigo.org>2003-08-30 15:54:37 +0000
committerz0rglub <z0rglub@piwigo.org>2003-08-30 15:54:37 +0000
commit044fba02566cd1854e8a1721a74552073a6ad2e3 (patch)
tree5e2960701b26c9d9a9ba6e887277a652024eb961 /admin/comments.php
parentb5bc93914972e247aeb6dbe3dd7e319e13f5034a (diff)
Multi categories for the same picture
git-svn-id: http://piwigo.org/svn/trunk@61 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--admin/comments.php19
1 files changed, 7 insertions, 12 deletions
diff --git a/admin/comments.php b/admin/comments.php
index 127d495f4..dc9e584ac 100644
--- a/admin/comments.php
+++ b/admin/comments.php
@@ -17,6 +17,7 @@
* *
***************************************************************************/
include_once( './include/isadmin.inc.php' );
+$page['plain_structure'] = get_plain_structure();
//------------------------------------------------------------------- functions
function display_pictures( $mysql_result, $maxtime, $validation_box = false )
{
@@ -28,7 +29,7 @@ function display_pictures( $mysql_result, $maxtime, $validation_box = false )
$vtp->addSession( $sub, 'picture' );
// 2. for each picture, getting informations for displaying thumbnail and
// link to the full size picture
- $query = 'SELECT name,file,cat_id,tn_ext';
+ $query = 'SELECT name,file,storage_category_id as cat_id,tn_ext';
$query.= ' FROM '.PREFIX_TABLE.'images';
$query.= ' WHERE id = '.$row['image_id'];
$query.= ';';
@@ -37,8 +38,9 @@ function display_pictures( $mysql_result, $maxtime, $validation_box = false )
if ( $array_cat_directories[$subrow['cat_id']] == '' )
{
+ $array_cat_directories[$subrow['cat_id']] =
+ get_complete_dir( $subrow['cat_id'] );
$cat_result = get_cat_info( $subrow['cat_id'] );
- $array_cat_directories[$subrow['cat_id']] = $cat_result['dir'];
$array_cat_site_id[$subrow['cat_id']] = $cat_result['site_id'];
$array_cat_names[$subrow['cat_id']] =
get_cat_display_name( $cat_result['name'], ' &gt; ', '' );
@@ -83,10 +85,7 @@ function display_pictures( $mysql_result, $maxtime, $validation_box = false )
{
$vtp->addSession( $sub, 'comment' );
$vtp->setVar( $sub, 'comment.author', $subrow['author'] );
- $displayed_date = $lang['day'][date( "w", $subrow['date'] )];
- $displayed_date.= date( " j ", $subrow['date'] );
- $displayed_date.= $lang['month'][date( "n", $subrow['date'] )];
- $displayed_date.= date( " Y G:i", $subrow['date'] );
+ $displayed_date = format_date( $subrow['date'], 'unix', true );
$vtp->setVar( $sub, 'comment.date', $displayed_date );
$vtp->setVar( $sub, 'comment.content', nl2br( $subrow['content'] ) );
$vtp->addSession( $sub, 'delete' );
@@ -183,11 +182,9 @@ if ( isset( $_GET['last_days'] ) )
$query = 'SELECT DISTINCT(image_id) as image_id';
$query.= ' FROM '.PREFIX_TABLE.'comments';
$query.= ', '.PREFIX_TABLE.'images as images';
- $query.= ', '.PREFIX_TABLE.'categories';
$query.= ' WHERE image_id = images.id';
- $query.= ' AND cat_id = images.cat_id';
$query.= ' AND date > '.$maxtime;
- $query.= ' ORDER BY cat_id ASC,date_available DESC';
+ $query.= ' ORDER BY date_available DESC';
$query.= ';';
$result = mysql_query( $query );
display_pictures( $result, $maxtime );
@@ -221,11 +218,9 @@ if ( isset( $_GET['show_unvalidated'] ) )
$query = 'SELECT DISTINCT(image_id) as image_id';
$query.= ' FROM '.PREFIX_TABLE.'comments as comments';
$query.= ', '.PREFIX_TABLE.'images as images';
- $query.= ', '.PREFIX_TABLE.'categories';
$query.= ' WHERE image_id = images.id';
- $query.= ' AND cat_id = images.cat_id';
$query.= " AND comments.validated = 'false'";
- $query.= ' ORDER BY cat_id ASC,date_available DESC';
+ $query.= ' ORDER BY date_available DESC';
$query.= ';';
$result = mysql_query( $query );
display_pictures( $result, 0, true );