mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
forgot some changes for post_time
git-svn-id: file:///svn/phpbb/trunk@6118 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
9c31a05b1c
commit
16a40387f1
5 changed files with 13 additions and 7 deletions
|
@ -485,6 +485,9 @@ class acp_search
|
|||
{
|
||||
global $db;
|
||||
|
||||
/**
|
||||
* @todo what is faster, doing a MAX() or an ORDER BY post_id and LIMIT 1?
|
||||
*/
|
||||
$sql = 'SELECT MAX(post_id) as max_post_id
|
||||
FROM '. POSTS_TABLE;
|
||||
$result = $db->sql_query($sql);
|
||||
|
|
|
@ -54,7 +54,7 @@ function mcp_front_view($id, $mode, $action)
|
|||
FROM ' . POSTS_TABLE . '
|
||||
WHERE forum_id IN (0, ' . implode(', ', $forum_list) . ')
|
||||
AND post_approved = 0
|
||||
ORDER BY post_id DESC';
|
||||
ORDER BY post_time DESC';
|
||||
$result = $db->sql_query_limit($sql, 5);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
|
@ -68,7 +68,7 @@ function mcp_front_view($id, $mode, $action)
|
|||
WHERE p.post_id IN (' . implode(', ', $post_list) . ')
|
||||
AND t.topic_id = p.topic_id
|
||||
AND p.poster_id = u.user_id
|
||||
ORDER BY p.post_id DESC';
|
||||
ORDER BY p.post_time DESC';
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
|
@ -158,7 +158,7 @@ function mcp_front_view($id, $mode, $action)
|
|||
AND r.user_id = u.user_id
|
||||
AND p.forum_id IN (0, ' . implode(', ', $forum_list) . ')',
|
||||
|
||||
'ORDER_BY' => 'p.post_id DESC'
|
||||
'ORDER_BY' => 'p.post_time DESC'
|
||||
));
|
||||
$result = $db->sql_query_limit($sql, 5);
|
||||
|
||||
|
|
|
@ -809,7 +809,7 @@ function mcp_fork_topic($topic_ids)
|
|||
$sql = 'SELECT *
|
||||
FROM ' . POSTS_TABLE . "
|
||||
WHERE topic_id = $topic_id
|
||||
ORDER BY post_id ASC";
|
||||
ORDER BY post_time ASC";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$post_rows = array();
|
||||
|
|
|
@ -545,14 +545,14 @@ function mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql,
|
|||
case 'posts':
|
||||
$limit_days = array(0 => $user->lang['ALL_POSTS'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
|
||||
$sort_by_text = array('a' => $user->lang['AUTHOR'], 't' => $user->lang['POST_TIME'], 's' => $user->lang['SUBJECT']);
|
||||
$sort_by_sql = array('a' => 'u.username', 't' => 'p.post_id', 's' => 'p.post_subject');
|
||||
$sort_by_sql = array('a' => 'u.username', 't' => 'p.post_time', 's' => 'p.post_subject');
|
||||
$limit_time_sql = ($min_time) ? "AND p.post_time >= $min_time" : '';
|
||||
break;
|
||||
|
||||
case 'reports':
|
||||
$limit_days = array(0 => $user->lang['ALL_REPORTS'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
|
||||
$sort_by_text = array('a' => $user->lang['AUTHOR'], 'r' => $user->lang['REPORTER'], 'p' => $user->lang['POST_TIME'], 't' => $user->lang['REPORT_TIME'], 's' => $user->lang['SUBJECT']);
|
||||
$sort_by_sql = array('a' => 'u.username', 'r' => 'ru.username', 'p' => 'p.post_id', 't' => 'r.report_time', 's' => 'p.post_subject');
|
||||
$sort_by_sql = array('a' => 'u.username', 'r' => 'ru.username', 'p' => 'p.post_time', 't' => 'r.report_time', 's' => 'p.post_subject');
|
||||
break;
|
||||
|
||||
case 'logs':
|
||||
|
|
|
@ -224,6 +224,9 @@ if (!$topic_data)
|
|||
// This is for determining where we are (page)
|
||||
if ($post_id)
|
||||
{
|
||||
/**
|
||||
* @todo adjust for using post_time? Generally adjust query... it is not called very often though
|
||||
*/
|
||||
$sql = 'SELECT COUNT(post_id) AS prev_posts
|
||||
FROM ' . POSTS_TABLE . "
|
||||
WHERE topic_id = {$topic_data['topic_id']}
|
||||
|
@ -325,7 +328,7 @@ if (!isset($topic_tracking_info))
|
|||
$limit_days = array(0 => $user->lang['ALL_POSTS'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
|
||||
|
||||
$sort_by_text = array('a' => $user->lang['AUTHOR'], 't' => $user->lang['POST_TIME'], 's' => $user->lang['SUBJECT']);
|
||||
$sort_by_sql = array('a' => 'u.username', 't' => 'p.post_id', 's' => 'p.post_subject');
|
||||
$sort_by_sql = array('a' => 'u.username', 't' => 'p.post_time', 's' => 'p.post_subject');
|
||||
|
||||
$s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = '';
|
||||
gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param);
|
||||
|
|
Loading…
Add table
Reference in a new issue