set_filenames(array('comments'=>'comments.tpl')); $template->assign( array( 'F_ACTION' => get_root_url().'admin.php?page=comments' ) ); // +-----------------------------------------------------------------------+ // | Tabs | // +-----------------------------------------------------------------------+ include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php'); $tabsheet = new tabsheet(); $tabsheet->set_id('comments'); $tabsheet->add('', l10n('User comments validation'), ''); $tabsheet->select(''); $tabsheet->assign(); // +-----------------------------------------------------------------------+ // | comments display | // +-----------------------------------------------------------------------+ $list = array(); $query = ' SELECT c.id, c.image_id, c.date, c.author, '. $conf['user_fields']['username'].' AS username, c.content, i.path, i.representative_ext FROM '.COMMENTS_TABLE.' AS c INNER JOIN '.IMAGES_TABLE.' AS i ON i.id = c.image_id LEFT JOIN '.USERS_TABLE.' AS u ON u.'.$conf['user_fields']['id'].' = c.author_id WHERE validated = \'false\' ORDER BY c.date DESC ;'; $result = pwg_query($query); while ($row = pwg_db_fetch_assoc($result)) { $thumb = DerivativeImage::thumb_url( array( 'id'=>$row['image_id'], 'path'=>$row['path'], ) ); if (empty($row['author_id'])) { $author_name = $row['author']; } else { $author_name = stripslashes($row['username']); } $template->append( 'comments', array( 'U_PICTURE' => get_root_url().'admin.php?page=photo-'.$row['image_id'], 'ID' => $row['id'], 'TN_SRC' => $thumb, 'AUTHOR' => trigger_event('render_comment_author', $author_name), 'DATE' => format_date($row['date'], true), 'CONTENT' => trigger_event('render_comment_content',$row['content']) ) ); array_push($list, $row['id']); } $template->assign('LIST', implode(',', $list) ); // +-----------------------------------------------------------------------+ // | sending html code | // +-----------------------------------------------------------------------+ $template->assign_var_from_handle('ADMIN_CONTENT', 'comments'); ?>