From be3bdf61d778928916942c07c6d60968fddf9d18 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 30 Apr 2005 14:36:33 +0000 Subject: [PATCH] - some fixes here and there git-svn-id: file:///svn/phpbb/trunk@5138 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/download.php | 3 +- phpBB/index.php | 10 +- phpBB/memberlist.php | 208 ++++++++++-------- phpBB/posting.php | 9 +- phpBB/search.php | 2 +- .../styles/subSilver/template/attachment.html | 2 +- .../subSilver/template/memberlist_body.html | 5 +- .../subSilver/template/memberlist_view.html | 6 + .../subSilver/template/overall_header.html | 4 +- .../template/posting_attach_body.html | 2 +- .../subSilver/template/posting_body.html | 2 +- .../subSilver/template/search_results.html | 2 +- .../subSilver/template/viewtopic_body.html | 8 +- phpBB/ucp.php | 2 +- phpBB/viewonline.php | 2 +- 15 files changed, 159 insertions(+), 108 deletions(-) diff --git a/phpBB/download.php b/phpBB/download.php index 4de5aebf1a..2ddbd42fe0 100644 --- a/phpBB/download.php +++ b/phpBB/download.php @@ -204,14 +204,13 @@ function send_file_to_browser($attachment, $upload_dir, $category) $attachment['mimetype'] = ($browser_agent == 'ie' || $browser_agent == 'opera') ? 'application/octetstream' : 'application/octet-stream'; } - if ($config['gzip_compress']) + if (@ob_get_length()) { @ob_end_clean(); } // Now the tricky part... let's dance header('Pragma: public'); -// header('Content-Transfer-Encoding: none'); // Send out the Headers header('Content-Type: ' . $attachment['mimetype'] . '; name="' . $attachment['real_filename'] . '"'); diff --git a/phpBB/index.php b/phpBB/index.php index 3914e8a5eb..5b135a1d1c 100644 --- a/phpBB/index.php +++ b/phpBB/index.php @@ -43,7 +43,7 @@ $result = $db->sql_query($sql); $legend = ''; while ($row = $db->sql_fetchrow($result)) { - $legend .= (($legend != '') ? ', ' : '') . '' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . ''; + $legend .= (($legend != '') ? ', ' : '') . '' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . ''; } $db->sql_freeresult($result); @@ -62,7 +62,7 @@ if ($config['load_birthdays']) while ($row = $db->sql_fetchrow($result)) { $user_colour = ($row['user_colour']) ? ' style="color:#' . $row['user_colour'] .'"' : ''; - $birthday_list .= (($birthday_list != '') ? ', ' : '') . '' . $row['username'] . ''; + $birthday_list .= (($birthday_list != '') ? ', ' : '') . '' . $row['username'] . ''; if ($age = (int)substr($row['user_birthday'], -4)) { @@ -77,7 +77,7 @@ $template->assign_vars(array( 'TOTAL_POSTS' => sprintf($user->lang[$l_total_post_s], $total_posts), 'TOTAL_TOPICS' => sprintf($user->lang[$l_total_topic_s], $total_topics), 'TOTAL_USERS' => sprintf($user->lang[$l_total_user_s], $total_users), - 'NEWEST_USER' => sprintf($user->lang['NEWEST_USER'], "", $newest_user, ''), + 'NEWEST_USER' => sprintf($user->lang['NEWEST_USER'], "", $newest_user, ''), 'LEGEND' => $legend, 'BIRTHDAY_LIST' => $birthday_list, @@ -85,10 +85,10 @@ $template->assign_vars(array( 'FORUM_NEW_IMG' => $user->img('forum_new', 'NEW_POSTS'), 'FORUM_LOCKED_IMG' => $user->img('forum_locked', 'NO_NEW_POSTS_LOCKED'), - 'S_LOGIN_ACTION' => "ucp.$phpEx$SID&mode=login", + 'S_LOGIN_ACTION' => "{$phpbb_root_path}ucp.$phpEx$SID&mode=login", 'S_DISPLAY_BIRTHDAY_LIST' => ($config['load_birthdays']) ? true : false, - 'U_MARK_FORUMS' => "index.$phpEx$SID&mark=forums") + 'U_MARK_FORUMS' => "{$phpbb_root_path}index.$phpEx$SID&mark=forums") ); // Output page diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index f7eca2d264..3a2231d2f7 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -38,7 +38,7 @@ switch ($mode) { if ($user->data['user_id'] != ANONYMOUS) { - trigger_error($user->lang['NO_VIEW_USERS']); + trigger_error('NO_VIEW_USERS'); } login_box('', $user->lang['LOGIN_EXPLAIN_' . strtoupper($mode)]); @@ -138,7 +138,7 @@ switch ($mode) if (!($row = $db->sql_fetchrow($result))) { - trigger_error($user->lang['NO_USER_DATA']); + trigger_error('NO_USER_DATA'); } $db->sql_freeresult($result); @@ -207,7 +207,7 @@ switch ($mode) if ($user_id == ANONYMOUS) { - trigger_error($user->lang['NO_USER']); + trigger_error('NO_USER'); } // Do the SQL thang @@ -233,7 +233,7 @@ switch ($mode) if (!($member = $db->sql_fetchrow($result))) { - trigger_error($user->lang['NO_USER']); + trigger_error('NO_USER'); } $db->sql_freeresult($result); @@ -386,13 +386,7 @@ switch ($mode) include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx); $cp = new custom_profile(); $profile_fields = $cp->generate_profile_fields_template('grab', $user_id); - $profile_fields = (isset($profile_fields[$user_id])) ? $cp->generate_profile_fields_template('show', false, $profile_fields[$user_id]) : array(); - - if (sizeof($profile_fields)) - { - $template->assign_vars($profile_fields); - } } $template->assign_vars(array( @@ -422,13 +416,26 @@ switch ($mode) 'S_PROFILE_ACTION' => "memberlist.$phpEx$SID&mode=group", 'S_GROUP_OPTIONS' => $group_options, - 'S_CUSTOM_FIELDS' => (sizeof($profile_fields)) ? true : false, + 'S_CUSTOM_FIELDS' => (isset($profile_fields['row']) && sizeof($profile_fields['row'])) ? true : false, 'U_ADD_FRIEND' => "ucp.$phpEx$SID&i=zebra&add=" . urlencode($member['username']), 'U_ADD_FOE' => "ucp.$phpEx$SID&i=zebra&mode=foes&add=" . urlencode($member['username']), 'U_ACTIVE_FORUM' => "viewforum.$phpEx$SID&f=$active_f_id", 'U_ACTIVE_TOPIC' => "viewtopic.$phpEx$SID&t=$active_t_id",) ); + + if (isset($profile_fields['row']) && sizeof($profile_fields['row'])) + { + $template->assign_vars($profile_fields['row']); + } + + if (isset($profile_fields['blockrow']) && sizeof($profile_fields['blockrow'])) + { + foreach ($profile_fields['blockrow'] as $field_data) + { + $template->assign_block_vars('custom_fields', $field_data); + } + } break; case 'email': @@ -436,25 +443,25 @@ switch ($mode) $page_title = $user->lang['SEND_EMAIL']; $template_html = 'memberlist_email.html'; - if (empty($config['email_enable'])) + if (!$config['email_enable']) { - trigger_error($user->lang['EMAIL_DISABLED']); + trigger_error('EMAIL_DISABLED'); } - if (($user_id == ANONYMOUS || empty($config['board_email_form'])) && !$topic_id) + if (($user_id == ANONYMOUS || !$config['board_email_form']) && !$topic_id) { - trigger_error($user->lang['NO_EMAIL']); + trigger_error('NO_EMAIL'); } if (!$auth->acl_get('u_sendemail')) { - trigger_error($user->lang['NO_EMAIL']); + trigger_error('NO_EMAIL'); } // Are we trying to abuse the facility? if (time() - $user->data['user_emailtime'] < $config['flood_interval']) { - trigger_error($lang['FLOOD_EMAIL_LIMIT']); + trigger_error('FLOOD_EMAIL_LIMIT'); } $name = strip_tags(request_var('name', '')); @@ -477,14 +484,14 @@ switch ($mode) if (!($row = $db->sql_fetchrow($result))) { - trigger_error($user->lang['NO_USER']); + trigger_error('NO_USER'); } $db->sql_freeresult($result); // Can we send email to this user? - if (empty($row['user_allow_viewemail']) && !$auth->acl_get('a_user')) + if (!$row['user_allow_viewemail'] && !$auth->acl_get('a_user')) { - trigger_error($user->lang['NO_EMAIL']); + trigger_error('NO_EMAIL'); } } else @@ -496,18 +503,18 @@ switch ($mode) if (!($row = $db->sql_fetchrow($result))) { - trigger_error($user->lang['NO_TOPIC']); + trigger_error('NO_TOPIC'); } $db->sql_freeresult($result); if (!$auth->acl_get('f_read', $row['forum_id'])) { - trigger_error($user->lang['NO_FORUM_READ']); + trigger_error('NO_FORUM_READ'); } if (!$auth->acl_get('f_email', $row['forum_id'])) { - trigger_error($user->lang['NO_EMAIL']); + trigger_error('NO_EMAIL'); } } @@ -579,8 +586,8 @@ switch ($mode) $messenger->assign_vars(array( 'SITENAME' => $config['sitename'], 'BOARD_EMAIL' => $config['board_contact'], - 'FROM_USERNAME' => $user->data['username'], - 'TO_USERNAME' => ($topic_id) ? $name : $row['username'], + 'FROM_USERNAME' => stripslashes($user->data['username']), + 'TO_USERNAME' => ($topic_id) ? stripslashes($name) : stripslashes($row['username']), 'MESSAGE' => $message, 'TOPIC_NAME' => ($topic_id) ? strtr($row['topic_title'], array_flip(get_html_translation_table(HTML_ENTITIES))) : '', @@ -603,18 +610,19 @@ switch ($mode) 'NAME' => htmlspecialchars($name), 'TOPIC_TITLE' => $row['topic_title'], - 'U_TOPIC' => "viewtopic.$phpEx$SID&f=" . $row['forum_id'] . "&t=topic_id", + 'U_TOPIC' => "{$phpbb_root_path}viewtopic.$phpEx$SID&f={$row['forum_id']}&t=$topic_id", 'S_LANG_OPTIONS'=> ($topic_id) ? language_select($email_lang) : '') ); } + $template->assign_vars(array( 'USERNAME' => (!$topic_id) ? addslashes($row['username']) : '', 'ERROR_MESSAGE' => (sizeof($error)) ? implode('
', $error) : '', 'L_EMAIL_BODY_EXPLAIN' => (!$topic_id) ? $user->lang['EMAIL_BODY_EXPLAIN'] : $user->lang['EMAIL_TOPIC_EXPLAIN'], - 'S_POST_ACTION' => (!$topic_id) ? "memberlist.$phpEx$SID&mode=email&u=$user_id" : "memberlist.$phpEx$SID&mode=email&f=$forum_id&t=$topic_id", + 'S_POST_ACTION' => (!$topic_id) ? "{$phpbb_root_path}memberlist.$phpEx$SID&mode=email&u=$user_id" : "{$phpbb_root_path}memberlist.$phpEx$SID&mode=email&f=$forum_id&t=$topic_id", 'S_SEND_USER' => (!$topic_id) ? true : false) ); break; @@ -744,7 +752,7 @@ switch ($mode) if (!extract($db->sql_fetchrow($result))) { - trigger_error($user->lang['NO_GROUP']); + trigger_error('NO_GROUP'); } $db->sql_freeresult($result); @@ -801,7 +809,7 @@ switch ($mode) 'AVATAR_IMG' => $avatar_img, 'RANK_IMG' => $rank_img, - 'U_PM' => ($auth->acl_get('u_sendpm') && $group_receive_pm && $config['allow_mass_pm']) ? "ucp.$phpEx$SID&i=pm&mode=compose&g=$group_id" : '',) + 'U_PM' => ($auth->acl_get('u_sendpm') && $group_receive_pm && $config['allow_mass_pm']) ? "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&mode=compose&g=$group_id" : '',) ); $sql_from = ', ' . USER_GROUP_TABLE . ' ug '; @@ -827,12 +835,8 @@ switch ($mode) $total_users = $config['num_users']; } - - - - // Pagination string - $pagination_url = "memberlist.$phpEx$SID&mode=$mode"; + $pagination_url = "{$phpbb_root_path}memberlist.$phpEx$SID&mode=$mode"; // Build a relevant pagination_url $global_var = ($submit) ? '_POST' : '_GET'; @@ -845,9 +849,6 @@ switch ($mode) $pagination_url .= '&' . $key . '=' . urlencode(htmlspecialchars($var)); } - - - // Some search user specific data if ($mode == 'searchuser' && ($config['load_search'] || $auth->acl_get('a_'))) { @@ -872,7 +873,7 @@ switch ($mode) // 'S_USERNAME_OPTIONS' => $username_list, 'S_JOINED_TIME_OPTIONS' => $s_find_join_time, 'S_ACTIVE_TIME_OPTIONS' => $s_find_active_time, - 'S_SEARCH_ACTION' => "memberlist.$phpEx$SID&mode=searchuser&form=$form&field=$field") + 'S_SEARCH_ACTION' => "{$phpbb_root_path}memberlist.$phpEx$SID&mode=searchuser&form=$form&field=$field") ); } @@ -898,60 +899,95 @@ switch ($mode) ORDER BY $order_by"; $result = $db->sql_query_limit($sql, $config['topics_per_page'], $start); - if ($row = $db->sql_fetchrow($result)) + $id_cache = array(); + while ($row = $db->sql_fetchrow($result)) { - $i = 0; - do + $row['session_time'] = (!empty($session_times[$row['user_id']])) ? $session_times[$row['user_id']] : ''; + + $id_cache[$row['user_id']] = $row; + } + $db->sql_freeresult($result); + + // Load custom profile fields + if ($config['load_cpf_memberlist']) + { + include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx); + $cp = new custom_profile(); + + // Grab all profile fields from users in id cache for later use - similar to the poster cache + $profile_fields_cache = $cp->generate_profile_fields_template('grab', array_keys($id_cache)); + } + + $i = 0; + foreach ($id_cache as $user_id => $row) + { + $cp_row = array(); + if ($config['load_cpf_memberlist']) { - $row['session_time'] = (!empty($session_times[$row['user_id']])) ? $session_times[$row['user_id']] : ''; - - $template->assign_block_vars('memberrow', array_merge(show_profile($row), array( - 'ROW_NUMBER' => $i + ($start + 1), - - 'U_VIEWPROFILE' => "memberlist.$phpEx$SID&mode=viewprofile&u=" . $row['user_id'])) - ); - - $i++; + $cp_row = (isset($profile_fields_cache[$user_id])) ? $cp->generate_profile_fields_template('show', false, $profile_fields_cache[$user_id]) : array(); } - while ($row = $db->sql_fetchrow($result)); - } - // Generate page - $template->assign_vars(array( - 'PAGINATION' => generate_pagination($pagination_url, $total_users, $config['topics_per_page'], $start), - 'PAGE_NUMBER' => on_page($total_users, $config['topics_per_page'], $start), - 'TOTAL_USERS' => ($total_users == 1) ? $user->lang['LIST_USER'] : sprintf($user->lang['LIST_USERS'], $total_users), + $memberrow = array_merge(show_profile($row), array( + 'ROW_NUMBER' => $i + ($start + 1), + 'S_CUSTOM_PROFILE' => (isset($cp_row['row']) && sizeof($cp_row['row'])) ? true : false, + 'U_VIEWPROFILE' => "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u=$user_id") + ); - 'PROFILE_IMG' => $user->img('btn_profile', $user->lang['PROFILE']), - 'PM_IMG' => $user->img('btn_pm', $user->lang['MESSAGE']), - 'EMAIL_IMG' => $user->img('btn_email', $user->lang['EMAIL']), - 'WWW_IMG' => $user->img('btn_www', $user->lang['WWW']), - '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']), - 'SEARCH_IMG' => $user->img('btn_search', $user->lang['SEARCH']), + if (isset($cp_row['row']) && sizeof($cp_row['row'])) + { + $memberrow = array_merge($memberrow, $cp_row['row']); + } - 'U_FIND_MEMBER' => (!empty($config['load_search']) || $auth->acl_get('a_')) ? "memberlist.$phpEx$SID&mode=searchuser" : '', - 'U_SORT_USERNAME' => $pagination_url . '&sk=a&sd=' . (($sort_key == 'a' && $sort_dir == 'a') ? 'd' : 'a'), - 'U_SORT_FROM' => $pagination_url . '&sk=b&sd=' . (($sort_key == 'b' && $sort_dir == 'a') ? 'd' : 'a'), - 'U_SORT_JOINED' => $pagination_url . '&sk=c&sd=' . (($sort_key == 'c' && $sort_dir == 'a') ? 'd' : 'a'), - 'U_SORT_POSTS' => $pagination_url . '&sk=d&sd=' . (($sort_key == 'd' && $sort_dir == 'a') ? 'd' : 'a'), - 'U_SORT_EMAIL' => $pagination_url . '&sk=e&sd=' . (($sort_key == 'e' && $sort_dir == 'a') ? 'd' : 'a'), - 'U_SORT_WEBSITE' => $pagination_url . '&sk=f&sd=' . (($sort_key == 'f' && $sort_dir == 'a') ? 'd' : 'a'), - 'U_SORT_ICQ' => $pagination_url . '&sk=g&sd=' . (($sort_key == 'g' && $sort_dir == 'a') ? 'd' : 'a'), - 'U_SORT_AIM' => $pagination_url . '&sk=h&sd=' . (($sort_key == 'h' && $sort_dir == 'a') ? 'd' : 'a'), - 'U_SORT_MSN' => $pagination_url . '&sk=i&sd=' . (($sort_key == 'i' && $sort_dir == 'a') ? 'd' : 'a'), - 'U_SORT_YIM' => $pagination_url . '&sk=j&sd=' . (($sort_key == 'j' && $sort_dir == 'a') ? 'd' : 'a'), - 'U_SORT_ACTIVE' => $pagination_url . '&sk=k&sd=' . (($sort_key == 'k' && $sort_dir == 'a') ? 'd' : 'a'), - 'U_SORT_RANK' => $pagination_url . '&sk=l&sd=' . (($sort_key == 'l' && $sort_dir == 'a') ? 'd' : 'a'), + $template->assign_block_vars('memberrow', $memberrow); - 'S_SHOW_GROUP' => ($mode == 'group') ? true : false, - 'S_MODE_SELECT' => $s_sort_key, - 'S_ORDER_SELECT' => $s_sort_dir, - 'S_MODE_ACTION' => $pagination_url . "&form=$form") - ); + if (isset($cp_row['blockrow']) && sizeof($cp_row['blockrow'])) + { + foreach ($cp_row['blockrow'] as $field_data) + { + $template->assign_block_vars('memberrow.custom_fields', $field_data); + } + } + + $i++; + unset($id_cache[$user_id]); + } + + // Generate page + $template->assign_vars(array( + 'PAGINATION' => generate_pagination($pagination_url, $total_users, $config['topics_per_page'], $start), + 'PAGE_NUMBER' => on_page($total_users, $config['topics_per_page'], $start), + 'TOTAL_USERS' => ($total_users == 1) ? $user->lang['LIST_USER'] : sprintf($user->lang['LIST_USERS'], $total_users), + + 'PROFILE_IMG' => $user->img('btn_profile', $user->lang['PROFILE']), + 'PM_IMG' => $user->img('btn_pm', $user->lang['MESSAGE']), + 'EMAIL_IMG' => $user->img('btn_email', $user->lang['EMAIL']), + 'WWW_IMG' => $user->img('btn_www', $user->lang['WWW']), + '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']), + 'SEARCH_IMG' => $user->img('btn_search', $user->lang['SEARCH']), + + 'U_FIND_MEMBER' => (!empty($config['load_search']) || $auth->acl_get('a_')) ? "memberlist.$phpEx$SID&mode=searchuser" : '', + 'U_SORT_USERNAME' => $pagination_url . '&sk=a&sd=' . (($sort_key == 'a' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_SORT_FROM' => $pagination_url . '&sk=b&sd=' . (($sort_key == 'b' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_SORT_JOINED' => $pagination_url . '&sk=c&sd=' . (($sort_key == 'c' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_SORT_POSTS' => $pagination_url . '&sk=d&sd=' . (($sort_key == 'd' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_SORT_EMAIL' => $pagination_url . '&sk=e&sd=' . (($sort_key == 'e' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_SORT_WEBSITE' => $pagination_url . '&sk=f&sd=' . (($sort_key == 'f' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_SORT_ICQ' => $pagination_url . '&sk=g&sd=' . (($sort_key == 'g' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_SORT_AIM' => $pagination_url . '&sk=h&sd=' . (($sort_key == 'h' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_SORT_MSN' => $pagination_url . '&sk=i&sd=' . (($sort_key == 'i' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_SORT_YIM' => $pagination_url . '&sk=j&sd=' . (($sort_key == 'j' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_SORT_ACTIVE' => $pagination_url . '&sk=k&sd=' . (($sort_key == 'k' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_SORT_RANK' => $pagination_url . '&sk=l&sd=' . (($sort_key == 'l' && $sort_dir == 'a') ? 'd' : 'a'), + + 'S_SHOW_GROUP' => ($mode == 'group') ? true : false, + 'S_MODE_SELECT' => $s_sort_key, + 'S_ORDER_SELECT' => $s_sort_dir, + 'S_MODE_ACTION' => $pagination_url . "&form=$form") + ); } @@ -1022,7 +1058,7 @@ function show_profile($data) 'ONLINE_IMG' => (intval($data['session_time']) >= time() - ($config['load_online_time'] * 60)) ? $user->img('btn_online', $user->lang['USER_ONLINE']) : $user->img('btn_offline', $user->lang['USER_ONLINE']), 'RANK_IMG' => $rank_img, - 'ICQ_STATUS_IMG'=> (!empty($data['user_icq'])) ? '' : '', + 'ICQ_STATUS_IMG'=> (!empty($data['user_icq'])) ? '' : '', 'U_PROFILE' => "memberlist.$phpEx$SID&mode=viewprofile&u=$user_id", 'U_SEARCH_USER' => ($auth->acl_get('u_search')) ? "search.$phpEx$SID&search_author=" . urlencode($username) . "&show_results=posts" : '', diff --git a/phpBB/posting.php b/phpBB/posting.php index 8a4a176d3f..5d695cc733 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -542,6 +542,7 @@ if ($submit || $preview || $refresh) switch (SQL_LAYER) { case 'mysql4': + case 'mysqli': $sql = 'DELETE FROM ' . POLL_OPTIONS_TABLE . ', ' . POLL_VOTES_TABLE . " WHERE topic_id = $topic_id"; $db->sql_query($sql); @@ -1360,7 +1361,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u 'post_text' => $data['message'], 'post_checksum' => $data['message_md5'], 'post_encoding' => $user->lang['ENCODING'], - 'post_attachment' => (isset($data['filename_data']) && sizeof($data['filename_data'])) ? 1 : 0, // sizeof($data['filename_data']['physical_filename']) + 'post_attachment' => (isset($data['filename_data']['physical_filename']) && sizeof($data['filename_data'])) ? 1 : 0, 'bbcode_bitfield' => $data['bbcode_bitfield'], 'bbcode_uid' => $data['bbcode_uid'], 'post_edit_locked' => $data['post_edit_locked'] @@ -1412,7 +1413,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u 'post_edit_user' => (int) $data['post_edit_user'], 'post_checksum' => $data['message_md5'], 'post_encoding' => $user->lang['ENCODING'], - 'post_attachment' => (isset($data['filename_data']) && sizeof($data['filename_data'])) ? 1 : 0, + 'post_attachment' => (isset($data['filename_data']['physical_filename']) && sizeof($data['filename_data'])) ? 1 : 0, 'bbcode_bitfield' => $data['bbcode_bitfield'], 'bbcode_uid' => $data['bbcode_uid'], 'post_edit_locked' => $data['post_edit_locked']) @@ -1440,7 +1441,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u 'topic_first_poster_name' => (!$user->data['is_registered'] && $username) ? stripslashes($username) : $user->data['username'], 'topic_type' => $topic_type, 'topic_time_limit' => ($topic_type == POST_STICKY || $topic_type == POST_ANNOUNCE) ? ($data['topic_time_limit'] * 86400) : 0, - 'topic_attachment' => (isset($data['filename_data']) && sizeof($data['filename_data'])) ? 1 : 0 + 'topic_attachment' => (isset($data['filename_data']['physical_filename']) && sizeof($data['filename_data'])) ? 1 : 0 ); if (isset($poll['poll_options']) && !empty($poll['poll_options'])) @@ -1493,7 +1494,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u 'poll_length' => ($poll['poll_options']) ? ($poll['poll_length'] * 86400) : 0, 'poll_vote_change' => $poll['poll_vote_change'], - 'topic_attachment' => ($post_mode == 'edit_topic') ? ((isset($data['filename_data']) && sizeof($data['filename_data'])) ? 1 : 0) : $data['topic_attachment'] + 'topic_attachment' => ($post_mode == 'edit_topic') ? ((isset($data['filename_data']['physical_filename']) && sizeof($data['filename_data'])) ? 1 : 0) : $data['topic_attachment'] ); break; } diff --git a/phpBB/search.php b/phpBB/search.php index 9dac6b12ee..9034a2b571 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -713,7 +713,7 @@ if ($search_keywords || $search_author || $search_id) 'TOPIC_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['img'] : '', 'TOPIC_ICON_IMG_WIDTH' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['width'] : '', 'TOPIC_ICON_IMG_HEIGHT' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['height'] : '', - 'ATTACH_ICON_IMG' => ($auth->acl_gets('f_download', 'u_download', $forum_id) && $row['topic_attachment']) ? $user->img('icon_attach', sprintf($user->lang['TOTAL_ATTACHMENTS'], $row['topic_attachment'])) : '', + 'ATTACH_ICON_IMG' => ($auth->acl_gets('f_download', 'u_download', $forum_id) && $row['topic_attachment']) ? $user->img('icon_attach', $user->lang['TOTAL_ATTACHMENTS']) : '', 'S_TOPIC_TYPE' => $row['topic_type'], 'S_USER_POSTED' => (!empty($row['mark_type'])) ? true : false, diff --git a/phpBB/styles/subSilver/template/attachment.html b/phpBB/styles/subSilver/template/attachment.html index f970fcb8a4..9727602bbc 100644 --- a/phpBB/styles/subSilver/template/attachment.html +++ b/phpBB/styles/subSilver/template/attachment.html @@ -61,7 +61,7 @@ {L_FILE_COMMENT}: {COMMENT}
- {DOWNLOAD_NAME}
+ {DOWNLOAD_NAME}
{DOWNLOAD_NAME} - {L_DOWNLOADED_VIEWED} {L_DOWNLOAD_COUNT} diff --git a/phpBB/styles/subSilver/template/memberlist_body.html b/phpBB/styles/subSilver/template/memberlist_body.html index a276bbca38..a6bb29377a 100644 --- a/phpBB/styles/subSilver/template/memberlist_body.html +++ b/phpBB/styles/subSilver/template/memberlist_body.html @@ -48,8 +48,11 @@  {PM_IMG}   {EMAIL_IMG}   {WWW_IMG}  + + +  {memberrow.PROFILE_FIELD1_VALUE} + - diff --git a/phpBB/styles/subSilver/template/memberlist_view.html b/phpBB/styles/subSilver/template/memberlist_view.html index 37d9512897..e95b662e46 100644 --- a/phpBB/styles/subSilver/template/memberlist_view.html +++ b/phpBB/styles/subSilver/template/memberlist_view.html @@ -127,6 +127,12 @@ {PROFILE_FIELD1_VALUE} + + + {custom_fields.PROFILE_FIELD_NAME}: + {custom_fields.PROFILE_FIELD_VALUE} + + diff --git a/phpBB/styles/subSilver/template/overall_header.html b/phpBB/styles/subSilver/template/overall_header.html index 167cd99a81..5126ae7523 100644 --- a/phpBB/styles/subSilver/template/overall_header.html +++ b/phpBB/styles/subSilver/template/overall_header.html @@ -24,7 +24,7 @@ if ({S_NEW_PM}) { - window.open('{U_POPUP_PM}', '_phpbbprivmsg', 'HEIGHT=225,resizable=yes,WIDTH=400'); + window.open('{U_JS_POPUP_PM}', '_phpbbprivmsg', 'HEIGHT=225,resizable=yes,WIDTH=400'); } @@ -64,7 +64,7 @@ function jumpto() diff --git a/phpBB/styles/subSilver/template/posting_attach_body.html b/phpBB/styles/subSilver/template/posting_attach_body.html index 8d2e80d60d..caadd34f07 100644 --- a/phpBB/styles/subSilver/template/posting_attach_body.html +++ b/phpBB/styles/subSilver/template/posting_attach_body.html @@ -33,7 +33,7 @@ {L_FILE_COMMENT} - +
   diff --git a/phpBB/styles/subSilver/template/posting_body.html b/phpBB/styles/subSilver/template/posting_body.html index 0691b8bd73..bd1a443ee2 100644 --- a/phpBB/styles/subSilver/template/posting_body.html +++ b/phpBB/styles/subSilver/template/posting_body.html @@ -439,7 +439,7 @@ function checkForm()
- + diff --git a/phpBB/styles/subSilver/template/search_results.html b/phpBB/styles/subSilver/template/search_results.html index 6701cc12ff..8b4d31782d 100644 --- a/phpBB/styles/subSilver/template/search_results.html +++ b/phpBB/styles/subSilver/template/search_results.html @@ -31,7 +31,7 @@ diff --git a/phpBB/styles/subSilver/template/viewtopic_body.html b/phpBB/styles/subSilver/template/viewtopic_body.html index 502687fb10..31e1768fac 100644 --- a/phpBB/styles/subSilver/template/viewtopic_body.html +++ b/phpBB/styles/subSilver/template/viewtopic_body.html @@ -170,7 +170,13 @@
{L_JOINED}: {postrow.POSTER_JOINED}
{L_POSTS}: {postrow.POSTER_POSTS}
{L_LOCATION}: {postrow.POSTER_FROM} -
{postrow.PROFILE_FIELD_1_NAME}: {postrow.PROFILE_FIELD_1_VALUE} + + +
{postrow.PROFILE_FIELD1_NAME}: {postrow.PROFILE_FIELD1_VALUE} + + +
{postrow.custom_fields.PROFILE_FIELD_NAME}: {postrow.custom_fields.PROFILE_FIELD_VALUE} + diff --git a/phpBB/ucp.php b/phpBB/ucp.php index c3cc7aeff7..07864a7449 100755 --- a/phpBB/ucp.php +++ b/phpBB/ucp.php @@ -350,7 +350,7 @@ while ($row = $db->sql_fetchrow($result)) $which = (time() - $update_time < $row['online_time']) ? 'online' : 'offline'; $template->assign_block_vars("friends_{$which}", array( - 'U_PROFILE' => "memberlist.$phpEx$SID&mode=viewprofile&u=" . $row['user_id'], + 'U_PROFILE' => "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u=" . $row['user_id'], 'USER_ID' => $row['user_id'], 'USERNAME' => $row['username']) diff --git a/phpBB/viewonline.php b/phpBB/viewonline.php index 64e86d6417..d93353236d 100644 --- a/phpBB/viewonline.php +++ b/phpBB/viewonline.php @@ -301,7 +301,7 @@ $result = $db->sql_query($sql); $legend = ''; while ($row = $db->sql_fetchrow($result)) { - $legend .= (($legend != '') ? ', ' : '') . '' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . ''; + $legend .= (($legend != '') ? ', ' : '') . '' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . ''; } $db->sql_freeresult($result);
{L_WHO_IS_ONLINE}

{L_WHO_IS_ONLINE}

{LOGGED_IN_USER_LIST}
{searchresults.TOPIC_FOLDER_IMG} - +