Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 9th, 2012  |  syntax: None  |  size: 0.56 KB  |  hits: 25  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. SELECT *, t.state+0 as state_num, t.id as topic_id from forumTopics t
  2. LEFT JOIN forumUsers u on t.creator=u.id
  3. LEFT JOIN forumReplies r ON r.posted=(SELECT posted FROM forumReplies WHERE topicID=t.id ORDER BY posted DESC LIMIT 1)
  4. WHERE t.sectionID=?
  5. ORDER BY COALESCE(%s, %s) DESC LIMIT %d, %d
  6.  
  7.  
  8.  
  9. Accessed by:
  10.  
  11.         public function getTopics($section, $start, $end, $by_created=false) {
  12.                 $s = ($by_created == true ? 't.created' : 'r.posted');
  13.                 return parent::query(sprintf($this->queries['getTopicsEx'], $s, 't.created', $start, $end), array(&$section));
  14.         }