Follow along with the video below to see how to install our site as a web app on your home screen.
Примечание: This feature may not be available in some browsers.
Проверено на 2.3.3. Рекомендуется к установке, чтобы спам-посты теряли смысл поднятия PR за ваш счет.
создаем в корне файл redirect.php с кодом:
Ищем в /sources/classes/bbcode файл class_bbcode_core.phpPHP:<? $arr = array("\n", "\r", "\t", "\r\n", "\n\r", "\0"); // тут опасные сиволы... $url = getenv('QUERY_STRING'); $url = str_replace($arr, "", $url); header("location: " . $url); ?>
строка
добавить выше:PHP:return ( isset($url['st']) ? $url['st'] : '' ) . "<a href=\"".$url['html']."\" target=\"_blank\">".$show."</a>" . $url['end'];
далее ищем в файле /sources/lib/post_parser.phpPHP:if (!strstr($url['html'], "http://ваш_сайт.сом")) $url['html'] = "http://ваш_сайт.сом/redirect.php?" . $url['html'];
меняем на:PHP:$txt = preg_replace( "#<a href=[\"'](http://|https://|ftp://|news://)?(\S+?)['\"].+?".">(.+?)</a>#" , "\[url=\\1\\2\]\\3\[/url\]" , $txt );
PHP:$txt = preg_replace( "#<a href=[\"'](http://|https://|ftp://|news://)?(\S+?)['\"].+?".">(.+?)</a>#" , "\[url=\\1\\2\]\\3\[/url\]" , str_replace("http://ваш_сайт.сом/redirect.php?", "", $txt) );
з.ы. - ваш_сайт.сом замените на правильный
Работает, но только для ссылок, добавленных после установки мода. Нельзя ли сделать, чтобы редирект был и на старые ссылки?