<?php
/*
*-------------------------------phpMyBitTorrent--------------------------------*
*--- The Ultimate BitTorrent Tracker and BMS (Bittorrent Management System) ---*
*--------------   Created By Antonio Anzivino (aka DJ Echelon)   --------------*
*-------------               http://www.p2pmania.it               -------------*
*----------         Developed By Emad Hossam (aka emadness)          ----------*
*-------------               http://www.fulldls.com               -------------*
*------------ Based on the Bit Torrent Protocol made by Bram Cohen ------------*
*-------------              http://www.bittorrent.com             -------------*
*------------------------------------------------------------------------------*
*------------------------------------------------------------------------------*
*--   This program is free software; you can redistribute it and/or modify   --*
*--   it under the terms of the GNU General Public License as published by   --*
*--   the Free Software Foundation; either version 2 of the License, or      --*
*--   (at your option) any later version.                                    --*
*--                                                                          --*
*--   This program is distributed in the hope that it will be useful,        --*
*--   but WITHOUT ANY WARRANTY; without even the implied warranty of         --*
*--   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          --*
*--   GNU General Public License for more details.                           --*
*--                                                                          --*
*--   You should have received a copy of the GNU General Public License      --*
*--   along with this program; if not, write to the Free Software            --*
*-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA --*
*--                                                                          --*
*------------------------------------------------------------------------------*
*------              ©2005 phpMyBitTorrent Development Team              ------*
*-----------               http://phpmybittorrent.com               -----------*
*------------------------------------------------------------------------------*
*/

if (!file_exists("include/config.php")) die("You must run this file from your phpMyBitTorrent ROOT directory, where index.php is!!");

function result($status) {
        if ($status == "ok") echo "<font color=\"#00FF00\">Done</font>";
        else echo "<font color=\"#FF0000\">Error!</font>";
}

function sql_run($sql, $descr, $failtext = "") {
        global $db;
        if ($db->sql_query($sql)){
		echo "<p>".$descr."...";
		result("ok");
		}elseif ($err["code"] =1060 ){
                //result("error");
                $err = Array();
                $err = $db->sql_error();
		echo "<p>".$descr."... ".$err["message"]."";
		result("ok");
		
		}else{
		echo "<p>".$descr."..."; 
                result("error");
                $err = Array();
                $err = $db->sql_error();
                echo("<br>");
                echo(_btsqlerror2.$err["code"]);
                echo("<br>");
                echo(_btsqlerror3.$err["message"]);

                $db->sql_query("ROLLBACK;"); //works only if in a transactional environment
                if (!empty($failtext)) echo "<br>".$failtext;
                die();
        }
		
        echo "</p>";
}

include("include/config.php");
include("language/english.php");
ob_implicit_flush(1);

echo "<h1>Upgrade from 1.0 to 1.2</h1>";

echo "<p>Detecting if in a transactional environment...";
if ($db->sql_query("START TRANSACTION;")) result("ok");
else {
        result("error");
        echo "<br>If anything goes wrong you'll have to manually upgrade your database";
}
echo "</p>";
sql_run("CREATE TABLE IF NOT EXISTS `".$db_prefix."_bonus` (
  `id` int(5) NOT NULL auto_increment,
  `bonusname` varchar(50) NOT NULL default '',
  `points` decimal(4,1) NOT NULL default '000.0',
  `description` text NOT NULL,
  `art` varchar(10) NOT NULL default 'traffic',
  `menge` bigint(20) unsigned NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM;","Adding Bonus Table ");
sql_run("INSERT IGNORE INTO`".$db_prefix."_bonus` VALUES (1, '1.0GB Uploaded', 75.0, 'If you reach the points for this case, you can exchange these points on the fly into traffic, we take off the points and you receive the traffic.', 'traffic', 1073741824);","Finally, updating version number!");
sql_run("INSERT IGNORE INTO`".$db_prefix."_bonus` VALUES (2, '2.5GB Uploaded', 150.0, 'If you reach the points for this case, you can exchange these points on the fly into traffic, we take off the points and you receive the traffic.', 'traffic', 2684354560);
","Finally, updating version number!");
sql_run("INSERT IGNORE INTO`".$db_prefix."_bonus` VALUES (3, '5GB Uploaded', 250.0, 'If you reach the points for this case, you can exchange these points on the fly into traffic, we take off the points and you receive the traffic.', 'traffic', 5368709120);
","Finally, updating version number!");
sql_run("INSERT IGNORE INTO`".$db_prefix."_bonus` VALUES (7, '3 Invites', 20.0, 'Trade your points in for invites to the site.', 'invite', 3);
","Finally, updating version number!");
sql_run("INSERT IGNORE INTO`".$db_prefix."_bonus` VALUES (6, '1 Invite', 10.0, 'Trade your points in for invites to the site.', 'invite', 1);
","Finally, updating version number!");
sql_run("INSERT IGNORE INTO`".$db_prefix."_bonus` VALUES (8, '10 Invites', 50.0, 'Trade your points in for invites to the site.', 'invite', 10);
","Finally, updating version number!");
sql_run("INSERT IGNORE INTO`".$db_prefix."_bonus` VALUES (9, '15 Invites', 75.0, 'Trade your points in for invites to the site.', 'invite', 15);
","Finally, updating version number!");
sql_run("INSERT IGNORE INTO`".$db_prefix."_bonus` VALUES (10, '25 Invites', 100.0, 'Trade your points in for invites to the site.', 'invite', 25);
","Finally, updating version number!");
sql_run("INSERT IGNORE INTO`".$db_prefix."_bonus` VALUES (4, '10GB Uploaded', 400.0, 'If you reach the points for this case, you can exchange these points on the fly into traffic, we take off the points and you receive the traffic.', 'traffic', 10737418240);
","Finally, updating version number!");
sql_run("INSERT IGNORE INTO`".$db_prefix."_bonus` VALUES (5, '25GB Uploaded', 1000.0, 'If you reach the points for this case, you can exchange these points on the fly into traffic, we take off the points and you receive the traffic.', 'traffic', 26843545600);
","Adding Bonus values");
sql_run("CREATE TABLE IF NOT EXISTS `".$db_prefix."_cards` (
  `id` int(11) NOT NULL auto_increment,
  `points` int(11) NOT NULL default '0',
  `pic` text NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM;
","Adding Black Jack Cards Table");
sql_run("INSERT IGNORE INTO`".$db_prefix."_cards` VALUES (1, 2, '2p.bmp');","Adding Cards For Black Jack");
sql_run("INSERT IGNORE INTO`".$db_prefix."_cards` VALUES (2, 3, '3p.bmp');","Adding Cards For Black Jack");
sql_run("INSERT IGNORE INTO`".$db_prefix."_cards` VALUES (3, 4, '4p.bmp');","Adding Cards For Black Jack");
sql_run("INSERT IGNORE INTO`".$db_prefix."_cards` VALUES (4, 5, '5p.bmp');","Adding Cards For Black Jack");
sql_run("INSERT IGNORE INTO`".$db_prefix."_cards` VALUES (5, 6, '6p.bmp');","Adding Cards For Black Jack");
sql_run("INSERT IGNORE INTO`".$db_prefix."_cards` VALUES (6, 7, '7p.bmp');","Adding Cards For Black Jack");
sql_run("INSERT IGNORE INTO`".$db_prefix."_cards` VALUES (7, 8, '8p.bmp');","Adding Cards For Black Jack");
sql_run("INSERT IGNORE INTO`".$db_prefix."_cards` VALUES (8, 9, '9p.bmp');","Adding Cards For Black Jack");
sql_run("INSERT IGNORE INTO`".$db_prefix."_cards` VALUES (9, 10, '10p.bmp');","Adding Cards For Black Jack");
sql_run("INSERT IGNORE INTO`".$db_prefix."_cards` VALUES (10, 10, 'vp.bmp');","Adding Cards For Black Jack");
sql_run("INSERT IGNORE INTO`".$db_prefix."_cards` VALUES (11, 10, 'dp.bmp');","Adding Cards For Black Jack");
sql_run("INSERT IGNORE INTO`".$db_prefix."_cards` VALUES (12, 10, 'kp.bmp');","Adding Cards For Black Jack");
sql_run("INSERT IGNORE INTO`".$db_prefix."_cards` VALUES (13, 1, 'tp.bmp');","Adding Cards For Black Jack");
sql_run("INSERT IGNORE INTO`".$db_prefix."_cards` VALUES (14, 2, '2b.bmp');","Adding Cards For Black Jack");
sql_run("INSERT IGNORE INTO`".$db_prefix."_cards` VALUES (15, 3, '3b.bmp');","Adding Cards For Black Jack");
sql_run("INSERT IGNORE INTO`".$db_prefix."_cards` VALUES (16, 4, '4b.bmp');","Adding Cards For Black Jack");
sql_run("INSERT IGNORE INTO`".$db_prefix."_cards` VALUES (17, 5, '5b.bmp');","Adding Cards For Black Jack");
sql_run("INSERT IGNORE INTO`".$db_prefix."_cards` VALUES (18, 6, '6b.bmp');","Adding Cards For Black Jack");
sql_run("INSERT IGNORE INTO`".$db_prefix."_cards` VALUES (19, 7, '7b.bmp');","Adding Cards For Black Jack");
sql_run("INSERT IGNORE INTO`".$db_prefix."_cards` VALUES (20, 8, '8b.bmp');","Adding Cards For Black Jack");
sql_run("INSERT IGNORE INTO`".$db_prefix."_cards` VALUES (21, 9, '9b.bmp');","Adding Cards For Black Jack");
sql_run("INSERT IGNORE INTO`".$db_prefix."_cards` VALUES (22, 10, '10b.bmp');","Adding Cards For Black Jack");
sql_run("INSERT IGNORE INTO`".$db_prefix."_cards` VALUES (23, 10, 'vb.bmp');","Adding Cards For Black Jack");
sql_run("INSERT IGNORE INTO`".$db_prefix."_cards` VALUES (24, 10, 'db.bmp');","Adding Cards For Black Jack");
sql_run("INSERT IGNORE INTO`".$db_prefix."_cards` VALUES (25, 10, 'kb.bmp');","Adding Cards For Black Jack");
sql_run("INSERT IGNORE INTO`".$db_prefix."_cards` VALUES (26, 1, 'tb.bmp');","Adding Cards For Black Jack");
sql_run("INSERT IGNORE INTO`".$db_prefix."_cards` VALUES (27, 2, '2k.bmp');","Adding Cards For Black Jack");
sql_run("INSERT IGNORE INTO`".$db_prefix."_cards` VALUES (28, 3, '3k.bmp');","Adding Cards For Black Jack");
sql_run("INSERT IGNORE INTO`".$db_prefix."_cards` VALUES (29, 4, '4k.bmp');","Adding Cards For Black Jack");
sql_run("INSERT IGNORE INTO`".$db_prefix."_cards` VALUES (30, 5, '5k.bmp');","Adding Cards For Black Jack");
sql_run("INSERT IGNORE INTO`".$db_prefix."_cards` VALUES (31, 6, '6k.bmp');","Adding Cards For Black Jack");
sql_run("INSERT IGNORE INTO`".$db_prefix."_cards` VALUES (32, 7, '7k.bmp');","Adding Cards For Black Jack");
sql_run("INSERT IGNORE INTO`".$db_prefix."_cards` VALUES (33, 8, '8k.bmp');","Adding Cards For Black Jack");
sql_run("INSERT IGNORE INTO`".$db_prefix."_cards` VALUES (34, 9, '9k.bmp');","Adding Cards For Black Jack");
sql_run("INSERT IGNORE INTO`".$db_prefix."_cards` VALUES (35, 10, '10k.bmp');","Adding Cards For Black Jack");
sql_run("INSERT IGNORE INTO`".$db_prefix."_cards` VALUES (36, 10, 'vk.bmp');","Adding Cards For Black Jack");
sql_run("INSERT IGNORE INTO`".$db_prefix."_cards` VALUES (37, 10, 'dk.bmp');","Adding Cards For Black Jack");
sql_run("INSERT IGNORE INTO`".$db_prefix."_cards` VALUES (38, 10, 'kk.bmp');","Adding Cards For Black Jack");
sql_run("INSERT IGNORE INTO`".$db_prefix."_cards` VALUES (39, 1, 'tk.bmp');","Adding Cards For Black Jack");
sql_run("INSERT IGNORE INTO`".$db_prefix."_cards` VALUES (40, 2, '2c.bmp');","Adding Cards For Black Jack");
sql_run("INSERT IGNORE INTO`".$db_prefix."_cards` VALUES (41, 3, '3c.bmp');","Adding Cards For Black Jack");
sql_run("INSERT IGNORE INTO`".$db_prefix."_cards` VALUES (42, 4, '4c.bmp');","Adding Cards For Black Jack");
sql_run("INSERT IGNORE INTO`".$db_prefix."_cards` VALUES (43, 5, '5c.bmp');","Adding Cards For Black Jack");
sql_run("INSERT IGNORE INTO`".$db_prefix."_cards` VALUES (44, 6, '6c.bmp');","Adding Cards For Black Jack");
sql_run("INSERT IGNORE INTO`".$db_prefix."_cards` VALUES (45, 7, '7c.bmp');","Adding Cards For Black Jack");
sql_run("INSERT IGNORE INTO`".$db_prefix."_cards` VALUES (46, 8, '8c.bmp');","Adding Cards For Black Jack");
sql_run("INSERT IGNORE INTO`".$db_prefix."_cards` VALUES (47, 9, '9c.bmp');","Adding Cards For Black Jack");
sql_run("INSERT IGNORE INTO`".$db_prefix."_cards` VALUES (48, 10, '10c.bmp');","Adding Cards For Black Jack");
sql_run("INSERT IGNORE INTO`".$db_prefix."_cards` VALUES (49, 10, 'vc.bmp');","Adding Cards For Black Jack");
sql_run("INSERT IGNORE INTO`".$db_prefix."_cards` VALUES (50, 10, 'dc.bmp');","Adding Cards For Black Jack");
sql_run("INSERT IGNORE INTO`".$db_prefix."_cards` VALUES (51, 10, 'kc.bmp');","Adding Cards For Black Jack");
sql_run("INSERT IGNORE INTO`".$db_prefix."_cards` VALUES (52, 1, 'tc.bmp');
","Adding Cards For Black Jack");
sql_run("CREATE TABLE IF NOT EXISTS `".$db_prefix."_casino` (
  `userid` int(10) NOT NULL default '0',
  `win` bigint(20) default NULL,
  `lost` bigint(20) default NULL,
  `trys` int(11) NOT NULL default '0',
  `date` datetime NOT NULL default '0000-00-00 00:00:00',
  `enableplay` enum('yes','no') NOT NULL default 'yes',
  `deposit` bigint(20) NOT NULL default '0',
  PRIMARY KEY  (`userid`)
) ENGINE=MyISAM;
","Adding Casino Users table");
sql_run("CREATE TABLE IF NOT EXISTS `".$db_prefix."_casino_bets` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `userid` int(10) NOT NULL default '0',
  `proposed` varchar(40) NOT NULL default '',
  `challenged` varchar(40) NOT NULL default '',
  `amount` bigint(20) NOT NULL default '0',
  `time` datetime NOT NULL default '0000-00-00 00:00:00',
  PRIMARY KEY  (`id`),
  KEY `userid` (`userid`,`proposed`,`challenged`,`amount`)
) ENGINE=MyISAM;
","Adding Casino Bets Table.");
sql_run("CREATE TABLE IF NOT EXISTS `".$db_prefix."_casino_config` (
  `name` varchar(255) NOT NULL default '',
  `value` varchar(255) NOT NULL default '',
  PRIMARY KEY  (`name`)
) ENGINE=MyISAM;
","Adding Casino Configs Table.");
sql_run("INSERT IGNORE INTO`".$db_prefix."_casino_config` VALUES ('class_allowed', 'user');","Adding Casino Basic Configs You can adjust them later!");
sql_run("INSERT IGNORE INTO`".$db_prefix."_casino_config` VALUES ('enable', '1');","Adding Casino Basic Configs You can adjust them later!");
sql_run("INSERT IGNORE INTO`".$db_prefix."_casino_config` VALUES ('ratio_mini', '1');","Adding Casino Basic Configs You can adjust them later!");
sql_run("INSERT IGNORE INTO`".$db_prefix."_casino_config` VALUES ('maxtrys', '500');","Adding Casino Basic Configs You can adjust them later!");
sql_run("INSERT IGNORE INTO`".$db_prefix."_casino_config` VALUES ('cheat_value', '5');","Adding Casino Basic Configs You can adjust them later!");
sql_run("INSERT IGNORE INTO`".$db_prefix."_casino_config` VALUES ('cheat_ratio_user', '0.4');","Adding Casino Basic Configs You can adjust them later!");
sql_run("INSERT IGNORE INTO`".$db_prefix."_casino_config` VALUES ('cheat_breakpoint', '2');","Adding Casino Basic Configs You can adjust them later!");
sql_run("INSERT IGNORE INTO`".$db_prefix."_casino_config` VALUES ('cheat_ratio_global', '0.4');","Adding Casino Basic Configs You can adjust them later!");
sql_run("INSERT IGNORE INTO`".$db_prefix."_casino_config` VALUES ('win_amount_on_number', '3');","Adding Casino Basic Configs You can adjust them later!");
sql_run("INSERT IGNORE INTO`".$db_prefix."_casino_config` VALUES ('win_amount', '2');","Adding Casino Basic Configs You can adjust them later!");
sql_run("INSERT IGNORE INTO`".$db_prefix."_casino_config` VALUES ('maxusrbet', '4');","Adding Casino Basic Configs You can adjust them later!");
sql_run("INSERT IGNORE INTO`".$db_prefix."_casino_config` VALUES ('maxtotbet', '30');","Adding Casino Basic Configs You can adjust them later!");
sql_run("INSERT IGNORE INTO`".$db_prefix."_casino_config` VALUES ('cheat_value_max', '7');
","Adding Casino Basic Configs You can adjust them later!");
sql_run("CREATE TABLE IF NOT EXISTS `".$db_prefix."_countries` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `name` varchar(50) default NULL,
  `flagpic` varchar(50) default NULL,
  `domain` char(3) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM;
","Adding Countries Flag Table");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (1, 'Sweden', 'sweden.gif', 'SE');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (2, 'United States of America', 'usa.gif', 'US');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (3, 'Russia', 'russia.gif', 'RU');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (4, 'Finland', 'finland.gif', 'FI');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (5, 'Canada', 'canada.gif', 'CA');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (6, 'France', 'france.gif', 'FR');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (7, 'Germany', 'germany.gif', 'DE');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (8, 'China', 'china.gif', 'CN');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (9, 'Italy', 'italy.gif', 'IT');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (10, 'Denmark', 'denmark.gif', 'DK');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (11, 'Norway', 'norway.gif', 'NO');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (12, 'United Kingdom', 'uk.gif', 'UK');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (13, 'Ireland', 'ireland.gif', 'IE');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (14, 'Poland', 'poland.gif', 'PL');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (15, 'Netherlands', 'netherlands.gif', 'NL');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (16, 'Belgium', 'belgium.gif', 'BE');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (17, 'Japan', 'japan.gif', 'JP');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (18, 'Brazil', 'brazil.gif', 'BR');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (19, 'Argentina', 'argentina.gif', 'AR');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (20, 'Australia', 'australia.gif', 'AU');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (21, 'New Zealand', 'newzealand.gif', 'NZ');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (23, 'Spain', 'spain.gif', 'ES');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (24, 'Portugal', 'portugal.gif', 'PT');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (25, 'Mexico', 'mexico.gif', 'MX');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (26, 'Singapore', 'singapore.gif', 'SG');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (29, 'South Africa', 'southafrica.gif', 'ZA');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (30, 'South Korea', 'southkorea.gif', 'KR');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (31, 'Jamaica', 'jamaica.gif', 'JM');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (32, 'Luxembourg', 'luxembourg.gif', 'LU');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (33, 'Hong Kong', 'hongkong.gif', 'HK');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (34, 'Belize', 'belize.gif', 'BZ');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (35, 'Algeria', 'algeria.gif', 'DZ');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (36, 'Angola', 'angola.gif', 'AO');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (37, 'Austria', 'austria.gif', 'AT');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (38, 'Yugoslavia', 'yugoslavia.gif', 'YU');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (39, 'Western Samoa', 'westernsamoa.gif', 'WS');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (40, 'Malaysia', 'malaysia.gif', 'MY');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (41, 'Dominican Republic', 'dominicanrep.gif', 'DO');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (42, 'Greece', 'greece.gif', 'GR');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (43, 'Guatemala', 'guatemala.gif', 'GT');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (44, 'Israel', 'israel.gif', 'IL');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (45, 'Pakistan', 'pakistan.gif', 'PK');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (46, 'Czech Republic', 'czechrep.gif', 'CZ');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (47, 'Serbia', 'serbia.gif', 'YU');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (48, 'Seychelles', 'seychelles.gif', 'SC');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (49, 'Taiwan', 'taiwan.gif', 'TW');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (50, 'Puerto Rico', 'puertorico.gif', 'PR');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (51, 'Chile', 'chile.gif', 'CL');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (52, 'Cuba', 'cuba.gif', 'CU');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (53, 'Congo', 'congo.gif', 'CG');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (54, 'Afghanistan', 'afghanistan.gif', 'AF');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (55, 'Turkey', 'turkey.gif', 'TR');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (56, 'Uzbekistan', 'uzbekistan.gif', 'UZ');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (57, 'Switzerland', 'switzerland.gif', 'CH');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (58, 'Kiribati', 'kiribati.gif', 'KI');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (59, 'Philippines', 'philippines.gif', 'PH');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (60, 'Burkina Faso', 'burkinafaso.gif', 'BF');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (61, 'Nigeria', 'nigeria.gif', 'NG');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (62, 'Iceland', 'iceland.gif', 'IS');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (63, 'Nauru', 'nauru.gif', 'NR');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (64, 'Slovenia', 'slovenia.gif', 'SI');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (65, 'Albania', 'albania.gif', 'AL');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (66, 'Turkmenistan', 'turkmenistan.gif', 'TM');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (67, 'Bosnia Herzegovina', 'bosniaherzegovina.gif', 'BA');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (68, 'Andorra', 'andorra.gif', 'AD');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (69, 'Lithuania', 'lithuania.gif', 'LT');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (70, 'India', 'india.gif', 'IN');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (71, 'Netherlands Antilles', 'nethantilles.gif', 'AN');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (72, 'Ukraine', 'ukraine.gif', 'UA');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (73, 'Venezuela', 'venezuela.gif', 'VE');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (74, 'Hungary', 'hungary.gif', 'HU');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (75, 'Romania', 'romania.gif', 'RO');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (76, 'Vanuatu', 'vanuatu.gif', 'VU');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (77, 'Vietnam', 'vietnam.gif', 'VN');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (78, 'Trinidad & Tobago', 'trinidadandtobago.gif', 'TT');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (79, 'Honduras', 'honduras.gif', 'HN');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (80, 'Kyrgyzstan', 'kyrgyzstan.gif', 'KG');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (81, 'Ecuador', 'ecuador.gif', 'EC');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (82, 'Bahamas', 'bahamas.gif', 'BS');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (83, 'Peru', 'peru.gif', 'PE');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (84, 'Cambodia', 'cambodia.gif', 'KH');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (85, 'Barbados', 'barbados.gif', 'BB');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (86, 'Bangladesh', 'bangladesh.gif', 'BD');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (87, 'Laos', 'laos.gif', 'LA');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (88, 'Uruguay', 'uruguay.gif', 'UY');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (89, 'Antigua Barbuda', 'antiguabarbuda.gif', 'AG');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (90, 'Paraguay', 'paraguay.gif', 'PY');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (92, 'Union of Soviet Socialist Republics', 'ussr.gif', 'SU');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (93, 'Thailand', 'thailand.gif', 'TH');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (94, 'Senegal', 'senegal.gif', 'SN');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (95, 'Togo', 'togo.gif', 'TG');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (96, 'North Korea', 'northkorea.gif', 'KP');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (97, 'Croatia', 'croatia.gif', 'HR');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (98, 'Estonia', 'estonia.gif', 'EE');","Adding Country Flags");
sql_run("INSERT IGNORE INTO`".$db_prefix."_countries` VALUES (99, 'Colombia', 'colombia.gif', 'CO');","Adding Country Flags");
sql_run("CREATE TABLE IF NOT EXISTS `".$db_prefix."_faq` (
  `id` int(10) NOT NULL auto_increment,
  `type` set('categ','item') NOT NULL default 'item',
  `question` text NOT NULL,
  `answer` text NOT NULL,
  `flag` set('0','1','2','3') NOT NULL default '1',
  `categ` int(10) NOT NULL default '0',
  `order` int(10) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM;
","Adding FAQ's Table");
$faqs1="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (1, 'categ', 'Site information', '', '1', 0, 1);";
$faqs2="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (2, 'categ', 'User information', '', '1', 0, 2);";
$faqs3="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (3, 'categ', 'Stats', '', '1', 0, 3);";
$faqs4="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (4, 'categ', 'Uploading', '', '1', 0, 4);";
$faqs5="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (5, 'categ', 'Downloading', '', '1', 0, 5);";
$faqs6="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (6, 'categ', 'How can I improve my download speed?', '', '1', 0, 6);";
$faqs7="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (7, 'categ', 'My ISP uses a transparent proxy. What should I do?', '', '1', 0, 7);";
$faqs8="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (8, 'categ', 'Why can''t I connect? Is the site blocking me?', '', '1', 0, 8);";
$faqs9="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (9, 'categ', 'What if I can''t find the answer to my problem here?', '', '1', 0, 9);";
$faqs10="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (10, 'item', 'What is this bittorrent all about anyway? How do I get the files?', 'Check out <a class=altlink href=\"http://www.btfaq.com/\">Brian\'s BitTorrent FAQ and Guide</a>', '1', 1, 1);";
$faqs11="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (13, 'item', 'I registered an account but did not receive the confirmation e-mail!', '\r\nNote though that if you didn\'t receive the email the first time it will probably not\r\nsucceed the second time either so you should really try another email address.', '1', 2, 1);";
$faqs12="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (15, 'item', 'Can you rename my account?', 'We do not rename accounts. Please create a new one. (Use <a href=delacct.php class=altlink>this form</a> to\r\ndelete your present account.)', '1', 2, 3);";
$faqs13="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (16, 'item', 'Can you delete my (confirmed) account?', 'You can do it yourself by using <a href=user.php?op=editprofile>this form</a>. Go to the bottom and select delete account', '1', 2, 4);";
$faqs14="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (17, 'item', 'So, what\'s MY ratio?', 'It\'s important to distinguish between your overall ratio and the individual ratio on each torrent you may be seeding or leeching. The overall ratio takes into account the total uploaded and downloaded from your account since you joined the site. The individual ratio takes into account those values for each torrent.\r\n\r\nYou may see two symbols instead of a number: \"Inf.\", which is just an abbreviation for Infinity, and means that you have downloaded 0 bytes while uploading a non-zero amount (ul/dl becomes infinity); \"---\", which should be read as \"non-available\", and shows up when you have both downloaded and uploaded 0 bytes (ul/dl = 0/0 which is an indeterminate amount). ', '1', 2, 5);";
$faqs15="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (18, 'item', 'Why is my IP displayed on my details page?', 'Only you and the site moderators can view your IP address and email. Regular users do not see that information.', '1', 2, 6);";
$faqs16="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (19, 'item', 'Help! I cannot login!?', 'This problem sometimes occurs with MSIE. Close all Internet Explorer windows and open Internet Options in the control panel. Click the Delete Cookies button. You should now be able to login.\r\n', '1', 2, 7);";
$faqs17="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (20, 'item', 'My IP address is dynamic. How do I stay logged in?', 'You do not have to anymore. All you have to do is make sure you are logged in with your actual\r\nIP when starting a torrent session. After that, even if the IP changes mid-session,\r\nthe seeding or leeching will continue and the statistics will update without any problem.', '1', 2, 8);";
$faqs18="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (21, 'item', 'Why is my port number reported as \"---\"? (And why should I care?)', 'The tracker has determined that you are firewalled or NATed and cannot accept incoming connections.\r\n<br>\r\n<br>\r\nThis means that other peers in the swarm will be unable to connect to you, only you to them. Even worse,\r\nif two peers are both in this state they will not be able to connect at all. This has obviously a\r\ndetrimental effect on the overall speed.\r\n<br>\r\n<br>\r\nThe way to solve the problem involves opening the ports used for incoming connections\r\n(the same range you defined in your client) on the firewall and/or configuring your\r\nNAT server to use a basic form of NAT\r\nfor that range instead of NAPT (the actual process differs widely between different router models.\r\nCheck your router documentation and/or support forum. You will also find lots of information on the\r\nsubject at <a class=altlink href=\"http://portforward.com/\">PortForward</a>).', '1', 2, 9);";
$faqs19="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (27, 'item', 'Most common reason for stats not updating', '<ul>\r\n<li>The user is cheating. (a.k.a. \"Summary Ban\")</li>\r\n<li>The server is overloaded and unresponsive. Just try to keep the session open until the server responds again. (Flooding the server with consecutive manual updates is not recommended.)</li>\r\n</ul>', '1', 3, 1);";
$faqs21="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (28, 'item', 'Best practices', '<ul>\r\n<li>If a torrent you are currently leeching/seeding is not listed on your profile, just wait or force a manual update.</li>\r\n<li>Make sure you exit your client properly, so that the tracker receives \"event=completed\".</li>\r\n<li>If the tracker is down, do not stop seeding. As long as the tracker is back up before you exit the client the stats should update properly.</li>\r\n</ul>', '1', 3, 2);";
$faqs22="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (29, 'item', 'May I use any bittorrent client?', 'Yes. The tracker now updates the stats correctly for all bittorrent clients. However, we still recommend\r\nthat you <b>avoid</b> the following clients:<br>\r\n<br>\r\n? BitTorrent++,<br>\r\n? Nova Torrent,<br>\r\n? TorrentStorm.<br>\r\n<br>\r\nThese clients do not report correctly to the tracker when canceling/finishing a torrent session.\r\nIf you use them then a few MB may not be counted towards\r\nthe stats near the end, and torrents may still be listed in your profile for some time after you have closed the client.<br>\r\n<br>\r\nAlso, clients in alpha or beta version should be avoided.', '1', 3, 3);";
$faqs23="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (30, 'item', 'Why is a torrent I''m leeching/seeding listed several times in my profile?', 'If for some reason (e.g. pc crash, or frozen client) your client exits improperly and you restart it,\r\nit will have a new peer_id, so it will show as a new torrent. The old one will never receive a \"event=completed\"\r\nor \"event=stopped\" and will be listed until some tracker timeout. Just ignore it, it will eventually go away.', '1', 3, 4);";
$faqs24="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (31, 'item', 'I''ve finished or cancelled a torrent. Why is it still listed in my profile?', 'Some clients, notably TorrentStorm and Nova Torrent, do not report properly to the tracker when canceling or finishing a torrent.\r\nIn that case the tracker will keep waiting for some message - and thus listing the torrent as seeding or leeching - until some\r\ntimeout occurs. Just ignore it, it will eventually go away.', '1', 3, 5);";
$faqs25="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (32, 'item', 'Why do I sometimes see torrents I''m not leeching in my profile!?', 'When a torrent is first started, the tracker uses the IP to identify the user. Therefore the torrent will\r\nbecome associated with the user <i>who last accessed the site</i> from that IP. If you share your IP in some\r\nway (you are behind NAT/ICS, or using a proxy), and some of the persons you share it with are also users,\r\nyou may occasionally see their torrents listed in your profile. (If they start a torrent session from that\r\nIP and you were the last one to visit the site the torrent will be associated with you). Note that now\r\ntorrents listed in your profile will always count towards your total stats.', '2', 3, 6);";
$faqs26="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (34, 'item', 'How does NAT/ICS change the picture?', 'This is a very particular case in that all computers in the LAN will appear to the outside world as having the same IP. We must distinguish\r\nbetween two cases:<br>\r\n<br>\r\n<b>1.</b> <i>You are the single  user in the LAN</i><br>\r\n<br>\r\nYou should use the same account in all the computers.<br>\r\n<br>\r\nNote also that in the ICS case it is preferable to run the BT client on the ICS gateway. Clients running on the other computers\r\nwill be unconnectable (their ports will be listed as \"---\", as explained elsewhere in the FAQ) unless you specify\r\nthe appropriate services in your ICS configuration (a good explanation of how to do this for Windows XP can be found\r\n<a class=altlink href=\"redirect.php?url=http://www.microsoft.com/downloads/details.aspx?FamilyID=1dcff3ce-f50f-4a34-ae67-cac31ccd7bc9&amp;displaylang=en\">here</a>).\r\nIn the NAT case you should configure different ranges for clients on different computers and create appropriate NAT rules in the router. (Details vary widely from router to router and are outside the scope of this FAQ. Check your router documentation and/or support forum.)<br>\r\n<br>\r\n<br>\r\n<b>2.</b> <i>There are multiple users in the LAN</i><br>\r\n<br>\r\nAt present there is no way of making this setup always work properly.\r\nEach torrent will be associated with the user who last accessed the site from within\r\nthe LAN before the torrent was started.\r\nUnless there is cooperation between the users mixing of statistics is possible.\r\n(User A accesses the site, downloads a .torrent file, but does not start the torrent immediately.\r\nMeanwhile, user B accesses the site. User A then starts the torrent. The torrent will count\r\ntowards user B\'s statistics, not user A\'s.)\r\n<br>\r\n<br>\r\nIt is your LAN, the responsibility is yours. Do not ask us to ban other users\r\nwith the same IP, we will not do that. (Why should we ban <i>him</i> instead of <i>you</i>?)', '1', 3, 8);";
$faqs27="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (36, 'item', 'Why can\'t I upload torrents?', 'Only specially authorized users (<font color=\"#4040c0\"><b>Uploaders</b></font>) have permission to upload torrents.', '1', 4, 1);";
$faqs28="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (37, 'item', 'What criteria must I meet before I can join the <font color=\"#4040c0\">Uploader</font> team?', 'You must be able to provide releases that:<br>\r\n? include a proper NFO,<br>\r\n? are genuine scene releases. If it''s not on <a class=altlink href=\"redir.php?url=http://www.nforce.nl\">NFOrce</a> then forget it! (except music).<br>\r\n? are not older than seven (7) days,<br>\r\n? have all files in original format (usually 14.3 MB RARs),<br>\r\n? you''ll be able to seed, or make sure are well-seeded, for at least 24 hours.<br>\r\n? you should have atleast 2MBit upload bandwith.<br>\r\n<br>\r\nIf you think you can match these criteria do not hesitate to <a class=altlink href=staff.php>contact</a> one of the administrators.<br>\r\n<b>Remember!</b> Write your application carefully! Be sure to include your UL speed and what kind of stuff you''re planning to upload.<br>\r\nOnly well written letters with serious intent will be considered.', '1', 4, 2);";
$faqs29="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (39, 'item', 'How do I use the files I''ve downloaded?', 'Check out <a class=altlink href=videoformats.php>this guide</a>.', '1', 5, 1);";
$faqs30="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (40, 'item', 'Downloaded a movie and don''t know what CAM/TS/TC/SCR means?', 'Check out <a class=altlink href=videoformats.php>this guide.', '1', 5, 2);";
$faqs31="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (41, 'item', 'Why did an active torrent suddenly disappear?', 'There may be three reasons for this:<br>\r\n(<b>1</b>) The torrent may have been out-of-sync with the site\r\n<a class=altlink href=rules.php>rules</a>.<br>\r\n(<b>2</b>) The uploader may have deleted it because it was a bad release.\r\nA replacement will probably be uploaded to take its place.<br>\r\n(<b>3</b>) Torrents are automatically deleted after 28 days.', '2', 5, 3);";
$faqs32="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (42, 'item', 'How do I resume a broken download or reseed something?', 'Open the .torrent file. When your client asks you for a location, choose the location of the existing file(s) and it will resume/reseed the torrent.\r\n', '1', 5, 4);";
$faqs33="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (43, 'item', 'Why do my downloads sometimes stall at 99%?', 'The more pieces you have, the harder it becomes to find peers who have pieces you are missing. That is why downloads sometimes slow down or even stall when there are just a few percent remaining. Just be patient and you will, sooner or later, get the remaining pieces.\r\n', '1', 5, 5);";
$faqs34="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (44, 'item', 'What are these \"a piece has failed an hash check\" messages?', 'Bittorrent clients check the data they receive for integrity. When a piece fails this check it is\r\nautomatically re-downloaded. Occasional hash fails are a common occurrence, and you shouldn''t worry.<br>\r\n<br>\r\nSome clients have an (advanced) option/preference to ''kick/ban clients that send you bad data'' or\r\nsimilar. It should be turned on, since it makes sure that if a peer repeatedly sends you pieces that\r\nfail the hash check it will be ignored in the future.', '1', 5, 6);";
$faqs35="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (45, 'item', 'The torrent is supposed to be 100MB. How come I downloaded 120MB?', 'See the hash fails topic. If your client receives bad data it will have to redownload it, therefore\r\nthe total downloaded may be larger than the torrent size. Make sure the \"kick/ban\" option is turned on\r\nto minimize the extra downloads.', '1', 5, 7);";
$faqs36="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (46, 'item', 'Why do I get a \"Not authorized (xx h) - READ THE FAQ\" error?', 'From the time that each <b>new</b> torrent is uploaded to the tracker, there is a period of time that\r\nsome users must wait before they can download it.<br>\r\nThis delay in downloading will only affect users with a low ratio, and users with low upload amounts.<br>\r\n<br>\r\n<table cellspacing=3 cellpadding=0>\r\n <tr>\r\n	<td class=embedded width=\"70\">Ratio below</td>\r\n	<td class=embedded width=\"40\" bgcolor=\"#F5F4EA\"><font color=\"#BB0000\"><div align=\"center\">0.50</div></font></td>\r\n	<td class=embedded width=\"10\">&nbsp;</td>\r\n	<td class=embedded width=\"110\">and/or upload below</td>\r\n	<td class=embedded width=\"40\" bgcolor=\"#F5F4EA\"><div align=\"center\">5.0GB</div></td>\r\n	<td class=embedded width=\"10\">&nbsp;</td>\r\n	<td class=embedded width=\"50\">delay of</td>\r\n	<td class=embedded width=\"40\" bgcolor=\"#F5F4EA\"><div align=\"center\">48h</div></td>\r\n </tr>\r\n <tr>\r\n	<td class=embedded>Ratio below</td>\r\n	<td class=embedded bgcolor=\"#F5F4EA\"><font color=\"#A10000\"><div align=\"center\">0.65</div></font></td>\r\n	<td class=embedded width=\"10\">&nbsp;</td>\r\n	<td class=embedded>and/or upload below</td>\r\n	<td class=embedded bgcolor=\"#F5F4EA\"><div align=\"center\">6.5GB</div></td>\r\n	<td class=embedded width=\"10\">&nbsp;</td>\r\n	<td class=embedded>delay of</td>\r\n	<td class=embedded bgcolor=\"#F5F4EA\"><div align=\"center\">24h</div></td>\r\n </tr>\r\n <tr>\r\n	<td class=embedded>Ratio below</td>\r\n	<td class=embedded bgcolor=\"#F5F4EA\"><font color=\"#880000\"><div align=\"center\">0.80</div></font></td>\r\n	<td class=embedded width=\"10\">&nbsp;</td>\r\n	<td class=embedded>and/or upload below</td>\r\n	<td class=embedded bgcolor=\"#F5F4EA\"><div align=\"center\">8.0GB</div></td>\r\n	<td class=embedded width=\"10\">&nbsp;</td>\r\n	<td class=embedded>delay of</td>\r\n	<td class=embedded bgcolor=\"#F5F4EA\"><div align=\"center\">12h</div></td>\r\n </tr>\r\n <tr>\r\n	<td class=embedded>Ratio below</td>\r\n	<td class=embedded bgcolor=\"#F5F4EA\"><font color=\"#6E0000\"><div align=\"center\">0.95</div></font></td>\r\n	<td class=embedded width=\"10\">&nbsp;</td>\r\n	<td class=embedded>and/or upload below</td>\r\n	<td class=embedded bgcolor=\"#F5F4EA\"><div align=\"center\">9.5GB</div></td>\r\n	<td class=embedded width=\"10\">&nbsp;</td>\r\n	<td class=embedded>delay of</td>\r\n	<td class=embedded bgcolor=\"#F5F4EA\"><div align=\"center\">06h</div></td>\r\n </tr>\r\n</table>\r\n<br>\r\n\"<b>And/or</b>\" means any or both. Your delay will be the <b>largest</b> one for which you meet <b>at least</b> one condition.<br>\r\n<br>\r\nThis applies to new users as well, so opening a new account will not help. Note also that this\r\nworks at tracker level, you will be able to grab the .torrent file itself at any time.<br>\r\n<br>\r\n<!--The delay applies only to leeching, not to seeding. If you got the files from any other source and\r\nwish to seed them you may do so at any time irrespectively of your ratio or total uploaded.<br>-->\r\nN.B. Due to some users exploiting the ''no-delay-for-seeders'' policy we had to change it. The delay\r\nnow applies to both seeding and leeching. So if you are subject to a delay and get the files from\r\nsome other source you will not be able to seed them until the delay has elapsed.', '3', 5, 8);";
$faqs37="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (47, 'item', 'Why do I get a \"rejected by tracker - Port xxxx is blacklisted\" error?', 'Your client is reporting to the tracker that it uses one of the default bittorrent ports\r\n(6881-6889) or any other common p2p port for incoming connections.<br>\r\n<br>\r\nThis tracker does not allow clients to use ports commonly associated with p2p protocols.\r\nThe reason for this is that it is a common practice for ISPs to throttle those ports\r\n(that is, limit the bandwidth, hence the speed). <br>\r\n<br>\r\nThe blocked ports list include, but is not neccessarily limited to, the following:<br>\r\n<br>\r\n<table cellspacing=3 cellpadding=0>\r\n  <tr>\r\n	<td class=embedded width=\"80\">Direct Connect</td>\r\n	<td class=embedded width=\"80\" bgcolor=\"#F5F4EA\"><div align=\"center\">411 - 413</div></td>\r\n  </tr>\r\n  <tr>\r\n	<td class=embedded width=\"80\">Kazaa</td>\r\n	<td class=embedded width=\"80\" bgcolor=\"#F5F4EA\"><div align=\"center\">1214</div></td>\r\n  </tr>\r\n  <tr>\r\n	<td class=embedded width=\"80\">eDonkey</td>\r\n	<td class=embedded width=\"80\" bgcolor=\"#F5F4EA\"><div align=\"center\">4662</div></td>\r\n  </tr>\r\n  <tr>\r\n	<td class=embedded width=\"80\">Gnutella</td>\r\n	<td class=embedded width=\"80\" bgcolor=\"#F5F4EA\"><div align=\"center\">6346 - 6347</div></td>\r\n  </tr>\r\n  <tr>\r\n	<td class=embedded width=\"80\">BitTorrent</td>\r\n	<td class=embedded width=\"80\" bgcolor=\"#F5F4EA\"><div align=\"center\">6881 - 6889</div></td>\r\n </tr>\r\n</table>\r\n<br>\r\nIn order to use use our tracker you must  configure your client to use\r\nany port range that does not contain those ports (a range within the region 49152 through 65535 is preferable,\r\ncf. <a class=altlink href=\"http://www.iana.org/assignments/port-numbers\">IANA</a>). Notice that some clients,\r\nlike Azureus 2.0.7.0 or higher, use a single port for all torrents, while most others use one port per open torrent. The size\r\nof the range you choose should take this into account (typically less than 10 ports wide. There\r\nis no benefit whatsoever in choosing a wide range, and there are possible security implications). <br>\r\n<br>\r\nThese ports are used for connections between peers, not client to tracker.\r\nTherefore this change will not interfere with your ability to use other trackers (in fact it\r\nshould <i>increase</i> your speed with torrents from any tracker, not just ours). Your client\r\nwill also still be able to connect to peers that are using the standard ports.\r\nIf your client does not allow custom ports to be used, you will have to switch to one that does.<br>\r\n<br>\r\nDo not ask us, or in the forums, which ports you should choose. The more random the choice is the harder\r\nit will be for ISPs to catch on to us and start limiting speeds on the ports we use.\r\nIf we simply define another range ISPs will start throttling that range also. <br>\r\n<br>\r\nFinally, remember to forward the chosen ports in your router and/or open them in your\r\nfirewall, should you have them.', '3', 5, 9);";
$faqs38="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (48, 'item', 'What''s this \"IOError - [Errno13] Permission denied\" error?', 'If you just want to fix it reboot your computer, it should solve the problem.\r\nOtherwise read on.<br>\r\n<br>\r\nIOError means Input-Output Error, and that is a file system error, not a tracker one.\r\nIt shows up when your client is for some reason unable to open the partially downloaded\r\ntorrent files. The most common cause is two instances of the client to be running\r\nsimultaneously:\r\nthe last time the client was closed it somehow didn''t really close but kept running in the\r\nbackground, and is therefore still\r\nlocking the files, making it impossible for the new instance to open them.<br>\r\n<br>\r\nA more uncommon occurrence is a corrupted FAT. A crash may result in corruption\r\nthat makes the partially downloaded files unreadable, and the error ensues. Running\r\nscandisk should solve the problem. (Note that this may happen only if you''re running\r\nWindows 9x - which only support FAT - or NT/2000/XP with FAT formatted hard drives.\r\nNTFS is much more robust and should never permit this problem.)', '3', 5, 10);";
$faqs39="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (49, 'item', 'What''s this \"TTL\" in the browse page?', 'The torrent''s Time To Live, in hours. It means the torrent will be deleted\r\nfrom the tracker after that many hours have elapsed (yes, even if it is still active).\r\nNote that this a maximum value, the torrent may be deleted at any time if it''s inactive.', '3', 5, 11);";
$faqs40="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (50, 'item', 'Do not immediately jump on new torrents', 'The download speed mostly depends on the seeder-to-leecher ratio (SLR). Poor download speed is\r\nmainly a problem with new and very popular torrents where the SLR is low.<br>\r\n<br>\r\n(Proselytising sidenote: make sure you remember that you did not enjoy the low speed.\r\n<b>Seed</b> so that others will not endure the same.)<br>\r\n<br>\r\nThere are a couple of things that you can try on your end to improve your speed:<br>\r\n<br>In particular, do not do it if you have a slow connection. The best speeds will be found around the\r\nhalf-life of a torrent, when the SLR will be at its highest. (The downside is that you will not be able to seed\r\nso much. It''s up to you to balance the pros and cons of this.)', '1', 6, 1);";
$faqs41="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (51, 'item', 'Limit your upload speed', 'The upload speed affects the download speed in essentially two ways:<br>\r\n<ul>\r\n    <li>Bittorrent peers tend to favour those other peers that upload to them. This means that if A and B\r\n	are leeching the same torrent and A is sending data to B at high speed then B will try to reciprocate.\r\n	So due to this effect high upload speeds lead to high download speeds.</li>\r\n\r\n    <li>Due to the way TCP works, when A is downloading something from B it has to keep telling B that\r\n        it received the data sent to him. (These are called acknowledgements - ACKs -, a sort of \"got it!\" messages).\r\n        If A fails to do this then B will stop sending data and wait. If A is uploading at full speed there may be no\r\n        bandwidth left for the ACKs and they will be delayed. So due to this effect excessively high upload speeds lead\r\n        to low download speeds.</li>\r\n</ul>\r\n\r\nThe full effect is a combination of the two. The upload should be kept as high as possible while allowing the\r\nACKs to get through without delay. <b>A good thumb rule is keeping the upload at about 80% of the theoretical\r\nupload speed.</b> You will have to fine tune yours to find out what works best for you. (Remember that keeping the\r\nupload high has the additional benefit of helping with your ratio.) <br>\r\n<br>\r\nIf you are running more than one instance of a client it is the overall upload speed that you must take into account.\r\nSome clients (e.g. Azureus) limit global upload speed, others (e.g. Shad0w''s) do it on a per torrent basis.\r\nKnow your client. The same applies if you are using your connection for anything else (e.g. browsing or ftp),\r\nalways think of the overall upload speed.', '1', 6, 2);";
$faqs42="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (52, 'item', 'Limit the number of simultaneous connections', 'Some operating systems (like Windows 9x) do not deal well with a large number of connections, and may even crash.\r\nAlso some home routers (particularly when running NAT and/or firewall with stateful inspection services) tend to become\r\nslow or crash when having to deal with too many connections. There are no fixed values for this, you may try 60 or 100\r\nand experiment with the value. Note that these numbers are additive, if you have two instances of\r\na client running the numbers add up.', '1', 6, 3);";
$faqs43="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (53, 'item', 'Limit the number of simultaneous uploads', 'Isn''t this the same as above? No. Connections limit the number of peers your client is talking to and/or\r\ndownloading from. Uploads limit the number of peers your client is actually uploading to. The ideal number is\r\ntypically much lower than the number of connections, and highly dependent on your (physical) connection.', '1', 6, 4);";
$faqs44="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (54, 'item', 'Just give it some time', 'As explained above peers favour other peers that upload to them. When you start leeching a new torrent you have\r\nnothing to offer to other peers and they will tend to ignore you. This makes the starts slow, in particular if,\r\nby change, the peers you are connected to include few or no seeders. The download speed should increase as soon\r\nas you have some pieces to share.', '1', 6, 5);";
$faqs45="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (55, 'item', 'Why is my browsing so slow while leeching?', 'Your download speed is always finite. If you are a peer in a fast torrent it will almost certainly saturate your\r\ndownload bandwidth, and your browsing will suffer. At the moment there is no client that allows you to limit the\r\ndownload speed, only the upload. You will have to use a third-party solution,\r\nsuch as <a class=altlink href=\"redir.php?url=http://www.netlimiter.com/\">NetLimiter</a>.<br>\r\n<br>\r\nBrowsing was used just as an example, the same would apply to gaming, IMing, etc...', '1', 6, 6);";
$faqs46="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (56, 'item', 'What is a proxy?', 'Basically a middleman. When you are browsing a site through a proxy your requests are sent to the proxy and the proxy\r\nforwards them to the site instead of you connecting directly to the site. There are several classifications\r\n(the terminology is far from standard):<br>\r\n<br>\r\n\r\n\r\n<table cellspacing=3 cellpadding=0>\r\n <tr>\r\n	<td class=embedded valign=\"top\" bgcolor=\"#F5F4EA\" width=\"100\">&nbsp;Transparent</td>\r\n	<td class=embedded width=\"10\">&nbsp;</td>\r\n	<td class=embedded valign=\"top\">A transparent proxy is one that needs no configuration on the clients. It works by automatically redirecting all port 80 traffic to the proxy. (Sometimes used as synonymous for non-anonymous.)</td>\r\n </tr>\r\n <tr>\r\n	<td class=embedded valign=\"top\" bgcolor=\"#F5F4EA\">&nbsp;Explicit/Voluntary</td>\r\n	<td class=embedded width=\"10\">&nbsp;</td>\r\n	<td class=embedded valign=\"top\">Clients must configure their browsers to use them.</td>\r\n </tr>\r\n <tr>\r\n	<td class=embedded valign=\"top\" bgcolor=\"#F5F4EA\">&nbsp;Anonymous</td>\r\n	<td class=embedded width=\"10\">&nbsp;</td>\r\n	<td class=embedded valign=\"top\">The proxy sends no client identification to the server. (HTTP_X_FORWARDED_FOR header is not sent; the server does not see your IP.)</td>\r\n </tr>\r\n <tr>\r\n	<td class=embedded valign=\"top\" bgcolor=\"#F5F4EA\">&nbsp;Highly Anonymous</td>\r\n	<td class=embedded width=\"10\">&nbsp;</td>\r\n	<td class=embedded valign=\"top\">The proxy sends no client nor proxy identification to the server. (HTTP_X_FORWARDED_FOR, HTTP_VIA and HTTP_PROXY_CONNECTION headers are not sent; the server doesn''t see your IP and doesn''t even know you''re using a proxy.)</td>\r\n </tr>\r\n <tr>\r\n	<td class=embedded valign=\"top\" bgcolor=\"#F5F4EA\">&nbsp;Public</td>\r\n	<td class=embedded width=\"10\">&nbsp;</td>\r\n	<td class=embedded valign=\"top\">(Self explanatory)</td>\r\n </tr>\r\n</table>\r\n<br>\r\nA transparent proxy may or may not be anonymous, and there are several levels of anonymity.', '1', 7, 1);";
$faqs47="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (57, 'item', 'How do I find out if I\'m behind a (transparent/anonymous) proxy?', 'Try <a href=http://proxyjudge.org class=\"altlink\">ProxyJudge</a>. It lists the HTTP headers that the server where it is running\r\nreceived from you. The relevant ones are HTTP_CLIENT_IP, HTTP_X_FORWARDED_FOR and REMOTE_ADDR.<br>\r\n<br>\r\n<br>\r\n<b>Why is my port listed as \"---\" even though I\'m not NAT/Firewalled?</b><a name=\"prox3\"></a><br>\r\n<br>\r\nThe tracker is quite smart at finding your real IP, but it does need the proxy to send the HTTP header\r\nHTTP_X_FORWARDED_FOR. If your ISP\'s proxy does not then what happens is that the tracker will interpret the proxy\'s IP\r\naddress as the client\'s IP address. So when you login and the tracker tries to connect to your client to see if you are\r\nNAT/firewalled it will actually try to connect to the proxy on the port your client reports to be using for\r\nincoming connections. Naturally the proxy will not be listening on that port, the connection will fail and the\r\ntracker will think you are NAT/firewalled.', '1', 7, 2);";
$faqs48="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (58, 'item', 'Can I bypass my ISP\'s proxy?', 'If your ISP only allows HTTP traffic through port 80 or blocks the usual proxy ports then you would need to use something\r\nlike <a href=http://www.socks.permeo.com>socks</a> and that is outside the scope of this FAQ.<br>\r\n<br>\r\nOtherwise you may try the following:<br>\r\n<ul>\r\n    <li>Choose any public <b>non-anonymous</b> proxy that does <b>not</b> use port 80\r\n	(e.g. from <a href=http://tools.rosinstrument.com/proxy  class=\"altlink\">this</a>,\r\n	<a href=http://www.proxy4free.com/index.html  class=\"altlink\">this</a> or\r\n	<a href=http://www.samair.ru/proxy  class=\"altlink\">this</a> list).</li>\r\n\r\n    <li>Configure your computer to use that proxy. For Windows XP, do <i>Start</i>, <i>Control Panel</i>, <i>Internet Options</i>,\r\n	<i>Connections</i>, <i>LAN Settings</i>, <i>Use a Proxy server</i>, <i>Advanced</i> and type in the IP and port of your chosen\r\n	proxy. Or from Internet Explorer use <i>Tools</i>, <i>Internet Options</i>, ...<br></li>\r\n\r\n    <li>(Facultative) Visit <a href=http://proxyjudge.org  class=\"altlink\">ProxyJudge</a>. If you see an HTTP_X_FORWARDED_FOR in\r\n	the list followed by your IP then everything should be ok, otherwise choose another proxy and try again.<br></li>\r\n\r\n    <li>Visit this site. Hopefully the tracker will now pickup your real IP (check your profile to make sure).</li>\r\n</ul>\r\n<br>\r\nNotice that now you will be doing all your browsing through a public proxy, which are typically quite slow.\r\nCommunications between peers do not use port 80 so their speed will not be affected by this, and should be better than when\r\nyou were \"unconnectable\".', '1', 7, 3);";
$faqs49="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (59, 'item', 'How do I make my bittorrent client use a proxy?', 'Just configure Windows XP as above. When you configure a proxy for Internet Explorer you''re actually configuring a proxy for\r\nall HTTP traffic (thank Microsoft and their \"IE as part of the OS policy\" ). On the other hand if you use another\r\nbrowser (Opera/Mozilla/Firefox) and configure a proxy there you''ll be configuring a proxy just for that browser. We don''t\r\nknow of any BT client that allows a proxy to be specified explicitly.', '1', 7, 4);";
$faqs50="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (60, 'item', 'Why can''t I signup from behind a proxy?', 'It is our policy not to allow new accounts to be opened from behind a proxy.', '1', 7, 5);";
$faqs51="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (62, 'item', 'Maybe my address is blacklisted?', 'The site blocks addresses listed in the (former) <a class=altlink href=\"http://methlabs.org/\">PeerGuardian</a>\r\ndatabase, as well as addresses of banned users. This works at Apache/PHP level, it''s just a script that\r\nblocks <i>logins</i> from those addresses. It should not stop you from reaching the site. In particular\r\nit does not block lower level protocols, you should be able to ping/traceroute the server even if your\r\naddress is blacklisted. If you cannot then the reason for the problem lies elsewhere.<br>\r\n<br>\r\nIf somehow your address is indeed blocked in the PG database do not contact us about it, it is not our\r\npolicy to open <i>ad hoc</i> exceptions. You should clear your IP with the database maintainers instead.', '1', 8, 1);";
$faqs52="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (63, 'item', 'Your ISP blocks the site''s address', '(In first place, it''s unlikely your ISP is doing so. DNS name resolution and/or network problems are the usual culprits.)\r\n<br>\r\nThere''s nothing we can do.\r\nYou should contact your ISP (or get a new one). Note that you can still visit the site via a proxy, follow the instructions\r\nin the relevant section. In this case it doesn''t matter if the proxy is anonymous or not, or which port it listens to.<br>\r\n<br>\r\nNotice that you will always be listed as an \"unconnectable\" client because the tracker will be unable to\r\ncheck that you''re capable of accepting incoming connections.', '1', 8, 2);";
$faqs53="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (65, 'item', 'You can try these:', 'Post in the <a class=\"altlink\" href=\"pm/index.php\">Forums</a>, by all means. You\'ll find they\r\nare usually a friendly and helpful place,\r\nprovided you follow a few basic guidelines:\r\n<ul>\r\n<li>Make sure your problem is not really in this FAQ. There\'s no point in posting just to be sent\r\nback here.\r\n<li>Before posting read the sticky topics (the ones at the top). Many times new information that\r\nstill hasn\'t been incorporated in the FAQ can be found there.</li>\r\n<li>Help us in helping you. Do not just say \"it doesn\'t work!\". Provide details so that we don\'t\r\nhave to guess or waste time asking. What client do you use? What\'s your OS? What\'s your network setup? What\'s the exact\r\nerror message you get, if any? What are the torrents you are having problems with? The more\r\nyou tell the easiest it will be for us, and the more probable your post will get a reply.</li>\r\n<li>And needless to say: be polite. Demanding help rarely works, asking for it usually does\r\nthe trick.', '1', 9, 1);";
$faqs54="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (66, 'item', 'Why am I listed as not connectable? (And why should I care?)', 'The tracker has determined that you are firewalled or NATed and cannot accept incoming connections.\r\n\r\nThis means that other peers in the swarm will be unable to connect to you, only you to them. Even worse, if two peers are both in this state they will not be able to connect at all. This has obviously a detrimental effect on the overall speed.\r\n\r\nThe way to solve the problem involves opening the ports used for incoming connections (the same range you defined in your client) on the firewall and/or configuring your NAT server to use a basic form of NAT for that range instead of NAPT (the actual process differs widely between different router models. Check your router documentation and/or support forum. You will also find lots of information on the subject at .<a class=altlink href=\"http://portforward.com/\">PortForward).</a>', '3', 2, 10);";
$faqs55="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (67, 'item', 'How to start downloading a torrent file from here', 'The first thing you need to be able to download a torrent file is a Bit Torrent Client, which is a small program that you have to download and install onto your hard disk.\r\nThese are the only clients we support!\r\n\r\n\r\n<a class=altlink href=http://azureus.sourceforge.net/>Azureus</a>\r\n\r\n\r\n<a class=altlink href=http://www.bittorrent.com/>Bittorrent</A>\r\n\r\n\r\n<a class=altlink  href=http://www.bittornado.com/>Bittornado</A>\r\n\r\n<a class=altlink  href=http://www.utorrent.com/>Utorrent</A>', '3', 5, 12);";
$faqs56="INSERT IGNORE INTO `".$db_prefix."_faq` VALUES (68, 'item', 'How Do I Get Files From This site', '  We do not host Any Files on this site\r\nthe only thing we Host are .torrents .\r\nYou can download the files indexed on our site only via Bittorrent, a peer-to-peer filesharing network. If you\'ve got no experience with Bittorrent whatsoever, read the relevant Sticky in our Bittorrent Forum. If that doesn\'t help, feel free to ask any question there.', '1', 1, 2);";
sql_run($faqs1,"Adding FAQ's");
sql_run($faqs2,"Adding FAQ's");
sql_run($faqs3,"Adding FAQ's");
sql_run($faqs4,"Adding FAQ's");
sql_run($faqs5,"Adding FAQ's");
sql_run($faqs6,"Adding FAQ's");
sql_run($faqs7,"Adding FAQ's");
sql_run($faqs8,"Adding FAQ's");
sql_run($faqs9,"Adding FAQ's");
sql_run($faqs10,"Adding FAQ's");
sql_run($faqs11,"Adding FAQ's");
sql_run($faqs12,"Adding FAQ's");
sql_run($faqs13,"Adding FAQ's");
sql_run($faqs14,"Adding FAQ's");
sql_run($faqs15,"Adding FAQ's");
sql_run($faqs16,"Adding FAQ's");
sql_run($faqs17,"Adding FAQ's");
sql_run($faqs18,"Adding FAQ's");
sql_run($faqs19,"Adding FAQ's");
sql_run($faqs21,"Adding FAQ's");
sql_run($faqs22,"Adding FAQ's");
sql_run($faqs23,"Adding FAQ's");
sql_run($faqs24,"Adding FAQ's");
sql_run($faqs25,"Adding FAQ's");
sql_run($faqs26,"Adding FAQ's");
sql_run($faqs27,"Adding FAQ's");
sql_run($faqs28,"Adding FAQ's");
sql_run($faqs29,"Adding FAQ's");
sql_run($faqs30,"Adding FAQ's");
sql_run($faqs31,"Adding FAQ's");
sql_run($faqs32,"Adding FAQ's");
sql_run($faqs33,"Adding FAQ's");
sql_run($faqs34,"Adding FAQ's");
sql_run($faqs35,"Adding FAQ's");
sql_run($faqs36,"Adding FAQ's");
sql_run($faqs37,"Adding FAQ's");
sql_run($faqs38,"Adding FAQ's");
sql_run($faqs39,"Adding FAQ's");
sql_run($faqs40,"Adding FAQ's");
sql_run($faqs41,"Adding FAQ's");
sql_run($faqs42,"Adding FAQ's");
sql_run($faqs43,"Adding FAQ's");
sql_run($faqs44,"Adding FAQ's");
sql_run($faqs45,"Adding FAQ's");
sql_run($faqs46,"Adding FAQ's");
sql_run($faqs47,"Adding FAQ's");
sql_run($faqs48,"Adding FAQ's");
sql_run($faqs49,"Adding FAQ's");
sql_run($faqs50,"Adding FAQ's");
sql_run($faqs51,"Adding FAQ's");
sql_run($faqs52,"Adding FAQ's");
sql_run($faqs53,"Adding FAQ's");
sql_run($faqs54,"Adding FAQ's");
sql_run($faqs55,"Adding FAQ's");
sql_run($faqs56,"Adding FAQ's");
sql_run("CREATE TABLE IF NOT EXISTS `".$db_prefix."_flashscores` (
  `ID` int(11) NOT NULL auto_increment,
  `game` int(11) NOT NULL default '0',
  `user` int(11) NOT NULL default '0',
  `level` int(11) NOT NULL default '0',
  `score` int(11) NOT NULL default '0',
  `date` datetime NOT NULL default '0000-00-00 00:00:00',
  PRIMARY KEY  (`ID`)
) ENGINE=MyISAM;
","Adding Flash Score Table");
sql_run("CREATE TABLE IF NOT EXISTS `".$db_prefix."_lottery_config` (
  `name` varchar(255) NOT NULL default '',
  `value` varchar(255) NOT NULL default '',
  PRIMARY KEY  (`name`)
) ENGINE=MyISAM;
","Adding Lottery Configs Table");
sql_run("INSERT IGNORE INTO`".$db_prefix."_lottery_config` VALUES ('ticket_amount', '100');","Adding Basic Lottery Configs You can adjust them later!");
sql_run("INSERT IGNORE INTO`".$db_prefix."_lottery_config` VALUES ('ticket_amount_type', 'MB');","Adding Basic Lottery Configs You can adjust them later!");
sql_run("INSERT IGNORE INTO`".$db_prefix."_lottery_config` VALUES ('user_tickets', '5');","Adding Basic Lottery Configs You can adjust them later!");
sql_run("INSERT IGNORE INTO`".$db_prefix."_lottery_config` VALUES ('class_allowed', 'premium');","Adding Basic Lottery Configs You can adjust them later!");
sql_run("INSERT IGNORE INTO`".$db_prefix."_lottery_config` VALUES ('total_winners', '1');","Adding Basic Lottery Configs You can adjust them later!");
sql_run("INSERT IGNORE INTO`".$db_prefix."_lottery_config` VALUES ('prize_fund', '0');","Adding Basic Lottery Configs You can adjust them later!");
sql_run("INSERT IGNORE INTO`".$db_prefix."_lottery_config` VALUES ('start_date', '2007-04-09 00:05:24');","Adding Basic Lottery Configs You can adjust them later!");
sql_run("INSERT IGNORE INTO`".$db_prefix."_lottery_config` VALUES ('end_date', '2007-05-05 00:05:24');","Adding Basic Lottery Configs You can adjust them later!");
sql_run("INSERT IGNORE INTO`".$db_prefix."_lottery_config` VALUES ('use_prize_fund', '0');","Adding Basic Lottery Configs You can adjust them later!");
sql_run("INSERT IGNORE INTO`".$db_prefix."_lottery_config` VALUES ('enable', '0');","Adding Basic Lottery Configs You can adjust them later!");
sql_run("INSERT IGNORE INTO`".$db_prefix."_lottery_config` VALUES ('lottery_winners', '1');","Adding Basic Lottery Configs You can adjust them later!");
sql_run("INSERT IGNORE INTO`".$db_prefix."_lottery_config` VALUES ('lottery_winners_amount', '524288000');","Adding Basic Lottery Configs You can adjust them later!");
sql_run("INSERT IGNORE INTO`".$db_prefix."_lottery_config` VALUES ('lottery_winners_time', '2007-01-06 05:00:18');
","Adding Basic Lottery Configs You can adjust them later!");
sql_run("CREATE TABLE IF NOT EXISTS `".$db_prefix."_offers` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `userid` int(10) unsigned NOT NULL default '0',
  `name` varchar(225) default NULL,
  `descr` text NOT NULL,
  `added` datetime NOT NULL default '0000-00-00 00:00:00',
  `for` int(10) unsigned NOT NULL default '0',
  `against` int(10) unsigned NOT NULL default '0',
  `category` int(11) NOT NULL default '0',
  `comments` int(11) NOT NULL default '0',
  `allowed` enum('allowed','pending','denied') NOT NULL default 'pending',
  `votes` tinyint(4) NOT NULL default '0',
  PRIMARY KEY  (`id`),
  KEY `userid` (`userid`)
) ENGINE=MyISAM;
","Adding Offers Table");
sql_run("CREATE TABLE IF NOT EXISTS `".$db_prefix."_offervotes` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `offerid` int(10) unsigned NOT NULL default '0',
  `userid` int(10) unsigned NOT NULL default '0',
  `vote` enum('for','against') NOT NULL default 'for',
  PRIMARY KEY  (`id`),
  KEY `userid` (`userid`)
) ENGINE=MyISAM;
","Adding Offers Vote table");
sql_run("CREATE TABLE IF NOT EXISTS `".$db_prefix."_offres_config` (
  `name` varchar(255) NOT NULL default '',
  `value` varchar(255) NOT NULL default '',
  PRIMARY KEY  (`name`)
) ENGINE=MyISAM;
","Adding Offers Config Table");
sql_run("INSERT IGNORE INTO`".$db_prefix."_offres_config` VALUES ('class_allowed', '0');","Adding Basic Offers Configs you can adjust them later!");
sql_run("INSERT IGNORE INTO`".$db_prefix."_offres_config` VALUES ('enable', '1');
","Adding Basic Offers Configs you can adjust them later!");
sql_run("CREATE TABLE IF NOT EXISTS `".$db_prefix."_pollanswers` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `pollid` int(10) unsigned NOT NULL default '0',
  `userid` int(10) unsigned NOT NULL default '0',
  `selection` tinyint(3) unsigned NOT NULL default '0',
  PRIMARY KEY  (`id`),
  KEY `pollid` (`pollid`),
  KEY `selection` (`selection`),
  KEY `userid` (`userid`)
) ENGINE=MyISAM;
","Adding Poll's Answers Table");
sql_run("CREATE TABLE IF NOT EXISTS `".$db_prefix."_polls` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `added` datetime NOT NULL default '0000-00-00 00:00:00',
  `question` varchar(255) NOT NULL default '',
  `option0` varchar(40) NOT NULL default '',
  `option1` varchar(40) NOT NULL default '',
  `option2` varchar(40) NOT NULL default '',
  `option3` varchar(40) NOT NULL default '',
  `option4` varchar(40) NOT NULL default '',
  `option5` varchar(40) NOT NULL default '',
  `option6` varchar(40) NOT NULL default '',
  `option7` varchar(40) NOT NULL default '',
  `option8` varchar(40) NOT NULL default '',
  `option9` varchar(40) NOT NULL default '',
  `sort` enum('yes','no') NOT NULL default 'yes',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM;
","Finally, updating version number!");
sql_run("INSERT IGNORE INTO`".$db_prefix."_polls` VALUES (1, '2007-07-30 15:14:34', 'Do you like the new modded version of phpMyBitTorrent V1.2.1', 'yes', 'no', 'I love it', 'hate it', 'could be better', 'what was going threw your head', '', '', '', '', 'yes');
","Adding First Poll");
sql_run("CREATE TABLE IF NOT EXISTS `".$db_prefix."_ratiowarn` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `userid` int(11) NOT NULL default '0',
  `warned` enum('yes','no') NOT NULL default 'no',
  `banned` enum('yes','no') NOT NULL default 'no',
  `ratiodate` datetime NOT NULL default '0000-00-00 00:00:00',
  `warntime` datetime NOT NULL default '0000-00-00 00:00:00',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM;
","Adding Ratio Watch Table");
sql_run("CREATE TABLE IF NOT EXISTS `".$db_prefix."_ratiowarn_config` (
  `name` varchar(255) NOT NULL default '',
  `value` varchar(255) NOT NULL default '',
  PRIMARY KEY  (`name`)
) ENGINE=MyISAM;
","Adding Ratio Configs.");
sql_run("INSERT IGNORE INTO`".$db_prefix."_ratiowarn_config` VALUES ('enable', 'false');","Adding Basic Ratio Configs you can adjust them later!");
sql_run("INSERT IGNORE INTO`".$db_prefix."_ratiowarn_config` VALUES ('ratio_mini', '.5');","Adding Basic Ratio Configs you can adjust them later!");
sql_run("INSERT IGNORE INTO`".$db_prefix."_ratiowarn_config` VALUES ('ratio_warn', '5');","Adding Basic Ratio Configs you can adjust them later!");
sql_run("INSERT IGNORE INTO`".$db_prefix."_ratiowarn_config` VALUES ('ratio_ban', '7');
","Adding Basic Ratio Configs you can adjust them later!");
sql_run("CREATE TABLE IF NOT EXISTS `".$db_prefix."_requests` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `userid` int(10) unsigned NOT NULL default '0',
  `request` varchar(225) default NULL,
  `descr` text NOT NULL,
  `added` datetime NOT NULL default '0000-00-00 00:00:00',
  `hits` int(10) unsigned NOT NULL default '0',
  `cat` int(10) unsigned NOT NULL default '0',
  `filled` varchar(75) NOT NULL default '',
  `filledby` int(10) unsigned NOT NULL default '0',
  PRIMARY KEY  (`id`),
  KEY `userid` (`userid`)
) ENGINE=MyISAM;
","Adding Requists Table!");
sql_run("CREATE TABLE IF NOT EXISTS `".$db_prefix."_requist_config` (
  `name` varchar(255) NOT NULL default '',
  `value` varchar(255) NOT NULL default '',
  PRIMARY KEY  (`name`)
) ENGINE=MyISAM;
","Adding Requist Coigs Table!");
sql_run("INSERT IGNORE INTO`".$db_prefix."_requist_config` VALUES ('class_allowed', '0');","Adding Basic Requists Configs you can adjust them later!");
sql_run("INSERT IGNORE INTO`".$db_prefix."_requist_config` VALUES ('enable', '1');
","Adding Basic Requists Configs you can adjust them later!");
sql_run("CREATE TABLE IF NOT EXISTS `".$db_prefix."_snatched` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `torrent` int(10) unsigned NOT NULL default '0',
  `torrentid` int(10) unsigned NOT NULL default '0',
  `userid` int(10) unsigned NOT NULL default '0',
  `ip` bigint(20) unsigned NOT NULL default '0',
  `".$db_prefix."_name` varchar(255) NOT NULL default '',
  `".$db_prefix."_category` int(10) unsigned NOT NULL default '0',
  `port` smallint(5) unsigned NOT NULL default '0',
  `uploaded` bigint(20) unsigned NOT NULL default '0',
  `downloaded` bigint(20) unsigned NOT NULL default '0',
  `to_go` bigint(20) unsigned NOT NULL default '0',
  `speedup` bigint(20) unsigned NOT NULL default '0',
  `speeddown` bigint(20) unsigned NOT NULL default '0',
  `seeder` enum('yes','no') NOT NULL default 'no',
  `last_action` datetime NOT NULL default '0000-00-00 00:00:00',
  `startdat` datetime NOT NULL default '0000-00-00 00:00:00',
  `completedat` datetime NOT NULL default '0000-00-00 00:00:00',
  `connectable` enum('yes','no') NOT NULL default 'yes',
  `agent` varchar(60) NOT NULL default '',
  `finished` enum('yes','no') NOT NULL default 'no',
  PRIMARY KEY  (`id`),
  UNIQUE KEY `torrentid_3` (`torrentid`,`userid`),
  KEY `finished` (`finished`,`torrentid`),
  KEY `torrentid` (`userid`),
  KEY `torrentid_2` (`torrentid`),
  KEY `userid` (`userid`,`torrentid`)
) ENGINE=MyISAM;
","Adding Snatched table!");
sql_run("CREATE TABLE IF NOT EXISTS `".$db_prefix."_tickets` (
  `id` int(4) NOT NULL auto_increment,
  `user` int(11) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM;
","Adding Lottery Ticket table");
sql_run("CREATE TABLE IF NOT EXISTS `".$db_prefix."_blackjack` (
  `userid` int(11) NOT NULL default '0',
  `points` int(11) NOT NULL default '0',
  `status` enum('playing','waiting') NOT NULL default 'playing',
  `cards` text NOT NULL,
  `date` datetime NOT NULL default '0000-00-00 00:00:00',
  PRIMARY KEY  (`userid`)
) ENGINE=MyISAM;
","Adding Black Jack table");
sql_run("CREATE TABLE IF NOT EXISTS `".$db_prefix."_avps` (
  `arg` varchar(20) NOT NULL default '',
  `value_s` text NOT NULL,
  `value_i` int(11) NOT NULL default '0',
  `value_u` int(10) unsigned NOT NULL default '0',
  PRIMARY KEY  (`arg`)
) ENGINE=MyISAM;
","Adding timed clean table");
sql_run("CREATE TABLE IF NOT EXISTS `".$db_prefix."_admin_forum` (
  `prefix` varchar(60) NOT NULL default '',
  `cookie_name` varchar(60) NOT NULL default '',
  `cookie_domain` varchar(60) NOT NULL default '',
  `cookie_path` varchar(60) NOT NULL default '',
  `cookie_time` varchar(60) NOT NULL default '0',
  `base_folder` varchar(60) NOT NULL default '',
  `forum_share` enum('true','false') NOT NULL default 'true',
  `auto_post` enum('true','false') NOT NULL default 'false',
  `auto_post_forum` varchar(60) NOT NULL default '0'
) ENGINE=MyISAM;
","Adding Furum configs table");
sql_run("INSERT IGNORE INTO`".$db_prefix."_admin_forum` VALUES ('phpbb', 'phpbb3_46vqs', 'www.yoursite.net', '/', '3', 'phpBB3', 'true', 'true', '2');","Adding basic forum settings");
sql_run("CREATE TABLE IF NOT EXISTS `".$db_prefix."_addedrequests` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `requestid` int(10) unsigned NOT NULL default '0',
  `userid` int(10) unsigned NOT NULL default '0',
  PRIMARY KEY  (`id`),
  KEY `pollid` (`id`),
  KEY `userid` (`userid`)
) ENGINE=MyISAM;
","Adding Requist table.");
$sql="SELECT *
FROM `".$db_prefix."_users`;"; 
$res = $db->sql_query($sql);
$row = $db->sql_fetchrow($res);
if(!$row["modcomment"])sql_run("ALTER TABLE  `".$db_prefix."_users`  ADD  `modcomment` varchar(225) NOT NULL default ''","Adding new rows to User table for Modd comments, warning system, invites system, users country flag, seedbox, and seed bonus.");
if(!$row["warned"])sql_run("ALTER TABLE `".$db_prefix."_users` ADD  `warned` int(1) unsigned NOT NULL default '0'","Adding new rows to User table for Modd comments, warning system, invites system, users country flag, seedbox, and seed bonus.");
if(!$row["warn_kapta"])sql_run("ALTER TABLE `".$db_prefix."_users`  ADD  `warn_kapta` int(11) NOT NULL default '0'","Adding new rows to User table for Modd comments, warning system, invites system, users country flag, seedbox, and seed bonus.");
if(!$row["warn_hossz"])sql_run("ALTER TABLE `".$db_prefix."_users`  ADD  `warn_hossz` int(11) NOT NULL default '0'","Adding new rows to User table for Modd comments, warning system, invites system, users country flag, seedbox, and seed bonus.");
if(!$row["invited_by"])sql_run("ALTER TABLE `".$db_prefix."_users`  ADD  `invited_by` int(10) NOT NULL default '0'","Adding new rows to User table for Modd comments, warning system, invites system, users country flag, seedbox, and seed bonus.");
if(!$row["invitees"])sql_run("ALTER TABLE `".$db_prefix."_users`  ADD  `invitees` varchar(100) NOT NULL default ''","Adding new rows to User table for Modd comments, warning system, invites system, users country flag, seedbox, and seed bonus.");
if(!$row["invites"])sql_run("ALTER TABLE `".$db_prefix."_users`  ADD  `invites` smallint(5) NOT NULL default '0'","Adding new rows to User table for Modd comments, warning system, invites system, users country flag, seedbox, and seed bonus.");
if(!$row["invitedate"])sql_run("ALTER TABLE `".$db_prefix."_users`  ADD  `invitedate` datetime NOT NULL default '0000-00-00 00:00:00'","Adding new rows to User table for Modd comments, warning system, invites system, users country flag, seedbox, and seed bonus.");
if(!$row["country"])sql_run("ALTER TABLE `".$db_prefix."_users`  ADD  `country` int(10) NOT NULL default '0'","Adding new rows to User table for Modd comments, warning system, invites system, users country flag, seedbox, and seed bonus.");
if(!$row["seedbonus"])sql_run("ALTER TABLE `".$db_prefix."_users`  ADD  `seedbonus` decimal(10,1) NOT NULL default '0.0'","Adding new rows to User table for Modd comments, warning system, invites system, users country flag, seedbox, and seed bonus.");
if(!$row["seedbox"])sql_run("ALTER TABLE `".$db_prefix."_users`  ADD  `seedbox` int(10) unsigned NOT NULL default '0';","Adding new rows to User table for Modd comments, warning system, invites system, users country flag, seedbox, and seed bonus.");
$sql1="SELECT *
FROM `".$db_prefix."_config`;"; 
$res1 = $db->sql_query($sql1);
$row1 = $db->sql_fetchrow($res1);
if(!$row1["invites_open"])sql_run("ALTER TABLE `".$db_prefix."_config`  ADD `invites_open` enum('true','false') NOT NULL default 'false';","Adding new rows to Config table for invites  ");
if(!$row1["invite_only"])sql_run("ALTER TABLE `".$db_prefix."_config`  ADD `invite_only` enum('true','false') NOT NULL default 'false';","Adding new rows to Config table for invites only ");
if(!$row1["max_members"])sql_run("ALTER TABLE `".$db_prefix."_config`  ADD `max_members` int(10) unsigned NOT NULL default '0';","Adding new rows to Config table for Max users ");
if(!$row1["auto_clean"])sql_run("ALTER TABLE `".$db_prefix."_config`  ADD `auto_clean` int(10) unsigned NOT NULL default '0' ;","Adding new rows to Config table for Auto timer for bonus system ");
if(!$row1["free_dl"])sql_run("ALTER TABLE `".$db_prefix."_config`  ADD  `free_dl` enum('true','false') NOT NULL default 'false';","Adding new rows to Config table for Site Wide Free Downloads ");
if(!$row1["GIGSA"])sql_run("ALTER TABLE `".$db_prefix."_config`  ADD  `GIGSA` int(10) NOT NULL default '0';","Adding new rows to Config table for Wait system ");
if(!$row1["RATIOA"])sql_run("ALTER TABLE `".$db_prefix."_config`  ADD  `RATIOA` decimal(10,2) NOT NULL default '0.00';","Adding new rows to Config table for Wait system ");
if(!$row1["WAITA"])sql_run("ALTER TABLE `".$db_prefix."_config`  ADD  `WAITA` int(10) NOT NULL default '0';","Adding new rows to Config table for Wait system ");
if(!$row1["GIGSB"])sql_run("ALTER TABLE `".$db_prefix."_config`  ADD  `GIGSB` int(10) NOT NULL default '0';","Adding new rows to Config table for Wait system ");
if(!$row1["RATIOB"])sql_run("ALTER TABLE `".$db_prefix."_config`  ADD  `RATIOB` decimal(10,2) NOT NULL default '0.00';","Adding new rows to Config table for Wait system ");
if(!$row1["WAITB"])sql_run("ALTER TABLE `".$db_prefix."_config`  ADD  `WAITB` int(10) NOT NULL default '0';","Adding new rows to Config table for Wait system ");
if(!$row1["GIGSC"])sql_run("ALTER TABLE `".$db_prefix."_config`  ADD  `GIGSC` int(10) NOT NULL default '0';","Adding new rows to Config table for Wait system ");
if(!$row1["RATIOC"])sql_run("ALTER TABLE `".$db_prefix."_config`  ADD  `RATIOC` decimal(10,2) NOT NULL default '0.00';","Adding new rows to Config table for Wait system ");
if(!$row1["WAITC"])sql_run("ALTER TABLE `".$db_prefix."_config`  ADD  `WAITC` int(10) NOT NULL default '0';","Adding new rows to Config table for Wait system ");
if(!$row1["GIGSD"])sql_run("ALTER TABLE `".$db_prefix."_config`  ADD  `GIGSD` int(10) NOT NULL default '0';","Adding new rows to Config table for Wait system ");
if(!$row1["RATIOD"])sql_run("ALTER TABLE `".$db_prefix."_config`  ADD  `RATIOD` decimal(10,2) NOT NULL default '0.00';","Adding new rows to Config table for Wait system ");
if(!$row1["WAITD"])sql_run("ALTER TABLE `".$db_prefix."_config`  ADD  `WAITD` int(10) NOT NULL default '0';","Adding new rows to Config table for Wait system ");
if(!$row1["wait_time"])sql_run("ALTER TABLE `".$db_prefix."_config`  ADD  `wait_time` enum('true','false') NOT NULL default 'false';","Adding new rows to Config table for Wait system ");
if(!$row1["addprivate"])sql_run("ALTER TABLE `".$db_prefix."_config`  ADD  `addprivate` enum('true','false') NOT NULL default 'false';","Adding new rows to Config table for Wait system ");
  $sql2="SELECT *
FROM `".$db_prefix."_comments`;"; 
$res2 = $db->sql_query($sql2);
$row2 = $db->sql_fetchrow($res2);
if(!$row2["addprivate"])sql_run("ALTER TABLE `".$db_prefix."_comments` ADD `ori_text` TEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL ;","Adding new rows to Comments for news and offers.");
if(!$row2["addprivate"])sql_run("ALTER TABLE `".$db_prefix."_comments` ADD `news` INT( 10 ) NOT NULL ;","Adding new rows to Comments for news and offers.");
if(!$row2["addprivate"])sql_run("ALTER TABLE `".$db_prefix."_comments` ADD `nzb` INT( 10 ) NOT NULL ;","Adding new rows to Comments for news and offers.");
if(!$row2["addprivate"])sql_run("ALTER TABLE `".$db_prefix."_comments` ADD `offer` INT( 11 ) NOT NULL ;","Adding new rows to Comments for news and offers.");
if(!$row2["addprivate"])sql_run("ALTER TABLE `".$db_prefix."_comments` ADD `editedat` DATETIME NOT NULL ;","Adding new rows to Comments for news and offers.");
if(!$row2["addprivate"])sql_run("ALTER TABLE `".$db_prefix."_comments` ADD `editedby` INT( 10 ) UNSIGNED NOT NULL ;","Adding new rows to Comments for news and offers.");
  $sql3="SELECT *
FROM `".$db_prefix."_torrents`;"; 
$res3 = $db->sql_query($sql3);
$row3 = $db->sql_fetchrow($res3);
if(!$row3["nuked"])sql_run("ALTER  TABLE `".$db_prefix."_torrents` ADD `nuked` ENUM( 'yes', 'no' ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT 'no';","Adding new rows to Torrent table for Nuked. ");
if(!$row3["ratiobuild"])sql_run("ALTER TABLE `".$db_prefix."_torrents` ADD `ratiobuild` ENUM( 'yes', 'no' ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT 'no';","Adding new rows to Torrent table for  Nuked Reason . ");
if(!$row3["nukereason"])sql_run("ALTER TABLE `".$db_prefix."_torrents` ADD `nukereason` VARCHAR( 225 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL ;","Adding new rows to Torrent table for  Ratio Build. ");
sql_run("UPDATE ".$db_prefix."_config SET version = '1.2.1';","Finally, updating version number!");
$db->sql_query("COMMIT;");

echo "<h3>Upgrade complete! You have Just Upgraded To the New Modded version of phpMyBitTorrent 1.2.1</h3>";
?>
