diff options
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/includes/functions_content.php | 49 | ||||
-rw-r--r-- | phpBB/styles/prosilver/template/jumpbox.html | 8 | ||||
-rw-r--r-- | phpBB/styles/prosilver/theme/common.css | 4 |
3 files changed, 43 insertions, 18 deletions
diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index 5fa37f60bd..7ecc99b39c 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -727,37 +727,58 @@ function make_clickable($text, $server_url = false, $class = 'postlink') $server_url = generate_board_url(); } - static $magic_url_match; - static $magic_url_replace; static $static_class; + static $magic_url_match_args; - if (!is_array($magic_url_match) || $static_class != $class) + if (!is_array($magic_url_match_args) || $static_class != $class) { $static_class = $class; $class = ($static_class) ? ' class="' . $static_class . '"' : ''; $local_class = ($static_class) ? ' class="' . $static_class . '-local"' : ''; - $magic_url_match = $magic_url_replace = array(); - // Be sure to not let the matches cross over. ;) + $magic_url_match_args = array(); // relative urls for this board - $magic_url_match[] = '#(^|[\n\t (>.])(' . preg_quote($server_url, '#') . ')/(' . get_preg_expression('relative_url_inline') . ')#ie'; - $magic_url_replace[] = "make_clickable_callback(MAGIC_URL_LOCAL, '\$1', '\$2', '\$3', '$local_class')"; + $magic_url_match_args[] = array( + '#(^|[\n\t (>.])(' . preg_quote($server_url, '#') . ')/(' . get_preg_expression('relative_url_inline') . ')#i', + MAGIC_URL_LOCAL, + $local_class, + ); // matches a xxxx://aaaaa.bbb.cccc. ... - $magic_url_match[] = '#(^|[\n\t (>.])(' . get_preg_expression('url_inline') . ')#ie'; - $magic_url_replace[] = "make_clickable_callback(MAGIC_URL_FULL, '\$1', '\$2', '', '$class')"; + $magic_url_match_args[] = array( + '#(^|[\n\t (>.])(' . get_preg_expression('url_inline') . ')#i', + MAGIC_URL_FULL, + $class, + ); // matches a "www.xxxx.yyyy[/zzzz]" kinda lazy URL thing - $magic_url_match[] = '#(^|[\n\t (>])(' . get_preg_expression('www_url_inline') . ')#ie'; - $magic_url_replace[] = "make_clickable_callback(MAGIC_URL_WWW, '\$1', '\$2', '', '$class')"; + $magic_url_match_args[] = array( + '#(^|[\n\t (>])(' . get_preg_expression('www_url_inline') . ')#i', + MAGIC_URL_WWW, + $class, + ); // matches an email@domain type address at the start of a line, or after a space or after what might be a BBCode. - $magic_url_match[] = '/(^|[\n\t (>])(' . get_preg_expression('email') . ')/ie'; - $magic_url_replace[] = "make_clickable_callback(MAGIC_URL_EMAIL, '\$1', '\$2', '', '')"; + $magic_url_match_args[] = array( + '/(^|[\n\t (>])(' . get_preg_expression('email') . ')/i', + MAGIC_URL_EMAIL, + '', + ); } - return preg_replace($magic_url_match, $magic_url_replace, $text); + foreach ($magic_url_match_args as $magic_args) + { + if (preg_match($magic_args[0], $text, $matches)) + { + $text = preg_replace_callback($magic_args[0], function($matches) use ($magic_args) + { + return make_clickable_callback($magic_args[1], $matches[1], $matches[2], $matches[3], $magic_args[2]); + }, $text); + } + } + + return $text; } /** diff --git a/phpBB/styles/prosilver/template/jumpbox.html b/phpBB/styles/prosilver/template/jumpbox.html index dd793fbadc..201b2dece2 100644 --- a/phpBB/styles/prosilver/template/jumpbox.html +++ b/phpBB/styles/prosilver/template/jumpbox.html @@ -1,12 +1,12 @@ <!-- IF S_VIEWTOPIC --> - <p></p><p><a href="{U_VIEW_FORUM}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}" accesskey="r">{L_RETURN_TO} {FORUM_NAME}</a></p> + <p class="jumpbox-return"><a href="{U_VIEW_FORUM}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}" accesskey="r">{L_RETURN_TO} {FORUM_NAME}</a></p> <!-- ELSEIF S_VIEWFORUM --> - <p></p><p><a href="{U_INDEX}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}" accesskey="r">{L_RETURN_TO} {L_INDEX}</a></p> + <p class="jumpbox-return"><a href="{U_INDEX}" class="left-box arrow-{S_CONTENT_FLOW_BEGIN}" accesskey="r">{L_RETURN_TO} {L_INDEX}</a></p> <!-- ELSEIF SEARCH_TOPIC --> - <p></p><p><a class="left-box arrow-{S_CONTENT_FLOW_BEGIN}" href="{U_SEARCH_TOPIC}" accesskey="r">{L_RETURN_TO}{L_COLON} {SEARCH_TOPIC}</a></p> + <p class="jumpbox-return"><a class="left-box arrow-{S_CONTENT_FLOW_BEGIN}" href="{U_SEARCH_TOPIC}" accesskey="r">{L_RETURN_TO}{L_COLON} {SEARCH_TOPIC}</a></p> <!-- ELSEIF S_SEARCH_ACTION --> - <p></p><p><a class="left-box arrow-{S_CONTENT_FLOW_BEGIN}" href="{U_SEARCH}" title="{L_SEARCH_ADV}" accesskey="r">{L_RETURN_TO_SEARCH_ADV}</a></p> + <p class="jumpbox-return"><a class="left-box arrow-{S_CONTENT_FLOW_BEGIN}" href="{U_SEARCH}" title="{L_SEARCH_ADV}" accesskey="r">{L_RETURN_TO_SEARCH_ADV}</a></p> <!-- ENDIF --> <!-- IF S_DISPLAY_JUMPBOX --> diff --git a/phpBB/styles/prosilver/theme/common.css b/phpBB/styles/prosilver/theme/common.css index 4a77dc78d0..9021c157a3 100644 --- a/phpBB/styles/prosilver/theme/common.css +++ b/phpBB/styles/prosilver/theme/common.css @@ -134,6 +134,10 @@ p.right { text-align: right; } +p.jumpbox-return { + margin-top: 1em; +} + b, strong { font-weight: bold; } |