Advertisement
Guest User

Untitled

a guest
Feb 27th, 2014
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 28.95 KB | None | 0 0
  1. <?php
  2.  
  3. echo "<html>\n<head>\n   \n    <meta content=\"text/html; charset=utf-8\" http-equiv=\"content-type\">\n    </head>\n<body>\n\n    ";
  4. ini_set( "display_errors", "on" );
  5. ini_set( "display_startup_errors", "on" );
  6. file_put_contents( "tmp_test", "" );
  7. if ( !file_exists( "tmp_test" ) )
  8. {
  9.     echo "установите права 777 на дииректорию";
  10.     exit( );
  11. }
  12. else
  13. {
  14.     @unlink( "tmp_test" );
  15. }
  16. if ( preg_match( "/nginx/i", $_SERVER['SERVER_SOFTWARE'] ) )
  17. {
  18.     echo "ВЫ используете NGINX, будет создана конфигурация для данного вебсервера<br><br>";
  19. }
  20. echo "magic_quotes_gpc должно быть <b>Off</b><br>";
  21. if ( get_magic_quotes_gpc( ) && preg_match( "/nginx/i", $_SERVER['SERVER_SOFTWARE'] ) )
  22. {
  23.     exit( );
  24. }
  25. if ( !function_exists( "curl_init" ) )
  26. {
  27.     echo "установите CURL";
  28.     exit( );
  29. }
  30. if ( !function_exists( "exec" ) )
  31. {
  32.     echo "включите exec";
  33.     exit( );
  34. }
  35. $admin_user = "";
  36. $admin_pass = "";
  37. if ( $_POST['proc'] == "mysql_setup" )
  38. {
  39.     $log = "";
  40.     if ( $_POST['admin_user'] == "" )
  41.     {
  42.         $log .= "<font color=red>введите логин</font><br>";
  43.     }
  44.     if ( $_POST['admin_pass'] == "" )
  45.     {
  46.         $log .= "<font color=red>введите пароль</font><br>";
  47.     }
  48.     if ( $_POST['dbhost'] == "" )
  49.     {
  50.         $log .= "<font color=red>введите хоcÑ‚</font><br>";
  51.     }
  52.     if ( $_POST['dbname'] == "" )
  53.     {
  54.         $log .= "<font color=red>введите имя базы</font><br>";
  55.     }
  56.     if ( $_POST['dbuser'] == "" )
  57.     {
  58.         $log .= "<font color=red>введите имя пользователя базы</font><br>";
  59.     }
  60.     if ( $_POST['dbpass'] == "" )
  61.     {
  62.         $log .= "<font color=red>введите пароль для базы</font><br>";
  63.     }
  64.     $config['host'] = addslashes( $_POST['dbhost'] );
  65.     $config['dbname'] = addslashes( $_POST['dbname'] );
  66.     $config['user'] = addslashes( $_POST['dbuser'] );
  67.     $config['pass'] = addslashes( $_POST['dbpass'] );
  68.     $config['mode'] = "local";
  69.     if ( $log == "" )
  70.     {
  71.         if ( @!_obfuscate_DRgtBTAdEh47NTcCAgpcGAtbBRMGNSIÿ( @$config['dbname'], @$link ) )
  72.         {
  73.             @$log .= "<font color=red>ОШИБКА соединения к mysql, введите правильно данные</font><br>";
  74.         }
  75.     }
  76.     if ( @( 0 < @_obfuscate_DR0UPhwFMhwDMRICFy03MjsrIgIXKREÿ( @$tables ) ) )
  77.     {
  78.         if ( @isset( $_POST['db_cleaner'] ) )
  79.         {
  80.             @_obfuscate_DSUlIRwPHBoWHCEcDCg4CR8aBwUhBxEÿ( @"DROP TABLE {$results['0']}" );
  81.         }
  82.         if ( @( 0 < @_obfuscate_DR0UPhwFMhwDMRICFy03MjsrIgIXKREÿ( @$tables ) ) )
  83.         {
  84.             echo "ошибка очистки базы, очистите базу в ручном режиме и <a href=\"install.php\">повторите установку</a>";
  85.             exit( );
  86.         }
  87.     }
  88.     else
  89.     {
  90.         echo "<font color=red>база содержит таблицы</font> скрипт можно устанавливать только в пустую базу данных<br>\n                                  ÐžÑ‡Ð¸ÑÑ‚ите базу данных или создайте новую.<br>\n                                  <a href=\"install.php\">повторить</a>";
  91.         exit( );
  92.     }
  93. }
  94. if ( @( $log != "" ) )
  95. {
  96.     echo $log;
  97.     exit( );
  98. }
  99. if ( @( $log == "" ) )
  100. {
  101.     if ( @( _obfuscate_DSUlIRwPHBoWHCEcDCg4CR8aBwUhBxEÿ( "CREATE TABLE IF NOT EXISTS `a_blocks` (\n  `name` char(32) NOT NULL,\n  `ads` text NOT NULL,\n  UNIQUE KEY `name` (`name`)\n) ENGINE=MyISAM DEFAULT CHARSET=latin1;" ) && _obfuscate_DSUlIRwPHBoWHCEcDCg4CR8aBwUhBxEÿ( "INSERT INTO `a_blocks` (`name`, `ads`) VALUES\n            ('tags', '');\n            " ) ) )
  102.     {
  103.         @$log .= "Таблица a_blocks - <font color=\"green\">ок</font><br>";
  104.     }
  105.     else
  106.     {
  107.         @$log .= "Таблица a_blocks - <font color=red>ошибка</font><br>";
  108.     }
  109.     if ( @_obfuscate_DSUlIRwPHBoWHCEcDCg4CR8aBwUhBxEÿ( "\nCREATE TABLE IF NOT EXISTS `dtags` (\n  `id` int(11) NOT NULL,\n  `tid` mediumint(7) NOT NULL,\n  `duration` smallint(4) NOT NULL,\n  `clicks` mediumint(7) NOT NULL,\n  `ctr` decimal(11,10) NOT NULL,\n  `date` int(11) NOT NULL,\n  UNIQUE KEY `id_tid_ctr` (`id`,`tid`,`ctr`)\n) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=FIXED;" ) )
  110.     {
  111.         @$log .= "Таблица dtags - <font color=\"green\">ок</font><br>";
  112.     }
  113.     else
  114.     {
  115.         @$log .= "Таблица dtags - <font color=red>ошибка</font><br>";
  116.     }
  117.     if ( @_obfuscate_DSUlIRwPHBoWHCEcDCg4CR8aBwUhBxEÿ( "\nCREATE TABLE IF NOT EXISTS `ids` (\n  `i` mediumint(10) NOT NULL AUTO_INCREMENT,\n  `id` mediumint(10) NOT NULL,\n  PRIMARY KEY (`i`),\n  UNIQUE KEY `id` (`id`)\n) ENGINE=MEMORY DEFAULT CHARSET=latin1;" ) )
  118.     {
  119.         @$log .= "Таблица ids - <font color=\"green\">ок</font><br>";
  120.     }
  121.     else
  122.     {
  123.         @$log .= "Таблица ids - <font color=red>ошибка</font><br>";
  124.     }
  125.     if ( @_obfuscate_DSUlIRwPHBoWHCEcDCg4CR8aBwUhBxEÿ( "\n               \n          CREATE TABLE IF NOT EXISTS `importer_logs` (\n  `profile` varchar(255) NOT NULL,\n  `num` int(11) NOT NULL,\n  `date_import` int(11) NOT NULL,\n  `status` set('ready','running','done') NOT NULL DEFAULT 'ready',\n  KEY `index` (`profile`,`date_import`,`status`)\n) ENGINE=MyISAM DEFAULT CHARSET=latin1;\n" ) )
  126.     {
  127.         @$log .= "Таблица importer_logs - <font color=\"green\">ок</font><br>";
  128.     }
  129.     else
  130.     {
  131.         @$log .= "Таблица importer_logs - <font color=red>ошибка</font><br>";
  132.     }
  133.     if ( @_obfuscate_DSUlIRwPHBoWHCEcDCg4CR8aBwUhBxEÿ( "\nCREATE TABLE IF NOT EXISTS `intraff` (\n  `rid` char(32) NOT NULL,\n  `ref` char(32) NOT NULL,\n  `ip` char(15) NOT NULL,\n  `time` decimal(15,4) NOT NULL,\n  UNIQUE KEY `time` (`time`)\n) ENGINE=MyISAM DEFAULT CHARSET=latin1;\n              " ) )
  134.     {
  135.         @$log .= "Таблица intraff - <font color=\"green\">ок</font><br>";
  136.     }
  137.     else
  138.     {
  139.         @$log .= "Таблица intraff - <font color=red>ошибка</font><br>";
  140.     }
  141.     if ( @( _obfuscate_DSUlIRwPHBoWHCEcDCg4CR8aBwUhBxEÿ( "\nCREATE TABLE IF NOT EXISTS `niches` (\n  `id` smallint(6) NOT NULL AUTO_INCREMENT,\n  `name` varchar(22) NOT NULL,\n  `title` varchar(255) NOT NULL,\n  `desc` varchar(1024) NOT NULL,\n  `keys` varchar(128) NOT NULL,\n  `url` char(255) NOT NULL,\n  `num` mediumint(7) NOT NULL,\n  `skim_url` text NOT NULL,\n  `skim_prc` int(3) NOT NULL,\n  `thumb` varchar(128) NOT NULL,\n  `clicks` int(8) NOT NULL,\n  `ads` text NOT NULL,\n  `hits` int(8) NOT NULL,\n  `ctr` float NOT NULL,\n  PRIMARY KEY (`id`),\n  UNIQUE KEY `name_clicks_num` (`name`,`clicks`,`num`),\n  UNIQUE KEY `name` (`name`),\n  KEY `ctr` (`ctr`)\n) ENGINE=MyISAM  DEFAULT CHARSET=latin1;\n" ) && _obfuscate_DSUlIRwPHBoWHCEcDCg4CR8aBwUhBxEÿ( "\n            INSERT INTO `niches` (`name`, `title`, `desc`, `keys`, `url`, `num`, `skim_url`, `skim_prc`, `thumb`, `clicks`, `ads`, `hits`, `ctr`) \nVALUES\n            ('main', 'all tubes', 'some desc', '*', '', 0, 'a:1:{i:0;s:0:\"\";}', 0, '', 0, '', 0, 0),\n            ('anal', 'anal tubes', 'some desc', 'anal*', '', 0, 'a:1:{i:0;s:0:\"\";}', 0, '', 0, '', 0, 0),\n            ('black_anal', 'black anal', 'some desc', '(black+anal)', '', 0, 'a:1:{i:0;s:0:\"\";}', 0, '', 0, '', 0, 0);" ) ) )
  142.     {
  143.         @$log .= "Таблица niches - <font color=\"green\">ок</font><br>";
  144.     }
  145.     else
  146.     {
  147.         @$log .= "Таблица niches - <font color=red>ошибка</font><br>";
  148.     }
  149.     if ( @_obfuscate_DSUlIRwPHBoWHCEcDCg4CR8aBwUhBxEÿ( "\nCREATE TABLE IF NOT EXISTS `pstats` (\n  `id` char(32) NOT NULL,\n  `ids` text NOT NULL,\n  `i` int(6) NOT NULL,\n  `date` int(12) NOT NULL,\n  UNIQUE KEY `id` (`id`),\n  KEY `date` (`date`)\n) ENGINE=MyISAM DEFAULT CHARSET=latin1;\n            " ) )
  150.     {
  151.         @$log .= "Таблица pstats - <font color=\"green\">ок</font><br>";
  152.     }
  153.     else
  154.     {
  155.         @$log .= "Таблица pstats - <font color=red>ошибка</font><br>";
  156.     }
  157.     if ( @_obfuscate_DSUlIRwPHBoWHCEcDCg4CR8aBwUhBxEÿ( "\nCREATE TABLE IF NOT EXISTS `stats_d` (\n  `day` int(8) NOT NULL,\n  `hits` int(7) NOT NULL,\n  `clicks` int(7) NOT NULL,\n  `prod` float NOT NULL,\n  `la` float NOT NULL,\n  PRIMARY KEY (`day`)\n) ENGINE=MyISAM DEFAULT CHARSET=latin1;\n            " ) )
  158.     {
  159.         @$log .= "Таблица stats_d - <font color=\"green\">ок</font><br>";
  160.     }
  161.     else
  162.     {
  163.         @$log .= "Таблица stats_d - <font color=red>ошибка</font><br>";
  164.     }
  165.     if ( @( _obfuscate_DSUlIRwPHBoWHCEcDCg4CR8aBwUhBxEÿ( "\nCREATE TABLE IF NOT EXISTS `stats_h` (\n  `hour` int(2) NOT NULL,\n  `hits` int(6) NOT NULL DEFAULT '0',\n  `clicks` int(6) NOT NULL DEFAULT '0',\n  `prod` float NOT NULL DEFAULT '0',\n  `la` float NOT NULL,\n  UNIQUE KEY `hour` (`hour`)\n) ENGINE=MyISAM DEFAULT CHARSET=latin1;\n            " ) && _obfuscate_DSUlIRwPHBoWHCEcDCg4CR8aBwUhBxEÿ( "\n             INSERT INTO `stats_h` (`hour`, `hits`, `clicks`, `prod`, `la`) VALUES\n                (0, 0, 0, 0, 0),\n                (1, 0, 0, 0, 0),\n                (2, 0, 0, 0, 0),\n                (3, 0, 0, 0, 0),\n                (4, 0, 0, 0, 0),\n                (5, 0, 0, 0, 0),\n                (6, 0, 0, 0, 0),\n                (7, 0, 0, 0, 0),\n                (8, 0, 0, 0, 0),\n                (9, 0, 0, 0, 0),\n                (10, 0, 0, 0, 0),\n                (11, 0, 0, 0, 0),\n                (12, 0, 0, 0, 0),\n                (13, 0, 0, 0, 0),\n                (14, 0, 0, 0, 0),\n                (15, 0, 0, 0, 0),\n                (16, 0, 0, 0, 0),\n                (17, 0, 0, 0, 0),\n                (18, 0, 0, 0, 0),\n                (19, 0, 0, 0, 0),\n                (20, 0, 0, 0, 0),\n                (21, 0, 0, 0, 0),\n                (22, 0, 0, 0, 0),\n                (23, 0, 0, 0, 0),\n                (24, 0, 0, 0, 0);" ) ) )
  166.     {
  167.         @$log .= "Таблица stats_h - <font color=\"green\">ок</font><br>";
  168.     }
  169.     else
  170.     {
  171.         @$log .= "Таблица stats_h - <font color=red>ошибка</font><br>";
  172.     }
  173.     if ( @_obfuscate_DSUlIRwPHBoWHCEcDCg4CR8aBwUhBxEÿ( "\nCREATE TABLE IF NOT EXISTS `tags` (\n  `id` int(11) NOT NULL,\n  `tags` char(255) NOT NULL,\n  `ctr` decimal(11,10) NOT NULL,\n  `clicks` mediumint(9) NOT NULL,\n  `duration` mediumint(9) NOT NULL,\n  KEY `ctr` (`ctr`)\n) ENGINE=MEMORY DEFAULT CHARSET=latin1;\n            " ) )
  174.     {
  175.         @$log .= "Таблица tags - <font color=\"green\">ок</font><br>";
  176.     }
  177.     else
  178.     {
  179.         @$log .= "Таблица tags - <font color=red>ошибка</font><br>";
  180.     }
  181.     if ( @_obfuscate_DSUlIRwPHBoWHCEcDCg4CR8aBwUhBxEÿ( "\nCREATE TABLE IF NOT EXISTS `tags_stats` (\n  `tid` mediumint(7) NOT NULL AUTO_INCREMENT,\n  `tag` varchar(12) NOT NULL,\n  `num` mediumint(8) NOT NULL,\n  PRIMARY KEY (`tag`),\n  KEY `tid` (`tid`)\n) ENGINE=MyISAM DEFAULT CHARSET=latin1;\n            " ) )
  182.     {
  183.         @$log .= "Таблица tags_stats - <font color=\"green\">ок</font><br>";
  184.     }
  185.     else
  186.     {
  187.         @$log .= "Таблица tags_stats - <font color=red>ошибка</font><br>";
  188.     }
  189.     if ( @_obfuscate_DSUlIRwPHBoWHCEcDCg4CR8aBwUhBxEÿ( "\nCREATE TABLE IF NOT EXISTS `templates` (\n  `name` varchar(32) NOT NULL,\n  `template` MEDIUMTEXT NOT NULL,\n  UNIQUE KEY `name` (`name`)\n) ENGINE=MyISAM DEFAULT CHARSET=latin1;\n                " ) )
  190.     {
  191.         @$log .= "Таблица templates - <font color=\"green\">ок</font><br>";
  192.     }
  193.     else
  194.     {
  195.         @$log .= "Таблица templates - <font color=red>ошибка</font><br>";
  196.     }
  197.     @_obfuscate_DSUlIRwPHBoWHCEcDCg4CR8aBwUhBxEÿ( @"INSERT INTO `templates` (`name`,`template`) VALUES ('main','{$main_tmpl}')" );
  198.     @_obfuscate_DSUlIRwPHBoWHCEcDCg4CR8aBwUhBxEÿ( @"INSERT INTO `templates` (`name`,`template`) VALUES ('sub','{$main_sub_tmpl}')" );
  199.     @_obfuscate_DSUlIRwPHBoWHCEcDCg4CR8aBwUhBxEÿ( @"INSERT INTO `templates` (`name`,`template`) VALUES ('embed','{$video_tmpl}')" );
  200.     @_obfuscate_DSUlIRwPHBoWHCEcDCg4CR8aBwUhBxEÿ( "INSERT INTO `templates` (`name`,`template`) VALUES ('embed_sub','')" );
  201.     @_obfuscate_DSUlIRwPHBoWHCEcDCg4CR8aBwUhBxEÿ( " INSERT INTO `templates` (`name` ,`template`) VALUES ('categories', '');" );
  202.     @_obfuscate_DSUlIRwPHBoWHCEcDCg4CR8aBwUhBxEÿ( " INSERT INTO `templates` (`name` ,`template` )VALUES ('categories_sub', '');" );
  203.     @_obfuscate_DSUlIRwPHBoWHCEcDCg4CR8aBwUhBxEÿ( "\nCREATE TABLE IF NOT EXISTS `templates_history` (\n  `time` int(11) NOT NULL,\n  `marker` varchar(32) NOT NULL,\n  `name` varchar(32) NOT NULL,\n  `template` mediumtext NOT NULL\n) ENGINE=MyISAM DEFAULT CHARSET=latin1;\n" );
  204.     @_obfuscate_DSUlIRwPHBoWHCEcDCg4CR8aBwUhBxEÿ( "ALTER TABLE `templates_history` ADD UNIQUE `time_name`(\n`time` ,\n`name`\n);" );
  205.     if ( @_obfuscate_DSUlIRwPHBoWHCEcDCg4CR8aBwUhBxEÿ( "\nCREATE TABLE IF NOT EXISTS `th_hash` (\n  `id` int(11) NOT NULL,\n  `hash` char(32) NOT NULL,\n  KEY `id` (`id`),\n  UNIQUE KEY `hash` (`hash`)\n) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=FIXED;\n                  " ) )
  206.     {
  207.         @$log .= "Таблица th_hash - <font color=\"green\">ок</font><br>";
  208.     }
  209.     else
  210.     {
  211.         @$log .= "Таблица th_hash - <font color=red>ошибка</font><br>";
  212.     }
  213.     if ( @_obfuscate_DSUlIRwPHBoWHCEcDCg4CR8aBwUhBxEÿ( "\n\nCREATE TABLE IF NOT EXISTS `w_content` (\n  `id` int(11) NOT NULL AUTO_INCREMENT,\n  `oid` char(40) NOT NULL,\n  `kid` char(16) NOT NULL,\n  `prov` char(32) NOT NULL,\n  `url` char(255) NOT NULL,\n  `title` char(255) NOT NULL,\n  `title_pre_syn` char(255) NOT NULL,\n  `desc` text NOT NULL,\n  `tags` char(255) DEFAULT NULL,\n  `thumbs` text NOT NULL,\n  `flv_file` char(255) NOT NULL,\n  `flv_hotlink_file` char(255) NOT NULL,\n  `embed` text NOT NULL,\n  `embed_code` text NOT NULL,\n  `duration` int(5) NOT NULL,\n  `date` int(11) NOT NULL,\n  `date_import` int(11) NOT NULL,\n  `r` mediumint(5) NOT NULL DEFAULT '0',\n  `t_r` int(8) NOT NULL,\n  `clicks` mediumint(7) NOT NULL,\n  `t_clicks` int(8) NOT NULL,\n  `l_clicks` mediumint(5) NOT NULL,\n  `ctr` decimal(11,10) NOT NULL,\n  `rs` tinyint(4) NOT NULL,\n  `at` tinyint(2) NOT NULL,\n  `t0_ctr` float NOT NULL,\n  `t1_ctr` float NOT NULL,\n  `t3_ctr` float NOT NULL,\n  `status` enum('0','1','2','6','7','8','9') NOT NULL,\n  `preloaded` set('yes','no') NOT NULL DEFAULT 'no',\n  `lr` int(12) NOT NULL,\n  `info` text NOT NULL,\n  PRIMARY KEY (`id`),\n  UNIQUE KEY `oid` (`oid`,`prov`),\n  KEY `status` (`status`),\n  KEY `r` (`r`,`clicks`,`ctr`,`at`),\n  KEY `rs` (`rs`),\n  KEY `ctr` (`ctr`),\n  KEY `duration` (`duration`),\n  KEY `preloaded` (`preloaded`),\n  KEY `prov_status_ctr` (`prov`,`status`,`ctr`),\n  KEY `date_import` (`date_import`)\n) ENGINE=MyISAM  DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC PACK_KEYS=0;\n              " ) )
  214.     {
  215.         @$log .= "Таблица w_content - <font color=\"green\">ок</font><br>";
  216.     }
  217.     else
  218.     {
  219.         @$log .= "Таблица w_content - <font color=red>ошибка</font><br>";
  220.     }
  221.     if ( @_obfuscate_DSUlIRwPHBoWHCEcDCg4CR8aBwUhBxEÿ( "\nCREATE TABLE IF NOT EXISTS `_intraff` (\n  `rid` char(32) NOT NULL,\n  `ref` char(32) NOT NULL,\n  `ip` char(15) NOT NULL,\n  `time` decimal(15,4) NOT NULL\n) ENGINE=MEMORY DEFAULT CHARSET=latin1;\n              " ) )
  222.     {
  223.         @$log .= "Таблица _intraff - <font color=\"green\">ок</font><br>";
  224.     }
  225.     else
  226.     {
  227.         @$log .= "Таблица _intraff - <font color=red>ошибка</font><br>";
  228.     }
  229.     if ( @_obfuscate_DSUlIRwPHBoWHCEcDCg4CR8aBwUhBxEÿ( "\nCREATE TABLE IF NOT EXISTS `_rids` (\n  `rid` char(32) NOT NULL,\n  `num` mediumint(4) NOT NULL,\n  UNIQUE KEY `rid` (`rid`)\n) ENGINE=MEMORY DEFAULT CHARSET=latin1;\n            " ) )
  230.     {
  231.         @$log .= "Таблица _rids - <font color=\"green\">ок</font><br>";
  232.     }
  233.     else
  234.     {
  235.         @$log .= "Таблица _rids - <font color=red>ошибка</font><br>";
  236.     }
  237.     if ( @_obfuscate_DSUlIRwPHBoWHCEcDCg4CR8aBwUhBxEÿ( "\nCREATE TABLE IF NOT EXISTS `_tags` (\n  `id` int(11) NOT NULL,\n  `tid` mediumint(7) NOT NULL,\n  `duration` smallint(4) NOT NULL,\n  `clicks` mediumint(7) NOT NULL,\n  `ctr` decimal(11,10) NOT NULL,\n  `date` int(11) NOT NULL,\n  KEY `tid` (`tid`)\n) ENGINE=MEMORY DEFAULT CHARSET=latin1 ROW_FORMAT=FIXED;\n            " ) )
  238.     {
  239.         @$log .= "Таблица _tags - <font color=\"green\">ок</font><br>";
  240.     }
  241.     else
  242.     {
  243.         @$log .= "Таблица _tags - <font color=red>ошибка</font><br>";
  244.     }
  245.     if ( @_obfuscate_DSUlIRwPHBoWHCEcDCg4CR8aBwUhBxEÿ( "\nCREATE TABLE IF NOT EXISTS `jobs` (\n  `name` char(32) NOT NULL,\n  `time` CHAR( 15 ) NOT NULL DEFAULT '0',\n  `status` tinyint(1) NOT NULL DEFAULT '0',\n   PRIMARY KEY `name` (`name`)\n) ENGINE=MyISAM DEFAULT CHARSET=latin1;\n            " ) )
  246.     {
  247.         @$log .= "Таблица jobs - <font color=\"green\">ок</font><br>";
  248.     }
  249.     else
  250.     {
  251.         @$log .= "Таблица jobs - <font color=red>ошибка</font><br>";
  252.     }
  253.     if ( @_obfuscate_DSUlIRwPHBoWHCEcDCg4CR8aBwUhBxEÿ( "CREATE TABLE IF NOT EXISTS `search_keys` \n                (\n                `key` char(32) NOT NULL,\n                `num` mediumint(6) NOT NULL,\n                UNIQUE KEY `key` (`key`)\n                ) \n                ENGINE=MEMORY DEFAULT CHARSET=latin1;" ) )
  254.     {
  255.         @$log .= "Таблица search_keys - <font color=\"green\">ок</font><br>";
  256.     }
  257.     else
  258.     {
  259.         @$log .= "Таблица search_keys - <font color=red>ошибка</font><br>";
  260.     }
  261.     if ( @_obfuscate_DSUlIRwPHBoWHCEcDCg4CR8aBwUhBxEÿ( "CREATE TABLE IF NOT EXISTS `sponsors` (\n  `prov` char(64) NOT NULL,\n  `title` VARCHAR( 255 ) NOT NULL,\n  `desc` text NOT NULL,\n  `links` text NOT NULL,\n  `ads` text NOT NULL,\n  PRIMARY KEY (`prov`)\n) ENGINE=MyISAM DEFAULT CHARSET=latin1;" ) )
  262.     {
  263.         @$log .= "Таблица sponsors - <font color=\"green\">ок</font><br>";
  264.     }
  265.     else
  266.     {
  267.         @$log .= "Таблица sponsors - <font color=red>ошибка</font><br>";
  268.     }
  269.     if ( @_obfuscate_DSUlIRwPHBoWHCEcDCg4CR8aBwUhBxEÿ( "INSERT INTO `sponsors` (\n`prov` ,\n`title` ,\n`desc` ,\n`links`,\n`ads`\n)\nVALUES (\n'import_main', '', '', '','')" ) )
  270.     {
  271.         @$log .= "...insert in sponsors - <font color=\"green\">ок</font><br>";
  272.     }
  273.     else
  274.     {
  275.         @$log .= "...insert in sponsors - <font color=red>ошибка</font><br>";
  276.     }
  277.     if ( @file_exists( "files/config" ) )
  278.     {
  279.         @unlink( "files/config" );
  280.     }
  281.     if ( @file_exists( "files/update.inc" ) )
  282.     {
  283.         @unlink( "files/update.inc" );
  284.     }
  285.     @preg_match( "/(.*)install\\.php.*/", @$_SERVER['REQUEST_URI'], @$matches );
  286.     @$config['index_dir_url'] = "http://{$_SERVER['HTTP_HOST']}{$matches['1']}";
  287.     @$config['http_host'] = $_SERVER['HTTP_HOST'];
  288.     @$config['syn_mode'] = "0";
  289.     if ( @!file_put_contents( "files/config", @serialize( @$config ) ) )
  290.     {
  291.         @$log .= "<font color=red>ошибка</font> создания конфига!<br>";
  292.     }
  293.     @$settings['grab_status'] = "noactive";
  294.     @$settings['ignore_grub_thread'] = "off";
  295.     @$settings['grub_to_preload'] = "off";
  296.     @$settings['ban_keys'] = "gay*,trann*,shemal*";
  297.     @$settings['good_keys'] = "";
  298.     @$settings['tubes'] = array( "pornhub" );
  299.     @$settings['grab_min_thumbs'] = "checked";
  300.     @$settings['content_limit'] = "10000";
  301.     @$settings['duration_limit'] = "60";
  302.     @$settings['grab_thumbs_limit'] = "5";
  303.     @$settings['im_command_line'] = "auto";
  304.     @$settings['thumbs_size'] = "";
  305.     @$settings['thumbs_crop_size'] = "320x240";
  306.     if ( @file_exists( "files/settings" ) )
  307.     {
  308.         @unlink( "files/settings" );
  309.     }
  310.     if ( @!file_put_contents( "files/settings", @serialize( @$settings ) ) )
  311.     {
  312.         @$log .= "<font color=red>ошибка</font> создания настроек!<br>";
  313.     }
  314.     @$auth['user'] = $admin_user;
  315.     @$auth['pass'] = $admin_pass;
  316.     if ( @file_exists( "files/auth" ) )
  317.     {
  318.         @unlink( "files/auth" );
  319.     }
  320.     if ( @!file_put_contents( "files/auth", @$auth ) )
  321.     {
  322.         @$log .= "<font color=red>ошибка</font> создания файла аутенфикации!<br>";
  323.     }
  324.     echo $log;
  325.     if ( @strpos( @$log, "ошибка" ) )
  326.     {
  327.         echo "<br><b>скрипт не установлен, исправьте ошибки</b><br><a href=\"install.php\">повторить</a>";
  328.         exit( );
  329.     }
  330.     if ( @!$php_path )
  331.     {
  332.         @$php_path = "{YOUR PATH TO PHP}";
  333.     }
  334.     echo "<h4>скрипт успешно установлен</h4><br>";
  335.     @$htstr = @"\nOptions -Indexes\n                        \nRewriteEngine On\n\n#RewriteCond %{REQUEST_FILENAME} !-d\n\nRewriteRule ^(duration|views|date)/?$ index.php?by=$1 [L,NC]\n\n#RewriteCond %{REQUEST_FILENAME} !-d\n\nRewriteRule ^t/([a-z\\-]{3,64})/p([0-9]{1,3})/?$ index.php?t=$1&p=$2 [L,NC]\n\n#RewriteCond %{REQUEST_FILENAME} !-d\n \nRewriteRule ^([a-z_-]{3,22})/p([0-9]{1,3})/?$ index.php?n=$1&p=$2 [L,NC]\n\n#RewriteCond %{REQUEST_FILENAME} !-d\n \nRewriteRule ^([a-z_-]{3,22})/?$ index.php?n=$1 [L,NC]\n\n#RewriteCond %{REQUEST_FILENAME} !-d\n \nRewriteRule ^p([0-9]{1,3})/?$ index.php?n=main&p=$1 [L]\n\n#RewriteCond %{REQUEST_FILENAME} !-d\n \nRewriteRule ^t/([a-z\\-]{3,64})/?$ index.php?t=$1 [L,NC]\n\n\n\n\n\n#RewriteCond %{REQUEST_FILENAME} !-d\n\nRewriteRule ^([a-z_-]{3,22})/(v[0-9]{1,9})/?$ index.php?n=$1&id=$2 [L,NC]\n\n#RewriteCond %{REQUEST_FILENAME} !-d\n\nRewriteRule ^(v[0-9]{1,9})/?$ index.php?id=$1 [L]\n\n#RewriteCond %{REQUEST_FILENAME} !-d\n\nRewriteRule ^t/([a-z\\-]{3,64})/(v[0-9]{1,9})/?$ index.php?t=$1&id=$2 [L,NC]\n\n#RewriteCond %{REQUEST_FILENAME} !-d\n\nRewriteRule ^.+/t/([a-z\\-]{3,64})/(v[0-9]{1,9})/?$ index.php?t=$1&id=$2 [L,NC]\n\n#RewriteCond %{REQUEST_FILENAME} !-d\n\nRewriteRule ^.+/([a-z_-]{3,22})/(v[0-9]{1,9})/?$ index.php?n=$1&id=$2 [L,NC]\n\n#RewriteCond %{REQUEST_FILENAME} !-d\n\nRewriteRule ^.+/(v[0-9]{1,9})/?$ index.php?id=$1 [L]\n\n\n\n\n#RewriteCond %{REQUEST_FILENAME} !-d\n \nRewriteRule ^t/([a-z\\-]{3,64})/(duration|views|date)/?$ index.php?t=$1&by=$2 [L,NC]\n\n#RewriteCond %{REQUEST_FILENAME} !-d\n \nRewriteRule ^t/([a-z\\-]{3,64})/p([0-9]{1,2})/(duration|views|date)/?$ index.php?t=$1&p=$2&by=$3 [L,NC]\n\n#RewriteCond %{REQUEST_FILENAME} !-d\n \nRewriteRule ^([a-z_-]{3,22})/p([0-9]{1,2})/(duration|views|date)/?$ index.php?n=$1&p=$2&by=$3 [L,NC]\n\n#RewriteCond %{REQUEST_FILENAME} !-d\n \nRewriteRule ^p([0-9]{1,3})/(duration|views|date)/?$ index.php?p=$1&by=$2 [L,NC]\n\n#RewriteCond %{REQUEST_FILENAME} !-d\n \nRewriteRule ^([a-z_-]{3,22})/(duration|views|date)/?$ index.php?n=$1&by=$2 [L,NC]\n\n";
  336.     if ( @get_magic_quotes_gpc( ) )
  337.     {
  338.         @$htstr .= "php_flag magic_quotes_gpc Off\n";
  339.     }
  340.     @$echo_htstr = @$Tmp_403."добавьте эти строки в htaccess. ModRewrite должен быть включен, для NGINX правила смотрите на ixi.tv<br>\n            <textarea cols=100 rows=18>{$htstr}</textarea><br>";
  341.     if ( @!file_exists( ".htaccess" ) )
  342.     {
  343.         if ( @!file_put_contents( ".htaccess", @$htstr ) )
  344.         {
  345.             echo $echo_htstr;
  346.         }
  347.     }
  348.     else
  349.     {
  350.         echo $echo_htstr;
  351.     }
  352.     @$cron = @"* * * * * cd {$path}/files && {$php_path} cron.php 1>/dev/null 2>/dev/null";
  353.     echo "<h4>добавьте задание в крон <br>\n             <textarea rows=1 cols=120>{$cron}</textarea><br><br>\n             а затем перейдите в <a href='admin.php?e=s' target='_blank'>админку</a></h4>\n             ";
  354.     echo "\n                 ваш логин {$user}<br>\n                 ваш пароль {$pass}<br>\n                     <br><br><br><br><br>\n\n";
  355.     @unlink( "install.php" );
  356.     exit( );
  357. }
  358. }
  359. if ( @( $_GET['proc'] == "install" ) )
  360. {
  361.     @$log = "";
  362.     @$url = "http://tuberotator.com/src/install_tr.0.6.3i.tar";
  363.     @_obfuscate_DTcEBzULPR8dFBYeHA8kNxs8GyMMAjIÿ( @$ch, @CURLOPT_URL, @$url );
  364.     @_obfuscate_DTcEBzULPR8dFBYeHA8kNxs8GyMMAjIÿ( @$ch, @CURLOPT_TIMEOUT, 20 );
  365.     @_obfuscate_DTcEBzULPR8dFBYeHA8kNxs8GyMMAjIÿ( @$ch, @CURLOPT_RETURNTRANSFER, 1 );
  366.     @_obfuscate_DTEJECoVNCU5Dz8aCiEUIhoHJwxAEyIÿ( @$ch );
  367.     if ( @( $Var_11472['http_code'] == "404" || $info['size_download'] < "100000" ) )
  368.     {
  369.         echo "<br>Возможно ваш инсталлятор устарел, <a href=\"http://www.tuberotator.com/\">скачайте</a> более свежий";
  370.         exit( );
  371.     }
  372.     else
  373.     {
  374.         @file_put_contents( "install_tr.tar", @$archive );
  375.         if ( @!file_exists( "install_tr.tar" ) )
  376.         {
  377.             echo "не могу сделать запись в текущую диру, проверьте права";
  378.             exit( );
  379.         }
  380.     }
  381.     if ( @empty( $tar_path ) )
  382.     {
  383.         @$tar_path = "tar";
  384.     }
  385.     @exec( @"{$tar_path} -xpf install_tr.tar" );
  386.     @unlink( "install_tr.tar" );
  387.     if ( @( !file_exists( "files" ) || !file_exists( "files/.htaccess" ) ) )
  388.     {
  389.         echo "ошибка в структуре, возможно не хватает прав или проблема с tar";
  390.         exit( );
  391.     }
  392.     echo "структура успешно создана<br>";
  393.     @unlink( "files/update.inc" );
  394.     echo "\n    <form action='install.php' method='POST'>\n    <h4>Логин и пароль для админки</h4>\n    <input type='text' name='admin_user' value='{$admin_user}'>User<br>\n    <input type='password' name='admin_pass' value='{$admin_pass}'> Pass<br><br><br>\n    <h4>Установки MYSQL</h4>\n    <input type='text' name='dbhost' value='localhost'>Mysql Host<br>\n    <input type='text' name='dbname'>Mysql DB Name<br>\n    <input type='text' name='dbuser'>Mysql User<br>\n    <input type='password' name='dbpass'>Mysql Pass<br>\n    <input type='checkbox' name='db_cleaner'> очистить базу<br>\n    <input type='hidden' name='proc' value='mysql_setup'>\n    <input type='submit' value='next'>\n    </form>\n";
  395.     exit( );
  396. }
  397. echo "<a href=\"install.php?proc=install\">Установить Tube Rotator</a><br>";
  398. echo "\n</body>\n</html>\n";
  399. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement