สำหรับ SMF 2.0.xxแก้ไขไฟล์:file $sourcedir/ManageSettings.php
ค้นหา -->>
// Mod authors, add any settings UNDER this line. Include a comma at the end of the line and don't remove this statement!!
แก้เป็น -->>
array('check', 'enable_spiderAccess',
&$txt['enable_spiderAccess']),
array('text', 'enabled_spider', '35',
&$txt['enabled_spider']),
'',
file $sourcedir/Display.php
ค้นหา -->>
?>
เพิ่มไว้ก่อน -->>
// Lets enable spider access
if (!empty($modSettings['enabled_spider']))
{
$enabled_spider = explode(",", preg_replace("/(\[^a-ZA-Z0-9,])/", "", $modSettings['enabled_spider']));
foreach ($enabled_spider as $key => $value)
if (empty($value))
unset($enabled_spider[$key]);
}
else
$enabled_spider = array();
$spider_match = false;
if (!empty($modSettings['enable_spiderAccess']))
{
foreach($enabled_spider as $spider)
{
preg_match('/' . $spider . '/', $_SERVER['HTTP_USER_AGENT'], $matches);
if(count($matches) > 0)
$spider_match = true;
}
}
if (!$spider_match || $context['user']['is_guest'])
is_not_guest();
file $sourcedir/MessageIndex.php
ค้นหา -->>
?>
เพิ่มไว้ก่อน -->>
// Lets enable spider access
if (!empty($modSettings['enabled_spider']))
{
$enabled_spider = explode(",", preg_replace("/(\[^a-ZA-Z0-9,])/", "", $modSettings['enabled_spider']));
foreach ($enabled_spider as $key => $value)
if (empty($value))
unset($enabled_spider[$key]);
}
else
$enabled_spider = array();
$spider_match = false;
if (!empty($modSettings['enable_spiderAccess']))
{
foreach($enabled_spider as $spider)
{
preg_match('/' . $spider . '/', $_SERVER['HTTP_USER_AGENT'], $matches);
if(count($matches) > 0)
$spider_match = true;
}
}
if (!$spider_match || $context['user']['is_guest'])
is_not_guest();
file $languagedir/Modifications.thai-utf8.php
เพิ่ม -->>
$txt['enable_spiderAccess'] = 'Enable spider access';
$txt['enabled_spider'] = 'The spiders,which should be able to browse the site <br /><i> (As an example,for the spiders <b><font color="red">google and yahoo</font></b> you should write google,yahoo) ';
ลิงค์หัวข้อ:
http://dexmore.com/topic/280