Example #1
0
 public function returnCommentsById($article_id)
 {
     return Database::querryAll('SELECT comment_id, author, comment, date
     FROM comments
     WHERE article_id = ?
     ORDER BY article_id DESC', array($article_id));
 }
Example #2
0
 public function returnSentMessages($sender)
 {
     return Database::querryAll('SELECT message_id, sender, recipient, subject, message, date, unread, sender_del, recipient_del
             FROM messages
             WHERE sender = ? AND sender_del = ?
             ORDER BY message_id DESC
             ', array($sender, 0));
 }
 public function returnTopArticlesByCategory($category)
 {
     return Database::querryAll('SELECT article_id, thumbnail_img, title, url, category, author, date, public
             FROM articles
             WHERE public = ? and category = ?
             ORDER BY article_id DESC LIMIT 3 OFFSET 0
         ', array(1, $category));
 }
Example #4
0
 public function returnUsers()
 {
     return Database::querryAll('
       SELECT user_id, name, avatar, admin, registration_date, last_visit, comments, articles, sex, email
       FROM users
       ORDER BY user_id ASC
     ');
 }
Example #5
0
 public function returnNotices()
 {
     return Database::querryAll('SELECT notice, type, notice_id, date
             FROM notices
             WHERE active = 1
             ORDER BY notice_id DESC
             ');
 }
Example #6
0
 public function returnArticlesByVisits()
 {
     return Database::querryAll('
       SELECT article_id, thumbnail_img, title, url, date, visits
       FROM articles
       ORDER BY visits DESC
     ');
 }
Example #7
0
 public function returnTopArticles()
 {
     return Database::querryAll('SELECT * FROM articles ORDER BY visits DESC LIMIT 5');
 }