- fix sql error (mysql4.1)

git-svn-id: file:///svn/phpbb/trunk@5070 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen 2005-01-21 09:48:46 +00:00
parent f71dae3365
commit 1438067953

View file

@ -258,11 +258,11 @@ class ucp_main extends module
'POSTS_DAY' => sprintf($user->lang['POST_DAY'], $posts_per_day),
'POSTS_PCT' => sprintf($user->lang['POST_PCT'], $percentage),
'ACTIVE_FORUM' => $active_f_name,
'ACTIVE_FORUM_POSTS'=> ($active_f_count == 1) ? sprintf($user->lang['USER_POST'], 1) : sprintf($user->lang['USER_POSTS'], $active_f_count),
'ACTIVE_FORUM_PCT' => sprintf($user->lang['POST_PCT'], $active_f_pct),
'ACTIVE_FORUM_POSTS'=> ($active_f_count == 1) ? sprintf($user->lang['USER_POST'], 1) : sprintf($user->lang['USER_POSTS'], $active_f_count),
'ACTIVE_FORUM_PCT' => sprintf($user->lang['POST_PCT'], $active_f_pct),
'ACTIVE_TOPIC' => $active_t_name,
'ACTIVE_TOPIC_POSTS'=> ($active_t_count == 1) ? sprintf($user->lang['USER_POST'], 1) : sprintf($user->lang['USER_POSTS'], $active_t_count),
'ACTIVE_TOPIC_PCT' => sprintf($user->lang['POST_PCT'], $active_t_pct),
'ACTIVE_TOPIC_PCT' => sprintf($user->lang['POST_PCT'], $active_t_pct),
'OCCUPATION' => (!empty($row['user_occ'])) ? $row['user_occ'] : '',
'INTERESTS' => (!empty($row['user_interests'])) ? $row['user_interests'] : '',
@ -388,7 +388,7 @@ class ucp_main extends module
'FORUM_ID' => $forum_id,
'FORUM_FOLDER_IMG' => $user->img($folder_image, $folder_alt),
'FORUM_NAME' => $row['forum_name'],
'LAST_POST_IMG' => $user->img('icon_post_latest', 'VIEW_LATEST_POST'),
'LAST_POST_IMG' => $user->img('icon_post_latest', 'VIEW_LATEST_POST'),
'LAST_POST_TIME' => $last_post_time,
'LAST_POST_AUTHOR' => $last_poster,
@ -420,13 +420,13 @@ class ucp_main extends module
}
$sql_from = ($config['load_db_lastread'] || $config['load_db_track']) ? '(' . TOPICS_TABLE . ' t LEFT JOIN ' . TOPICS_TRACK_TABLE . ' tt ON (tt.topic_id = t.topic_id AND tt.user_id = ' . $user->data['user_id'] . '))' : TOPICS_TABLE . ' t';
$sql_f_tracking = ($config['load_db_lastread']) ? 'LEFT JOIN ' . FORUMS_TRACK_TABLE . ' ft ON (ft.forum_id = t.forum_id AND ft.user_id = ' . $user->data['user_id'] . '), ' : '';
$sql_f_tracking = ($config['load_db_lastread']) ? 'LEFT JOIN ' . FORUMS_TRACK_TABLE . ' ft ON (ft.forum_id = t.forum_id AND ft.user_id = ' . $user->data['user_id'] . ')' : '';
$sql_t_select = ($config['load_db_lastread'] || $config['load_db_track']) ? ', tt.mark_type, tt.mark_time' : '';
$sql_f_select = ($config['load_db_lastread']) ? ', ft.mark_time AS forum_mark_time' : '';
$sql = "SELECT t.* $sql_f_select $sql_t_select
FROM $sql_from $sql_f_tracking " . TOPICS_WATCH_TABLE . ' tw
FROM $sql_from $sql_f_tracking, " . TOPICS_WATCH_TABLE . ' tw
WHERE tw.user_id = ' . $user->data['user_id'] . '
AND t.topic_id = tw.topic_id
ORDER BY t.topic_last_post_time DESC';