diff --git a/phpBB/posting.php b/phpBB/posting.php index 27b66811fa..d1de009998 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -1157,7 +1157,7 @@ function topic_review($topic_id, $is_inline_review = false) trigger_error($user->lang['NO_TOPIC']); } - $forum_id = intval($row['forum_id']); + $forum_id = $row['forum_id']; $topic_title = $row['topic_title']; if (!$auth->acl_get('f_read', $forum_id)) @@ -1234,18 +1234,24 @@ function topic_review($topic_id, $is_inline_review = false) } $template->assign_block_vars('postrow', array( - 'MINI_POST_IMG' => $user->img('icon_post', $user->lang['POST']), - 'POSTER_NAME' => $poster, - 'POST_DATE' => $user->format_date($row['post_time']), - 'POST_SUBJECT' => $post_subject, - 'POST_ID' => $row['post_id'], - 'MESSAGE' => nl2br($message), + 'MINI_POST_IMG' => $user->img('icon_post', $user->lang['POST']), + 'POSTER_NAME' => $poster, + 'POST_DATE' => $user->format_date($row['post_time']), + 'POST_SUBJECT' => $post_subject, + 'POST_ID' => $row['post_id'], + 'MESSAGE' => str_replace("\n", '
', $message), + + 'U_QUOTE' => ($auth->acl_get('f_quote', $forum_id)) ? "javascript:addquote(" . $row['post_id'] . ", '$poster')" : '', 'S_ROW_COUNT' => $i) ); unset($rowset[$i]); } + // + $template->assign_var('QUOTE_IMG', $user->img('btn_quote', $user->lang['QUOTE_POST'])); + + // page_header($page_title); $template->set_filenames(array( diff --git a/phpBB/templates/subSilver/posting_topic_review.html b/phpBB/templates/subSilver/posting_topic_review.html index 14025cf8b7..f45be07ca4 100644 --- a/phpBB/templates/subSilver/posting_topic_review.html +++ b/phpBB/templates/subSilver/posting_topic_review.html @@ -72,7 +72,7 @@ function addquote(post_id, username) { - + diff --git a/phpBB/templates/subSilver/viewforum_body.html b/phpBB/templates/subSilver/viewforum_body.html index 853f7b34b1..288b3c895c 100644 --- a/phpBB/templates/subSilver/viewforum_body.html +++ b/phpBB/templates/subSilver/viewforum_body.html @@ -2,21 +2,21 @@
{postrow.MINI_POST_IMG}{L_POSTED}: {postrow.POST_DATE}    {L_POST_SUBJECT}: {postrow.POST_SUBJECT}{QUOTE_IMG}

- + - - + + +
{FORUM_NAME}
{L_MODERATORS}: {MODERATORS}
{FORUM_NAME}
{L_MODERATORS}: {MODERATORS}
{MOD_CP}
{LOGGED_IN_USER_LIST}{PAGINATION}[ {TOTAL_TOPICS} ] {PAGINATION}
- +
- - - + +
{POST_IMG}{L_MARK_TOPICS_READ}{POST_IMG}
@@ -27,6 +27,19 @@ + + + + + + + + @@ -38,7 +51,9 @@ + + @@ -48,29 +63,31 @@ + - + - + - + + + @@ -79,23 +96,42 @@ + - +
+ + + + +
 {L_TOPICS}  {L_VIEWS}   {L_LAST_POST} 
{L_ANNOUNCEMENTS}{L_TOPICS}
{topicrow.TOPIC_FOLDER_IMG}{topicrow.TOPIC_FOLDER_IMG} {topicrow.TOPIC_ICON_IMG}{topicrow.TOPIC_ICON_IMG} - - - - - - -
{UNAPPROVED_IMG} {REPORTED_IMG} {topicrow.NEWEST_POST_IMG}{topicrow.ATTACH_ICON_IMG}{topicrow.TOPIC_TYPE}{topicrow.TOPIC_TITLE}
{topicrow.GOTO_PAGE}
- - {topicrow.NEWEST_POST_IMG}{topicrow.ATTACH_ICON_IMG}{topicrow.TOPIC_TYPE}{topicrow.TOPIC_TITLE}
{topicrow.GOTO_PAGE}
- -
+ + + + + + +
+ {UNAPPROVED_IMG}  + {REPORTED_IMG}  + {topicrow.NEWEST_POST_IMG}{topicrow.ATTACH_ICON_IMG}{topicrow.TOPIC_TITLE}
{topicrow.GOTO_PAGE}
{topicrow.TOPIC_AUTHOR} {topicrow.REPLIES} {topicrow.VIEWS} {topicrow.LAST_POST_TIME}
{topicrow.LAST_POST_AUTHOR} {topicrow.LAST_POST_IMG}
{L_NO_TOPICS}
{L_DISPLAY_TOPICS}: {S_SELECT_SORT_DAYS} {L_SORT_BY} {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR} {L_DISPLAY_TOPICS}: {S_SELECT_SORT_DAYS} {L_SORT_BY} {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR} 
- +
- - + + - - +
{POST_IMG}{S_TIMEZONE}
{PAGINATION}
{S_TIMEZONE}
{PAGE_NUMBER} [ {TOTAL_TOPICS} ] + + + + + +
 [ {TOTAL_TOPICS} ]
+ +
+ + + + + + + + +
{L_WHO_IS_ONLINE}
{LOGGED_IN_USER_LIST}
+ +
diff --git a/phpBB/templates/subSilver/viewtopic_body.html b/phpBB/templates/subSilver/viewtopic_body.html index 8818c0c33e..4910515f50 100644 --- a/phpBB/templates/subSilver/viewtopic_body.html +++ b/phpBB/templates/subSilver/viewtopic_body.html @@ -6,15 +6,20 @@ - - +
{MCP}
{LOGGED_IN_USER_LIST}{PAGINATION} + + + + + +
 [ {TOTAL_POSTS} ]
- +
- +
{POST_IMG} {REPLY_IMG}
@@ -22,8 +27,8 @@ - - + +
 {L_PRINT_TOPIC} :: {L_EMAIL_TOPIC}{L_VIEW_UNREAD_POST} :: {L_VIEW_PREVIOUS_TOPIC} :: {L_VIEW_NEXT_TOPIC} 
@@ -86,17 +91,18 @@ - + {postrow.L_IGNORE_POST} - + {postrow.L_IGNORE_POST} - - {postrow.POSTER_NAME}
{postrow.POSTER_RANK}
{postrow.RANK_IMAGE}{postrow.POSTER_AVATAR}

{L_JOINED}: {postrow.POSTER_JOINED}
{L_POSTS}: {postrow.POSTER_POSTS}
{L_LOCATION}: {postrow.POSTER_FROM}
+ + {postrow.POSTER_NAME}
{postrow.POSTER_RANK}
{postrow.RANK_IMAGE}{postrow.POSTER_AVATAR}

{L_JOINED}: {postrow.POSTER_JOINED}
{L_POSTS}: {postrow.POSTER_POSTS}
{L_LOCATION}: {postrow.POSTER_FROM}
- - - + + + +
{postrow.POST_ICON} {L_POST_SUBJECT}: {postrow.POST_SUBJECT}{postrow.QUOTE_IMG} {postrow.EDIT_IMG} {postrow.DELETE_IMG} {postrow.IP_IMG}{postrow.POST_ICON_IMG} {L_POST_SUBJECT}: {postrow.POST_SUBJECT} {QUOTE_IMG} {EDIT_IMG} {DELETE_IMG} {IP_IMG}
@@ -114,7 +120,7 @@ - + @@ -138,18 +151,17 @@ - + @@ -160,18 +172,36 @@
@@ -124,7 +130,14 @@ - + + + + + + + +
{UNAPPROVED_IMG}{REPORTED_IMG}  {L_POST_REPORTED}  {postrow.MINI_POST_IMG}{L_POSTED}: {postrow.POST_DATE} {postrow.MINI_POST_IMG}{L_POSTED}: {postrow.POST_DATE} {REPORT_IMG}
- - + //-->
{postrow.PROFILE_IMG} {postrow.PM_IMG} {postrow.EMAIL_IMG} {postrow.WWW_IMG} {postrow.AIM_IMG} {postrow.YIM_IMG} {postrow.MSN_IMG}{REPORT_IMG}
- +
- - + + - - +
{POST_IMG} {REPLY_IMG}{S_TIMEZONE}
{PAGINATION}
{S_TIMEZONE}
{PAGE_NUMBER} [ {TOTAL_POSTS} ] + + + + + +
 [ {TOTAL_POSTS} ]
+ +
+ + + + + + + + +
{L_WHO_IS_ONLINE}
{LOGGED_IN_USER_LIST}
+ +
diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index daba02a28c..8e183865f4 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -25,18 +25,16 @@ include($phpbb_root_path . 'extension.inc'); include($phpbb_root_path . 'common.'.$phpEx); -// Start initial var setup -$forum_id = (isset($_REQUEST['f'])) ? max(intval($_REQUEST['f']), 0) : 0; -$start = (isset($_GET['start'])) ? max(intval($_GET['start']), 0) : 0; -$mark_read = (!empty($_GET['mark'])) ? $_GET['mark'] : ''; - - // Start session $user->start(); $auth->acl($user->data); -// Put these here so we can use user defaults if set +// Start initial var setup +$forum_id = (isset($_REQUEST['f'])) ? max(intval($_REQUEST['f']), 0) : 0; +$start = (isset($_GET['start'])) ? max(intval($_GET['start']), 0) : 0; +$mark_read = (!empty($_GET['mark'])) ? htmlspecialchars($_GET['mark']) : ''; + $sort_days = (!empty($_REQUEST['st'])) ? max(intval($_REQUEST['st']), 0) : ((!empty($user->data['user_show_days'])) ? $user->data['user_show_days'] : 0); $sort_key = (!empty($_REQUEST['sk'])) ? htmlspecialchars($_REQUEST['sk']) : ((!empty($user->data['user_sortby_type'])) ? $user->data['user_sortby_type'] : 't'); $sort_dir = (!empty($_REQUEST['sd'])) ? htmlspecialchars($_REQUEST['sd']) : ((!empty($user->data['user_sortby_dir'])) ? $user->data['user_sortby_dir'] : 'd'); @@ -171,7 +169,7 @@ if ($forum_data['forum_type'] == FORUM_POST) meta_refresh(3, "viewforum.$phpEx$SID&f=$forum_id"); - $message = $user->lang['TOPICS_MARKED_READ'] . '

' . sprintf($user->lang['RETURN_FORUM'], '', ' '); + $message = $user->lang['TOPICS_MARKED'] . '

' . sprintf($user->lang['RETURN_FORUM'], '', ' '); trigger_error($message); } @@ -415,7 +413,7 @@ if ($forum_data['forum_type'] == FORUM_POST) } - $newest_post_img = ($unread_topic) ? "" . $user->img('icon_post_newest', 'VIEW_NEWEST_POST') . ' ' : ''; + $newest_post_img = ($unread_topic) ? "" . $user->img('icon_post_newest', 'VIEW_NEWEST_POST') . ' ' : ''; $folder_img = ($unread_topic) ? $folder_new : $folder; $folder_alt = ($unread_topic) ? 'NEW_POSTS' : (($row['topic_status'] == ITEM_LOCKED) ? 'TOPIC_LOCKED' : 'NO_NEW_POSTS'); diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 126bc60b03..39341db68a 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -49,6 +49,7 @@ if (!$topic_id && !$post_id) // Find topic id if user requested a newer or older topic +$unread_post_id = ''; if (isset($_GET['view']) && !$post_id) { if ($_GET['view'] == 'unread') @@ -94,21 +95,21 @@ if (isset($_GET['view']) && !$post_id) $message = $user->lang['NO_UNREAD_POSTS'] . '

' . sprintf($user->lang['RETURN_TOPIC'], "", ''); trigger_error($message); } + $db->sql_freeresult($result); - redirect("viewtopic.$phpEx$SID&p=" . $row['post_id'] . "#" . $row['post_id']); + $unread_post_id = $post_id = $row['post_id']; } - - redirect("index.$phpEx$SID"); } else if ($_GET['view'] == 'next' || $_GET['view'] == 'previous') { $sql_condition = ($_GET['view'] == 'next') ? '>' : '<'; $sql_ordering = ($_GET['view'] == 'next') ? 'ASC' : 'DESC'; - $sql = "SELECT t.topic_id - FROM " . TOPICS_TABLE . " t, " . TOPICS_TABLE . " t2 + $sql = 'SELECT t.topic_id + FROM ' . TOPICS_TABLE . ' t, ' . TOPICS_TABLE . " t2 WHERE t2.topic_id = $topic_id AND t.forum_id = t2.forum_id + " . (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND t.topic_approved = 1') . " AND t.topic_last_post_time $sql_condition t2.topic_last_post_time ORDER BY t.topic_last_post_time $sql_ordering"; $result = $db->sql_query_limit($sql, 1); @@ -175,11 +176,15 @@ if ($user->data['user_id'] != ANONYMOUS) -// Note2: after much inspection, having to find a valid forum_id when making return_to_topic links for global announcements in mcp is a pain. The easiest solution is to let admins choose under what forum topics should be seen when forum_id is not specified (preferably a public forum) +// Note2: after much inspection, having to find a valid forum_id when making return_to_topic links +// for global announcements in mcp is a pain. The easiest solution is to let admins choose under +// what forum topics should be seen when forum_id is not specified (preferably a public forum) if (!$forum_id) { $forum_id = 2; } + + $sql = 'SELECT t.topic_id, t.forum_id AS real_forum_id, t.topic_title, t.topic_attachment, t.topic_status, ' . (($auth->acl_get('m_approve')) ? 't.topic_replies_real AS topic_replies' : 't.topic_replies') . ', t.topic_last_post_id, t.topic_time, t.topic_type, t.poll_max_options, t.poll_start, t.poll_length, t.poll_title, f.forum_name, f.forum_desc, f.forum_parents, f.parent_id, f.left_id, f.right_id, f.forum_status, f.forum_id, f.forum_style, f.forum_password' . $extra_fields . ' FROM ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . ' f' . $join_sql_table . " WHERE $join_sql @@ -233,18 +238,21 @@ if (!empty($post_id)) $start = floor(($prev_posts - 1) / $config['posts_per_page']) * $config['posts_per_page']; } + // Fill extension informations, if this topic has attachments $extensions = array(); - if ($topic_attachment) { obtain_attach_extensions($extensions); } + // Are we watching this topic? -$s_watching_topic = ''; -$s_watching_topic_img = ''; -watch_topic_forum('topic', $s_watching_topic, $s_watching_topic_img, $user->data['user_id'], $topic_id, $notify_status); +$s_watching_topic = $s_watching_topic_img = ''; +if ($config['email_enable']) +{ + watch_topic_forum('topic', $s_watching_topic, $s_watching_topic_img, $user->data['user_id'], $topic_id, $notify_status); +} // Post ordering options @@ -424,10 +432,23 @@ $template->assign_vars(array( 'MCP' => ($auth->acl_get('m_', $forum_id)) ? sprintf($user->lang['MCP'], "session_id . "&f=$forum_id&t=$topic_id&start=$start&$u_sort_param&posts_per_page=" . $config['posts_per_page'] . '">', '') : '', 'MODERATORS' => (sizeof($forum_moderators[$forum_id])) ? implode(', ', $forum_moderators[$forum_id]) : '', - 'POST_IMG' => $post_img, - 'REPLY_IMG' => $reply_img, - 'REPORT_IMG' => $user->img('btn_report', $user->lang['REPORT_TO_ADMIN']), - + 'POST_IMG' => $post_img, + 'REPLY_IMG' => $reply_img, + 'QUOTE_IMG' => $user->img('btn_quote', $user->lang['QUOTE_POST']), + 'EDIT_IMG' => $user->img('btn_edit', $user->lang['EDIT_POST']), + 'DELETE_IMG' => $user->img('btn_delete', $user->lang['DELETE_POST']), + 'IP_IMG' => $user->img('btn_ip', $user->lang['VIEW_IP']), + 'PROFILE_IMG' => $user->img('btn_profile', $user->lang['READ_PROFILE']), + 'SEARCH_IMG' => $user->img('btn_search', $user->lang['SEARCH_USER_POSTS']), + 'PM_IMG' => $user->img('btn_pm', $user->lang['SEND_PRIVATE_MESSAGE']), + 'EMAIL_IMG' => $user->img('btn_email', $user->lang['SEND_EMAIL']), + 'WWW_IMG' => $user->img('btn_www', $user->lang['VISIT_WEBSITE']), + 'ICQ_IMG' => $user->img('btn_icq', $user->lang['ICQ']), + 'AIM_IMG' => $user->img('btn_aim', $user->lang['AIM']), + 'MSN_IMG' => $user->img('btn_msnm', $user->lang['MSNM']), + 'YIM_IMG' => $user->img('btn_yim', $user->lang['YIM']) , + 'JABBER_IMG' => $user->img('btn_jabber', $user->lang['JABBER']) , + 'REPORT_IMG' => $user->img('btn_report', $user->lang['REPORT_POST']), 'REPORTED_IMG' => $user->img('icon_reported', $user->lang['POST_BEEN_REPORTED']), 'UNAPPROVED_IMG' => $user->img('icon_unapproved', $user->lang['POST_NOT_BEEN_APPROVED']), @@ -444,7 +465,7 @@ $template->assign_vars(array( 'U_TOPIC' => $server_path . "viewtopic.$phpEx?f=$forum_id&t=$topic_id", 'U_FORUM' => $server_path, - 'U_VIEW_UNREAD_POST' => "viewtopic.$phpEx$SID&f=$forum_id&t=$topic_id&view=unread", + 'U_VIEW_UNREAD_POST' => "viewtopic.$phpEx$SID&f=$forum_id&t=$topic_id&view=unread#unread", 'U_VIEW_TOPIC' => "viewtopic.$phpEx$SID&f=$forum_id&t=$topic_id&start=$start&$u_sort_param&hilit=$highlight", 'U_VIEW_FORUM' => $view_forum_url, 'U_VIEW_OLDER_TOPIC' => $view_prev_topic_url, @@ -456,12 +477,11 @@ $template->assign_vars(array( 'U_POST_REPLY_TOPIC' => $reply_topic_url) ); - // Does this topic contain a poll? if (!empty($poll_start)) { - $sql = "SELECT * - FROM " . POLL_OPTIONS_TABLE . " + $sql = 'SELECT * + FROM ' . POLL_OPTIONS_TABLE . " WHERE topic_id = $topic_id ORDER BY poll_option_id"; $result = $db->sql_query($sql); @@ -474,8 +494,8 @@ if (!empty($poll_start)) if ($user->data['user_id'] != ANONYMOUS) { - $sql = "SELECT poll_option_id - FROM " . POLL_VOTES_TABLE . " + $sql = 'SELECT poll_option_id + FROM ' . POLL_VOTES_TABLE . " WHERE topic_id = $topic_id AND vote_user_id = " . $user->data['user_id']; $result = $db->sql_query($sql); @@ -584,8 +604,8 @@ if (!empty($poll_start)) 'POLL_LEFT_CAP_IMG' => $user->img('poll_left'), 'POLL_RIGHT_CAP_IMG'=> $user->img('poll_right'), - 'L_MAX_VOTES' => ($poll_max_options == 1) ? $user->lang['MAX_OPTION_SELECT'] : sprintf($user->lang['MAX_OPTIONS_SELECT'], $poll_max_options), - 'L_POLL_LENGTH' => ($poll_length) ? sprintf($user->lang['POLL_RUN_TILL'], $user->format_date($poll_length + $poll_start)) : '', + 'L_MAX_VOTES' => ($poll_max_options == 1) ? $user->lang['MAX_OPTION_SELECT'] : sprintf($user->lang['MAX_OPTIONS_SELECT'], $poll_max_options), + 'L_POLL_LENGTH' => ($poll_length) ? sprintf($user->lang['POLL_RUN_TILL'], $user->format_date($poll_length + $poll_start)) : '', 'S_HAS_POLL' => true, 'S_CAN_VOTE' => $s_can_vote, @@ -593,7 +613,7 @@ if (!empty($poll_start)) 'S_IS_MULTI_CHOICE' => ($poll_max_options > 1) ? true : false, 'S_POLL_ACTION' => "viewtopic.$phpEx$SID&t=$topic_id&$u_sort_param", - 'U_VIEW_RESULTS' => "viewtopic.$phpEx$SID&t=$topic_id&$u_sort_param&vote=viewresult") + 'U_VIEW_RESULTS' => "viewtopic.$phpEx$SID&t=$topic_id&$u_sort_param&vote=viewresult") ); unset($poll_info); @@ -608,7 +628,7 @@ $force_encoding = ''; $bbcode_bitfield = $i = 0; // Go ahead and pull all data for this topic -$sql = "SELECT u.username, u.user_id, u.user_posts, u.user_from, u.user_karma, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_sig_bbcode_uid, u.user_sig_bbcode_bitfield, u.user_avatar, u.user_avatar_type, u.user_avatar_width, u.user_avatar_height, p.* +$sql = "SELECT u.username, u.user_id, u.user_posts, u.user_from, u.user_karma, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_jabber, u.user_regdate, u.user_msnm, u.user_allow_viewemail, u.user_rank, u.user_sig, u.user_sig_bbcode_uid, u.user_sig_bbcode_bitfield, u.user_avatar, u.user_avatar_type, u.user_avatar_width, u.user_avatar_height, p.* FROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u WHERE p.topic_id = $topic_id " . (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND p.post_approved = 1') . " @@ -693,22 +713,14 @@ do 'rank_image' => '', 'sig' => '', 'posts' => '', - 'profile_img' => '', 'profile' => '', - 'pm_img' => '', 'pm' => '', - 'email_img' => '', 'email' => '', - 'www_img' => '', 'www' => '', 'icq_status_img'=> '', - 'icq_img' => '', 'icq' => '', - 'aim_img' => '', 'aim' => '', - 'msn_img' => '', 'msn' => '', - 'search_img' => '', 'search' => '' ); } @@ -728,42 +740,29 @@ do $user_sig = ($row['user_allowsmile'] || $config['enable_smilies']) ? preg_replace('# $user->format_date($row['user_regdate'], $user->lang['DATE_FORMAT']), - 'posts' => (!empty($row['user_posts'])) ? $row['user_posts'] : '', - 'from' => (!empty($row['user_from'])) ? $row['user_from'] : '', + 'joined' => $user->format_date($row['user_regdate'], $user->lang['DATE_FORMAT']), + 'posts' => (!empty($row['user_posts'])) ? $row['user_posts'] : '', + 'from' => (!empty($row['user_from'])) ? $row['user_from'] : '', - 'sig' => $user_sig, - 'sig_bbcode_uid' => (!empty($row['user_sig_bbcode_uid'])) ? $row['user_sig_bbcode_uid'] : '', - 'sig_bbcode_bitfield' => (!empty($row['user_sig_bbcode_bitfield'])) ? $row['user_sig_bbcode_bitfield'] : '', + 'sig' => $user_sig, + 'sig_bbcode_uid' => (!empty($row['user_sig_bbcode_uid'])) ? $row['user_sig_bbcode_uid'] : '', + 'sig_bbcode_bitfield' => (!empty($row['user_sig_bbcode_bitfield'])) ? $row['user_sig_bbcode_bitfield'] : '', - 'avatar' => '', + 'avatar' => '', - 'profile_img' => '' . $user->img('btn_profile', $user->lang['READ_PROFILE']) . '', - 'profile' => '' . $user->lang['READ_PROFILE'] . '', - 'pm_img' => '' . $user->img('btn_pm', $user->lang['SEND_PRIVATE_MESSAGE']) . '', - 'pm' => '' . $user->lang['SEND_PRIVATE_MESSAGE'] . '', - 'www_img' => ($row['user_website']) ? '' . $user->img('btn_www', $user->lang['VISIT_WEBSITE']) . '' : '', - 'www' => ($row['user_website']) ? '' . $user->lang['VISIT_WEBSITE'] . '' : '', - 'aim_img' => ($row['user_aim']) ? '' . $user->img('btn_aim', $user->lang['AIM']) . '' : '', - 'aim' => ($row['user_aim']) ? '' . $user->lang['AIM'] . '' : '', - 'msn_img' => ($row['user_msnm']) ? '' . $user->img('btn_msnm', $user->lang['MSNM']) . '' : '', - 'msn' => ($row['user_msnm']) ? '' . $user->lang['MSNM'] . '' : '', - 'yim_img' => ($row['user_yim']) ? '' . $user->img('btn_yim', $user->lang['YIM']) . '' : '', - 'yim' => ($row['user_yim']) ? '' . $user->lang['YIM'] . '' : '', - 'search_img' => ($auth->acl_get('f_search', $forum_id)) ? '' . $user->img('btn_search', $user->lang['SEARCH_USER_POSTS']) . '' : '', - 'search' => ($auth->acl_get('f_search', $forum_id)) ? '' . $user->lang['SEARCH_USER_POSTS'] . '' : '' + 'profile' => "memberlist.$phpEx$SID&mode=viewprofile&u=$poster_id", + 'pm' => "ucp.$phpEx$SID&mode=message&action=send&u=$poster_id", + 'www' => $row['user_website'], + 'aim' => ($row['user_aim']) ? "memberlist.$phpEx$SID&mode=contact&action=aim&u=$poster_id" : '', + 'msn' => ($row['user_msnm']) ? "memberlist.$phpEx$SID&mode=contact&action=msnm&u=$poster_id" : '', + 'yim' => ($row['user_yim']) ? 'http://edit.yahoo.com/config/send_webmesg?.target=' . $row['user_yim'] . '&.src=pg' : '', + 'jabber' => ($row['user_jabber']) ? "memberlist.$phpEx$SID&mode=contact&action=jabber&u=$poster_id" : '', + 'search' => ($auth->acl_get('u_search')) ? "search.$phpEx$SID&search_author=" . urlencode($row['username']) .'&showresults=posts' : '' ); - if ($row['user_avatar_type'] && $auth->acl_get('u_setavatar') && $user->data['user_viewavatars']) + if ($row['user_avatar_type'] && $user->data['user_viewavatars']) { switch ($row['user_avatar_type']) { @@ -801,27 +800,21 @@ do if ((!empty($row['user_allow_viewemail']) || $auth->acl_get('m_', $forum_id)) && $config['email_enable']) { - $email_url = ($config['board_email_form']) ? "memberlist.$phpEx$SID&mode=email&u=" . $poster_id : 'mailto:' . $row['user_email']; - $user_cache[$poster_id]['email_img'] = '' . $user->img('btn_email', $user->lang['SEND_EMAIL']) . ''; - $user_cache[$poster_id]['email'] = '' . $user->lang['SEND_EMAIL'] . ''; + $user_cache[$poster_id]['email'] = ($config['board_email_form']) ? "memberlist.$phpEx$SID&mode=email&u=" . $poster_id : 'mailto:' . $row['user_email']; } else { - $user_cache[$poster_id]['email_img'] = ''; $user_cache[$poster_id]['email'] = ''; } if (!empty($row['user_icq'])) { - $icq_url = "memberlist.$phpEx$SID&mode=contact&action=icq&u=$poster_id"; - $user_cache[$poster_id]['icq_status_img'] = ''; - $user_cache[$poster_id]['icq_img'] = '' . $user->img('btn_icq', $user->lang['ICQ']) . ''; - $user_cache[$poster_id]['icq'] = '' . $user->lang['ICQ'] . ''; + $user_cache[$poster_id]['icq'] = "memberlist.$phpEx$SID&mode=contact&action=icq&u=$poster_id"; + $user_cache[$poster_id]['icq_status_img'] = ''; } else { $user_cache[$poster_id]['icq_status_img'] = ''; - $user_cache[$poster_id]['icq_img'] = ''; $user_cache[$poster_id]['icq'] = ''; } } @@ -960,47 +953,6 @@ foreach ($rowset as $key => $row) $user_cache[$poster_id]['sig_parsed'] = TRUE; } - // Non-user specific images/text - $temp_url = 'posting.' . $phpEx . $SID . '&mode=quote&p=' . $row['post_id']; - $quote_img = '' . $user->img('btn_quote', $user->lang['REPLY_WITH_QUOTE']) . ''; - $quote = '' . $user->lang['REPLY_WITH_QUOTE'] . ''; - - if (($user->data['user_id'] == $poster_id && $auth->acl_get('f_edit', $forum_id) && ($post_time > time() - $config['edit_time'] || !$config['edit_time'])) || $auth->acl_get('m_edit', $forum_id)) - { - $temp_url = "posting.$phpEx$SID&mode=edit&f=" . $row['forum_id'] . "&p=" . $row['post_id']; - $edit_img = '' . $user->img('btn_edit', $user->lang['EDIT_DELETE_POST']) . ''; - $edit = '' . $user->lang['EDIT_DELETE_POST'] . ''; - } - else - { - $edit_img = ''; - $edit = ''; - } - - if ($auth->acl_get('m_ip', $forum_id)) - { - $temp_url = "mcp.$phpEx?sid=" . $user->session_id . "&mode=post_details&p=" . $row['post_id'] . "&t=$topic_id#ip"; - $ip_img = '' . $user->img('btn_ip', $user->lang['VIEW_IP']) . ''; - $ip = '' . $user->lang['VIEW_IP'] . ''; - } - else - { - $ip_img = ''; - $ip = ''; - } - - if (($user->data['user_id'] == $poster_id && $auth->acl_get('f_delete', $forum_id) && $topic_data['topic_last_post_id'] == $row['post_id']) || $auth->acl_get('m_delete', $forum_id)) - { - $temp_url = "posting.$phpEx$SID&mode=delete&p=" . $row['post_id']; - $delpost_img = '' . $user->img('btn_delete', $user->lang['DELETE_POST']) . ''; - $delpost = '' . $user->lang['DELETE_POST'] . ''; - } - else - { - $delpost_img = ''; - $delpost = ''; - } - // Parse the message and subject $message = $row['post_text']; @@ -1062,14 +1014,6 @@ foreach ($rowset as $key => $row) } - // Define the little post icon - $mini_post_img = ($row['post_time'] > $user->data['user_lastvisit'] && $row['post_time'] > $topic_last_read) ? $user->img('icon_post_new', $user->lang['New_post']) : $user->img('icon_post', $user->lang['Post']); - - // Little post link and anchor name - $mini_post_url = 'viewtopic.' . $phpEx . $SID . '&p=' . $row['post_id'] . '#' . $row['post_id']; - $u_post_id = (!empty($newest_post_id) && $newest_post_id == $row['post_id']) ? 'newest' : $row['post_id']; - - // Dump vars into template $template->assign_block_vars('postrow', array( 'POSTER_NAME' => $row['poster'], @@ -1088,52 +1032,39 @@ foreach ($rowset as $key => $row) 'RATING' => $rating, - 'MINI_POST_IMG' => $mini_post_img, - 'EDIT_IMG' => $edit_img, - 'EDIT' => $edit, - 'QUOTE_IMG' => $quote_img, - 'QUOTE' => $quote, - 'IP_IMG' => $ip_img, - 'IP' => $ip, - 'DELETE_IMG' => $delpost_img, - 'DELETE' => $delpost, + 'MINI_POST_IMG' => ($row['post_time'] > $user->data['user_lastvisit'] && $row['post_time'] > $topic_last_read) ? $user->img('icon_post_new', $user->lang['NEW_POST']) : $user->img('icon_post', $user->lang['POST']), + 'POST_ICON_IMG' => (!empty($row['icon_id'])) ? '' : '', + 'ICQ_STATUS_IMG' => $user_cache[$poster_id]['icq_status_img'], - 'PROFILE_IMG' => $user_cache[$poster_id]['profile_img'], - 'PROFILE' => $user_cache[$poster_id]['profile'], - 'SEARCH_IMG' => $user_cache[$poster_id]['search_img'], - 'SEARCH' => $user_cache[$poster_id]['search'], - 'PM_IMG' => $user_cache[$poster_id]['pm_img'], - 'PM' => $user_cache[$poster_id]['pm'], - 'EMAIL_IMG' => $user_cache[$poster_id]['email_img'], - 'EMAIL' => $user_cache[$poster_id]['email'], - 'WWW_IMG' => $user_cache[$poster_id]['www_img'], - 'WWW' => $user_cache[$poster_id]['www'], - 'ICQ_STATUS_IMG'=> $user_cache[$poster_id]['icq_status_img'], - 'ICQ_IMG' => $user_cache[$poster_id]['icq_img'], - 'ICQ' => $user_cache[$poster_id]['icq'], - 'AIM_IMG' => $user_cache[$poster_id]['aim_img'], - 'AIM' => $user_cache[$poster_id]['aim'], - 'MSN_IMG' => $user_cache[$poster_id]['msn_img'], - 'MSN' => $user_cache[$poster_id]['msn'], - 'YIM_IMG' => $user_cache[$poster_id]['yim_img'], - 'YIM' => $user_cache[$poster_id]['yim'], + 'U_EDIT' => (($user->data['user_id'] == $poster_id && $auth->acl_get('f_edit', $forum_id) && ($post_time > time() - $config['edit_time'] || !$config['edit_time'])) || $auth->acl_get('m_edit', $forum_id)) ? "posting.$phpEx$SID&mode=edit&f=" . $row['forum_id'] . "&p=" . $row['post_id'] : '', + 'U_QUOTE' => ($auth->acl_get('f_quote', $forum_id)) ? "posting.$phpEx$SID&mode=quote&p=" . $row['post_id'] : '', + 'U_IP' => ($auth->acl_get('m_ip', $forum_id)) ? "mcp.$phpEx?sid=" . $user->session_id . "&mode=post_details&p=" . $row['post_id'] . "&t=$topic_id#ip" : '', + 'U_DELETE' => (($user->data['user_id'] == $poster_id && $auth->acl_get('f_delete', $forum_id) && $topic_data['topic_last_post_id'] == $row['post_id']) || $auth->acl_get('m_delete', $forum_id)) ? "posting.$phpEx$SID&mode=delete&p=" . $row['post_id'] : '', - 'POST_ICON' => (!empty($row['icon_id'])) ? '' : '', + 'U_PROFILE' => $user_cache[$poster_id]['profile'], + 'U_SEARCH' => $user_cache[$poster_id]['search'], + 'U_PM' => $user_cache[$poster_id]['pm'], + 'U_EMAIL' => $user_cache[$poster_id]['email'], + 'U_WWW' => $user_cache[$poster_id]['www'], + 'U_ICQ' => $user_cache[$poster_id]['icq'], + 'U_AIM' => $user_cache[$poster_id]['aim'], + 'U_MSN' => $user_cache[$poster_id]['msn'], + 'U_YIM' => $user_cache[$poster_id]['yim'], + 'U_JABBER' => $user_cache[$poster_id]['jabber'], - 'L_MINI_POST_ALT' => $mini_post_alt, + 'U_REPORT' => "report.$phpEx$SID&p=" . $row['post_id'], + 'U_MCP_REPORT' => ($auth->acl_get('f_report', $forum_id)) ? "mcp.$phpEx$SID&mode=post_details&p=" . $row['post_id'] : '', + 'U_MCP_APPROVE' => "mcp.$phpEx$SID&mode=approve&p=" . $row['post_id'], + 'U_MINI_POST' => "viewtopic.$phpEx$SID&p=" . $row['post_id'] . '#' . $row['post_id'], + 'U_POST_ID' => ($unread_post_id == $row['post_id']) ? 'unread' : $row['post_id'], 'S_ROW_COUNT' => $i++, 'S_HAS_ATTACHMENTS' => (!empty($attachments[$row['post_id']])) ? TRUE : FALSE, 'S_POST_UNAPPROVED' => ($row['post_approved']) ? FALSE : TRUE, - 'S_POST_REPORTED' => ($row['post_reported'] && $auth->acl_get('m_', $forum_id)) ? TRUE : FALSE, - - 'U_REPORT' => "report.$phpEx$SID&p=" . $row['post_id'], - 'U_MCP_REPORT' => ($auth->acl_get('f_report', $forum_id)) ? "mcp.$phpEx$SID&mode=post_details&p=" . $row['post_id'] : '', - 'U_MCP_APPROVE' => "mcp.$phpEx$SID&mode=approve&p=" . $row['post_id'], - 'U_MINI_POST' => $mini_post_url, - 'U_POST_ID' => $u_post_id) + 'S_POST_REPORTED' => ($row['post_reported'] && $auth->acl_get('m_', $forum_id)) ? TRUE : FALSE) ); + // Process Attachments for this post if (sizeof($attachments[$row['post_id']])) { @@ -1201,13 +1132,13 @@ foreach ($rowset as $key => $row) { $display_cat = NONE_CAT; - if (intval($config['img_display_inlined'])) + if ($config['img_display_inlined']) { - if ( (intval($config['img_link_width']) != 0) || (intval($config['img_link_height']) != 0) ) + if ($config['img_link_width'] || $config['img_link_height']) { list($width, $height) = image_getdimension($filename); - $display_cat = (($width == 0) && ($height == 0)) ? IMAGE_CAT : ((($width <= intval($config['img_link_width'])) && ($height <= intval($config['img_link_height']))) ? IMAGE_CAT : NONE_CAT); + $display_cat = (!$width && !$height) ? IMAGE_CAT : (($width <= $config['img_link_width'] && $height <=$config['img_link_height']) ? IMAGE_CAT : NONE_CAT); } } else @@ -1339,7 +1270,7 @@ unset($user_cache); // if this is the first 'page view' if (!preg_match("#&t=$topic_id#", $user->data['session_page'])) { - $sql = "UPDATE " . TOPICS_TABLE . " + $sql = 'UPDATE ' . TOPICS_TABLE . " SET topic_views = topic_views + 1 WHERE topic_id = $topic_id"; $db->sql_query($sql); @@ -1347,9 +1278,9 @@ if (!preg_match("#&t=$topic_id#", $user->data['session_page'])) // Update the attachment download counts if (count($update_count)) { - $sql = "UPDATE " . ATTACHMENTS_DESC_TABLE . " + $sql = 'UPDATE ' . ATTACHMENTS_DESC_TABLE . ' SET download_count = download_count + 1 - WHERE attach_id IN (" . implode(', ', array_unique($update_count)) . ")"; + WHERE attach_id IN (' . implode(', ', array_unique($update_count)) . ')'; $db->sql_query($sql); } }