RedirectPage อีกรูปแบบของการป้องกันลิงค์สด
หน้าแรก
เว็บบอร์ด
กระทู้โปรด
กระทู้ล่าสุด
ติดต่อทีมงาน
ห้องเกมส์
ร้านค้า
ซื้อไอเท็ม
ศูนย์กลางซื้อ-ขาย
ไอเท็มของคุณ
ไอเท็มของสมาชิก
ส่งเงินให้เพื่อน
ส่งไอเท็มให้เพื่อน
ธนาคาร
สัตว์เลี้ยง
สัตว์เลี้ยงของคุณ
สัตว์เลี้ยงของสมาชิก
เกี่ยวกับเรา
ปฏิทิน
สมาชิก
22 พฤษภาคม 2555, 17:18:46
ยินดีต้อนรับผู้เยี่ยมชม
ยินดีต้อนรับคุณ,
ผู้เยี่ยมชม
กรุณา
เข้าสู่ระบบ
หรือ
ลงทะเบียน
1 ชั่วโมง
1 วัน
1 สัปดาห์
1 เดือน
ตลอดกาล
เข้าสู่ระบบด้วยชื่อผู้ใช้ รหัสผ่าน และระยะเวลาในเซสชั่น
ระเบียบปฏิบัติ
สมัครสมาชิก
ทำเว็บไซต์ | แต่งบอร์ด | ออกแบบ | SMF | Joomla | Drupal | WordPress | JQuery | CMS | ECommerce | Tel. +668-08577477
-:-DexMoreGroup แหล่งมั่วสุมทางปัญญา-:-
Web Achieve
Simple Machines Forum
SMF Modifications
RedirectPage อีกรูปแบบของการป้องกันลิงค์สด
หน้า:
1
ผู้เขียน
หัวข้อ: RedirectPage อีกรูปแบบของการป้องกันลิงค์สด (อ่าน 4942 ครั้ง)
0 สมาชิก และ 1 ผู้เยี่ยมชม กำลังดูหัวข้อนี้
UnclEo
!Personal
Reputation :
5863
Chips :
9884 Mony
Age
: 33
Member ID
: 2
Level 44 : Exp 80%
HP: 49.4%
PD: 3.542
Login Time
: 472:0
Total Posts
: 3043
Total Topics
: 1519
Adviser
: 24
RedirectPage อีกรูปแบบของการป้องกันลิงค์สด
เมื่อ:
20 สิงหาคม 2553, 18:35:57
ชื่อ: RedirectPage
ผู้เขียน: D#S
นำเสนอโดย:
DexMoreGroup
ประเภท: Search Engine Optimization
รองรับ: SMF 1.1.xx, 2.0.xx
ปรับปรุงล่าสุด: 26 กรกฏาคม 2553
ต้นฉบับ:
RedirectPage
รายละเอียด
เป็นการสร้างหน้าเปลี่ยนเส้นทางการเชื่อมโยงลิงค์ภายนอกเหมือนๆ กับ mod AnonymizeLinks หรือ go.php ของ zone-it นั่นแหละครับ แต่ตัวนี้มีคนทำเป็น mod ให้ติดตั้งกันได้เลย คุณสมบัติพิเศษของมันก็คือ
เลือกใช้หรือไม่ใช้ธีมของ SMF
กำหนดข้อความในการเชื่อมโยงลิงค์ภายนอกได้
กำหนดระยะหน่วงเวลาที่ต้องรอได้
หากผู้ใช้ไม่ต้องการรอสามารถคลิกไปต่อได้ทันที
หากผู้ใช้เปลี่ยนใจไม่ไปต่อสามารถคลิกย้อนกลับได้
กำหนดใช้กับลิงค์ปกติหรือ TAG URL, IURL ได้
กำหนดใช้กับผู้ใช้ทั้งหมดหรือเฉพาะบุคคลทั่วไป
ใช้ลิงค์เข้ารหัสได้
ตัดคำของลิงค์ที่มีความยาวให้เหลื่อเท่าที่กำหนด
กำหนดใช้กับลิงค์เว็บไซต์ของสมาชิก
กำหนดใช้กับ icq msn หรือผู้ให้บริการข้อความอื่นๆ ได้
3 รูปแบบการเปลื่ยนเส้นทาง ปกติ, หน่วงเวลา, ทันทีทันใด
*
ข้อเสีย
ไม่สามารถใช้ร่วมกับ SPortal ได้
ตัวอย่าง
สำหรับ SMF 1.1.xx
แก้ไขไฟล์:
file $sourcedir/Load.php
ค้นหา -->>
โค๊ด:
[Select]
// Loads the user's basic values... meant for template/theme usage.
function loadMemberContext($user)
{
global $memberContext, $user_profile, $txt, $scripturl, $user_info;
แก้เป็น -->>
โค๊ด:
[Select]
// Loads the user's basic values... meant for template/theme usage.
function loadMemberContext($user, $display_custom_fields = false)
{
global $memberContext, $user_profile, $txt, $scripturl, $boardurl, $user_info;
ค้นหา -->>
โค๊ด:
[Select]
'website' => array(
'title' => &$profile['websiteTitle'],
'url' => &$profile['websiteUrl'],
),
แก้เป็น -->>
โค๊ด:
[Select]
'website' => array(
'title' => $profile['websiteTitle'],
'url' => (empty($modSettings['RedirectPage_on_members_sites']) || strpos($profile['websiteUrl'], 'http://') !== 0)? $profile['websiteUrl'] : $boardurl . '/go.php?url=' . ($modSettings['RedirectPage_encode'] ? base64_encode($profile['websiteUrl']) : $profile['websiteUrl']),
),
ค้นหา -->>
โค๊ด:
[Select]
'link' => '<a href="http://www.icq.com/whitepages/about_me.php?uin=' . $profile['ICQ'] . '" target="_blank"><img src="http://status.icq.com/online.gif?img=5&icq=' . $profile['ICQ'] . '" alt="' . $profile['ICQ'] . '" width="18" height="18" border="0" /></a>',
'link_text' => '<a href="http://www.icq.com/whitepages/about_me.php?uin=' . $profile['ICQ'] . '" target="_blank">' . $profile['ICQ'] . '</a>',
แก้เป็น -->>
โค๊ด:
[Select]
'link' => '<a href="' . ((!empty($modSettings['RedirectPage_on_members_icq_etc']))? $boardurl . '/go.php?url=' . ($modSettings['RedirectPage_encode'] ? base64_encode('http://www.icq.com/whitepages/about_me.php?uin=' . $profile['ICQ']) : 'http://www.icq.com/whitepages/about_me.php?uin=' . $profile['ICQ']) : 'http://www.icq.com/whitepages/about_me.php?uin=' . $profile['ICQ']) . '" target="_blank" title="' . $profile['ICQ'] . '"><img src="http://status.icq.com/online.gif?img=5&icq=' . $profile['ICQ'] . '" alt="' . $profile['ICQ'] . '" width="18" height="18" border="0" /></a>',
'link_text' => '<a href="' . ((!empty($modSettings['RedirectPage_on_members_icq_etc']))? $boardurl . '/go.php?url=' . ($modSettings['RedirectPage_encode'] ? base64_encode('http://www.icq.com/whitepages/about_me.php?uin=' . $profile['ICQ']) : 'http://www.icq.com/whitepages/about_me.php?uin=' . $profile['ICQ']) : 'http://www.icq.com/whitepages/about_me.php?uin=' . $profile['ICQ']) . '" target="_blank">' . $profile['ICQ'] . '</a>',
ค้นหา -->>
โค๊ด:
[Select]
'link' => '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . urlencode($profile['YIM']) . '"><img src="http://opi.yahoo.com/online?u=' . urlencode($profile['YIM']) . '&m=g&t=0" alt="' . $profile['YIM'] . '" border="0" /></a>',
'link_text' => '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . urlencode($profile['YIM']) . '">' . $profile['YIM'] . '</a>'
แก้เป็น -->>
โค๊ด:
[Select]
'link' => '<a href="' . ((!empty($modSettings['RedirectPage_on_members_icq_etc']))? $boardurl . '/go.php?url=' . ($modSettings['RedirectPage_encode'] ? base64_encode('http://edit.yahoo.com/config/send_webmesg?.target=' . urlencode($profile['YIM'])) : 'http://edit.yahoo.com/config/send_webmesg?.target=' . urlencode($profile['YIM'])) : 'http://edit.yahoo.com/config/send_webmesg?.target=' . urlencode($profile['YIM'])) . '" title="' . $profile['YIM'] . '"><img src="http://opi.yahoo.com/online?u=' . urlencode($profile['YIM']) . '&m=g&t=0" alt="' . $profile['YIM'] . '" border="0" /></a>',
'link_text' => '<a href="' . ((!empty($modSettings['RedirectPage_on_members_icq_etc']))? $boardurl . '/go.php?url=' . ($modSettings['RedirectPage_encode'] ? base64_encode('http://edit.yahoo.com/config/send_webmesg?.target=' . urlencode($profile['YIM'])) : 'http://edit.yahoo.com/config/send_webmesg?.target=' . urlencode($profile['YIM'])) : 'http://edit.yahoo.com/config/send_webmesg?.target=' . urlencode($profile['YIM'])) . '">' . $profile['YIM'] . '</a>',
ค้นหา -->>
โค๊ด:
[Select]
'link' => '<a href="http://members.msn.com/' . $profile['MSN'] . '" target="_blank"><img src="' . $settings['images_url'] . '/msntalk.gif" alt="' . $profile['MSN'] . '" border="0" /></a>',
'link_text' => '<a href="http://members.msn.com/' . $profile['MSN'] . '" target="_blank">' . $profile['MSN'] . '</a>'
แก้เป็น -->>
โค๊ด:
[Select]
'link' => '<a href="' . ((!empty($modSettings['RedirectPage_on_members_icq_etc']))? $boardurl . '/go.php?url=' . ($modSettings['RedirectPage_encode'] ? base64_encode('http://members.msn.com/' . $profile['MSN']) : 'http://members.msn.com/' . $profile['MSN']) : 'http://members.msn.com/' . $profile['MSN']) . '" title="' . $profile['MSN'] . '"><img src="' . $settings['images_url'] . '/msntalk.gif" alt="' . $profile['MSN'] . '" border="0" /></a>',
'link_text' => '<a href="' . ((!empty($modSettings['RedirectPage_on_members_icq_etc']))? $boardurl . '/go.php?url=' . ($modSettings['RedirectPage_encode'] ? base64_encode('http://members.msn.com/' . $profile['MSN']) : 'http://members.msn.com/' . $profile['MSN']) : 'http://members.msn.com/' . $profile['MSN']) . '">' . $profile['MSN'] . '</a>',
file $sourcedir/ModSettings.php
ค้นหา -->>
โค๊ด:
[Select]
);
// By default do the basic settings.
เพิ่มไว้ก่อน -->>
โค๊ด:
[Select]
'RedirectPage' => 'RedirectPageSettings',
ค้นหา -->>
โค๊ด:
[Select]
'is_last' => true,
แก้เป็น -->>
โค๊ด:
[Select]
),
'RedirectPage' => array(
'title' => $txt['admin_menu_RedirectPage'],
'href' => $scripturl . '?action=featuresettings;sa=RedirectPage;sesc=' . $context['session_id'],
'is_last' => true,
ค้นหา -->>
โค๊ด:
[Select]
);
// Default to core (I assume)
เพิ่มไว้ก่อน -->>
โค๊ด:
[Select]
'RedirectPage' => 'RedirectPageSettings',
ค้นหา -->>
โค๊ด:
[Select]
?>
เำพิ่มไว้ก่อน -->>
โค๊ด:
[Select]
function RedirectPageSettings()
{
global $txt, $scripturl, $boardurl, $boarddir, $context, $settings, $sc;
$config_vars = array(
array('check', 'RedirectPage_on_plain'),
array('check', 'RedirectPage_on_url'),
array('check', 'RedirectPage_on_iurl'),
'',
array('check', 'RedirectPage_on_members_sites'),
array('check', 'RedirectPage_on_members_icq_etc'),
'',
array('check', 'RedirectPage_on_same_host'),
array('check', 'RedirectPage_guests_only'),
'',
array('select', 'RedirectPage_type', Array('normal' => $txt['RedirectPage_type_normal'], 'delayed' => $txt['RedirectPage_type_delayed'], 'instant' => $txt['RedirectPage_type_instant'])),
array('int', 'RedirectPage_delay', 3),
array('check', 'RedirectPage_use_theme'),
array('check', 'RedirectPage_encode'),
array('large_text', 'RedirectPage_text', 10),
'',
array('int', 'RedirectPage_trim_links', 3),
array('check', 'RedirectPage_Aeva_compatibility'),
);
// Saving?
if (isset($_GET['save']))
{
saveDBSettings($config_vars);
redirectexit('action=featuresettings;sa=RedirectPage');
}
$context['post_url'] = $scripturl . '?action=featuresettings2;save;sa=RedirectPage';
$context['settings_title'] = $txt['admin_menu_RedirectPage'];
prepareDBSettingContext($config_vars);
// Chek robots.txt info
$deep = substr_count($boardurl, '/') - 2;
$site_dir = $boarddir . str_repeat('/..', $deep);
$robots_path = $site_dir . '/robots.txt';
$robots = file_exists($robots_path);
if ($robots){
$robots = file_get_contents($robots_path);
$robots = strpos($robots, 'Disallow: ' . parse_url($boardurl, PHP_URL_PATH) . '/go.php') !== false;
}
if (!$robots){
$context['settings_message'] = '<div class="centertext">' . str_replace('{BOARD_URL}', parse_url($boardurl, PHP_URL_PATH), $txt['RedirectPage_robots_note']) . '</div>';
}
}
file $sourcedir/Subs.php
ค้นหา -->>
โค๊ด:
[Select]
array(
'tag' => 'iurl',
'type' => 'unparsed_content',
'content' => '<a href="$1">$1</a>',
'validate' => create_function('&$tag, &$data, $disabled', '
$data = strtr($data, array(\'<br />\' => \'\'));
if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0)
$data = \'http://\' . $data;
'),
),
array(
'tag' => 'iurl',
'type' => 'unparsed_equals',
'before' => '<a href="$1">',
'after' => '</a>',
'validate' => create_function('&$tag, &$data, $disabled', '
if (substr($data, 0, 1) == \'#\')
$data = \'#post_\' . substr($data, 1);
elseif (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0)
$data = \'http://\' . $data;
'),
'disallow_children' => array('email', 'ftp', 'url', 'iurl'),
'disabled_after' => ' ($1)',
),
แก้เป็น -->>
โค๊ด:
[Select]
array(
'tag' => 'iurl',
'type' => 'unparsed_content',
'content' => '<a href="$1">$1</a>',
'validate' => create_function('&$tag, &$data, $disabled', '
$data = strtr($data, array(\'<br />\' => \'\'));
if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0)
$data = \'http://\' . $data;
global $modSettings, $context, $boardurl;
$is_same_host = str_ireplace(\'www.\', \'\', parse_url($boardurl, PHP_URL_HOST)) == str_ireplace(\'www.\', \'\', parse_url($data, PHP_URL_HOST));
if (!empty($modSettings[\'RedirectPage_on_iurl\']) && (empty($modSettings[\'RedirectPage_guests_only\']) || $context[\'user\'][\'is_guest\']) && (!empty($modSettings[\'RedirectPage_on_same_host\']) || !$is_same_host)){
global $sourcedir, $sites;
$is_aeva_link = false;
if (!empty($modSettings[\'RedirectPage_Aeva_compatibility\']))
if(file_exists($sourcedir . \'/Subs-Aeva-Sites.php\'))
if (!empty($sites))
foreach ($sites as $s => $arr)
if ($arr[\'type\'] != \'local\' && preg_match(\'~\' . $arr[\'pattern\'] . \'~\', $data)){
$is_aeva_link = true;
break;
}
if (!$is_aeva_link && strpos($data, $boardurl) === false)
$tag[\'content\'] = \'<a href="\' . $boardurl . \'/go.php?url=\' . ($modSettings[\'RedirectPage_encode\'] ? base64_encode($data) : $data) . \'">\' . $data . \'</a>\';
}
'),
),
array(
'tag' => 'iurl',
'type' => 'unparsed_equals',
'before' => '<a href="$1">',
'after' => '</a>',
'validate' => create_function('&$tag, &$data, $disabled', '
if (substr($data, 0, 1) == \'#\')
$data = \'#post_\' . substr($data, 1);
else {
if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0)
$data = \'http://\' . $data;
global $modSettings, $context, $boardurl;
$is_same_host = str_ireplace(\'www.\', \'\', parse_url($boardurl, PHP_URL_HOST)) == str_ireplace(\'www.\', \'\', parse_url($data, PHP_URL_HOST));
if (!empty($modSettings[\'RedirectPage_on_iurl\']) && (empty($modSettings[\'RedirectPage_guests_only\']) || $context[\'user\'][\'is_guest\']) && (!empty($modSettings[\'RedirectPage_on_same_host\']) || !$is_same_host)){
global $sourcedir,$sites;
$is_aeva_link = false;
if (!empty($modSettings[\'RedirectPage_Aeva_compatibility\']))
if(file_exists($sourcedir . \'/Subs-Aeva-Sites.php\'))
if (!empty($sites))
foreach ($sites as $s => $arr)
if ($arr[\'type\'] != \'local\' && preg_match(\'~\' . $arr[\'pattern\'] . \'~\', $data)){
$is_aeva_link = true;
break;
}
if (!$is_aeva_link && strpos($data, $boardurl) === false)
$data = $boardurl . \'/go.php?url=\' . ($modSettings[\'RedirectPage_encode\'] ? base64_encode($data) : $data);
}
}
'),
'disallow_children' => array('email', 'ftp', 'url', 'iurl'),
'disabled_after' => ' ($1)',
),
ค้นหา -->>
โค๊ด:
[Select]
array(
'tag' => 'url',
'type' => 'unparsed_content',
'content' => '<a href="$1" target="_blank">$1</a>',
'validate' => create_function('&$tag, &$data, $disabled', '
$data = strtr($data, array(\'<br />\' => \'\'));
if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0)
$data = \'http://\' . $data;
'),
),
array(
'tag' => 'url',
'type' => 'unparsed_equals',
'before' => '<a href="$1" target="_blank">',
'after' => '</a>',
'validate' => create_function('&$tag, &$data, $disabled', '
if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0)
$data = \'http://\' . $data;
'),
'disallow_children' => array('email', 'ftp', 'url', 'iurl'),
'disabled_after' => ' ($1)',
),
แก้เป็น -->>
โค๊ด:
[Select]
array(
'tag' => 'url',
'type' => 'unparsed_content',
'content' => '<a href="$1" target="_blank">$2</a>',
'validate' => create_function('&$tag, &$data, $disabled', '
$data = strtr($data, array(\'<br />\' => \'\'));
if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0)
$data = \'http://\' . $data;
global $modSettings, $context;
if (!empty($modSettings[\'RedirectPage_trim_links\'])){
$short = preg_replace(\'~^https?://~i\', \'\', $data);
if (strlen($short) > $modSettings[\'RedirectPage_trim_links\']){
$site = parse_url($data, PHP_URL_HOST);
if (strlen($site) > $modSettings[\'RedirectPage_trim_links\']/2){
$before = $site . \'/\';
$after = (strlen($site) < $modSettings[\'RedirectPage_trim_links\'] - 3)? substr($short, -($modSettings[\'RedirectPage_trim_links\'] - strlen($site))) : \'\';
}
else{
$before = substr($short, 0, $modSettings[\'RedirectPage_trim_links\']/2);
$after = substr($short, -$modSettings[\'RedirectPage_trim_links\']/2);
}
$short = $before . \'...\' . $after;
}
}
else
$short = $data;
global $boardurl;
$is_same_host = str_ireplace(\'www.\', \'\', parse_url($boardurl, PHP_URL_HOST)) == str_ireplace(\'www.\', \'\', parse_url($data, PHP_URL_HOST));
if (!empty($modSettings[\'RedirectPage_on_plain\']) && (empty($modSettings[\'RedirectPage_guests_only\']) || $context[\'user\'][\'is_guest\']) && (!empty($modSettings[\'RedirectPage_on_same_host\']) || !$is_same_host)){
global $sourcedir, $sites;
$is_aeva_link = false;
if (!empty($modSettings[\'RedirectPage_Aeva_compatibility\']))
if(file_exists($sourcedir . \'/Subs-Aeva-Sites.php\'))
if (!empty($sites))
foreach ($sites as $s => $arr)
if ($arr[\'type\'] != \'local\' && preg_match(\'~\' . $arr[\'pattern\'] . \'~\', $data)){
$is_aeva_link = true;
break;
}
if (!$is_aeva_link && strpos($data, $boardurl) !== 0)
$data = $boardurl . \'/go.php?url=\' . ($modSettings[\'RedirectPage_encode\'] ? base64_encode($data) : $data);
}
$tag[\'content\'] = \'<a href="\' . $data . \'" target="_blank">\' . $short . \'</a>\';
'),
),
array(
'tag' => 'url',
'type' => 'unparsed_equals',
'before' => '<a href="$1" target="_blank">',
'after' => '</a>',
'validate' => create_function('&$tag, &$data, $disabled', '
if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0)
$data = \'http://\' . $data;
global $boardurl, $modSettings, $context;
$is_same_host = str_ireplace(\'www.\', \'\', parse_url($boardurl, PHP_URL_HOST)) == str_ireplace(\'www.\', \'\', parse_url($data, PHP_URL_HOST));
if (!empty($modSettings[\'RedirectPage_on_url\']) && (empty($modSettings[\'RedirectPage_guests_only\']) || $context[\'user\'][\'is_guest\']) && (!empty($modSettings[\'RedirectPage_on_same_host\']) || !$is_same_host)){
global $sourcedir, $sites;
$is_aeva_link = false;
if (!empty($modSettings[\'RedirectPage_Aeva_compatibility\']))
if(file_exists($sourcedir . \'/Subs-Aeva-Sites.php\'))
if (!empty($sites))
foreach ($sites as $s => $arr)
if ($arr[\'type\'] != \'local\' && preg_match(\'~\' . $arr[\'pattern\'] . \'~\', $data)){
$is_aeva_link = true;
break;
}
if (!$is_aeva_link && strpos($data, $boardurl) === false)
$data = $boardurl . \'/go.php?url=\' . ($modSettings[\'RedirectPage_encode\'] ? base64_encode($data) : $data);
}
'),
'disallow_children' => array('email', 'ftp', 'url', 'iurl'),
'disabled_after' => ' ($1)',
),
file $languagedir/Modifications.thai-utf8.php
เพิ่ม -->>
โค๊ด:
[Select]
// BIOHAZARD:RedirectPage strings
$txt['admin_menu_RedirectPage'] = 'RedirectPage';
$txt['RedirectPage_settings_title'] = 'RedirectPage settings';
$txt['RedirectPage_settings_desc'] = 'Please edit RedirectPage settings';
//Strings for the settings area
$txt['RedirectPage_type'] = 'Redirection type';
$txt['RedirectPage_type_normal'] = 'normal';
$txt['RedirectPage_type_delayed'] = 'delayed';
$txt['RedirectPage_type_instant'] = 'instant';
$txt['RedirectPage_delay'] = 'Delay, seconds (for delayed redirection only)';
$txt['RedirectPage_use_theme'] = 'Use forums theme';
$txt['RedirectPage_encode'] = 'Encode links';
$txt['RedirectPage_text'] = 'Redirection page text<br />
<span style="color: #555; font-size: 85%;">
You can use:
<ul style="margin: 0;">
<li>{LINK} - active link</li>
<li>{link} - text link</li>
<li>{SITE} - site name</li>
<li>{DELAY} - delay in seconds</li>
</ul>
Set to blank for default text message.</span>';
$txt['RedirectPage_on_plain']
= 'Enable plain links redirection';
$txt['RedirectPage_on_url']
= 'Enable [url] tag redirection';
$txt['RedirectPage_on_iurl']
= 'Enable [iurl] tag redirection';
$txt['RedirectPage_on_members_sites']
= 'Enable members websites redirection';
$txt['RedirectPage_on_members_icq_etc']
= 'Enable icq and all other message services redirection';
$txt['RedirectPage_on_same_host']
= 'Enable redirection on same host';
$txt['RedirectPage_guests_only']
= 'Enable redirection for guests only';
$txt['RedirectPage_trim_links'] = 'Trim long links (set maximum links length or leave blank to disable trim function)';
$txt['RedirectPage_Aeva_compatibility'] = 'Use Aeva Media compatibility mode';
//
Strings for redirection page
$txt['RedirectPage_title'] = 'Going to an external site...';
$txt['RedirectPage_default_text'] = 'You are leaving the site on an external link <b>{LINK}</b> provided by one of users.<br /><br />Administration is not responsible for the content of the site <b>{SITE}</b>. In addition, the site may contain viruses, trojans and other malware to damage your PC. If you do not have serious reasons to trust this site, it is better not to pass by link.<br /><br />If you have not changed your mind, click on the <b><a href="{link}">link</a></b>. If you do not want to risk the security of your account and your computer, click <b><a href="javascript:window.close()">Cancel</a></b>.';
$txt['RedirectPage_robots_note'] = '
Dont forget to update your robots.txt.
Add to your robots.txt string<br />
<i>Disallow: {BOARD_URL}/go.php</i><br />
More info on <a href="http://www.robotstxt.org/" target="_blank">www.robotstxt.org</a>';
// End BIOHAZARD:RedirectPage strings
ดาวน์โหลด:
go.rar
ขออภัย! ท่านไม่สามารถเข้าถึงข้อมูลส่วนนี้ได้ กรุณาอ่าน
เงื่อนไขการใช้งาน DexMore.Com
แตกไฟล์แล้วอัพโหลดไปไว้ที่
file go.php -->> $boarddir
สร้างไฟล์:
install.php เพื่อสร้างฐานข้อมูล ไว้ใน $boarddir (ที่เดียวกับไฟล์ SSI.php) รัน http://www.your_url.xxx/$boarddir/install.php -->> Enter เสร็จแล้วลบทิ้ง
โค๊ด:
[Select]
<?php
###################################################################
# To run this install manually please make sure you place this #
# in the same place and SSI.php and index.php #
###################################################################
global
$smcFunc
,
$db_prefix
,
$context
,
$boarddir
,
$modSettings
,
$scripturl
,
$boardurl
,
$sourcedir
;
if (!
defined
(
'SMF'
) &&
file_exists
(
dirname
(
__FILE__
) .
'/SSI.php'
)) {
require_once(
dirname
(
__FILE__
) .
'/SSI.php'
);
}
elseif (!
defined
(
'SMF'
))
die(
'The installer wasn\'t able to connect to SMF! Make sure that you are either installing this via the Package Manager or the SSI.php file is in the same directory.'
);
// setting up default values (only if not presented)
$blank_values
= Array();
if (empty(
$modSettings
[
'RedirectPage_type'
]))
$blank_values
[
'RedirectPage_type'
]
=
'normal'
;
if (empty(
$modSettings
[
'RedirectPage_delay'
]))
$blank_values
[
'RedirectPage_delay'
]
=
'10'
;
if (empty(
$modSettings
[
'RedirectPage_use_theme'
]))
$blank_values
[
'RedirectPage_use_theme'
]
=
'1'
;
if (empty(
$modSettings
[
'RedirectPage_encode'
]))
$blank_values
[
'RedirectPage_encode'
]
=
'1'
;
updateSettings
(
$blank_values
);
// If we're using SSI, tell them we're done
if(
SMF
==
'SSI'
)
echo
'Database changes are complete! <br />'
;
// installing permission for go.php to 644
$permission
=
chmod
(
'go.php'
,
0644
);
if(
SMF
==
'SSI'
)
echo
'Installing permission for go.php are complete!<br />'
;
// adding robots.txt in not presented yet
$deep
=
substr_count
(
$boardurl
,
'/'
) -
2
;
$site_dir
=
$boarddir
.
str_repeat
(
'/..'
,
$deep
);
$robots_path
=
$site_dir
.
'/robots.txt'
;
if(!
file_exists
(
$robots_path
)){
$robots
=
fopen
(
$robots_path
,
'x'
);
fwrite
(
$robots
,
"User-Agent: *\nDisallow: "
.
parse_url
(
$boardurl
,
PHP_URL_PATH
) .
'/go.php'
);
fclose
(
$robots
);
}
?>
การตั้งค่า:
ผู้ดูแล -->> ส่วนปรับแต่งค่าการใช้งาน -->> เปลี่ยนเส้นทาง
ลิงค์หัวข้อ
:
http://dexmore.com/topic/2864
zicaros
,
ชนเผ่า
,
SoftWorld
บันทึกการเข้า
UnclEo
!Personal
Reputation :
5863
Chips :
9884 Mony
Age
: 33
Member ID
: 2
Level 44 : Exp 80%
HP: 49.4%
PD: 3.542
Login Time
: 472:0
Total Posts
: 3043
Total Topics
: 1519
Adviser
: 24
RedirectPage อีกรูปแบบของการป้องกันลิงค์สด
ความคิดเห็นที่ 1 เมื่อ:
20 สิงหาคม 2553, 19:05:42
สำหรับ SMF 2.0.xx
แก้ไขไฟล์:
file $sourcedir/Admin.php
ค้นหา -->>
โค๊ด:
[Select]
// Mod Authors for a "ADD AFTER" on this line. Ensure you end your change with a comma. For example:
เพิ่มไว้หลัง -->>
โค๊ด:
[Select]
'RedirectPage' =>array($txt['admin_menu_RedirectPage']),
ค้นหา -->>
โค๊ด:
[Select]
// Mod authors if you want to be "real freaking good" then add any setting pages for your mod BELOW this line!
เพิ่มไว้หลัง -->>
โค๊ด:
[Select]
//Start BIOHAZARD:RedirectPage
array('ModifyRedirectPageSettings', 'area=modsettings;sa=RedirectPage'),
//End BIOHAZARD:RedirectPage
file $sourcedir/Load.php
ค้นหา -->>
โค๊ด:
[Select]
// Loads the user's basic values... meant for template/theme usage.
function loadMemberContext($user, $display_custom_fields = false)
{
global $memberContext, $user_profile, $txt, $scripturl, $user_info;
แก้เป็น -->>
โค๊ด:
[Select]
// Loads the user's basic values... meant for template/theme usage.
function loadMemberContext($user, $display_custom_fields = false)
{
global $memberContext, $user_profile, $txt, $scripturl, $boardurl, $user_info;
ค้นหา -->>
โค๊ด:
[Select]
'website' => array(
'title' => $profile['website_title'],
'url' => $profile['website_url'],
),
แก้เป็น -->>
โค๊ด:
[Select]
'website' => array(
'title' => $profile['website_title'],
'url' => (empty($modSettings['RedirectPage_on_members_sites']) || strpos($profile['website_url'], 'http://') !== 0)? $profile['website_url'] : $boardurl . '/go.php?url=' . ($modSettings['RedirectPage_encode'] ? base64_encode($profile['website_url']) : $profile['website_url']),
),
ค้นหา -->>
โค๊ด:
[Select]
'link' => '<a class="icq new_win" href="http://www.icq.com/whitepages/about_me.php?uin=' . $profile['icq'] . '" target="_blank" title="' . $txt['icq_title'] . ' - ' . $profile['icq'] . '"><img src="http://status.icq.com/online.gif?img=5&icq=' . $profile['icq'] . '" alt="' . $txt['icq_title'] . ' - ' . $profile['icq'] . '" width="18" height="18" border="0" /></a>',
แก้เป็น -->>
โค๊ด:
[Select]
'link' => '<a class="icq new_win" href="' . ((!empty($modSettings['RedirectPage_on_members_icq_etc']))? $boardurl . '/go.php?url=' . ($modSettings['RedirectPage_encode'] ? base64_encode('http://www.icq.com/whitepages/about_me.php?uin=' . $profile['icq']) : 'http://www.icq.com/whitepages/about_me.php?uin=' . $profile['icq']) : 'http://www.icq.com/whitepages/about_me.php?uin=' . $profile['icq']) . '" target="_blank" title="' . $txt['icq_title'] . ' - ' . $profile['icq'] . '"><img src="http://status.icq.com/online.gif?img=5&icq=' . $profile['icq'] . '" alt="' . $txt['icq_title'] . ' - ' . $profile['icq'] . '" width="18" height="18" border="0" /></a>',
ค้นหา -->>
โค๊ด:
[Select]
'link' => '<a class="yim" href="http://edit.yahoo.com/config/send_webmesg?.target=' . urlencode($profile['yim']) . '" title="' . $txt['yim_title'] . ' - ' . $profile['yim'] . '"><img src="http://opi.yahoo.com/online?u=' . urlencode($profile['yim']) . '&m=g&t=0" alt="' . $txt['yim_title'] . ' - ' . $profile['yim'] . '" border="0" /></a>',
แก้เป็น -->>
โค๊ด:
[Select]
'link' => '<a class="yim" href="' . ((!empty($modSettings['RedirectPage_on_members_icq_etc']))? $boardurl . '/go.php?url=' . ($modSettings['RedirectPage_encode'] ? base64_encode('http://edit.yahoo.com/config/send_webmesg?.target=' . urlencode($profile['yim'])) : 'http://edit.yahoo.com/config/send_webmesg?.target=' . urlencode($profile['yim'])) : 'http://edit.yahoo.com/config/send_webmesg?.target=' . urlencode($profile['yim'])) . '" title="' . $txt['yim_title'] . ' - ' . $profile['yim'] . '"><img src="http://opi.yahoo.com/online?u=' . urlencode($profile['yim']) . '&m=g&t=0" alt="' . $txt['yim_title'] . ' - ' . $profile['yim'] . '" border="0" /></a>',
ค้นหา -->>
โค๊ด:
[Select]
'link' => '<a class="msn new_win" href="http://members.msn.com/' . $profile['msn'] . '" title="' . $txt['msn_title'] . ' - ' . $profile['msn'] . '"><img src="' . $settings['images_url'] . '/msntalk.gif" alt="' . $txt['msn_title'] . ' - ' . $profile['msn'] . '" border="0" /></a>',
แก้เป็น -->>
โค๊ด:
[Select]
'link' => '<a class="msn new_win" href="' . ((!empty($modSettings['RedirectPage_on_members_icq_etc']))? $boardurl . '/go.php?url=' . ($modSettings['RedirectPage_encode'] ? base64_encode('http://members.msn.com/' . $profile['msn']) : 'http://members.msn.com/' . $profile['msn']) : 'http://members.msn.com/' . $profile['msn']) . '" title="' . $txt['msn_title'] . ' - ' . $profile['msn'] . '"><img src="' . $settings['images_url'] . '/msntalk.gif" alt="' . $txt['msn_title'] . ' - ' . $profile['msn'] . '" border="0" /></a>',
file $sourcedir/ManageSettings.php
ค้นหา -->>
โค๊ด:
[Select]
// Mod authors, once again, if you have a whole section to add do it AFTER this line, and keep a comma at the end.
เพิ่มไว้หลัง -->>
โค๊ด:
[Select]
//Start BIOHAZARD:RedirectPage
'RedirectPage' => 'ModifyRedirectPageSettings',
//End BIOHAZARD:RedirectPage
ค้นหา -->>
โค๊ด:
[Select]
?>
เพิ่มไว้ก่อน -->>
โค๊ด:
[Select]
function ModifyRedirectPageSettings($return_config = false){
global $txt, $scripturl, $context, $modSettings, $boardurl, $boarddir;
$config_vars = array(
array('check', 'RedirectPage_on_plain'),
array('check', 'RedirectPage_on_url'),
array('check', 'RedirectPage_on_iurl'),
'',
array('check', 'RedirectPage_on_members_sites'),
array('check', 'RedirectPage_on_members_icq_etc'),
'',
array('check', 'RedirectPage_on_same_host'),
array('check', 'RedirectPage_guests_only'),
'',
array('select', 'RedirectPage_type', Array('normal' => $txt['RedirectPage_type_normal'], 'delayed' => $txt['RedirectPage_type_delayed'], 'instant' => $txt['RedirectPage_type_instant'])),
array('int', 'RedirectPage_delay', 3),
array('check', 'RedirectPage_use_theme'),
array('check', 'RedirectPage_encode'),
array('large_text', 'RedirectPage_text', 10),
'',
array('int', 'RedirectPage_trim_links', 3),
array('check', 'RedirectPage_Aeva_compatibility'),
);
if ($return_config)
return $config_vars;
$context['post_url'] = $scripturl . '?action=admin;area=modsettings;save;sa=RedirectPage';
$context['settings_title'] = $txt['RedirectPage_settings_title'];
// Chek robots.txt info
$deep = substr_count($boardurl, '/') - 2;
$site_dir = $boarddir . str_repeat('/..', $deep);
$robots_path = $site_dir . '/robots.txt';
$robots = file_exists($robots_path);
if ($robots){
$robots = file_get_contents($robots_path);
$robots = strpos($robots, 'Disallow: ' . parse_url($boardurl, PHP_URL_PATH) . '/go.php') !== false;
}
if (!$robots){
$context['settings_message'] = '<div class="centertext">' . str_replace('{BOARD_URL}', parse_url($boardurl, PHP_URL_PATH), $txt['RedirectPage_robots_note']) . '</div>';
}
// Saving?
if (isset($_GET['save'])){
checkSession();
$save_vars = $config_vars;
saveDBSettings($save_vars);
redirectexit('action=admin;area=modsettings;sa=RedirectPage');
}
prepareDBSettingContext($config_vars);
}
file $sourcedir/Subs.php
ค้นหา -->>
โค๊ด:
[Select]
array(
'tag' => 'iurl',
'type' => 'unparsed_content',
'content' => '<a href="$1" class="bbc_link">$1</a>',
'validate' => create_function('&$tag, &$data, $disabled', '
$data = strtr($data, array(\'<br />\' => \'\'));
if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0)
$data = \'http://\' . $data;
'),
),
array(
'tag' => 'iurl',
'type' => 'unparsed_equals',
'before' => '<a href="$1" class="bbc_link">',
'after' => '</a>',
'validate' => create_function('&$tag, &$data, $disabled', '
if (substr($data, 0, 1) == \'#\')
$data = \'#post_\' . substr($data, 1);
elseif (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0)
$data = \'http://\' . $data;
'),
'disallow_children' => array('email', 'ftp', 'url', 'iurl'),
'disabled_after' => ' ($1)',
),
แก้เป็น -->>
โค๊ด:
[Select]
array(
'tag' => 'iurl',
'type' => 'unparsed_content',
'content' => '<a href="$1" class="bbc_link">$1</a>',
'validate' => create_function('&$tag, &$data, $disabled', '
$data = strtr($data, array(\'<br />\' => \'\'));
if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0)
$data = \'http://\' . $data;
global $modSettings, $context, $boardurl;
$is_same_host = str_ireplace(\'www.\', \'\', parse_url($boardurl, PHP_URL_HOST)) == str_ireplace(\'www.\', \'\', parse_url($data, PHP_URL_HOST));
if (!empty($modSettings[\'RedirectPage_on_iurl\']) && (empty($modSettings[\'RedirectPage_guests_only\']) || $context[\'user\'][\'is_guest\']) && (!empty($modSettings[\'RedirectPage_on_same_host\']) || !$is_same_host)){
global $boardurl, $sourcedir, $modSettings, $sites;
$is_aeva_link = false;
if (!empty($modSettings[\'RedirectPage_Aeva_compatibility\']))
if(file_exists($sourcedir . \'/Subs-Aeva-Sites.php\'))
if (!empty($sites))
foreach ($sites as $s => $arr)
if ($arr[\'type\'] != \'local\' && preg_match(\'~\' . $arr[\'pattern\'] . \'~\', $data)){
$is_aeva_link = true;
break;
}
if (!$is_aeva_link && strpos($data, $boardurl) === false)
$tag[\'content\'] = \'<a href="\' . $boardurl . \'/go.php?url=\' . ($modSettings[\'RedirectPage_encode\'] ? base64_encode($data) : $data) . \'" class="bbc_link">\' . $data . \'</a>\';
}
'),
),
array(
'tag' => 'iurl',
'type' => 'unparsed_equals',
'before' => '<a href="$1" class="bbc_link">',
'after' => '</a>',
'validate' => create_function('&$tag, &$data, $disabled', '
if (substr($data, 0, 1) == \'#\')
$data = \'#post_\' . substr($data, 1);
else {
if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0)
$data = \'http://\' . $data;
global $modSettings, $context, $boardurl;
$is_same_host = str_ireplace(\'www.\', \'\', parse_url($boardurl, PHP_URL_HOST)) == str_ireplace(\'www.\', \'\', parse_url($data, PHP_URL_HOST));
if (!empty($modSettings[\'RedirectPage_on_iurl\']) && (empty($modSettings[\'RedirectPage_guests_only\']) || $context[\'user\'][\'is_guest\']) && (!empty($modSettings[\'RedirectPage_on_same_host\']) || !$is_same_host)){
global $boardurl, $sourcedir, $modSettings, $sites;
$is_aeva_link = false;
if (!empty($modSettings[\'RedirectPage_Aeva_compatibility\']))
if(file_exists($sourcedir . \'/Subs-Aeva-Sites.php\'))
if (!empty($sites))
foreach ($sites as $s => $arr)
if ($arr[\'type\'] != \'local\' && preg_match(\'~\' . $arr[\'pattern\'] . \'~\', $data)){
$is_aeva_link = true;
break;
}
if (!$is_aeva_link && strpos($data, $boardurl) === false)
$data = $boardurl . \'/go.php?url=\' . ($modSettings[\'RedirectPage_encode\'] ? base64_encode($data) : $data);
}
}
'),
'disallow_children' => array('email', 'ftp', 'url', 'iurl'),
'disabled_after' => ' ($1)',
),
ค้นหา -->>
โค๊ด:
[Select]
array(
'tag' => 'url',
'type' => 'unparsed_content',
'content' => '<a href="$1" class="bbc_link new_win" target="_blank">$1</a>',
'validate' => create_function('&$tag, &$data, $disabled', '
$data = strtr($data, array(\'<br />\' => \'\'));
if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0)
$data = \'http://\' . $data;
'),
),
array(
'tag' => 'url',
'type' => 'unparsed_equals',
'before' => '<a href="$1" class="bbc_link new_win" target="_blank">',
'after' => '</a>',
'validate' => create_function('&$tag, &$data, $disabled', '
if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0)
$data = \'http://\' . $data;
'),
'disallow_children' => array('email', 'ftp', 'url', 'iurl'),
'disabled_after' => ' ($1)',
),
แก้เป็น -->>
โค๊ด:
[Select]
array(
'tag' => 'url',
'type' => 'unparsed_content',
'content' => 'nox',
'validate' => create_function('&$tag, &$data, $disabled', '
$data = strtr($data, array(\'<br />\' => \'\'));
if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0)
$data = \'http://\' . $data;
global $modSettings, $context;
if (!empty($modSettings[\'RedirectPage_trim_links\'])){
$short = preg_replace(\'~^https?://~i\', \'\', $data);
if (strlen($short) > $modSettings[\'RedirectPage_trim_links\']){
$site = parse_url($data, PHP_URL_HOST);
if (strlen($site) > $modSettings[\'RedirectPage_trim_links\']/2){
$before = $site . \'/\';
$after = (strlen($site) < $modSettings[\'RedirectPage_trim_links\'] - 3)? substr($short, -($modSettings[\'RedirectPage_trim_links\'] - strlen($site))) : \'\';
}
else{
$before = substr($short, 0, $modSettings[\'RedirectPage_trim_links\']/2);
$after = substr($short, -$modSettings[\'RedirectPage_trim_links\']/2);
}
$short = $before . \'...\' . $after;
}
}
else
$short = $data;
global $boardurl;
$is_same_host = str_ireplace(\'www.\', \'\', parse_url($boardurl, PHP_URL_HOST)) == str_ireplace(\'www.\', \'\', parse_url($data, PHP_URL_HOST));
if (!empty($modSettings[\'RedirectPage_on_plain\']) && (empty($modSettings[\'RedirectPage_guests_only\']) || $context[\'user\'][\'is_guest\']) && (!empty($modSettings[\'RedirectPage_on_same_host\']) || !$is_same_host)){
global $sourcedir, $modSettings, $sites;
$is_aeva_link = false;
if (!empty($modSettings[\'RedirectPage_Aeva_compatibility\']))
if(file_exists($sourcedir . \'/Subs-Aeva-Sites.php\'))
if (!empty($sites))
foreach ($sites as $s => $arr)
if ($arr[\'type\'] != \'local\' && preg_match(\'~\' . $arr[\'pattern\'] . \'~\', $data)){
$is_aeva_link = true;
break;
}
if (!$is_aeva_link && strpos($data, $boardurl) !== 0)
$data = $boardurl . \'/go.php?url=\' . ($modSettings[\'RedirectPage_encode\'] ? base64_encode($data) : $data);
}
$tag[\'content\'] = \'<a href="\' . $data . \'" class="bbc_link new_win" target="_blank">\' . $short . \'</a>\';
'),
),
array(
'tag' => 'url',
'type' => 'unparsed_equals',
'before' => '<a href="$1" class="bbc_link new_win" target="_blank">',
'after' => '</a>',
'validate' => create_function('&$tag, &$data, $disabled', '
if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0)
$data = \'http://\' . $data;
global $boardurl;
$is_same_host = str_ireplace(\'www.\', \'\', parse_url($boardurl, PHP_URL_HOST)) == str_ireplace(\'www.\', \'\', parse_url($data, PHP_URL_HOST));
global $modSettings, $context;
if (!empty($modSettings[\'RedirectPage_on_url\']) && (empty($modSettings[\'RedirectPage_guests_only\']) || $context[\'user\'][\'is_guest\']) && (!empty($modSettings[\'RedirectPage_on_same_host\']) || !$is_same_host)){
global $boardurl, $sourcedir, $modSettings, $sites;
$is_aeva_link = false;
if (!empty($modSettings[\'RedirectPage_Aeva_compatibility\']))
if(file_exists($sourcedir . \'/Subs-Aeva-Sites.php\'))
if (!empty($sites))
foreach ($sites as $s => $arr)
if ($arr[\'type\'] != \'local\' && preg_match(\'~\' . $arr[\'pattern\'] . \'~\', $data)){
$is_aeva_link = true;
break;
}
if (!$is_aeva_link && strpos($data, $boardurl) === false)
$data = $boardurl . \'/go.php?url=\' . ($modSettings[\'RedirectPage_encode\'] ? base64_encode($data) : $data);
}
'),
'disallow_children' => array('email', 'ftp', 'url', 'iurl'),
'disabled_after' => ' ($1)',
),
file $sourcedir/Subs-Post.php
ค้นหา -->>
โค๊ด:
[Select]
elseif ($hasEqualSign)
$replaces['[' . $matches[1][$k] . '=' . $matches[2][$k] . ']'] = '[' . $this_tag . '=' . $replace . ']';
แก้เป็น -->>
โค๊ด:
[Select]
elseif ($hasEqualSign)
$replaces['[' . $matches[1][$k] . '=' . $matches[2][$k] . ']'] = '[' . $this_tag . '=' . $replace . ']';
elseif ($embeddedUrl && $matches[1][$k] == 'url' && !$hasEqualSign)
$replaces['[' . $matches[1][$k] . ']' . $matches[2][$k] . '[/' . $matches[3][$k] . ']'] = '[' . $this_tag . ']' . $replace . '[/' . $this_close . ']';
file $languagedir/Modifications.thai-utf8.php
เพิ่ม -->>
โค๊ด:
[Select]
// BIOHAZARD:RedirectPage strings
$txt['admin_menu_RedirectPage'] = 'RedirectPage';
$txt['RedirectPage_settings_title'] = 'RedirectPage settings';
$txt['RedirectPage_settings_desc'] = 'Please edit RedirectPage settings';
//Strings for the settings area
$txt['RedirectPage_type'] = 'Redirection type';
$txt['RedirectPage_type_normal'] = 'normal';
$txt['RedirectPage_type_delayed'] = 'delayed';
$txt['RedirectPage_type_instant'] = 'instant';
$txt['RedirectPage_delay'] = 'Delay, seconds (for delayed redirection only)';
$txt['RedirectPage_use_theme'] = 'Use forums theme';
$txt['RedirectPage_encode'] = 'Encode links';
$txt['RedirectPage_text'] = 'Redirection page text<br />
<span style="color: #555; font-size: 85%;">
You can use:
<ul style="margin: 0;">
<li>{LINK} - active link</li>
<li>{link} - text link</li>
<li>{SITE} - site name</li>
<li>{DELAY} - delay in seconds</li>
</ul>
Set to blank for default text message.</span>';
$txt['RedirectPage_on_plain']
= 'Enable plain links redirection';
$txt['RedirectPage_on_url']
= 'Enable [url] tag redirection';
$txt['RedirectPage_on_iurl']
= 'Enable [iurl] tag redirection';
$txt['RedirectPage_on_members_sites']
= 'Enable members websites redirection';
$txt['RedirectPage_on_members_icq_etc']
= 'Enable icq and all other message services redirection';
$txt['RedirectPage_on_same_host']
= 'Enable redirection on same host';
$txt['RedirectPage_guests_only']
= 'Enable redirection for guests only';
$txt['RedirectPage_trim_links'] = 'Trim long links (set maximum links length or leave blank to disable trim function)';
$txt['RedirectPage_Aeva_compatibility'] = 'Use Aeva Media compatibility mode';
//
Strings for redirection page
$txt['RedirectPage_title'] = 'Going to an external site...';
$txt['RedirectPage_default_text'] = 'You are leaving the site on an external link <b>{LINK}</b> provided by one of users.<br /><br />Administration is not responsible for the content of the site <b>{SITE}</b>. In addition, the site may contain viruses, trojans and other malware to damage your PC. If you do not have serious reasons to trust this site, it is better not to pass by link.<br /><br />If you have not changed your mind, click on the <b><a href="{link}">link</a></b>. If you do not want to risk the security of your account and your computer, click <b><a href="javascript:window.close()">Cancel</a></b>.';
$txt['RedirectPage_robots_note'] = '
Dont forget to update your robots.txt.
Add to your robots.txt string<br />
<i>Disallow: {BOARD_URL}/go.php</i><br />
More info on <a href="http://www.robotstxt.org/" target="_blank">www.robotstxt.org</a>';
// End BIOHAZARD:RedirectPage strings
ดาวน์โหลด:
go.rar
ขออภัย! ท่านไม่สามารถเข้าถึงข้อมูลส่วนนี้ได้ กรุณาอ่าน
เงื่อนไขการใช้งาน DexMore.Com
แตกไฟล์แล้วอัพโหลดไปไว้ที่
file go.php -->> $boarddir
สร้างไฟล์:
install.php เพื่อสร้างฐานข้อมูล ไว้ใน $boarddir (ที่เดียวกับไฟล์ SSI.php) รัน http://www.your_url.xxx/$boarddir/install.php -->> Enter เสร็จแล้วลบทิ้ง
โค๊ด:
[Select]
<?php
###################################################################
# To run this install manually please make sure you place this #
# in the same place and SSI.php and index.php #
###################################################################
global
$smcFunc
,
$db_prefix
,
$context
,
$boarddir
,
$modSettings
,
$scripturl
,
$boardurl
,
$sourcedir
;
if (!
defined
(
'SMF'
) &&
file_exists
(
dirname
(
__FILE__
) .
'/SSI.php'
)) {
require_once(
dirname
(
__FILE__
) .
'/SSI.php'
);
}
elseif (!
defined
(
'SMF'
))
die(
'The installer wasn\'t able to connect to SMF! Make sure that you are either installing this via the Package Manager or the SSI.php file is in the same directory.'
);
// setting up default values (only if not presented)
$blank_values
= Array();
if (empty(
$modSettings
[
'RedirectPage_type'
]))
$blank_values
[
'RedirectPage_type'
]
=
'normal'
;
if (empty(
$modSettings
[
'RedirectPage_delay'
]))
$blank_values
[
'RedirectPage_delay'
]
=
'10'
;
if (empty(
$modSettings
[
'RedirectPage_use_theme'
]))
$blank_values
[
'RedirectPage_use_theme'
]
=
'1'
;
if (empty(
$modSettings
[
'RedirectPage_encode'
]))
$blank_values
[
'RedirectPage_encode'
]
=
'1'
;
updateSettings
(
$blank_values
);
// If we're using SSI, tell them we're done
if(
SMF
==
'SSI'
)
echo
'Database changes are complete! <br />'
;
// installing permission for go.php to 644
$permission
=
chmod
(
'go.php'
,
0644
);
if(
SMF
==
'SSI'
)
echo
'Installing permission for go.php are complete!<br />'
;
// adding robots.txt in not presented yet
$deep
=
substr_count
(
$boardurl
,
'/'
) -
2
;
$site_dir
=
$boarddir
.
str_repeat
(
'/..'
,
$deep
);
$robots_path
=
$site_dir
.
'/robots.txt'
;
if(!
file_exists
(
$robots_path
)){
$robots
=
fopen
(
$robots_path
,
'x'
);
fwrite
(
$robots
,
"User-Agent: *\nDisallow: "
.
parse_url
(
$boardurl
,
PHP_URL_PATH
) .
'/go.php'
);
fclose
(
$robots
);
}
?>
ลิงค์หัวข้อ
:
http://dexmore.com/topic/2864
บันทึกการเข้า
UnclEo
!Personal
Reputation :
5863
Chips :
9884 Mony
Age
: 33
Member ID
: 2
Level 44 : Exp 80%
HP: 49.4%
PD: 3.542
Login Time
: 472:0
Total Posts
: 3043
Total Topics
: 1519
Adviser
: 24
RedirectPage อีกรูปแบบของการป้องกันลิงค์สด
ความคิดเห็นที่ 2 เมื่อ:
25 ธันวาคม 2553, 10:33:35
ลงได้ครับ แต่ใช้งานไม่ได้มันขัดกับ function redirect ของ portal
ลิงค์หัวข้อ
:
http://dexmore.com/topic/2864
บันทึกการเข้า
หน้า:
1
-:-DexMoreGroup แหล่งมั่วสุมทางปัญญา-:-
Web Achieve
Simple Machines Forum
SMF Modifications
RedirectPage อีกรูปแบบของการป้องกันลิงค์สด
กระโดดไป:
เลือกหัวข้อ:
-----------------------------
Specialty
-----------------------------
=> เทิดพระเกียรติฯ
-----------------------------
Living room
-----------------------------
=> ห้องรับแขก
=> ประชาสัมพันธ์
-----------------------------
Web Achieve
-----------------------------
=> Web Basis
===> Cascading Style Sheet
=> Simple Machines Forum
===> SMF Modifications
===> SMF Thai Translation
=> CMS Joomla
===> Extention
=> Drupal
=> WordPress [WP]
=> jQuery Plugin
=> Web Graphics
-----------------------------
Tip Computer
-----------------------------
=> โปรแกรมคอมพิวเตอร์
=> ทริบเทคนิคการดูแล
=> ปัญหาคอมพิวเตอร์
=> Themes-Wallpaper
=> ข่าวสารวงการ IT
-----------------------------
Game Computer
-----------------------------
=> Game-Flash
=> Game-News
=> Game-Download
=> Game-Mobile
-----------------------------
Variety Talk
-----------------------------
=> สัพเพเหระ
=> เก็บของเก่า
=> เล่าความหลัง
=> คำคม-คำคน
=> มีรูปมาอวด
=> เมลดีดี
กำลังโหลด...