Esempio n. 1
0
 public function filter($value)
 {
     $values = parent::filter($value);
     //array expected
     foreach ($values as $idx => $val) {
         try {
             $values[$idx] = $this->strFilter->filter($val);
             //string expected
             $values[$idx] = $this->inFilter->filter($values[$idx]);
             //among valid values
         } catch (FilterException $ex) {
             throw new FilterException('Array of strings expected');
         }
     }
     return $values;
 }
Esempio n. 2
0
 private static function defineLang()
 {
     $cookieLang = in::getCookie('lang');
     $getLang = in::getGet('lang');
     if (!empty($getLang)) {
         self::$lang = in::getGet('lang');
         out::setCookie('lang', self::$lang, time() + 60 * 60);
     } elseif (!empty($cookieLang)) {
         self::$lang = in::getCookie('lang');
     } else {
         self::$lang = self::defaultLang;
     }
     if (!@(include_once 'includes/langs/' . self::$lang . '.php')) {
         //throw new Exception('includes/langs/'.self::$lang.'.php doesnt exist.');
         @(include_once 'includes/langs/' . self::defaultLang . '.php');
     }
     if (LANGC_DEBUGCHARSET) {
         if (LANGC_LANGCHARSET == 'iso-8859-1' && LANGC_CHARSET == 'utf-8') {
             $sort = null;
             foreach ($STRING as $key => $value) {
                 $sort[$key] = utf8_encode($STRING[$key]);
             }
             $STRING = $sort;
         } elseif (LANGC_LANGCHARSET == 'utf-8' && LANGC_CHARSET == 'iso-8859-1') {
             $sort = null;
             foreach ($STRING as $key => $value) {
                 $sort[$key] = utf8_decode($STRING[$key]);
             }
             $STRING = $sort;
         }
     }
     self::$strings = $STRING;
 }
Esempio n. 3
0
 public static function getStatus()
 {
     if (in::getCookie('session') && in::getCookie('v')) {
         $bdd = new mysql();
         $Qsession = $bdd->prepare("SELECT session,password_tmp,last_here FROM user WHERE session=:session");
         $Qsession->bindParam(':session', in::getCookie('session'), PDO::PARAM_STR);
         $Qsession->execute();
         $session = $Qsession->fetch();
         $Qsession->closeCursor();
         $tmpPassword = $session['password_tmp'];
         $lastHere = $session['last_here'];
         $session = $session['session'];
         if (in::getCookie('session') == $session && md5(in::getCookie('v')) == $tmpPassword) {
             if ($lastHere >= time() - 60 * 30) {
                 return true;
             } else {
                 self::getLogout();
                 return false;
             }
         } else {
             self::getLogout();
             return false;
         }
     } else {
         return false;
     }
 }
Esempio n. 4
0
 function process()
 {
     global $CONF, $DB, $FORM, $LNG, $TMPL;
     $TMPL['url'] = $DB->escape($FORM['url'], 1);
     $TMPL['title'] = $DB->escape($FORM['title'], 1);
     $TMPL['description'] = $DB->escape($FORM['description'], 1);
     $TMPL['category'] = $DB->escape($FORM['category'], 1);
     $TMPL['banner_url'] = $DB->escape($FORM['banner_url'], 1);
     $TMPL['email'] = $DB->escape($FORM['email'], 1);
     $TMPL['title'] = $this->bad_words($TMPL['title']);
     $TMPL['description'] = $this->bad_words($TMPL['description']);
     if ($this->check_ban('edit')) {
         if ($this->check_input('edit')) {
             if ($FORM['password']) {
                 $password = md5($FORM['password']);
                 $password_sql = ", password = '******'";
             } else {
                 $password_sql = '';
             }
             require_once "{$CONF['path']}/sources/in.php";
             $short_url = in::short_url($TMPL['url']);
             // Update everything but URL and title
             $DB->query("UPDATE {$CONF['sql_prefix']}_sites SET short_url = '{$short_url}', description = '{$TMPL['description']}', category = '{$TMPL['category']}', banner_url = '{$TMPL['banner_url']}', email = '{$TMPL['email']}'{$password_sql} WHERE username = '******'username']}'", __FILE__, __LINE__);
             // Update URL and title; send to admin for approval if necessary
             $TMPL['edit_delay'] = '';
             if ($CONF['active_default']) {
                 $DB->query("DELETE FROM {$CONF['sql_prefix']}_sites_edited WHERE username = '******'username']}'", __FILE__, __LINE__);
                 $DB->query("UPDATE {$CONF['sql_prefix']}_sites SET url = '{$TMPL['url']}', title = '{$TMPL['title']}' WHERE username = '******'username']}'", __FILE__, __LINE__);
             } else {
                 list($url, $title) = $DB->fetch("SELECT url, title FROM {$CONF['sql_prefix']}_sites WHERE username = '******'username']}'", __FILE__, __LINE__);
                 if ($url != $TMPL['url'] || $title != $TMPL['title']) {
                     $DB->query("DELETE FROM {$CONF['sql_prefix']}_sites_edited WHERE username = '******'username']}'", __FILE__, __LINE__);
                     $DB->query("INSERT INTO {$CONF['sql_prefix']}_sites_edited (username, url, title) VALUES ('{$TMPL['username']}', '{$TMPL['url']}', '{$TMPL['title']}')", __FILE__, __LINE__);
                     $TMPL['edit_delay'] = $LNG['edit_delay'];
                 }
             }
             $TMPL['user_cp_content'] = $this->do_skin('edit_finish');
         } else {
             $this->form();
         }
     } else {
         $this->form();
     }
 }
Esempio n. 5
0
 function process()
 {
     global $CONF, $DB, $FORM, $LNG, $TMPL;
     $TMPL['url'] = $DB->escape($FORM['url']);
     $TMPL['title'] = $DB->escape($FORM['title']);
     $TMPL['description'] = $DB->escape($FORM['description']);
     $TMPL['category'] = $DB->escape($FORM['category']);
     $TMPL['banner_url'] = $DB->escape($FORM['banner_url']);
     $TMPL['email'] = $DB->escape($FORM['email']);
     $TMPL['active'] = intval($FORM['active']);
     if ($this->check_input('edit')) {
         if ($FORM['password']) {
             $password = md5($FORM['password']);
             $password_sql = ", password = '******'";
         } else {
             $password_sql = '';
         }
         require_once "{$CONF['path']}/sources/in.php";
         $short_url = in::short_url($TMPL['url']);
         $DB->query("UPDATE {$CONF['sql_prefix']}_sites SET url = '{$TMPL['url']}', short_url = '{$short_url}', title = '{$TMPL['title']}', description = '{$TMPL['description']}', category = '{$TMPL['category']}', banner_url = '{$TMPL['banner_url']}', email = '{$TMPL['email']}', active = {$TMPL['active']}{$password_sql} WHERE username = '******'username']}'", __FILE__, __LINE__);
         $TMPL['admin_content'] = $LNG['a_edit_edited'];
     } else {
         $this->form();
     }
 }
Esempio n. 6
0
 function process()
 {
     global $CONF, $DB, $FORM, $LNG, $TMPL;
     $TMPL['username'] = $DB->escape($FORM['u'], 1);
     $TMPL['url'] = $DB->escape($FORM['url'], 1);
     $TMPL['title'] = $DB->escape($FORM['title'], 1);
     $FORM['description'] = str_replace(array("\r\n", "\n", "\r"), ' ', $FORM['description']);
     $TMPL['description'] = $DB->escape($FORM['description'], 1);
     $TMPL['category'] = $DB->escape($FORM['category'], 1);
     $TMPL['banner_url'] = $DB->escape($FORM['banner_url'], 1);
     $TMPL['email'] = $DB->escape($FORM['email'], 1);
     $TMPL['title'] = $this->bad_words($TMPL['title']);
     $TMPL['description'] = $this->bad_words($TMPL['description']);
     if ($this->check_ban('join')) {
         if ($this->check_input('join')) {
             $password = md5($FORM['password']);
             require_once "{$CONF['path']}/sources/in.php";
             $short_url = in::short_url($TMPL['url']);
             $join_date = date('Y-m-d', time() + 3600 * $CONF['time_offset']);
             $user_ip = $DB->escape($_SERVER['REMOTE_ADDR'], 1);
             $DB->query("INSERT INTO {$CONF['sql_prefix']}_sites (username, password, url, short_url, title, description, category, banner_url, email, join_date, active, openid, user_ip)\n                  VALUES ('{$TMPL['username']}', '{$password}', '{$TMPL['url']}', '{$short_url}', '{$TMPL['title']}', '{$TMPL['description']}', '{$TMPL['category']}', '{$TMPL['banner_url']}', '{$TMPL['email']}', '{$join_date}', {$CONF['active_default']}, 0, '{$user_ip}')", __FILE__, __LINE__);
             $DB->query("INSERT INTO {$CONF['sql_prefix']}_stats (username) VALUES ('{$TMPL['username']}')", __FILE__, __LINE__);
             if ($CONF['google_friendly_links']) {
                 $TMPL['verbose_link'] = "";
             } else {
                 $TMPL['verbose_link'] = "index.php?a=in&u={$TMPL['username']}";
             }
             $TMPL['link_code'] = $this->do_skin('link_code');
             $LNG['join_welcome'] = sprintf($LNG['join_welcome'], $TMPL['list_name']);
             if ($CONF['email_admin_on_join']) {
                 $join_email_admin = new skin('join_email_admin');
                 $join_email_admin->send_email($CONF['your_email']);
             }
             if ($CONF['active_default']) {
                 $join_email = new skin('join_email');
                 $join_email->send_email($TMPL['email']);
                 $TMPL['content'] = $this->do_skin('join_finish');
             } else {
                 $TMPL['content'] = $this->do_skin('join_finish_approve');
             }
         } else {
             $this->form();
         }
     } else {
         $this->form();
     }
 }
                $DB->query("INSERT INTO {$CONF['sql_prefix']}_categories (category) VALUES ('{$category}')", __FILE__, __LINE__);
            }
            $DB->query("CREATE TABLE `{$CONF['sql_prefix']}_ip_log` (\n                    `ip_address` varchar(78) default '' NOT NULL,\n                    `username` varchar(255) default '' NOT NULL,\n                    `unq_pv` tinyint(1) default 0,\n                    `unq_in` tinyint(1) default 0,\n                    `unq_out` tinyint(1) default 0,\n                    `rate` tinyint(1) default 0,\n                    PRIMARY KEY  (`ip_address`,`username`)\n                  )", __FILE__, __LINE__);
            $DB->query("ALTER TABLE `{$CONF['sql_prefix']}_reviews`\n                  CHANGE `id3` `username` varchar(255),\n                  CHANGE `review_id` `id` bigint NOT NULL,\n                  CHANGE `review_date` `date` datetime,\n                  ADD `active` tinyint(1) default 1", __FILE__, __LINE__);
            $DB->query("DROP TABLE {$CONF['sql_prefix']}_sessions", __FILE__, __LINE__);
            $DB->query("CREATE TABLE `{$CONF['sql_prefix']}_sessions` (\n                    `type` varchar(7) default '',\n                    `sid` varchar(32) default '' NOT NULL,\n                    `time` int(10) unsigned default 0,\n                    `data` varchar(255) default '',\n                    PRIMARY KEY  (`sid`)\n                  )", __FILE__, __LINE__);
            $DB->query("CREATE TABLE `{$CONF['sql_prefix']}_sites` (\n                    `username` varchar(255) default '' NOT NULL,\n                    `password` varchar(32) default '',\n                    `url` varchar(255) default '',\n                    `short_url` varchar(255) default '',\n                    `title` varchar(255) default '',\n                    `description` varchar(255) default '',\n                    `category` varchar(255) default '',\n                    `banner_url` varchar(255) default '',\n                    `email` varchar(255) default '',\n                    `join_date` date default '0000-00-00',\n                    `active` tinyint(1) default 1,\n                    `openid` tinyint(1) default 0,\n                    `user_ip` varchar(255) default '',\n                    PRIMARY KEY  (`username`)\n                  )", __FILE__, __LINE__);
            $DB->query("CREATE TABLE `{$CONF['sql_prefix']}_sites_edited` (\n                    `username` varchar(255) default '' NOT NULL,\n                    `url` varchar(255) default '',\n                    `title` varchar(255) default '',\n                    PRIMARY KEY  (`username`)\n                  );", __FILE__, __LINE__);
            $DB->query("DROP TABLE {$CONF['sql_prefix']}_stats", __FILE__, __LINE__);
            $DB->query("CREATE TABLE `{$CONF['sql_prefix']}_stats` (\n                    `username` varchar(255) default '' NOT NULL,\n                    `rank_cache` bigint(20) unsigned default 0,\n                    `rank_cache_time` int(10) unsigned default 0,\n                    `old_rank` bigint(20) unsigned default 0,\n                    `days_inactive` int(10) unsigned default 0,\n                    `total_rating` bigint(20) unsigned default 0,\n                    `num_ratings` bigint(20) unsigned default 0,\n                    `unq_pv_overall` bigint(20) unsigned default 0,\n                    `tot_pv_overall` bigint(20) unsigned default 0,\n                    `unq_in_overall` bigint(20) unsigned default 0,\n                    `tot_in_overall` bigint(20) unsigned default 0,\n                    `unq_out_overall` bigint(20) unsigned default 0,\n                    `tot_out_overall` bigint(20) unsigned default 0,\n                    `unq_pv_0_daily` bigint(20) unsigned default 0,\n                    `unq_pv_1_daily` bigint(20) unsigned default 0,\n                    `unq_pv_2_daily` bigint(20) unsigned default 0,\n                    `unq_pv_3_daily` bigint(20) unsigned default 0,\n                    `unq_pv_4_daily` bigint(20) unsigned default 0,\n                    `unq_pv_5_daily` bigint(20) unsigned default 0,\n                    `unq_pv_6_daily` bigint(20) unsigned default 0,\n                    `unq_pv_7_daily` bigint(20) unsigned default 0,\n                    `unq_pv_8_daily` bigint(20) unsigned default 0,\n                    `unq_pv_9_daily` bigint(20) unsigned default 0,\n                    `unq_pv_max_daily` bigint(20) unsigned default 0,\n                    `tot_pv_0_daily` bigint(20) unsigned default 0,\n                    `tot_pv_1_daily` bigint(20) unsigned default 0,\n                    `tot_pv_2_daily` bigint(20) unsigned default 0,\n                    `tot_pv_3_daily` bigint(20) unsigned default 0,\n                    `tot_pv_4_daily` bigint(20) unsigned default 0,\n                    `tot_pv_5_daily` bigint(20) unsigned default 0,\n                    `tot_pv_6_daily` bigint(20) unsigned default 0,\n                    `tot_pv_7_daily` bigint(20) unsigned default 0,\n                    `tot_pv_8_daily` bigint(20) unsigned default 0,\n                    `tot_pv_9_daily` bigint(20) unsigned default 0,\n                    `tot_pv_max_daily` bigint(20) unsigned default 0,\n                    `unq_in_0_daily` bigint(20) unsigned default 0,\n                    `unq_in_1_daily` bigint(20) unsigned default 0,\n                    `unq_in_2_daily` bigint(20) unsigned default 0,\n                    `unq_in_3_daily` bigint(20) unsigned default 0,\n                    `unq_in_4_daily` bigint(20) unsigned default 0,\n                    `unq_in_5_daily` bigint(20) unsigned default 0,\n                    `unq_in_6_daily` bigint(20) unsigned default 0,\n                    `unq_in_7_daily` bigint(20) unsigned default 0,\n                    `unq_in_8_daily` bigint(20) unsigned default 0,\n                    `unq_in_9_daily` bigint(20) unsigned default 0,\n                    `unq_in_max_daily` bigint(20) unsigned default 0,\n                    `tot_in_0_daily` bigint(20) unsigned default 0,\n                    `tot_in_1_daily` bigint(20) unsigned default 0,\n                    `tot_in_2_daily` bigint(20) unsigned default 0,\n                    `tot_in_3_daily` bigint(20) unsigned default 0,\n                    `tot_in_4_daily` bigint(20) unsigned default 0,\n                    `tot_in_5_daily` bigint(20) unsigned default 0,\n                    `tot_in_6_daily` bigint(20) unsigned default 0,\n                    `tot_in_7_daily` bigint(20) unsigned default 0,\n                    `tot_in_8_daily` bigint(20) unsigned default 0,\n                    `tot_in_9_daily` bigint(20) unsigned default 0,\n                    `tot_in_max_daily` bigint(20) unsigned default 0,\n                    `unq_out_0_daily` bigint(20) unsigned default 0,\n                    `unq_out_1_daily` bigint(20) unsigned default 0,\n                    `unq_out_2_daily` bigint(20) unsigned default 0,\n                    `unq_out_3_daily` bigint(20) unsigned default 0,\n                    `unq_out_4_daily` bigint(20) unsigned default 0,\n                    `unq_out_5_daily` bigint(20) unsigned default 0,\n                    `unq_out_6_daily` bigint(20) unsigned default 0,\n                    `unq_out_7_daily` bigint(20) unsigned default 0,\n                    `unq_out_8_daily` bigint(20) unsigned default 0,\n                    `unq_out_9_daily` bigint(20) unsigned default 0,\n                    `unq_out_max_daily` bigint(20) unsigned default 0,\n                    `tot_out_0_daily` bigint(20) unsigned default 0,\n                    `tot_out_1_daily` bigint(20) unsigned default 0,\n                    `tot_out_2_daily` bigint(20) unsigned default 0,\n                    `tot_out_3_daily` bigint(20) unsigned default 0,\n                    `tot_out_4_daily` bigint(20) unsigned default 0,\n                    `tot_out_5_daily` bigint(20) unsigned default 0,\n                    `tot_out_6_daily` bigint(20) unsigned default 0,\n                    `tot_out_7_daily` bigint(20) unsigned default 0,\n                    `tot_out_8_daily` bigint(20) unsigned default 0,\n                    `tot_out_9_daily` bigint(20) unsigned default 0,\n                    `tot_out_max_daily` bigint(20) unsigned default 0,\n                    `unq_pv_0_weekly` bigint(20) unsigned default 0,\n                    `unq_pv_1_weekly` bigint(20) unsigned default 0,\n                    `unq_pv_2_weekly` bigint(20) unsigned default 0,\n                    `unq_pv_3_weekly` bigint(20) unsigned default 0,\n                    `unq_pv_4_weekly` bigint(20) unsigned default 0,\n                    `unq_pv_5_weekly` bigint(20) unsigned default 0,\n                    `unq_pv_6_weekly` bigint(20) unsigned default 0,\n                    `unq_pv_7_weekly` bigint(20) unsigned default 0,\n                    `unq_pv_8_weekly` bigint(20) unsigned default 0,\n                    `unq_pv_9_weekly` bigint(20) unsigned default 0,\n                    `unq_pv_max_weekly` bigint(20) unsigned default 0,\n                    `tot_pv_0_weekly` bigint(20) unsigned default 0,\n                    `tot_pv_1_weekly` bigint(20) unsigned default 0,\n                    `tot_pv_2_weekly` bigint(20) unsigned default 0,\n                    `tot_pv_3_weekly` bigint(20) unsigned default 0,\n                    `tot_pv_4_weekly` bigint(20) unsigned default 0,\n                    `tot_pv_5_weekly` bigint(20) unsigned default 0,\n                    `tot_pv_6_weekly` bigint(20) unsigned default 0,\n                    `tot_pv_7_weekly` bigint(20) unsigned default 0,\n                    `tot_pv_8_weekly` bigint(20) unsigned default 0,\n                    `tot_pv_9_weekly` bigint(20) unsigned default 0,\n                    `tot_pv_max_weekly` bigint(20) unsigned default 0,\n                    `unq_in_0_weekly` bigint(20) unsigned default 0,\n                    `unq_in_1_weekly` bigint(20) unsigned default 0,\n                    `unq_in_2_weekly` bigint(20) unsigned default 0,\n                    `unq_in_3_weekly` bigint(20) unsigned default 0,\n                    `unq_in_4_weekly` bigint(20) unsigned default 0,\n                    `unq_in_5_weekly` bigint(20) unsigned default 0,\n                    `unq_in_6_weekly` bigint(20) unsigned default 0,\n                    `unq_in_7_weekly` bigint(20) unsigned default 0,\n                    `unq_in_8_weekly` bigint(20) unsigned default 0,\n                    `unq_in_9_weekly` bigint(20) unsigned default 0,\n                    `unq_in_max_weekly` bigint(20) unsigned default 0,\n                    `tot_in_0_weekly` bigint(20) unsigned default 0,\n                    `tot_in_1_weekly` bigint(20) unsigned default 0,\n                    `tot_in_2_weekly` bigint(20) unsigned default 0,\n                    `tot_in_3_weekly` bigint(20) unsigned default 0,\n                    `tot_in_4_weekly` bigint(20) unsigned default 0,\n                    `tot_in_5_weekly` bigint(20) unsigned default 0,\n                    `tot_in_6_weekly` bigint(20) unsigned default 0,\n                    `tot_in_7_weekly` bigint(20) unsigned default 0,\n                    `tot_in_8_weekly` bigint(20) unsigned default 0,\n                    `tot_in_9_weekly` bigint(20) unsigned default 0,\n                    `tot_in_max_weekly` bigint(20) unsigned default 0,\n                    `unq_out_0_weekly` bigint(20) unsigned default 0,\n                    `unq_out_1_weekly` bigint(20) unsigned default 0,\n                    `unq_out_2_weekly` bigint(20) unsigned default 0,\n                    `unq_out_3_weekly` bigint(20) unsigned default 0,\n                    `unq_out_4_weekly` bigint(20) unsigned default 0,\n                    `unq_out_5_weekly` bigint(20) unsigned default 0,\n                    `unq_out_6_weekly` bigint(20) unsigned default 0,\n                    `unq_out_7_weekly` bigint(20) unsigned default 0,\n                    `unq_out_8_weekly` bigint(20) unsigned default 0,\n                    `unq_out_9_weekly` bigint(20) unsigned default 0,\n                    `unq_out_max_weekly` bigint(20) unsigned default 0,\n                    `tot_out_0_weekly` bigint(20) unsigned default 0,\n                    `tot_out_1_weekly` bigint(20) unsigned default 0,\n                    `tot_out_2_weekly` bigint(20) unsigned default 0,\n                    `tot_out_3_weekly` bigint(20) unsigned default 0,\n                    `tot_out_4_weekly` bigint(20) unsigned default 0,\n                    `tot_out_5_weekly` bigint(20) unsigned default 0,\n                    `tot_out_6_weekly` bigint(20) unsigned default 0,\n                    `tot_out_7_weekly` bigint(20) unsigned default 0,\n                    `tot_out_8_weekly` bigint(20) unsigned default 0,\n                    `tot_out_9_weekly` bigint(20) unsigned default 0,\n                    `tot_out_max_weekly` bigint(20) unsigned default 0,\n                    `unq_pv_0_monthly` bigint(20) unsigned default 0,\n                    `unq_pv_1_monthly` bigint(20) unsigned default 0,\n                    `unq_pv_2_monthly` bigint(20) unsigned default 0,\n                    `unq_pv_3_monthly` bigint(20) unsigned default 0,\n                    `unq_pv_4_monthly` bigint(20) unsigned default 0,\n                    `unq_pv_5_monthly` bigint(20) unsigned default 0,\n                    `unq_pv_6_monthly` bigint(20) unsigned default 0,\n                    `unq_pv_7_monthly` bigint(20) unsigned default 0,\n                    `unq_pv_8_monthly` bigint(20) unsigned default 0,\n                    `unq_pv_9_monthly` bigint(20) unsigned default 0,\n                    `unq_pv_max_monthly` bigint(20) unsigned default 0,\n                    `tot_pv_0_monthly` bigint(20) unsigned default 0,\n                    `tot_pv_1_monthly` bigint(20) unsigned default 0,\n                    `tot_pv_2_monthly` bigint(20) unsigned default 0,\n                    `tot_pv_3_monthly` bigint(20) unsigned default 0,\n                    `tot_pv_4_monthly` bigint(20) unsigned default 0,\n                    `tot_pv_5_monthly` bigint(20) unsigned default 0,\n                    `tot_pv_6_monthly` bigint(20) unsigned default 0,\n                    `tot_pv_7_monthly` bigint(20) unsigned default 0,\n                    `tot_pv_8_monthly` bigint(20) unsigned default 0,\n                    `tot_pv_9_monthly` bigint(20) unsigned default 0,\n                    `tot_pv_max_monthly` bigint(20) unsigned default 0,\n                    `unq_in_0_monthly` bigint(20) unsigned default 0,\n                    `unq_in_1_monthly` bigint(20) unsigned default 0,\n                    `unq_in_2_monthly` bigint(20) unsigned default 0,\n                    `unq_in_3_monthly` bigint(20) unsigned default 0,\n                    `unq_in_4_monthly` bigint(20) unsigned default 0,\n                    `unq_in_5_monthly` bigint(20) unsigned default 0,\n                    `unq_in_6_monthly` bigint(20) unsigned default 0,\n                    `unq_in_7_monthly` bigint(20) unsigned default 0,\n                    `unq_in_8_monthly` bigint(20) unsigned default 0,\n                    `unq_in_9_monthly` bigint(20) unsigned default 0,\n                    `unq_in_max_monthly` bigint(20) unsigned default 0,\n                    `tot_in_0_monthly` bigint(20) unsigned default 0,\n                    `tot_in_1_monthly` bigint(20) unsigned default 0,\n                    `tot_in_2_monthly` bigint(20) unsigned default 0,\n                    `tot_in_3_monthly` bigint(20) unsigned default 0,\n                    `tot_in_4_monthly` bigint(20) unsigned default 0,\n                    `tot_in_5_monthly` bigint(20) unsigned default 0,\n                    `tot_in_6_monthly` bigint(20) unsigned default 0,\n                    `tot_in_7_monthly` bigint(20) unsigned default 0,\n                    `tot_in_8_monthly` bigint(20) unsigned default 0,\n                    `tot_in_9_monthly` bigint(20) unsigned default 0,\n                    `tot_in_max_monthly` bigint(20) unsigned default 0,\n                    `unq_out_0_monthly` bigint(20) unsigned default 0,\n                    `unq_out_1_monthly` bigint(20) unsigned default 0,\n                    `unq_out_2_monthly` bigint(20) unsigned default 0,\n                    `unq_out_3_monthly` bigint(20) unsigned default 0,\n                    `unq_out_4_monthly` bigint(20) unsigned default 0,\n                    `unq_out_5_monthly` bigint(20) unsigned default 0,\n                    `unq_out_6_monthly` bigint(20) unsigned default 0,\n                    `unq_out_7_monthly` bigint(20) unsigned default 0,\n                    `unq_out_8_monthly` bigint(20) unsigned default 0,\n                    `unq_out_9_monthly` bigint(20) unsigned default 0,\n                    `unq_out_max_monthly` bigint(20) unsigned default 0,\n                    `tot_out_0_monthly` bigint(20) unsigned default 0,\n                    `tot_out_1_monthly` bigint(20) unsigned default 0,\n                    `tot_out_2_monthly` bigint(20) unsigned default 0,\n                    `tot_out_3_monthly` bigint(20) unsigned default 0,\n                    `tot_out_4_monthly` bigint(20) unsigned default 0,\n                    `tot_out_5_monthly` bigint(20) unsigned default 0,\n                    `tot_out_6_monthly` bigint(20) unsigned default 0,\n                    `tot_out_7_monthly` bigint(20) unsigned default 0,\n                    `tot_out_8_monthly` bigint(20) unsigned default 0,\n                    `tot_out_9_monthly` bigint(20) unsigned default 0,\n                    `tot_out_max_monthly` bigint(20) unsigned default 0,\n                    PRIMARY KEY  (`username`)\n                  )", __FILE__, __LINE__);
            require_once "{$CONF['path']}/sources/misc/classes.php";
            require_once "{$CONF['path']}/sources/in.php";
            $result = $DB->query("SELECT id, password, url, title, description, category, urlbanner, email, total_ratings, num_ratings, jointime, active FROM {$CONF['sql_prefix']}_members", __FILE__, __LINE__);
            while (list($username, $password, $url, $title, $description, $category, $banner_url, $email, $total_rating, $num_ratings, $jointime, $active) = $DB->fetch_array($result)) {
                $join_date = date('Y-m-d', $jointime);
                $short_url = in::short_url($url);
                $url = $DB->escape($url);
                $title = $DB->escape($title);
                $description = $DB->escape($description);
                $category = $DB->escape($category);
                $banner_url = $DB->escape($banner_url);
                $email = $DB->escape($email);
                $DB->query("INSERT INTO {$CONF['sql_prefix']}_sites (username, password, url, short_url, title, description, category, banner_url, email, join_date, active)\n                    VALUES ('{$username}', '{$password}', '{$url}', '{$short_url}', '{$title}', '{$description}', '{$category}', '{$banner_url}', '{$email}', '{$join_date}', {$active})", __FILE__, __LINE__);
                $DB->query("INSERT INTO {$CONF['sql_prefix']}_stats (username, total_rating, num_ratings)\n                    VALUES ('{$username}', {$total_rating}, {$num_ratings})", __FILE__, __LINE__);
            }
            $DB->query("DROP TABLE {$CONF['sql_prefix']}_iplog", __FILE__, __LINE__);
            $TMPL['content'] = <<<EndHTML
{$LNG['upgrade_done']}<br /><br />
<a href="{$TMPL['list_url']}/">{$LNG['install_your']}</a><br />
<a href="{$TMPL['list_url']}/index.php?a=admin">{$LNG['install_admin']}</a><br />
<a href="http://www.aardvarktopsitesphp.com/manual/">{$LNG['install_manual']}</a><br /><br />