/** * Gets all comments for admin accept * * @param integer $_limit The limit * * @return <type> All. */ public static function admin_get($_limit = 50) { if (!is_numeric($_limit)) { $_limit = 50; } $pagenation_query = "SELECT\tid\tFROM comments WHERE\tcomments.comment_type = 'comment' AND comments.comment_status = 'unapproved'\n\t\t -- comments::admin_get() for pagenation "; list($limit_start, $_limit) = \lib\db::pagnation($pagenation_query, $_limit); $limit = " LIMIT {$limit_start}, {$_limit} "; $query = "\n\t\t\tSELECT\n\t\t\t\tcomments.*,\n\t\t\t\tposts.post_title AS 'title',\n\t\t\t\tposts.post_url AS 'url',\n\t\t\t\tusers.user_status AS 'status',\n\t\t\t\tusers.user_email AS 'email'\n\t\t\tFROM\n\t\t\t\tcomments\n\t\t\tINNER JOIN posts ON posts.id = comments.post_id\n\t\t\tINNER JOIN users ON users.id = comments.user_id\n\t\t\tWHERE\n\t\t\t\tcomments.comment_type = 'comment' AND\n\t\t\t\tcomments.comment_status = 'unapproved'\n\t\t\tORDER BY id ASC\n\t\t\t{$limit}\n\t\t\t-- comments::admin_get()\n\t\t"; return \lib\db::get($query); }