Changeset 229
- Timestamp:
- 2009-02-03 11:12:32 (3 years ago)
- Files:
-
- trunk/classes/pages/Newposts.php (modified) (1 diff)
- trunk/classes/pages/Search.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/classes/pages/Newposts.php
r213 r229 64 64 if (!isset($INPUT['page']) || $INPUT['page'] == '') { $INPUT['page'] = 1; } 65 65 $start = ($INPUT['page'] - 1) * $SETTINGS['postsperpage']; 66 $query2 .= ' ORDER BY p. posttime DESC LIMIT ' . $SETTINGS['postsperpage'] . ' OFFSET ' . $start;66 $query2 .= ' ORDER BY p.topic DESC, p.posttime DESC LIMIT ' . $SETTINGS['postsperpage'] . ' OFFSET ' . $start; 67 67 $q = $C->prepare($query2); 68 68 $q->bindParam(':timestamp', $_SESSION['lastvisit'], PDO::PARAM_STR, 20); trunk/classes/pages/Search.php
r228 r229 55 55 switch ($scope[0]) { 56 56 case 'all': 57 $query = 'SELECT p.postid, p.topic, p.poster, p.posttime, p.post, t.topictitle FROM ' . $SETTINGS['dbtableprefix'] . 'posts p, ' . $SETTINGS['dbtableprefix'] . 'topics t WHERE t.topicid = p.topic %cond% GROUP BY p.postid, p.topic, p.poster, p.posttime, p.post, t.topictitle ORDER BY p. posttime DESC';57 $query = 'SELECT p.postid, p.topic, p.poster, p.posttime, p.post, t.topictitle FROM ' . $SETTINGS['dbtableprefix'] . 'posts p, ' . $SETTINGS['dbtableprefix'] . 'topics t WHERE t.topicid = p.topic %cond% GROUP BY p.postid, p.topic, p.poster, p.posttime, p.post, t.topictitle ORDER BY p.topic DESC, p.posttime DESC'; 58 58 break; 59 59 case 'category': 60 $query = 'SELECT p.postid, p.topic, p.poster, p.posttime, p.post, t.topictitle FROM ' . $SETTINGS['dbtableprefix'] . 'posts p, ' . $SETTINGS['dbtableprefix'] . 'topics t, ' . $SETTINGS['dbtableprefix'] . 'forums f WHERE f.forum_category=:scope1 AND t.forum=f.forumid AND t.topicid = p.topic %cond% GROUP BY p.postid, p.topic, p.poster, p.posttime, p.post, t.topictitle ORDER BY p. posttime DESC';60 $query = 'SELECT p.postid, p.topic, p.poster, p.posttime, p.post, t.topictitle FROM ' . $SETTINGS['dbtableprefix'] . 'posts p, ' . $SETTINGS['dbtableprefix'] . 'topics t, ' . $SETTINGS['dbtableprefix'] . 'forums f WHERE f.forum_category=:scope1 AND t.forum=f.forumid AND t.topicid = p.topic %cond% GROUP BY p.postid, p.topic, p.poster, p.posttime, p.post, t.topictitle ORDER BY p.topic DESC, p.posttime DESC'; 61 61 break; 62 62 case 'forum': 63 $query = 'SELECT p.postid, p.topic, p.poster, p.posttime, p.post, t.topictitle FROM ' . $SETTINGS['dbtableprefix'] . 'posts p, ' . $SETTINGS['dbtableprefix'] . 'topics t WHERE t.forum=:scope1 AND t.topicid = p.topic %cond% GROUP BY p.postid, p.topic, p.poster, p.posttime, p.post, t.topictitle ORDER BY p. posttime DESC';63 $query = 'SELECT p.postid, p.topic, p.poster, p.posttime, p.post, t.topictitle FROM ' . $SETTINGS['dbtableprefix'] . 'posts p, ' . $SETTINGS['dbtableprefix'] . 'topics t WHERE t.forum=:scope1 AND t.topicid = p.topic %cond% GROUP BY p.postid, p.topic, p.poster, p.posttime, p.post, t.topictitle ORDER BY p.topic DESC, p.posttime DESC'; 64 64 break; 65 65 } … … 170 170 $_username = $q->fetchColumn(); 171 171 $q = NULL; 172 $query = 'SELECT p.postid, p.topic, p.poster, p.posttime, p.post, t.topictitle FROM ' . $SETTINGS['dbtableprefix'] . 'posts p, ' . $SETTINGS['dbtableprefix'] . 'topics t WHERE t.topicid = p.topic AND p.poster = :username AND p.postedbymember = :memberid %cond% ORDER BY p. posttime DESC';172 $query = 'SELECT p.postid, p.topic, p.poster, p.posttime, p.post, t.topictitle FROM ' . $SETTINGS['dbtableprefix'] . 'posts p, ' . $SETTINGS['dbtableprefix'] . 'topics t WHERE t.topicid = p.topic AND p.poster = :username AND p.postedbymember = :memberid %cond% ORDER BY p.topic DESC, p.posttime DESC'; 173 173 break; 174 174 default:
