diff options
| author | forums <forums@ns38133.ovh.net> | 2011-02-12 23:34:52 +0100 |
|---|---|---|
| committer | forums <forums@ns38133.ovh.net> | 2011-02-12 23:36:21 +0100 |
| commit | b85c3b967a7f6fa061439061076695613622960c (patch) | |
| tree | 6b5d9c96fc1cc6f77810c3bbef621be677581abe /phpBB/memberlist.php | |
| parent | 43cc2cd33c892b6dbcbed8a5ad59e52c83a6326d (diff) | |
| download | forums-b85c3b967a7f6fa061439061076695613622960c.tar forums-b85c3b967a7f6fa061439061076695613622960c.tar.gz forums-b85c3b967a7f6fa061439061076695613622960c.tar.bz2 forums-b85c3b967a7f6fa061439061076695613622960c.tar.xz forums-b85c3b967a7f6fa061439061076695613622960c.zip | |
Patched for SEO with phpbb-seo toolkit
Diffstat (limited to 'phpBB/memberlist.php')
| -rw-r--r-- | phpBB/memberlist.php | 86 |
1 files changed, 68 insertions, 18 deletions
diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index 2fa2d11ee1..24bc7ddbbd 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -21,7 +21,14 @@ include($phpbb_root_path . 'includes/functions_display.' . $phpEx); $user->session_begin(); $auth->acl($user->data); $user->setup(array('memberlist', 'groups')); - +// www.phpBB-SEO.com SEO TOOLKIT BEGIN +if (!empty($_REQUEST['un'])) { + $_REQUEST['un'] = rawurldecode($_REQUEST['un']); + if (!$phpbb_seo->is_utf8($_REQUEST['un'])) { + $_REQUEST['un'] = utf8_normalize_nfc(utf8_recode($_REQUEST['un'], 'ISO-8859-1')); + } +} +// www.phpBB-SEO.com SEO TOOLKIT END // Grab data $mode = request_var('mode', ''); $action = request_var('action', ''); @@ -71,6 +78,15 @@ $ranks = $cache->obtain_ranks(); switch ($mode) { case 'leaders': + // www.phpBB-SEO.com SEO TOOLKIT BEGIN - Zero dupe + if (!empty($phpbb_seo->seo_opt['url_rewrite'])) { + $phpbb_seo->seo_path['canonical'] = $phpbb_seo->drop_sid(append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=leaders')); + } + $phpbb_seo->seo_opt['zero_dupe']['redir_def'] = array( + 'mode' => array('val' => 'leaders', 'keep' => true), + ); + $phpbb_seo->seo_chk_dupe(); + // www.phpBB-SEO.com SEO TOOLKIT END - Zero dupe // Display a listing of board admins, moderators include($phpbb_root_path . 'includes/functions_user.' . $phpEx); @@ -234,6 +250,9 @@ switch ($mode) else { $group_name = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']; + // www.phpBB-SEO.com SEO TOOLKIT BEGIN + $phpbb_seo->prepare_url('group', $row['group_name'], $row['group_id']); + // www.phpBB-SEO.com SEO TOOLKIT END $u_group = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $row['group_id']); } @@ -429,7 +448,19 @@ switch ($mode) } $user_id = (int) $member['user_id']; - + // www.phpBB-SEO.com SEO TOOLKIT BEGIN + $phpbb_seo->set_user_url( $member['username'], $user_id ); + // www.phpBB-SEO.com SEO TOOLKIT END + // www.phpBB-SEO.com SEO TOOLKIT BEGIN - Zero dupe + if (!empty($phpbb_seo->seo_opt['url_rewrite'])) { + $phpbb_seo->seo_path['canonical'] = $phpbb_seo->drop_sid(append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=viewprofile&u=$user_id")); + } + $phpbb_seo->seo_opt['zero_dupe']['redir_def'] = array( + 'mode' => array('val' => 'viewprofile', 'keep' => true), + 'u' => array('val' => $user_id, 'keep' => true, 'force' => true), + ); + $phpbb_seo->seo_chk_dupe(); + // www.phpBB-SEO.com SEO TOOLKIT END - Zero dupe // Get group memberships // Also get visiting user's groups to determine hidden group memberships if necessary. $auth_hidden_groups = ($user_id === (int) $user->data['user_id'] || $auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel')) ? true : false; @@ -1333,6 +1364,17 @@ switch ($mode) $pagination_url = append_sid("{$phpbb_root_path}memberlist.$phpEx", implode('&', $params)); $sort_url = append_sid("{$phpbb_root_path}memberlist.$phpEx", implode('&', $sort_params)); + // www.phpBB-SEO.com SEO TOOLKIT BEGIN - Zero dupe + if ($mode == 'group') { + $phpbb_seo->prepare_url('group', $group_row['group_name'], $group_row['group_id']); + $phpbb_seo->seo_opt['zero_dupe']['start'] = $phpbb_seo->seo_chk_start( $start, $config['topics_per_page'] ); + + $phpbb_seo->seo_chk_dupe("{$phpbb_root_path}memberlist.$phpEx?" . implode('&', $params) . '&start=' . $phpbb_seo->seo_opt['zero_dupe']['start']); + if (!empty($phpbb_seo->seo_opt['url_rewrite'])) { + $phpbb_seo->seo_path['canonical'] = $phpbb_seo->drop_sid(append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=group&g={$group_row['group_id']}&start=" . $phpbb_seo->seo_opt['zero_dupe']['start'])); + } + } + // www.phpBB-SEO.com SEO TOOLKIT END - Zero dupe unset($search_params, $sort_params); // Some search user specific data @@ -1539,7 +1581,9 @@ switch ($mode) unset($id_cache[$user_id]); } } - + // www.phpBB-SEO.com SEO TOOLKIT BEGIN + $seo_sep = strpos($sort_url, '?') === false ? '?' : '&'; + // www.phpBB-SEO.com SEO TOOLKIT END // Generate page $template->assign_vars(array( 'PAGINATION' => generate_pagination($pagination_url, $total_users, $config['topics_per_page'], $start), @@ -1559,20 +1603,22 @@ switch ($mode) 'U_FIND_MEMBER' => ($config['load_search'] || $auth->acl_get('a_')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser' . (($start) ? "&start=$start" : '') . (!empty($params) ? '&' . implode('&', $params) : '')) : '', 'U_HIDE_FIND_MEMBER' => ($mode == 'searchuser') ? $u_hide_find_member : '', - 'U_SORT_USERNAME' => $sort_url . '&sk=a&sd=' . (($sort_key == 'a' && $sort_dir == 'a') ? 'd' : 'a'), - 'U_SORT_FROM' => $sort_url . '&sk=b&sd=' . (($sort_key == 'b' && $sort_dir == 'a') ? 'd' : 'a'), - 'U_SORT_JOINED' => $sort_url . '&sk=c&sd=' . (($sort_key == 'c' && $sort_dir == 'a') ? 'd' : 'a'), - 'U_SORT_POSTS' => $sort_url . '&sk=d&sd=' . (($sort_key == 'd' && $sort_dir == 'a') ? 'd' : 'a'), - 'U_SORT_EMAIL' => $sort_url . '&sk=e&sd=' . (($sort_key == 'e' && $sort_dir == 'a') ? 'd' : 'a'), - 'U_SORT_WEBSITE' => $sort_url . '&sk=f&sd=' . (($sort_key == 'f' && $sort_dir == 'a') ? 'd' : 'a'), - 'U_SORT_LOCATION' => $sort_url . '&sk=b&sd=' . (($sort_key == 'b' && $sort_dir == 'a') ? 'd' : 'a'), - 'U_SORT_ICQ' => $sort_url . '&sk=g&sd=' . (($sort_key == 'g' && $sort_dir == 'a') ? 'd' : 'a'), - 'U_SORT_AIM' => $sort_url . '&sk=h&sd=' . (($sort_key == 'h' && $sort_dir == 'a') ? 'd' : 'a'), - 'U_SORT_MSN' => $sort_url . '&sk=i&sd=' . (($sort_key == 'i' && $sort_dir == 'a') ? 'd' : 'a'), - 'U_SORT_YIM' => $sort_url . '&sk=j&sd=' . (($sort_key == 'j' && $sort_dir == 'a') ? 'd' : 'a'), - 'U_SORT_ACTIVE' => ($auth->acl_get('u_viewonline')) ? $sort_url . '&sk=l&sd=' . (($sort_key == 'l' && $sort_dir == 'a') ? 'd' : 'a') : '', - 'U_SORT_RANK' => $sort_url . '&sk=m&sd=' . (($sort_key == 'm' && $sort_dir == 'a') ? 'd' : 'a'), - 'U_LIST_CHAR' => $sort_url . '&sk=a&sd=' . (($sort_key == 'l' && $sort_dir == 'a') ? 'd' : 'a'), + // www.phpBB-SEO.com SEO TOOLKIT BEGIN + 'U_SORT_USERNAME' => $sort_url . $seo_sep . 'sk=a&sd=' . (($sort_key == 'a' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_SORT_FROM' => $sort_url . $seo_sep . 'sk=b&sd=' . (($sort_key == 'b' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_SORT_JOINED' => $sort_url . $seo_sep . 'sk=c&sd=' . (($sort_key == 'c' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_SORT_POSTS' => $sort_url . $seo_sep . 'sk=d&sd=' . (($sort_key == 'd' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_SORT_EMAIL' => $sort_url . $seo_sep . 'sk=e&sd=' . (($sort_key == 'e' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_SORT_WEBSITE' => $sort_url . $seo_sep . 'sk=f&sd=' . (($sort_key == 'f' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_SORT_LOCATION' => $sort_url . $seo_sep . 'sk=b&sd=' . (($sort_key == 'b' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_SORT_ICQ' => $sort_url . $seo_sep . 'sk=g&sd=' . (($sort_key == 'g' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_SORT_AIM' => $sort_url . $seo_sep . 'sk=h&sd=' . (($sort_key == 'h' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_SORT_MSN' => $sort_url . $seo_sep . 'sk=i&sd=' . (($sort_key == 'i' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_SORT_YIM' => $sort_url . $seo_sep . 'sk=j&sd=' . (($sort_key == 'j' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_SORT_ACTIVE' => ($auth->acl_get('u_viewonline')) ? $sort_url . $seo_sep . 'sk=l&sd=' . (($sort_key == 'l' && $sort_dir == 'a') ? 'd' : 'a') : '', + 'U_SORT_RANK' => $sort_url . $seo_sep . 'sk=m&sd=' . (($sort_key == 'm' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_LIST_CHAR' => $sort_url . $seo_sep . 'sk=a&sd=' . (($sort_key == 'l' && $sort_dir == 'a') ? 'd' : 'a'), + // www.phpBB-SEO.com SEO TOOLKIT END 'S_SHOW_GROUP' => ($mode == 'group') ? true : false, 'S_VIEWONLINE' => $auth->acl_get('u_viewonline'), @@ -1580,7 +1626,11 @@ switch ($mode) 'S_MODE_SELECT' => $s_sort_key, 'S_ORDER_SELECT' => $s_sort_dir, 'S_CHAR_OPTIONS' => $s_char_options, - 'S_MODE_ACTION' => $pagination_url) + // www.phpBB-SEO.com SEO TOOLKIT BEGIN + // Here we circumvent because our append_sid does not allow + // an url to end with an ?, as it should. + 'S_MODE_ACTION' => $pagination_url . (strpos($pagination_url, '?') !== false ? '' : '?') ) + // www.phpBB-SEO.com SEO TOOLKIT END ); } |
