diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2007-06-09 11:11:20 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2007-06-09 11:11:20 +0000 |
commit | 455536773fd34f72e371386b5b0d9a517e0fc1e7 (patch) | |
tree | b92b8cb07045e0aac93749f4e419d9d3a1f1654d /phpBB/includes/functions.php | |
parent | cbf7b00cb801bc7cbed5735452fc680c85cd9669 (diff) | |
download | forums-455536773fd34f72e371386b5b0d9a517e0fc1e7.tar forums-455536773fd34f72e371386b5b0d9a517e0fc1e7.tar.gz forums-455536773fd34f72e371386b5b0d9a517e0fc1e7.tar.bz2 forums-455536773fd34f72e371386b5b0d9a517e0fc1e7.tar.xz forums-455536773fd34f72e371386b5b0d9a517e0fc1e7.zip |
ok, mess around with the templates + fixing some bugs + adjusting headers for those files already modified to circumvent conflicts for those having their editor set to remove trailing spaces (not recommended!)
git-svn-id: file:///svn/phpbb/trunk@7736 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions.php')
-rw-r--r-- | phpBB/includes/functions.php | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 64d4b1ba37..fc1e173600 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -1,10 +1,10 @@ <?php -/** +/** * * @package phpBB3 * @version $Id$ -* @copyright (c) 2005 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @copyright (c) 2005 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License * */ @@ -1586,11 +1586,30 @@ function append_sid($url, $params = false, $is_amp = true, $session_id = false) // Appending custom url parameter? $append_url = (!empty($_EXTRA_URL)) ? implode($amp_delim, $_EXTRA_URL) : ''; + $anchor = ''; + if (strpos($url, '#') !== false) + { + list($url, $anchor) = explode('#', $url, 2); + $anchor = '#' . $anchor; + } + else if (!is_array($params) && strpos($params, '#') !== false) + { + list($params, $anchor) = explode('#', $params, 2); + $anchor = '#' . $anchor; + } + // Use the short variant if possible ;) if ($params === false) { // Append session id - return (!$session_id) ? $url . (($append_url) ? $url_delim . $append_url : '') : $url . (($append_url) ? $url_delim . $append_url . $amp_delim : $url_delim) . 'sid=' . $session_id; + if (!$session_id) + { + return $url . (($append_url) ? $url_delim . $append_url : '') . $anchor; + } + else + { + return $url . (($append_url) ? $url_delim . $append_url . $amp_delim : $url_delim) . 'sid=' . $session_id . $anchor; + } } // Build string if parameters are specified as array @@ -1605,6 +1624,12 @@ function append_sid($url, $params = false, $is_amp = true, $session_id = false) continue; } + if ($key == '#') + { + $anchor = '#' . $item; + continue; + } + $output[] = $key . '=' . $item; } @@ -1613,7 +1638,7 @@ function append_sid($url, $params = false, $is_amp = true, $session_id = false) // Append session id and parameters (even if they are empty) // If parameters are empty, the developer can still append his/her parameters without caring about the delimiter - return $url . (($append_url) ? $url_delim . $append_url . $amp_delim : $url_delim) . $params . ((!$session_id) ? '' : $amp_delim . 'sid=' . $session_id); + return $url . (($append_url) ? $url_delim . $append_url . $amp_delim : $url_delim) . $params . ((!$session_id) ? '' : $amp_delim . 'sid=' . $session_id) . $anchor; } /** |