Code: Selecteer alles
<?php
/**
*
* @package phpBB3
* @version $Id: $
* @copyright (c) 2006 Star Trek Guide Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @author Highway of Life : Lew21
*
*/
/**
* @ignore
*/
define('IN_PHPBB', true);
$phpbb_root_path = './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('common');
//Set admin only beyond this point
if ($user->data['user_type'] != USER_FOUNDER)
{
trigger_error('404 Error: Page Not Found!');
}
// List of bots
function bots()
{
global $special_bots, $normal_bots;
$special_bots = array(
'Gigabot [Bad bot]' => 'Gigabot/',
'Java [Bad bot]' => 'Java/',
'W3C [Validator]' => 'W3C_*Validator',
'W3C [Linkcheck]' => 'W3C-checklink/',
'Thumbshots [Capture]' => 'thumbshots-de-Bot',
'Susie [Sync]' => '!Susie',
'Online link [Validator]' => 'online link validator',
);
$normal_bots = array(
'Google' => 'Googlebot',
'Google Desktop' => 'Google Desktop',
'Google Adsense' => 'Mediapartners-Google/',
'Google Feedfetcher' => 'Feedfetcher-Google',
'Google Ads' => 'AdsBot-Google',
'Google Python URL fetcher' => 'Python-urllib/',
'Google Search Appliance' => 'gsa',
'Yahoo! Search Marketing' => 'crawlx',
'Yahoo! DE' => 'Yahoo! DE Slurp',
'Yahoo!' => 'Yahoo! Slurp',
'Yahoo! SpiderMan' => 'SpiderMan',
'Yahoo! Mindset' => 'Yahoo! Mindset',
'Yahoo! Blogs' => 'Yahoo-Blogs',
'Yahoo! Feed Seeker' => 'YahooFeedSeeker',
'Yahoo! Multimedia' => 'Yahoo-MM',
'Yahoo! Seeker' => 'YahooSeeker',
'Yahoo! Test' => 'Yahoo-Test',
'Yahoo! VerticalCrawler' => 'Yahoo-VerticalCrawler',
'Fast PartnerSite' => 'Fast PartnerSite Crawler',
'Fast Crawler Gold' => 'Fast Crawler Gold Edition',
'FAST WebCrawler' => 'FAST-WebCrawler/',
'FAST Enterprise' => 'FAST Enterprise Crawler',
'FAST FirstPage retriever' => 'FAST FirstPage retriever',
'FAST MetaWeb' => 'FAST MetaWeb Crawler',
'MSN' => 'msnbot',
'Ask Jeeves' => 'Ask Jeeves',
'Alexa' => 'ia_archiver',
'Alta Vista' => 'Scooter/',
'Alta Vista' => 'AltaVista',
'ichiro' => 'ichiro/',
'IBM Research' => 'ibm.com/cs/crawler',
'Walhello' => 'appie',
'Voyager' => 'voyager/',
'WiseNut' => 'http://www.WISEnutbot.com',
'GeoBot' => 'GeoBot/version',
'suchpad' => 'http://www.suchpad.de/bot/',
'Telekom' => 'crawleradmin.t-info@telekom.de',
'Insuranco' => 'InsurancoBot',
'Xaldon' => 'Xaldon WebSpider',
'Nutch' => 'Nutch',
'Cosmix' => 'cfetch/',
'Heise IT-Markt Crawler' => 'heise-IT-Markt-Crawler',
'Esperanza' => 'EsperanzaBot',
'EliteSys' => 'EliteSys SuperBot/',
'NG-Search' => 'http://www.ng-search.com)',
'MP3-Bot' => 'MP3-Bot',
'ICCenter' => 'iCCrawler (',
'genie' => 'genieBot (',
'Baidu' => 'Baiduspider+(',
'Sensis' => 'Sensis Web Crawler',
'Seoma' => 'Seoma [SEO Crawler]',
'g2' => 'g2Crawler',
'OmniExplorer' => 'OmniExplorer_Bot/',
'GBSpider' => 'GBSpider v',
'Picsearch' => 'psbot/',
'PlantyNet' => 'PlantyNet_WebRobot_V',
'Twiceler' => 'Twiceler http://www.cuill.com/robots.html',
'IPG' => 'internet-provider-guenstig.de-Bot',
'WissenOnline' => 'WissenOnline-Bot',
'24spider' => '24spider-Robot',
'Snappy' => 'Snappy/',
'Zerx' => 'zerxbot/',
'LinkWalker' => 'LinkWalker',
'Exabot' => 'Exabot/',
'Jyxobot' => 'Jyxobot/',
'Tbot' => 'Tbot/',
'Findexa Crawler' => 'Findexa Crawler (',
'ISC Systems iRc Search' => 'ISC Systems iRc Search',
'IRLbot' => 'http://irl.cs.tamu.edu/crawler',
'Mirago' => 'HeinrichderMiragoRobot (',
'Sygol' => 'SygolBot',
'Nutch/CVS' => 'NutchCVS/',
'WWWeasel' => 'WWWeasel Robot v',
'Naver' => 'nhnbot@naver.com',
'Heritrix' => 'heritrix/',
'MMSBot' => 'http://www.mmsweb.at/bot.html',
'Hogsearch' => 'oegp v. ',
'Kraehe' => '-DIE-KRAEHE- META-SEARCH-ENGINE/',
'TurnitinBot' => 'TurnitinBot/',
'Seekport' => 'Seekbot/',
'Vagabondo' => 'http://webagent.wise-guys.nl/',
'Nimble' => 'NimbleCrawler',
'Bunnybot' => 'powered by http://www.buncat.de',
'Boitho' => 'boitho.com-dc/',
'Scumbot' => 'Scumbot/',
'GeigerzaehlerBot' => 'http://www.geigerzaehler.org/bot.html',
'Steeler' => 'http://www.tkl.iis.u-tokyo.ac.jp/~crawler/',
'Orbiter' => 'http://www.dailyorbit.com/bot.htm',
'ASPseek' => 'ASPseek/',
'Crawler Search' => '.Crawler-Search.de',
'Francis' => 'http://www.neomo.de/',
'Singingfish Asterias' => 'Asterias',
'NetResearchServer' => 'NetResearchServer/',
'OrangeSpider' => 'OrangeSpider',
'McSeek' => 'powered by http://www.McSeek.de',
'Accoona' => 'Accoona-AI-Agent/',
'Webmeasurement' => 'webmeasurement-bot,',
'123spider' => '123spider-Bot',
'Cometrics' => 'cometrics-bot,',
'Houxou' => 'HouxouCrawler/',
'Ocelli' => 'Ocelli/',
'Yacy' => 'yacybot',
'EchO!' => 'EchO!/',
'Majestic-12' => 'MJ12bot/',
'Gigablast' => 'gigablast.com/',
'SurveyBot' => 'SurveyBot/',
'Marvin Medhunt' => 'Marvin',
'InfoSeek SideWinder' => 'Infoseek SideWinder/',
'InternetSeer' => 'InternetSeer',
'Rambler' => 'StackRambler/',
'Vestris Alkaline' => 'AlkalineBOT/',
'Robozilla' => 'Robozilla/',
'Openfind' => 'openfind.com',
'Diggit!' => 'Digger/',
'Become' => 'become.com/',
'NetSprint' => 'NetSprint',
'Szukacz' => 'szukacz',
'Gooro' => 'Gooru-WebSpider',
'Onet' => 'OnetSzukaj',
);
}
// Replaces $db, when data should NOT go to the DB
class display
{
function sql_query($sql)
{
global $br;
echo $sql . $br . $br;
return true;
}
function sql_fetchrow($result)
{
return;
}
function sql_freeresult(&$result)
{
$result = false;
}
}
// Insert bot informations to the DB
function insert_data($user_type, $user_lang, $user_style, $group_id, $group_colour, $mode = 'db')
{
global $br, $special_bots, $normal_bots;
if ($mode == 'db')
{
global $db;
$br = "\n";
$sql = 'TRUNCATE TABLE ' . BOTS_TABLE;
$db->sql_query($sql);
$sql = 'DELETE FROM ' . USERS_TABLE . ' WHERE group_id = ' . $group_id . ' AND user_type = ' . $user_type;
$db->sql_query($sql);
$sql = 'DELETE FROM ' . USER_GROUP_TABLE . ' WHERE group_id = ' . $group_id;
$db->sql_query($sql);
}
else
{
$db = new display();
$br = '<br />';
}
foreach ($special_bots as $name => $agent)
{
$name = addslashes($name);
$agent = addslashes($agent);
$users[] = "($user_type, $group_id, '$name', '$user_lang', $user_style, '$group_colour')";
$bots[] = "('$name', '$agent')";
}
foreach ($normal_bots as $name => $agent)
{
$users[] = "($user_type, $group_id, '$name [Bot]', '$user_lang', $user_style, '$group_colour')";
$bots[] = "('$name [Bot]', '$agent')";
}
$users_sql = 'INSERT INTO ' . USERS_TABLE . ' (user_type, group_id, username, user_lang, user_style, user_colour) VALUES ' . $br;
$users_sql .= implode(', ' . $br, $users);
$bots_sql = 'INSERT INTO ' . BOTS_TABLE . ' (bot_name, bot_agent) VALUES ' . $br;
$bots_sql .= implode(', ' . $br, $bots);
$db->sql_query($bots_sql);
$db->sql_query($users_sql);
echo '<h2 style="color: green">Bots data inserted successfully.</h2><br />' . "\n";
$sql = 'SELECT u.user_id, b.bot_id
FROM ' . BOTS_TABLE . ' b
LEFT JOIN ' . USERS_TABLE . ' u ON u.username = b.bot_name';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
$sql = 'UPDATE ' . BOTS_TABLE . ' SET user_id = \'' . $row['user_id'] . '\' WHERE bot_id = \'' . $row['bot_id'] . '\' LIMIT 1';
$db->sql_query($sql);
$user_group[] = '(' . $group_id . ', ' . $row['user_id'] . ', 0)';
}
$db->sql_freeresult($result);
if (!empty($user_group))
{
$user_group_sql = 'INSERT INTO ' . USER_GROUP_TABLE . ' (group_id, user_id, user_pending) VALUES ' . $br;
$user_group_sql .= implode(', ' . $br, $user_group);
$db->sql_query($user_group_sql);
}
echo '<h2 style="color: green">Bots data resynchronized successfully.</h2><br />' . "\n";
}
$user_type = 2;
$sql = 'SELECT group_id, group_colour
FROM ' . GROUPS_TABLE . "
WHERE group_name = 'BOTS'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
bots();
$number = count($special_bots) + count($normal_bots);
$queries = $number + 10;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Adding <? echo $number; ?> bots to your forum</title>
<link rel="stylesheet" href="<? echo $phpbb_root_path; ?>styles/subSilver/theme/stylesheet.css" type="text/css" />
<style type="text/css">
body {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
margin: 10px;
}
fieldset {
border: 2px solid #714D43;
padding: 16px;
width: 60%;
margin-left: auto;
margin-right: auto;
margin-top: 40px;
}
legend {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 14px;
font-weight: bold;
color: #000099;
padding: 5px;
}
table {
margin-left: auto;
margin-right: auto;
font-size:10px;
}
h1, h2 {
text-align: center;
}
</style>
</head>
<body>
<h1>Adding <? echo $number; ?> bots to your forum</h1>
<?php
insert_data($user_type, $config['default_lang'], $config['default_style'], $row['group_id'], $row['group_colour']);
$sql = 'SELECT b.bot_id, b.bot_name, b.bot_agent, b.user_id
FROM ' . BOTS_TABLE . ' b
LEFT JOIN ' . USERS_TABLE . ' u ON u.user_id = b.user_id AND u.username = b.bot_name
LEFT JOIN ' . USER_GROUP_TABLE . ' g ON g.user_id = u.user_id AND g.group_id = ' . $row['group_id'] . '
WHERE user_type = ' . $user_type;
$result = $db->sql_query($sql);
?>
<table class="tablebg" cellpadding="0" cellspacing="1">
<thead>
<tr>
<th style="white-space: nowrap">Bot ID</th>
<th style="white-space: nowrap">Bot Name</th>
<th style="white-space: nowrap">Bot Agent</th>
<th style="white-space: nowrap">User ID</th>
</tr>
</thead>
<tbody>
<? while ($row = $db->sql_fetchrow($result)) { ?>
<tr class="row1">
<td style="font-weight: bold; text-align: right;"><?php echo $row['bot_id'] ?>.</td>
<td style="white-space: nowrap"><?php echo $row['bot_name'] ?></td>
<td style="white-space: nowrap; text-align: right"><?php echo $row['bot_agent'] ?></td>
<td style="font-weight: bold"><?php echo $row['user_id'] ?></td>
</tr>
<? $row = array(); } ?>
</tbody>
</table>
<div id="wrapfooter">
<span class="copyright">Copyright © 2006 Highway of Life, LEW21<br />[ <? echo $queries ?> Queries ]</span>
</div>
</body>
</html>
<? unset($db); exit(); ?>