При установке моде Prime Links не следует вносить изменения в includes/functions_content.php, а если изменения уже внесены, то найти:
Код: Выделить всё
//-- mod: Prime Links -------------------------------------------------------//
if (!function_exists('prime_links'))
{
global $phpEx;
include($phpbb_root_path . 'includes/prime_links.' . $phpEx);
}
$text = prime_links($text);
//-- end: Prime Links -------------------------------------------------------//Затем, в includes/prime_links.php:
найти:
Код: Выделить всё
$href = $this->decode_entities($href);
Код: Выделить всё
// mod: Fast Prime Links
$src_href = $href;
// end: Fast Prime Links
Код: Выделить всё
$new_link = str_replace('href="', 'href="' . $external_prefix, $new_link);
Код: Выделить всё
// mod: Fast Prime Links
if(!empty($external_prefix))
{
$href_searches[] = 'href="' . $external_prefix . $src_href . '"';
$href_replacements[] = 'href="' . $external_prefix .
str_replace(
array('<','>','&', '#', '&', '/', ':', ';', '<', '=', '>', '?'),
array( '%3C', '%3E', '%26','%23','%26','%2F','%3A','%3B','%3C','%3D','%3E','%3F'),
$src_href) . '"';
}
// end: Fast Prime Links
Код: Выделить всё
if (isset($searches) && isset($replacements))
{
$message = str_replace($searches, $replacements, $message);
}
Код: Выделить всё
// mod: Fast Prime Links
if (isset($href_searches) && isset($href_replacements))
{
$message = str_replace($href_searches, $href_replacements, $message);
}
// end: Fast Prime Links
Код: Выделить всё
<?php
/**
*
* @package phpBB Fast Prime Links Hook (addon for Prime Links mod, see https://www.phpbb.com/community/viewtopic.php?f=69&t=875585)
* @version 1.0.0
* @copyright (c) 2013 c61 http://www.phpbbguru.net & http://c61.no-ip.org
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
exit;
}
function fast_prime_links()
{
global $template;
if(isset($template->_tpldata['postrow']))
{
// Применяем функцию do_fast_prime_links() к каждому члену массива postrow, содержащего тексты сообщений
foreach($template->_tpldata['postrow'] as $key => $val)
{
do_fast_prime_links($template->_tpldata['postrow'][$key]['MESSAGE']);
}
} elseif (isset($template->_rootref))
{
// Применяем функцию do_fast_prime_links() к предпросмотру сообщения
do_fast_prime_links($template->_rootref['PREVIEW_MESSAGE']);
// Возможно, есть обзор сообщений в предпросмотре
if (isset($template->_tpldata['topic_review_row']))
{
// Применяем функцию do_fast_prime_links() к каждому члену массива topic_review_row, содержащего тексты сообщений
foreach($template->_tpldata['topic_review_row'] as $key => $val)
{
do_fast_prime_links($template->_tpldata['topic_review_row'][$key]['MESSAGE']);
}
}
}
}
function do_fast_prime_links(&$item)
{
if(!isset($item)) return;
//-- mod: Prime Links -------------------------------------------------------//
if (!function_exists('prime_links'))
{
global $phpbb_root_path, $phpEx;
include($phpbb_root_path . 'includes/prime_links.' . $phpEx);
}
$item = prime_links($item);
//-- end: Prime Links -------------------------------------------------------//
}
// Регистрируем хук
$phpbb_hook->register(array('template', 'display'), 'fast_prime_links');
?>Очистить кэш.
ВНИМАНИЕ !!! Мод для применения только на слабых серверах, когда требуется экономия времени выполнения скриптов php.

