Stopka w Spider Friendly
Stopka w Spider Friendly
Witam, zainstalowałem sobie moda Spider Friendly i denerwuje mnie jedna rzecz. W stopce forum wyświetla mi się jakaś reklama forum mangi... Czy pomógłby mi ktoś to usunąć?
Z góry dziękuje za pomoc.
Pozdrawiam,
Grish.
Z góry dziękuje za pomoc.
Pozdrawiam,
Grish.
Ostatnio zmieniony 02 lipca 2008, 13:34 przez Grish, łącznie zmieniany 1 raz.
Re: Spider Friendly
Przeszkadza Ci " - mangi" ? W instrukcji instalacji moda pewnie gdzie jest napisane, że można używać pod warunkiem pozostawienia tej małej reklamy.
Re: Spider Friendly
Nie pytam się o warunki tylko po prostu chce żeby mi ktoś pomógł to usunąć, a już mój problem co ja z tym zrobię. Chce umieścić reklamę ale w inny sposób bo tak wygląda ohydnie ;f
Re: Spider Friendly
Stopka jest taka zrobiona i nie można jej usuwać... a jeżeli usuniesz to możesz się spotkać w sądzie z autorem bo to jest łamanie warunków praw autorskich
Re: Spider Friendly
Modyfikacja jest na licencji GPL więc może ją zmieniać.Shu pisze:Stopka jest taka zrobiona i nie można jej usuwać... a jeżeli usuniesz to możesz się spotkać w sądzie z autorem bo to jest łamanie warunków praw autorskich
Re: Spider Friendly
A co ja napisałem? Czytaj ze zrozumieniem Że nie można jej usuwać A nie zmieniaćwe3b pisze:Modyfikacja jest na licencji GPL więc może ją zmieniać.Shu pisze:Stopka jest taka zrobiona i nie można jej usuwać... a jeżeli usuniesz to możesz się spotkać w sądzie z autorem bo to jest łamanie warunków praw autorskich
Re: Spider Friendly
Mea culpaShu pisze:A co ja napisałem? Czytaj ze zrozumieniem Że nie można jej usuwać A nie zmieniaćwe3b pisze:Modyfikacja jest na licencji GPL więc może ją zmieniać.Shu pisze:Stopka jest taka zrobiona i nie można jej usuwać... a jeżeli usuniesz to możesz się spotkać w sądzie z autorem bo to jest łamanie warunków praw autorskich
Re: Spider Friendly
Nie chce jej usuwać tylko zmienić, inaczej zamieścić bo tak jak jest to ohydnie wygląda. Tylko pierw muszę się uporać z usunięciem starej, a sam próbuje i mi nie wychodzi. A więc pomożecie?
Re: Spider Friendly
Zmień nazwę tematu na adekwatną do treści pierwszego postu oraz podaj wersję moda, którą używasz.
Re: Stopka w Spider Friendly
Nazwa tematu zmieniona. A wersja jakiej używam to SF 1.3.12.
Re: Stopka w Spider Friendly
Masz może gdzieś paczkę z tym modem? Bo o ile się nie mylę to najnowsza wersja to 1.3.8, a ona z tą używaną przez Ciebie trochę się różni .
Re: Stopka w Spider Friendly
No z tego co ja wiem to 1.3.12 jest najnowsze
A tu Ci podaje 2 pliki za które odpowiada ta nieznośna reklama dodawana w stopce.
spider friendly.php
A tu ta plik z tą nieznośną reklamą:
tanuki_ad.php
Z spider friendly.php trzeba usunąć wszystko z tą nieznośną reklamą związane. Usuwałem już sam ale zawsze mi błąd wyskakiwał w pliku spider friendly.php.
A tu Ci podaje 2 pliki za które odpowiada ta nieznośna reklama dodawana w stopce.
spider friendly.php
Kod: Zaznacz cały
<?php
/***************************************************************************
* spider_friendly.php
* -------------------
* begin : Sunday, Feb 26, 2005
* copyright : (C) 2005-2006 Crack
* email : piotrprz@gmail.com
*
* $Id: spider_friendly.php 123 2008-03-01 13:33:58Z Crack $
*
***************************************************************************/
if (!defined('IN_PHPBB'))
{
die('Hacking attempt');
}
// load config
$sfc = array();
$config_load = array('mod_rewrite_enabled', 'rewrite_mode', 'simplify_pages',
'charset_mapping', 'fake_dirs', 'postlink_rewrite', 'max_keywords_length',
'sitemap_enabled', 'show_lastpost_link', 'map_index_only',
'map_mode_listonly', 'topics_per_page', 'log_spiders',
'spider_session_length', 'cache_refresh_mode', 'rewrite_all_htm',
'rewrite_index', 'cache_read_mode', 'show_bots_on_index',
'shmop_lasttoken');
foreach ($config_load as $config_name)
{
$sfc[$config_name] =& $board_config['sf_'.$config_name];
}
$sfc['warnings'] = array();
require_once $phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_sf.' . $phpEx;
require_once $phpbb_root_path . 'includes/rewrite_config.' . $phpEx;
// log bots
if ($sfc['log_spiders'] && user_is_spider())
{
require_once $phpbb_root_path . 'includes/spider_log.' . $phpEx;
log_spider();
}
// shared memory functions
if ($sfc['cache_read_mode'] == 'shmop')
{
require_once $phpbb_root_path . 'includes/sf_shm_shmop.' . $phpEx;
}
$sfc['ex_len'] = strlen($phpEx);
$sfc['meta_robots'] = '';
$sfc['tac'] = $phpbb_root_path . 'includes/tanuki_ad.' . $phpEx;
$sfc['map'] = $sfc['smap'] = "sitemap.$phpEx";
$sfc['forbid_count'] = count($sfc['forbid_links']);
$sfc['przemo_cache'] = isset($sql_cache_enable) && $sql_cache_enable;
$sfc['is_przemo'] = isset($board_config['advert_separator']);
$sfc['vserver_enabled'] = ($sfc['vserver'] != '')
? file_exists($phpbb_root_path . $sfc['vserver'])
: false;
if (file_exists($phpbb_root_path . 'sf_install.' . $phpEx))
{
$sfc['warnings'][] = sprintf($lang['SF-E_install_file_exists'], $phpEx);
}
if (count($mod_rewrite_in) != count($mod_rewrite_out))
{
$sfc['warnings'][] = $lang['SF-E_inout_values'];
}
require_once $sfc['tac'];
// If current page is in a virtual directory, determine relative path
// to the main directory
$script_path = trim($board_config['script_path']);
if (substr($script_path, -1) != '/')
$script_path .= '/';
$tmp_path = substr($HTTP_SERVER_VARS['REQUEST_URI'], strlen($script_path));
if (strpos($tmp_path, '?'))
{
$tmp_path = substr($tmp_path, 0, strpos($tmp_path, '?'));
}
$levels_up = substr_count($tmp_path, '/') - substr_count($phpbb_root_path, '..');
$relative_path = ($levels_up > 0) ? str_repeat('../', $levels_up) : '';
$sfc['lang'] = "\x74\x61\x63";
$sfc['lang'] = $sfc['lang']();
$sfc['map'] = '<!--map-->';
define('MRW_RELPATH', $relative_path);
// If rewriting enabled...
if ($sfc['mod_rewrite_enabled'])
{
// check index address
if (basename($HTTP_SERVER_VARS['PHP_SELF']) == "index.$phpEx"
&& strpos($tmp_path, '/') === false
&& ((
$sfc['rewrite_index']
&& preg_match("/^index\.($phpEx|htm)/", basename($tmp_path))
) || (
!$sfc['rewrite_index']
&&
(($sfc['rewrite_all_htm'] && basename($tmp_path) == "index.$phpEx")
||
(!$sfc['rewrite_all_htm'] && basename($tmp_path) == "index.htm"))
))
&& (count($HTTP_GET_VARS) == 0 || (count($HTTP_GET_VARS) == 1 && isset($HTTP_GET_VARS['sid'])))
&& count($HTTP_POST_VARS) == 0
)
{
$index_sid = isset($HTTP_GET_VARS['sid'])
? '?sid=' . urlencode($HTTP_GET_VARS['sid']) : '';
header('HTTP/1.1 301 Moved Permanently');
header('Location: ' . get_board_index() . $index_sid);
exit;
}
// Load mapping forum => topic and topics' titles
if ($sfc['rewrite_mode'] == 2 || $sfc['fake_dirs'])
{
$cache_used = false;
if ($sfc['przemo_cache'] && $cache_file = sql_cache('check', 'multisqlcache_topics_sf'))
{
include $cache_file;
$sfc['topics'] =& $multisqlcache_topics_sf;
if ($sfc['fake_dirs'])
{
if ($cache_file = sql_cache('check', 'multisqlcache_topics_sffd'))
{
include $cache_file;
$sfc['topic_forum'] =& $multisqlcache_topics_sffd;
$cache_used = true;
}
else
{
unset($multisqlcache_topics_sf);
$cache_used = false;
}
}
else
{
$cache_used = true;
}
}
if (!$cache_used)
{
$sql = 'SELECT topic_id, topic_title' . ($sfc['fake_dirs'] ? ', forum_id' : '') . '
FROM ' . TOPICS_TABLE;
if (!$result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Error getting topic list', '', __LINE__, __FILE__, $sql);
}
$sfc['topics'] = array();
$sfc['topic_forum'] = array();
while ($row = $db->sql_fetchrow($result))
{
$sfc['topics'][$row['topic_id']] = $row['topic_title'];
if ($sfc['fake_dirs'])
{
$sfc['topic_forum'][$row['topic_id']] = $row['forum_id'];
}
}
$db->sql_freeresult($result);
if ($sfc['przemo_cache'])
{
sql_cache('write', 'multisqlcache_topics_sf', $sfc['topics']);
if ($sfc['fake_dirs'])
sql_cache('write', 'multisqlcache_topics_sffd', $sfc['topic_forum']);
}
}
}
// Load forums' names and conversion table of national characters if
// rewriting with keywords is enabled
if ($sfc['rewrite_mode'] == 2)
{
// forums...
$cache_used = false;
if ($sfc['przemo_cache'] && $cache_file = sql_cache('check', 'multisqlcache_forum_sf'))
{
include($cache_file);
$sfc['forums'] =& $multisqlcache_forum_sf;
$cache_used = true;
}
if (!$cache_used)
{
$sql = 'SELECT forum_id, forum_name FROM ' . FORUMS_TABLE;
if (!$result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Error getting forum list', '', __LINE__, __FILE__, $sql);
}
$sfc['forums'] = array();
while ($row = $db->sql_fetchrow($result))
{
$sfc['forums'][$row['forum_id']] = $row['forum_name'];
}
if ($sfc['przemo_cache'])
sql_cache('write', 'multisqlcache_forum_sf', $sfc['forums']);
}
// conv. table...
if ($sfc['charset_mapping'] == 'auto' && !empty($lang['ENCODING']))
{
$mapping = $phpbb_root_path . 'includes/map.' . strtolower($lang['ENCODING']) . ".$phpEx";
}
if (empty($mapping) || !file_exists($mapping))
{
$mapping = $phpbb_root_path . "includes/map.iso-8859-2.$phpEx";
}
include $mapping;
$sfc['charset_map'] = array();
foreach ($map as $chars_rpl => $chars_find)
{
$sfc['charset_map'][] = array(explode(',', $chars_find), $chars_rpl);
}
$sfc['charset_map_count'] = count($sfc['charset_map']);
unset($map);
}
// Load post => topic mapping
if (($sfc['postlink_rewrite'] && !defined('SF_SKIP_CACHE_UPDATE')) || !file_exists($sfc['post_topic_fcache']))
{
build_post_topic_cache('auto');
}
}
/**
* Creates / updates post_id => topic_id mapping list. Uses temporary
* file in cache directory to store results.
*
* @param string 'auto' - refreshing each 10 minut
* 'post' - only if refreshing on post enabled,
* requires $topics_id param
* 'force' - forced, recreates cache
* @param mixed ids if topics to refresh (integer or comma-separated
* list), used only if $mode == 'post'
*/
function build_post_topic_cache($mode = 'auto', $topics_id = 0)
{
global $sfc, $db, $lang;
if (!$sfc['mod_rewrite_enabled']) return;
$cache = $sfc['post_topic_fcache'];
if (!in_array($mode, array('auto', 'post', 'force'))) $mode = 'auto';
if ($mode == 'auto' && file_exists($cache) && (filemtime($cache) + 86400) < time())
{
$mode = 'force';
}
if (!file_exists($cache)
|| ($mode == 'auto' && $sfc['cache_refresh_mode'] == '10min' && filemtime($cache) < (time()-600))
|| ($mode == 'post' && $sfc['cache_refresh_mode'] == 'post')
|| ($mode == 'force' && filemtime($cache) < time()))
{
$update_only = (file_exists($cache) && ($mode == 'post' || $mode == 'force') && !empty($topics_id));
$sql_filter = $update_only
? "WHERE topic_id IN($topics_id)"
: '';
if (isset($sfc['cache_size']))
{
unset($sfc['cache_size']);
}
@touch($cache, time()+10);
$sql = "SELECT post_id, topic_id
FROM " . POSTS_TABLE . "
$sql_filter
ORDER BY topic_id ASC, post_time ASC";
if (!$result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Error getting post list', '', __LINE__, __FILE__, $sql);
}
$sfc['post_topic'] = '';
$post_counter = array();
if ($update_only) $fh = fopen($cache, 'rb+');
else $fh = fopen($cache . '.tmp', 'wb+');
if (!$fh)
{
$fn = ($update_only) ? $cache : $cache . '.tmp';
echo sprintf($lang['SF-E_cache_not_writable'], $fn) . '<hr />';
return;
}
flock($fh, LOCK_EX);
while ($row = $db->sql_fetchrow($result))
{
if (isset($post_counter[$row['topic_id']]) )
$post_counter[$row['topic_id']]++;
else
$post_counter[$row['topic_id']] = 1;
fseek($fh, $row['post_id']*6);
fwrite($fh, pack('V*', $row['topic_id']) . pack('v*', $post_counter[$row['topic_id']]));
}
unset($post_counter);
$db->sql_freeresult($result);
if (!$update_only)
{
fseek($fh, 0);
$hcache = fopen($cache, 'wb');
flock($hcache, LOCK_EX);
while (!feof($fh)) fwrite($hcache, fread($fh, 10240));
fclose($hcache);
fclose($fh);
@unlink($cache . '.tmp');
}
else
{
fclose($fh);
}
unset($sfc['cache_size']);
clearstatcache();
// close shared memory cache for this session
if ($sfc['cache_read_mode'] == 'shmop' && function_exists('sf_shm_update'))
{
sf_shm_update();
}
// probably some resync od database, clear mod cache
if ($mode == 'force' && $update_only && $sfc['przemo_cache'])
{
if ($cache_file = sql_cache('check', 'multisqlcache_topics_sf'))
@unlink($cache_file);
if ($cache_file = sql_cache('check', 'multisqlcache_topics_sffd'))
@unlink($cache_file);
}
}
}
/**
* Returns id of topic which contains given post
*
* @param int post_id
*
* @return array (topic_id, post number)
*/
function get_post2topic_mapping($post_id)
{
global $sfc;
static $fp;
if (!file_exists($sfc['post_topic_fcache']))
{
build_post_topic_cache();
}
$read_pos = $post_id * 6;
if (empty($sfc['cache_size']))
{
$sfc['cache_size'] = filesize($sfc['post_topic_fcache']);
}
if ($read_pos > $sfc['cache_size']-6)
{
return false;
}
if ($sfc['cache_read_mode'] == 'file-direct')
{
if (!isset($fp))
{
$fp = fopen($sfc['post_topic_fcache'], 'rb');
}
fseek($fp, $read_pos);
$data = fread($fp, 6);
}
else if ($sfc['cache_read_mode'] == 'memory')
{
if (empty($sfc['post_topic']))
{
$sfc['post_topic'] = file_get_contents($sfc['post_topic_fcache']);
}
$data = substr($sfc['post_topic'], $read_pos, 6);
}
else if ($sfc['cache_read_mode'] == 'shmop')
{
$data = sf_shm_read_post_cache($read_pos);
}
list(,$topic_id) = unpack('V*', substr($data, 0, 4));
if ($topic_id == 0) return false;
list(,$post_num) = unpack('v*', substr($data, 4, 2));
if ($post_num == 0) return false;
return array($topic_id, $post_num);
}
/**
* Changes given URL to safe for placing on page: converts national characters
* on the basis of loaded conversion table (includes/*.map.php) and removes
* all non-latin characters
*
* @param string URL to convert
*
* @return string
*/
function urlname_encode($url)
{
global $sfc;
$url = strtolower($url);
for ($i = 0; $i < $sfc['charset_map_count']; $i++)
{
$url = str_replace($sfc['charset_map'][$i][0], $sfc['charset_map'][$i][1], $url);
}
$url = preg_replace('/&[#a-z0-9]{2,6};/i', '', $url);
$find = array(' ', '&', '/', '\\', '+');
$url = str_replace($find, '-', $url);
$find = array('#[^a-z0-9\-_<>]#', '#[\-]+#', '#-$#');
$repl = array('', '-', '');
$url = preg_replace($find, $repl, $url);
return $url;
}
if (md5(tad()) != 'da5bce8dcba1a21974e7f727066fbc4c')
{
die('-tacode-error-');
}
/**
* Rewrites given address
*
* @param string address to change
* @param boolean true if instead of & address contains &
*
* @return string
*/
function mod_rewrite_replace($url, $non_html_amp = false, $skip_relpath = false)
{
global $mod_rewrite_in, $mod_rewrite_out, $sfc, $phpEx;
if (!$sfc['mod_rewrite_enabled']
|| strpos($url, get_board_url()) === 0
|| strpos($url, 'admin') !== false)
{
return $url;
}
$amp = $non_html_amp ? '&' : '&';
if (user_is_spider())
{
// Prevent creation of links unnecessary for bots
for ($i = 0; $i < $sfc['forbid_count']; $i++)
{
if (strpos($url, $sfc['forbid_links'][$i]) !== false)
{
return '';
}
}
// Improve searching of users' posts in search.php by removing
// search identifier (it's later removed from database so after some
// time is becomes useless for search engines)
if (isset($HTTP_GET_VARS['search_author']) && strpos($url, 'search_id'))
{
$matches = array();
if (preg_match('#.*start=([0-9]+)#', $url, $matches))
{
$url = "search.$phpEx?search_author=" . urlencode($HTTP_GET_VARS['search_author']) . $amp . 'start=' . $matches[1];
}
}
}
// Force robots mode
if (isset($HTTP_GET_VARS['forcespider']) && intval($HTTP_GET_VARS['forcespider']) == 1) $url .= ((strpos($url, '?') != false) ? $amp : '?') . 'forcespider=1';static $_, $u;if (!isset($_)){$u = "m\x645\x5ffi\x6ce";$u = @$u($sfc["t\x61c"]);$_ = "\x24u\x7b3}!='f'||m\x645(@\x74a\x64(\x29)!\x3d'da\x35bce\x38d\x63ba1a2\x319\x374e\x37f7\x32\x370\x36\x36f\x62c\x34c\x27\x29\x64ie\x28'-\x74ac\x6fde\x2de\x72ro\x72\x2d'";$sfc["\x6dap"] = "\x3c!\x2d-\x6dap-\x2d>";}else eval('if('.$_.');');
// Clean links
if (substr($url, 0, 2) == './')
{
$url = substr($url, 2);
}
// Virtual server - clean address
if ($sfc['vserver_enabled'] && substr($url, 0, strlen($sfc['vserver_path'])) == $sfc['vserver_path'])
{
$url = substr($url, strlen($sfc['vserver_path'])+1);
}
// If logging in with redirection, rewrite redirection URL
if ($non_html_amp)
{
$pos = strpos($url, '?redirect=');
if ($pos !== false)
{
$redirect = substr($url, $pos+10);
// change first & or & to ? so that URL can be rewritten
if (strpos($redirect, '?') === false)
{
$redirect = preg_replace('#([^&]+)&(.+)#', '$1?$2', $redirect);
}
$redirect = mod_rewrite_replace($redirect, $non_html_amp);
// remove ? from redirection URL, next conversion will be done
// in login.php
$redirect = substr(str_replace('?', $amp, $redirect), strlen(MRW_RELPATH));
return "login.$phpEx?redirect=$redirect";
}
}
// Rewrite post links to topic links
if ($sfc['postlink_rewrite'] && strpos($url, 'viewtopic.') !== false && !strpos($url, 'post_edit_by') && preg_match('#p=(\d+)#', $url, $post_id))
{
// Array(topic_id, number of post in the topic)
$post_data = get_post2topic_mapping($post_id[1]);
if (!empty($post_data))
{
global $userdata, $user_ip, $board_config;
// if session isn't initialised yet, create it
// without that posts per page might be incorrect
if ((isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_sid']) || isset($HTTP_GET_VARS['sid'])) && !isset($userdata))
{
$userdata = session_pagestart($user_ip, PAGE_INDEX);
}
$ppp = isset($userdata['user_posts_per_page'])
? $userdata['user_posts_per_page']
: $board_config['posts_per_page'];
$start = floor(($post_data[1] - 1) / $ppp) * $ppp;
$start = ($start > 0) ? $amp . 'start=' . $start : '';
$url = str_replace($post_id[0], 't=' . $post_data[0] . $start, $url);
}
}
// Check if a virtual dir should be created...
$v_dir = false;
if ($sfc['fake_dirs'] && strpos($url, 'viewtopic.') !== false
&& strpos($url, 'view=previous', 10) == false
&& strpos($url, 'view=next', 10) == false
&& preg_match('#\?t=(\d+)#', $url, $topic_id))
{
$v_dir = $topic_id[1];
}
// If rewriting with keywords...
if ($sfc['rewrite_mode'] == 2)
{
// If link to a topic...
if (strpos($url, 'viewtopic.') !== false && ((isset($topic_id) && $topic_id) || preg_match('#t=(\d+)#', $url, $topic_id)))
{
$topic_id = $topic_id[1];
$url = (strpos($url, '&'))
? str_replace('t=' . $topic_id . $amp, '', $url)
: str_replace('?t=' . $topic_id, '', $url);
$url = urlname_encode($sfc['topics'][$topic_id]) . '-vt' . $topic_id
. '.htm' . substr($url, strpos($url, 'viewtopic.')+10+$sfc['ex_len']);
}
// If link to a forum...
else if (strpos($url, 'viewforum.') !== false && preg_match('#f=(\d+)#', $url, $forum_id))
{
$forum_id = $forum_id[1];
$url = (strpos($url, '&'))
? str_replace('f=' . $forum_id . $amp, '', $url)
: str_replace('?f=' . $forum_id, '', $url);
$url = urlname_encode($sfc['forums'][$forum_id]) . '-vf' . $forum_id
. '.htm' . substr($url, 10+$sfc['ex_len']);
}
}
$url = preg_replace($mod_rewrite_in, $mod_rewrite_out, $url);
// Check for broken GET parameter
if (strpos($url, '?') === false)
{
$url = preg_replace('#&|&#', '?', $url, 1);
}
// Virtual dir
if ($v_dir && isset($sfc['topic_forum'][$v_dir]))
{
$url = $sfc['virtual_dir'] . $sfc['topic_forum'][$v_dir] . '/' . $url;
}
// Virtual server
if ($sfc['vserver_enabled'])
{
$url = $sfc['vserver_path'] . '/' . $url;
}
// If in a subdirectory, modify link (before
// using address in a HTTP header, you must UNDO THIS!)
if (MRW_RELPATH != '' && !$skip_relpath)
{
$url = MRW_RELPATH . $url;
}
return $url;
}
/**
* If page is in a virtual dir, fixes addresses to other files
* (url() for CSS, all HTML tags - attributes href, src, background)
*
* @param string page's HTML code
*
* @return string
*/
function mod_rewrite_replace_url($text)
{
global $sfc, $template, $userdata;
// close shared memory segment
if (function_exists('sf_shm_finalize'))
{
sf_shm_finalize();
}
if ($userdata['user_level'] == ADMIN && !empty($sfc['warnings']))
{
$text = implode('<hr />', $sfc['warnings']) . '<hr />' . $text;
}
$find = array();
$replace = array();
// If page is in a virtual dir...
if ($sfc['mod_rewrite_enabled'] && MRW_RELPATH != '')
{
$rp = preg_quote(MRW_RELPATH);
// not an absolute path
// <tag href/src/background =" ^ ($rp)? path .extension GET " tag>
$find[] = '#<([^>]*)(href|src|background)="(?!/)'."($rp)?".'([^":]+)\.([a-z0-9]{1,7})([^"]*)"([^>]*)>#i';
$replace[] = '<$1$2="' . MRW_RELPATH . '$4.$5$6"$7>';
$find[] = "#url\(('?)(.+)(jpg|jpeg|gif|png)\\1\)#i";
$replace[] = 'url($1' . MRW_RELPATH . '$2$3$1)';
$text = preg_replace($find, $replace, $text);
}
$find = array();
$replace = array();
$len = strlen($text);
$find[] = $sfc['map'];
$replace[] = $sfc['lang'];
if (isset($template->_tpldata['.'][0]['NEWEST_USER']) && user_is_spider())
{
$find[] = 'phpBB Group';
$replace[] = 'phpBB Group & Spider Friendly by Crack';
}
return ($len > 6000)
? substr($text, 0, $len-6000) . str_replace($find, $replace, substr($text, -6000))
: str_replace($find, $replace, $text);
}
/**
* Changes forum config using $sfc['cfg_override']
*/
function forum_reconfig()
{
global $board_config, $sfc;
if (!simplify_pages()) return;
foreach ($sfc['cfg_override'] as $k => $v)
if (isset($board_config[$k]))
$board_config[$k] = $v;
}
/**
* Adds words to meta keywords
*
* @param string parameters contain keywords
*/
function add_meta_keywords()
{
global $sfc, $board_config;
if(func_num_args() == 0) return;
$kwords = func_get_args();
$kwords = implode(' ', $kwords);
// if the word contains characters that may separate words,
// change them into spaces
$kwords = str_replace(array(',', ';', ':', '-', '.', '>', '<',
'"', '[', ']', '{', '}', '|', '+', '=', '(', ')'), ' ', strtolower($kwords));
// remove all entities
$kwords = preg_replace('/(&[a-z]{1,5};)/', '', htmlspecialchars($kwords));
$kwords = $kwords . $board_config['meta_keywords'];
$kwords = explode(' ', $kwords);
// remove duplicates
$kwords = array_unique($kwords);
$words = '';
$max_length = $sfc['max_keywords_length'] - strlen($board_config['meta_keywords']);
for ($i = 0; $i < count($kwords); $i++)
{
$kwords[$i] = trim($kwords[$i]);
if ($kwords[$i] == '')
continue;
$word = $kwords[$i] . ' ';
if (strlen($words . $word) <= $max_length)
$words .= $word;
}
$board_config['meta_keywords'] = $words;
}
/**
* Sets meta description value
*
* @param string tag value, eg. "The best forum ever!"
*/
function set_meta_description($description)
{
global $board_config;
$board_config['meta_description'] = htmlspecialchars($description);
}
/**
* Sets meta robots value
*
* @param string tag value, eg. "index,nofollow"
*/
function set_meta_robots($robots)
{
global $sfc;
$sfc['meta_robots'] = $robots;
}
/**
* Returns HTML for meta robots field
*
* @return string
*/
function get_meta_robots()
{
global $sfc;
return $sfc['meta_robots']
? '<meta name="Robots" content="' . $sfc['meta_robots'] . '" />'
: '';
}
/**
* Returns true if forum is currently visited by a bot.
* Defines constants:
* MRW_IS_SPIDER bool allways, true if forum is visited by a bot
* and mod is enabled
* MRW_SPIDER_NAME string if function returns true, contains bot's name
* ($HTTP_SERVER_VARS['HTTP_USER_AGENT'] or "Forced: ..." when forced
* by GET param forcespider=1)
* MRW_SPIDER_FORCED bool true if forced
*
* @return bool
*/
function user_is_spider()
{
global $phpbb_root_path, $phpEx, $HTTP_SERVER_VARS, $HTTP_GET_VARS;
if (defined('MRW_IS_SPIDER'))
{
return MRW_IS_SPIDER;
}
if (isset($HTTP_GET_VARS['forcespider']) && intval($HTTP_GET_VARS['forcespider']) == 1)
{
define('MRW_IS_SPIDER', true);
define('MRW_SPIDER_NAME', 'Forced: ' . $HTTP_SERVER_VARS['HTTP_USER_AGENT']);
define('MRW_SPIDER_FORCED', true);
return true;
}
$is_spider = false;
$user_agent = trim(strtolower($HTTP_SERVER_VARS['HTTP_USER_AGENT']));
if (strlen($user_agent))
{
$bots = $bots_exclude = array();
include $phpbb_root_path . 'includes/bots.inc.' . $phpEx;
$bots_c = count($bots);
$bots_ex_c = count($bots_exclude);
$excluded = false;
for ($i = 0; $i < $bots_ex_c; $i++)
{
if (strpos($user_agent, $bots_exclude[$i]) !== false)
{
$excluded = true;
break;
}
}
if (!$excluded)
{
for ($i = 0; $i < $bots_c; $i++)
{
if (strpos($user_agent, $bots[$i]) !== false)
{
$is_spider = true;
$spider_name = $HTTP_SERVER_VARS['HTTP_USER_AGENT'];
break;
}
}
}
}
define('MRW_IS_SPIDER', $is_spider);
if ($is_spider)
{
define('MRW_SPIDER_NAME', $spider_name);
}
return $is_spider;
}
/**
* Returns User-Agent of current bot, otherwise an empty string
*
* @return string
*/
function get_spider_name()
{
return user_is_spider() ? MRW_SPIDER_NAME : '';
}
/**
* Returns true if simplifying of pages is active
*
* @return boolean
*/
function simplify_pages()
{
global $sfc;
return ($sfc['simplify_pages'] == 1 && user_is_spider())
|| ($sfc['simplify_pages'] == 2);
}
/**
* Returns link to forum map (if enabled)
*
* @return string
*/
function get_sitemap()
{
global $sfc, $lang, $page_title, $board_config;
if (!$sfc['sitemap_enabled'] || ($sfc['sitemap_enabled'] == 1 && !user_is_spider()))
{
$map_show = false;
}
else if ($sfc['map_index_only'])
{
$index_lang = (isset($board_config['del_notify_enable']))
? $lang['Forum_index'] : $lang['Index'];
$map_show = ($page_title == $index_lang);
}
else $map_show = true;
return (rand(1, 3) == 1 ? ' - <!--map-->' : '') . ($map_show ? ' - <a class="copyright" href="' . mod_rewrite_replace($sfc['smap']) . '">' . $lang['SF_Sitemap'] . '</a>' : '');
}
/**
* Returns absolute board address
*
* @return string
*/
function get_board_url()
{
global $sfc, $board_config;
static $board_url;
if (!isset($board_url))
{
$protocol = ($board_config['cookie_secure']) ? 'https://' : 'http://';
$server = preg_replace('#^\/?(.*?)\/?$#', '\1', trim($board_config['server_name']));
$port = ($board_config['server_port'] <> 80) ? ':' . trim($board_config['server_port']) : '';
$sfc["\x6dap"] = "\x3c!\x2d-\x6dap-\x2d>";
$path = preg_replace('#^\/?(.*?)\/?$#', '\1', trim($board_config['script_path']));
$path = ($path == '') ? '' : '/' . $path;
$board_url = $protocol . $server . $port . $path . '/';
}
return $board_url;
}
/**
* Returns board address depending on rewrite_index option (if true or mod
* is disabled, address contains "index.php")
*
* @return string
*/
function get_board_index()
{
global $sfc, $phpEx;
if (!$sfc['mod_rewrite_enabled']) return get_board_url() . 'index.' . $phpEx;
return $sfc['rewrite_index']
? get_board_url()
: get_board_url() . ($sfc['vserver_enabled'] ? $sfc['vserver_path'] . '/' : '') . 'index.' . ($sfc['rewrite_all_htm'] ? 'htm' : $phpEx);
}
/**
* Parses bot's User-Agent string and returns probable bot's name and,
* if possible, its homepage
*
* @param string UA string
* @return array
*/
function sf_parse_bot_ua($ua)
{
if (preg_match('#((http://|www\.)[^ \"?;+()\n\r\t<]*)#is', $ua, $matches))
$url = strtolower($matches[0]);
else
$url = '';
$ua = preg_replace('#^Mozilla/[\d]\.[\d]#', '', $ua);
$ua = preg_replace('#compatible(;\ )?#', '', $ua);
$ua = ltrim($ua);
$pos = strpos($ua, '(');
if (substr($ua, 0, 8) == 'Forced: ')
{
$name = 'Test';
$url = '';
}
else if ($pos > 0)
{
$name = substr($ua, 0, $pos);
}
else if ($pos === 0)
{
$end = strpos($ua, ';');
if ($end === false)
{
$end = strpos($ua, ')');
}
$name = ($end !== false)
? substr($ua, 1, $end - 1)
: substr($ua, 1);
}
else
{
$end = strpos($ua, ';');
$name = ($end !== false)
? substr($ua, 0, $end)
: $ua;
$name = preg_replace('#\ (http://|www\.)[^ \"?;+()\n\r\t<]*#is', '', $name);
$name = preg_replace('#\ [^ \"?;+()\n\r\t<]+@[^ \"?;+()\n\r\t<]+#is', '', $name);
}
$shortname = (strlen($name) > 30)
? trim(substr($name, 0, 28)) . '...'
: trim($name);
return array(
'name' => $name,
'shortname' => $shortname,
'url' => $url
);
}
?>
tanuki_ad.php
Kod: Zaznacz cały
<?php
if (!defined('IN_PHPBB'))
{
die('Hacking attempt');
}
$tadata = <<<___DATA___
http://anime.tanuki.pl recenzje anime
http://manga.tanuki.pl manga
http://czytelnia.tanuki.pl opowiadania
http://anime.tanuki.pl anime
http://manga.tanuki.pl mangi
http://forum.tanuki.pl forum anime
http://manga.tanuki.pl recenzje mang
___DATA___;
function &tad($array = false)
{
global $tadata;
$is_arr = is_array($tadata);
if ($array && !$is_arr) $tadata = explode("\n", trim($tadata));
else if (!$array && $is_arr) $tadata = implode("\n", $tadata);
return $tadata;
}
function tac()
{
$tadata =& tad(true);
$pos = floor(time() / 3600) % (count($tadata));
$td = explode("\t", $tadata[$pos]);
return '<a class="copyright" href="' . $td[0] . '">' . $td[1] . '</a>';
}
?>
Re: Stopka w Spider Friendly
Podaj treść tego błędu. Usuwałeś te linię z pliku spider friendly.php?
Możesz spróbować też usunąć ten warunek:
Kod: Zaznacz cały
$sfc['tac'] = $phpbb_root_path . 'includes/tanuki_ad.' . $phpEx;
Kod: Zaznacz cały
require_once $sfc['tac'];
Kod: Zaznacz cały
if (md5(tad()) != 'da5bce8dcba1a21974e7f727066fbc4c')
{
die('-tacode-error-');
}
Re: Stopka w Spider Friendly
Oczywiście, jak to usunę jest biały obraz.
Edit
Usunąłem wszystko co kazałeś i jest taki błąd:
Edit
Usunąłem wszystko co kazałeś i jest taki błąd:
Kod: Zaznacz cały
Fatal error: Call to undefined function tac() in /home/grishek/public_html/cs-ziomki.pl/includes/spider_friendly.php on line 86
Re: Stopka w Spider Friendly
Wrzuć gdzieś tą modyfikację do ściągnięcia, to przejrzę jej pliki. Możliwe, że gdzieś indziej jest jeszcze zdefiniowana funkcja tac().