function __construct($post, $filter = 'ALL', $sort = 'none', $DESC = true){ if(session_check()) { $this->_sort = $sort; $this->_DESC = $DESC; loadIntClass('sql_query'); $sql = new Sql_query('comments'); $this->_comments = $sql->getComments($post,$filter); } else{ die('Your session has expired. Please <a href="'.ADMIN_URL.'/logout" target="_self">login</a> again in order to submit your post.'); } }
<?php require(ROOT.DS.MAIN.DS.'reflex'.DS.'admin'.DS.'documents'.DS.'headnavfoot'.DS.'header.php'); $slug='ALL'; $filter = array('pending','spam'); if(array_key_exists('post',$_GET)){ $slug = $_GET['post'] !== '_index_' ? str_replace('_','/',$_GET['post']) : '_index_'; $filter = 'ALL'; } loadIntClass('sql_query'); $sql = new Sql_query('comments'); $comments = $sql->getComments($slug,$filter); $table = ''; $pending = 0; $approved = 0; $spam = 0; for($i = 0; $i < count($comments); ++$i){ $table .= ' <tr id="'.$comments[$i]['id'].'" class="'.$comments[$i]['approved'].'" title="comment"> <td><input title="'.$comments[$i]['id'].'" type="checkbox" class="table_check" /></td> <td class="auth">'.$comments[$i]['author_name'].'</td> <td class="comm">'.$comments[$i]['content'].'</td> <td class="resp">'.$comments[$i]['post_slug'].'</td> <td class="date">'.date('m/d/Y',intval($comments[$i]['time'])).'</td> </tr> '; switch($comments[$i]['approved']){ case 'approved': $approved+=1; break; case 'pending': $pending+=1; break;