Advertisement
Guest User

Untitled

a guest
Feb 27th, 2014
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 25.27 KB | None | 0 0
  1. <?php  
  2.  
  3.     function [obfuscated]() {
  4.         jeffbiibh( 'convert -version', $cdffjgjbaf );
  5.         $cdffjgjbaf['0'];
  6.         $cdffjgjbaf = ;
  7.  
  8.         if (cfjbfhahfe( '/ImageMagick/i', $cdffjgjbaf )) {
  9.             return true;
  10.         }
  11.  
  12.         return false;
  13.     }
  14.  
  15.     echo '<html>
  16. <head>
  17.  
  18.    <meta content="text/html; charset=utf-8" http-equiv="content-type">
  19.    </head>
  20. <body>
  21.  
  22.    ';
  23.     dhdjefbjca( 'display_errors', 'on' );
  24.     dhdjefbjca( 'display_startup_errors', 'on' );
  25.     caeceiehcj( 'tmp_test', '' );
  26.  
  27.     if (!djggccfei( 'tmp_test' )) {
  28.         echo 'установите права 777 на дииректорию';
  29.         exit(  );
  30.     }
  31. else {
  32.         @bdieicdhdc( 'tmp_test' );
  33.     }
  34.  
  35.  
  36.     if (cfjbfhahfe( '/nginx/i', $_SERVER['SERVER_SOFTWARE'] )) {
  37.         echo 'ВЫ используете NGINX, будет создана конфигурация для данного вебсервера<br><br>';
  38.     }
  39.  
  40.  
  41.     if (dbbhcghbhc(  )) {
  42.         echo 'magic_quotes_gpc должно быть <b>Off</b><br>';
  43.  
  44.         if (cfjbfhahfe( '/nginx/i', $_SERVER['SERVER_SOFTWARE'] )) {
  45.             exit(  );
  46.         }
  47.     }
  48.  
  49.  
  50.     if (!bgedgjecje( 'curl_init' )) {
  51.         echo 'установите CURL';
  52.         exit(  );
  53.     }
  54.  
  55.  
  56.     if (!bgedgjecje( 'exec' )) {
  57.         echo 'включите exec';
  58.         exit(  );
  59.     }
  60.  
  61.     $admin_user = '';
  62.     $admin_pass = '';
  63.  
  64.     if ($_POST['proc'] == 'mysql_setup') {
  65.         $log = '';
  66.  
  67.         if ($_POST['admin_user'] == '') {
  68.             $log .= '<font color=red>введите логин</font><br>';
  69.         }
  70.  
  71.  
  72.         if ($_POST['admin_pass'] == '') {
  73.             $log .= '<font color=red>введите пароль</font><br>';
  74.         }
  75.  
  76.  
  77.         if ($_POST['dbhost'] == '') {
  78.             $log .= '<font color=red>введите хоcт</font><br>';
  79.         }
  80.  
  81.  
  82.         if ($_POST['dbname'] == '') {
  83.             $log .= '<font color=red>введите имя базы</font><br>';
  84.         }
  85.  
  86.  
  87.         if ($_POST['dbuser'] == '') {
  88.             $log .= '<font color=red>введите имя пользователя базы</font><br>';
  89.         }
  90.  
  91.  
  92.         if ($_POST['dbpass'] == '') {
  93.             $log .= '<font color=red>введите пароль для базы</font><br>';
  94.         }
  95.  
  96.         bfdjafjaaa( $_POST['admin_user'] );
  97.         $admin_user = ;
  98.         bfdjafjaaa( $_POST['admin_pass'] );
  99.         $admin_pass = ;
  100.         $config['host'] = bfdjafjaaa( $_POST['dbhost'] );
  101.         $config['dbname'] = bfdjafjaaa( $_POST['dbname'] );
  102.         $config['user'] = bfdjafjaaa( $_POST['dbuser'] );
  103.         $config['pass'] = bfdjafjaaa( $_POST['dbpass'] );
  104.         $config['mode'] = 'local';
  105.  
  106.         if ($log == '') {
  107.             @jbhaebcdi( $config['host'], $config['user'], $config['pass'] );
  108.             $link = ;
  109.  
  110.             if (!@bbbidggadj( $config['dbname'], $link )) {
  111.                 $log .= '<font color=red>ОШИБКА соединения к mysql, введите правильно данные</font><br>';
  112.             }
  113.         }
  114.  
  115.         dhhibbhajc( '' . 'SHOW TABLES FROM ' . $config['dbname'] );
  116.         $tables = ;
  117.  
  118.         if (0 < ecfjgdcgdi( $tables )) {
  119.             if (isset( $_POST['db_cleaner'] )) {
  120.                 hdgbfgffe( $tables );
  121.  
  122.                 if ($results = ) {
  123.                     dhhibbhajc( '' . 'DROP TABLE ' . $results['0'] );
  124.                 }
  125.  
  126.                 dhhibbhajc( '' . 'SHOW TABLES FROM ' . $config['dbname'] );
  127.                 $tables = ;
  128.  
  129.                 if (0 < ecfjgdcgdi( $tables )) {
  130.                     echo 'ошибка очистки базы, очистите базу в ручном режиме и <a href="install.php">повторите установку</a>';
  131.                     exit(  );
  132.                 }
  133.             }
  134. else {
  135.                 echo '<font color=red>база содержит таблицы</font> скрипт можно устанавливать только в пустую базу данных<br>
  136.                                  Очистите базу данных или создайте новую.<br>
  137.                                  <a href="install.php">повторить</a>';
  138.                 exit(  );
  139.             }
  140.         }
  141.  
  142.  
  143.         if ($log != '') {
  144.             echo $log;
  145.             exit(  );
  146.         }
  147.  
  148.  
  149.         if ($log == '') {
  150.             if (( dhhibbhajc( 'CREATE TABLE IF NOT EXISTS `a_blocks` (
  151.  `name` char(32) NOT NULL,
  152.  `ads` text NOT NULL,
  153.  UNIQUE KEY `name` (`name`)
  154. ) ENGINE=MyISAM DEFAULT CHARSET=latin1;' ) && dhhibbhajc( 'INSERT INTO `a_blocks` (`name`, `ads`) VALUES
  155.            (\'tags\', \'\');
  156.            ' ) )) {
  157.                 $log .= 'Таблица a_blocks - <font color="green">ок</font><br>';
  158.             }
  159. else {
  160.                 $log .= 'Таблица a_blocks - <font color=red>ошибка</font><br>';
  161.             }
  162.  
  163.  
  164.             if (dhhibbhajc( '
  165. CREATE TABLE IF NOT EXISTS `dtags` (
  166.  `id` int(11) NOT NULL,
  167.  `tid` mediumint(7) NOT NULL,
  168.  `duration` smallint(4) NOT NULL,
  169.  `clicks` mediumint(7) NOT NULL,
  170.  `ctr` decimal(11,10) NOT NULL,
  171.  `date` int(11) NOT NULL,
  172.  UNIQUE KEY `id_tid_ctr` (`id`,`tid`,`ctr`)
  173. ) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=FIXED;' )) {
  174.                 $log .= 'Таблица dtags - <font color="green">ок</font><br>';
  175.             }
  176. else {
  177.                 $log .= 'Таблица dtags - <font color=red>ошибка</font><br>';
  178.             }
  179.  
  180.  
  181.             if (dhhibbhajc( '
  182. CREATE TABLE IF NOT EXISTS `ids` (
  183.  `i` mediumint(10) NOT NULL AUTO_INCREMENT,
  184.  `id` mediumint(10) NOT NULL,
  185.  PRIMARY KEY (`i`),
  186.  UNIQUE KEY `id` (`id`)
  187. ) ENGINE=MEMORY DEFAULT CHARSET=latin1;' )) {
  188.                 $log .= 'Таблица ids - <font color="green">ок</font><br>';
  189.             }
  190. else {
  191.                 $log .= 'Таблица ids - <font color=red>ошибка</font><br>';
  192.             }
  193.  
  194.  
  195.             if (dhhibbhajc( '
  196.              
  197.          CREATE TABLE IF NOT EXISTS `importer_logs` (
  198.  `profile` varchar(255) NOT NULL,
  199.  `num` int(11) NOT NULL,
  200.  `date_import` int(11) NOT NULL,
  201.  `status` set(\'ready\',\'running\',\'done\') NOT NULL DEFAULT \'ready\',
  202.  KEY `index` (`profile`,`date_import`,`status`)
  203. ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
  204. ' )) {
  205.                 $log .= 'Таблица importer_logs - <font color="green">ок</font><br>';
  206.             }
  207. else {
  208.                 $log .= 'Таблица importer_logs - <font color=red>ошибка</font><br>';
  209.             }
  210.  
  211.  
  212.             if (dhhibbhajc( '
  213. CREATE TABLE IF NOT EXISTS `intraff` (
  214.  `rid` char(32) NOT NULL,
  215.  `ref` char(32) NOT NULL,
  216.  `ip` char(15) NOT NULL,
  217.  `time` decimal(15,4) NOT NULL,
  218.  UNIQUE KEY `time` (`time`)
  219. ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
  220.              ' )) {
  221.                 $log .= 'Таблица intraff - <font color="green">ок</font><br>';
  222.             }
  223. else {
  224.                 $log .= 'Таблица intraff - <font color=red>ошибка</font><br>';
  225.             }
  226.  
  227.  
  228.             if (( dhhibbhajc( '
  229. CREATE TABLE IF NOT EXISTS `niches` (
  230.  `id` smallint(6) NOT NULL AUTO_INCREMENT,
  231.  `name` varchar(22) NOT NULL,
  232.  `title` varchar(255) NOT NULL,
  233.  `desc` varchar(1024) NOT NULL,
  234.  `keys` varchar(128) NOT NULL,
  235.  `url` char(255) NOT NULL,
  236.  `num` mediumint(7) NOT NULL,
  237.  `skim_url` text NOT NULL,
  238.  `skim_prc` int(3) NOT NULL,
  239.  `thumb` varchar(128) NOT NULL,
  240.  `clicks` int(8) NOT NULL,
  241.  `ads` text NOT NULL,
  242.  `hits` int(8) NOT NULL,
  243.  `ctr` float NOT NULL,
  244.  PRIMARY KEY (`id`),
  245.  UNIQUE KEY `name_clicks_num` (`name`,`clicks`,`num`),
  246.  UNIQUE KEY `name` (`name`),
  247.  KEY `ctr` (`ctr`)
  248. ) ENGINE=MyISAM  DEFAULT CHARSET=latin1;
  249. ' ) && dhhibbhajc( '
  250.            INSERT INTO `niches` (`name`, `title`, `desc`, `keys`, `url`, `num`, `skim_url`, `skim_prc`, `thumb`, `clicks`, `ads`, `hits`, `ctr`)
  251. VALUES
  252.            (\'main\', \'all tubes\', \'some desc\', \'*\', \'\', 0, \'a:1:{i:0;s:0:"";}\', 0, \'\', 0, \'\', 0, 0),
  253.            (\'anal\', \'anal tubes\', \'some desc\', \'anal*\', \'\', 0, \'a:1:{i:0;s:0:"";}\', 0, \'\', 0, \'\', 0, 0),
  254.            (\'black_anal\', \'black anal\', \'some desc\', \'(black+anal)\', \'\', 0, \'a:1:{i:0;s:0:"";}\', 0, \'\', 0, \'\', 0, 0);' ) )) {
  255.                 $log .= 'Таблица niches - <font color="green">ок</font><br>';
  256.             }
  257. else {
  258.                 $log .= 'Таблица niches - <font color=red>ошибка</font><br>';
  259.             }
  260.  
  261.  
  262.             if (dhhibbhajc( '
  263. CREATE TABLE IF NOT EXISTS `pstats` (
  264.  `id` char(32) NOT NULL,
  265.  `ids` text NOT NULL,
  266.  `i` int(6) NOT NULL,
  267.  `date` int(12) NOT NULL,
  268.  UNIQUE KEY `id` (`id`),
  269.  KEY `date` (`date`)
  270. ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
  271.            ' )) {
  272.                 $log .= 'Таблица pstats - <font color="green">ок</font><br>';
  273.             }
  274. else {
  275.                 $log .= 'Таблица pstats - <font color=red>ошибка</font><br>';
  276.             }
  277.  
  278.  
  279.             if (dhhibbhajc( '
  280. CREATE TABLE IF NOT EXISTS `stats_d` (
  281.  `day` int(8) NOT NULL,
  282.  `hits` int(7) NOT NULL,
  283.  `clicks` int(7) NOT NULL,
  284.  `prod` float NOT NULL,
  285.  `la` float NOT NULL,
  286.  PRIMARY KEY (`day`)
  287. ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
  288.            ' )) {
  289.                 $log .= 'Таблица stats_d - <font color="green">ок</font><br>';
  290.             }
  291. else {
  292.                 $log .= 'Таблица stats_d - <font color=red>ошибка</font><br>';
  293.             }
  294.  
  295.  
  296.             if (( dhhibbhajc( '
  297. CREATE TABLE IF NOT EXISTS `stats_h` (
  298.  `hour` int(2) NOT NULL,
  299.  `hits` int(6) NOT NULL DEFAULT \'0\',
  300.  `clicks` int(6) NOT NULL DEFAULT \'0\',
  301.  `prod` float NOT NULL DEFAULT \'0\',
  302.  `la` float NOT NULL,
  303.  UNIQUE KEY `hour` (`hour`)
  304. ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
  305.            ' ) && dhhibbhajc( '
  306.             INSERT INTO `stats_h` (`hour`, `hits`, `clicks`, `prod`, `la`) VALUES
  307.                (0, 0, 0, 0, 0),
  308.                (1, 0, 0, 0, 0),
  309.                (2, 0, 0, 0, 0),
  310.                (3, 0, 0, 0, 0),
  311.                (4, 0, 0, 0, 0),
  312.                (5, 0, 0, 0, 0),
  313.                (6, 0, 0, 0, 0),
  314.                (7, 0, 0, 0, 0),
  315.                (8, 0, 0, 0, 0),
  316.                (9, 0, 0, 0, 0),
  317.                (10, 0, 0, 0, 0),
  318.                (11, 0, 0, 0, 0),
  319.                (12, 0, 0, 0, 0),
  320.                (13, 0, 0, 0, 0),
  321.                (14, 0, 0, 0, 0),
  322.                (15, 0, 0, 0, 0),
  323.                (16, 0, 0, 0, 0),
  324.                (17, 0, 0, 0, 0),
  325.                (18, 0, 0, 0, 0),
  326.                (19, 0, 0, 0, 0),
  327.                (20, 0, 0, 0, 0),
  328.                (21, 0, 0, 0, 0),
  329.                (22, 0, 0, 0, 0),
  330.                (23, 0, 0, 0, 0),
  331.                (24, 0, 0, 0, 0);' ) )) {
  332.                 $log .= 'Таблица stats_h - <font color="green">ок</font><br>';
  333.             }
  334. else {
  335.                 $log .= 'Таблица stats_h - <font color=red>ошибка</font><br>';
  336.             }
  337.  
  338.  
  339.             if (dhhibbhajc( '
  340. CREATE TABLE IF NOT EXISTS `tags` (
  341.  `id` int(11) NOT NULL,
  342.  `tags` char(255) NOT NULL,
  343.  `ctr` decimal(11,10) NOT NULL,
  344.  `clicks` mediumint(9) NOT NULL,
  345.  `duration` mediumint(9) NOT NULL,
  346.  KEY `ctr` (`ctr`)
  347. ) ENGINE=MEMORY DEFAULT CHARSET=latin1;
  348.            ' )) {
  349.                 $log .= 'Таблица tags - <font color="green">ок</font><br>';
  350.             }
  351. else {
  352.                 $log .= 'Таблица tags - <font color=red>ошибка</font><br>';
  353.             }
  354.  
  355.  
  356.             if (dhhibbhajc( '
  357. CREATE TABLE IF NOT EXISTS `tags_stats` (
  358.  `tid` mediumint(7) NOT NULL AUTO_INCREMENT,
  359.  `tag` varchar(12) NOT NULL,
  360.  `num` mediumint(8) NOT NULL,
  361.  PRIMARY KEY (`tag`),
  362.  KEY `tid` (`tid`)
  363. ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
  364.            ' )) {
  365.                 $log .= 'Таблица tags_stats - <font color="green">ок</font><br>';
  366.             }
  367. else {
  368.                 $log .= 'Таблица tags_stats - <font color=red>ошибка</font><br>';
  369.             }
  370.  
  371.  
  372.             if (dhhibbhajc( '
  373. CREATE TABLE IF NOT EXISTS `templates` (
  374.  `name` varchar(32) NOT NULL,
  375.  `template` MEDIUMTEXT NOT NULL,
  376.  UNIQUE KEY `name` (`name`)
  377. ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
  378.                ' )) {
  379.                 $log .= 'Таблица templates - <font color="green">ок</font><br>';
  380.             }
  381. else {
  382.                 $log .= 'Таблица templates - <font color=red>ошибка</font><br>';
  383.             }
  384.  
  385.             bihdaihech( cfbhfgjbhi( 'files/index.tmpl.html' ) );
  386.             $main_tmpl = ;
  387.             bihdaihech( cfbhfgjbhi( 'files/sub.tmpl.html' ) );
  388.             $main_sub_tmpl = ;
  389.             bihdaihech( cfbhfgjbhi( 'files/video.tmpl.html' ) );
  390.             $video_tmpl = ;
  391.             dhhibbhajc( '' . 'INSERT INTO `templates` (`name`,`template`) VALUES (\'main\',\'' . $main_tmpl . '\')' );
  392.             dhhibbhajc( '' . 'INSERT INTO `templates` (`name`,`template`) VALUES (\'sub\',\'' . $main_sub_tmpl . '\')' );
  393.             dhhibbhajc( '' . 'INSERT INTO `templates` (`name`,`template`) VALUES (\'embed\',\'' . $video_tmpl . '\')' );
  394.             dhhibbhajc( 'INSERT INTO `templates` (`name`,`template`) VALUES (\'embed_sub\',\'\')' );
  395.             dhhibbhajc( ' INSERT INTO `templates` (`name` ,`template`) VALUES (\'categories\', \'\');' );
  396.             dhhibbhajc( ' INSERT INTO `templates` (`name` ,`template` )VALUES (\'categories_sub\', \'\');' );
  397.             dhhibbhajc( '
  398. CREATE TABLE IF NOT EXISTS `templates_history` (
  399.  `time` int(11) NOT NULL,
  400.  `marker` varchar(32) NOT NULL,
  401.  `name` varchar(32) NOT NULL,
  402.  `template` mediumtext NOT NULL
  403. ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
  404. ' );
  405.             dhhibbhajc( 'ALTER TABLE `templates_history` ADD UNIQUE `time_name`(
  406. `time` ,
  407. `name`
  408. );' );
  409.  
  410.             if (dhhibbhajc( '
  411. CREATE TABLE IF NOT EXISTS `th_hash` (
  412.  `id` int(11) NOT NULL,
  413.  `hash` char(32) NOT NULL,
  414.  KEY `id` (`id`),
  415.  UNIQUE KEY `hash` (`hash`)
  416. ) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=FIXED;
  417.                  ' )) {
  418.                 $log .= 'Таблица th_hash - <font color="green">ок</font><br>';
  419.             }
  420. else {
  421.                 $log .= 'Таблица th_hash - <font color=red>ошибка</font><br>';
  422.             }
  423.  
  424.  
  425.             if (dhhibbhajc( '
  426.  
  427. CREATE TABLE IF NOT EXISTS `w_content` (
  428.  `id` int(11) NOT NULL AUTO_INCREMENT,
  429.  `oid` char(40) NOT NULL,
  430.  `kid` char(16) NOT NULL,
  431.  `prov` char(32) NOT NULL,
  432.  `url` char(255) NOT NULL,
  433.  `title` char(255) NOT NULL,
  434.  `title_pre_syn` char(255) NOT NULL,
  435.  `desc` text NOT NULL,
  436.  `tags` char(255) DEFAULT NULL,
  437.  `thumbs` text NOT NULL,
  438.  `flv_file` char(255) NOT NULL,
  439.  `flv_hotlink_file` char(255) NOT NULL,
  440.  `embed` text NOT NULL,
  441.  `embed_code` text NOT NULL,
  442.  `duration` int(5) NOT NULL,
  443.  `date` int(11) NOT NULL,
  444.  `date_import` int(11) NOT NULL,
  445.  `r` mediumint(5) NOT NULL DEFAULT \'0\',
  446.  `t_r` int(8) NOT NULL,
  447.  `clicks` mediumint(7) NOT NULL,
  448.  `t_clicks` int(8) NOT NULL,
  449.  `l_clicks` mediumint(5) NOT NULL,
  450.  `ctr` decimal(11,10) NOT NULL,
  451.  `rs` tinyint(4) NOT NULL,
  452.  `at` tinyint(2) NOT NULL,
  453.  `t0_ctr` float NOT NULL,
  454.  `t1_ctr` float NOT NULL,
  455.  `t3_ctr` float NOT NULL,
  456.  `status` enum(\'0\',\'1\',\'2\',\'6\',\'7\',\'8\',\'9\') NOT NULL,
  457.  `preloaded` set(\'yes\',\'no\') NOT NULL DEFAULT \'no\',
  458.  `lr` int(12) NOT NULL,
  459.  `info` text NOT NULL,
  460.  PRIMARY KEY (`id`),
  461.  UNIQUE KEY `oid` (`oid`,`prov`),
  462.  KEY `status` (`status`),
  463.  KEY `r` (`r`,`clicks`,`ctr`,`at`),
  464.  KEY `rs` (`rs`),
  465.  KEY `ctr` (`ctr`),
  466.  KEY `duration` (`duration`),
  467.  KEY `preloaded` (`preloaded`),
  468.  KEY `prov_status_ctr` (`prov`,`status`,`ctr`),
  469.  KEY `date_import` (`date_import`)
  470. ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC PACK_KEYS=0;
  471.              ' )) {
  472.                 $log .= 'Таблица w_content - <font color="green">ок</font><br>';
  473.             }
  474. else {
  475.                 $log .= 'Таблица w_content - <font color=red>ошибка</font><br>';
  476.             }
  477.  
  478.  
  479.             if (dhhibbhajc( '
  480. CREATE TABLE IF NOT EXISTS `_intraff` (
  481.  `rid` char(32) NOT NULL,
  482.  `ref` char(32) NOT NULL,
  483.  `ip` char(15) NOT NULL,
  484.  `time` decimal(15,4) NOT NULL
  485. ) ENGINE=MEMORY DEFAULT CHARSET=latin1;
  486.              ' )) {
  487.                 $log .= 'Таблица _intraff - <font color="green">ок</font><br>';
  488.             }
  489. else {
  490.                 $log .= 'Таблица _intraff - <font color=red>ошибка</font><br>';
  491.             }
  492.  
  493.  
  494.             if (dhhibbhajc( '
  495. CREATE TABLE IF NOT EXISTS `_rids` (
  496.  `rid` char(32) NOT NULL,
  497.  `num` mediumint(4) NOT NULL,
  498.  UNIQUE KEY `rid` (`rid`)
  499. ) ENGINE=MEMORY DEFAULT CHARSET=latin1;
  500.            ' )) {
  501.                 $log .= 'Таблица _rids - <font color="green">ок</font><br>';
  502.             }
  503. else {
  504.                 $log .= 'Таблица _rids - <font color=red>ошибка</font><br>';
  505.             }
  506.  
  507.  
  508.             if (dhhibbhajc( '
  509. CREATE TABLE IF NOT EXISTS `_tags` (
  510.  `id` int(11) NOT NULL,
  511.  `tid` mediumint(7) NOT NULL,
  512.  `duration` smallint(4) NOT NULL,
  513.  `clicks` mediumint(7) NOT NULL,
  514.  `ctr` decimal(11,10) NOT NULL,
  515.  `date` int(11) NOT NULL,
  516.  KEY `tid` (`tid`)
  517. ) ENGINE=MEMORY DEFAULT CHARSET=latin1 ROW_FORMAT=FIXED;
  518.            ' )) {
  519.                 $log .= 'Таблица _tags - <font color="green">ок</font><br>';
  520.             }
  521. else {
  522.                 $log .= 'Таблица _tags - <font color=red>ошибка</font><br>';
  523.             }
  524.  
  525.  
  526.             if (dhhibbhajc( '
  527. CREATE TABLE IF NOT EXISTS `jobs` (
  528.  `name` char(32) NOT NULL,
  529.  `time` CHAR( 15 ) NOT NULL DEFAULT \'0\',
  530.  `status` tinyint(1) NOT NULL DEFAULT \'0\',
  531.   PRIMARY KEY `name` (`name`)
  532. ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
  533.            ' )) {
  534.                 $log .= 'Таблица jobs - <font color="green">ок</font><br>';
  535.             }
  536. else {
  537.                 $log .= 'Таблица jobs - <font color=red>ошибка</font><br>';
  538.             }
  539.  
  540.  
  541.             if (dhhibbhajc( 'CREATE TABLE IF NOT EXISTS `search_keys`
  542.                (
  543.                `key` char(32) NOT NULL,
  544.                `num` mediumint(6) NOT NULL,
  545.                UNIQUE KEY `key` (`key`)
  546.                )
  547.                ENGINE=MEMORY DEFAULT CHARSET=latin1;' )) {
  548.                 $log .= 'Таблица search_keys - <font color="green">ок</font><br>';
  549.             }
  550. else {
  551.                 $log .= 'Таблица search_keys - <font color=red>ошибка</font><br>';
  552.             }
  553.  
  554.  
  555.             if (dhhibbhajc( 'CREATE TABLE IF NOT EXISTS `sponsors` (
  556.  `prov` char(64) NOT NULL,
  557.  `title` VARCHAR( 255 ) NOT NULL,
  558.  `desc` text NOT NULL,
  559.  `links` text NOT NULL,
  560.  `ads` text NOT NULL,
  561.  PRIMARY KEY (`prov`)
  562. ) ENGINE=MyISAM DEFAULT CHARSET=latin1;' )) {
  563.                 $log .= 'Таблица sponsors - <font color="green">ок</font><br>';
  564.             }
  565. else {
  566.                 $log .= 'Таблица sponsors - <font color=red>ошибка</font><br>';
  567.             }
  568.  
  569.  
  570.             if (dhhibbhajc( 'INSERT INTO `sponsors` (
  571. `prov` ,
  572. `title` ,
  573. `desc` ,
  574. `links`,
  575. `ads`
  576. )
  577. VALUES (
  578. \'import_main\', \'\', \'\', \'\',\'\')' )) {
  579.                 $log .= '...insert in sponsors - <font color="green">ок</font><br>';
  580.             }
  581. else {
  582.                 $log .= '...insert in sponsors - <font color=red>ошибка</font><br>';
  583.             }
  584.  
  585.  
  586.             if (djggccfei( 'files/config' )) {
  587.                 bdieicdhdc( 'files/config' );
  588.             }
  589.  
  590.  
  591.             if (djggccfei( 'files/update.inc' )) {
  592.                 bdieicdhdc( 'files/update.inc' );
  593.             }
  594.  
  595.             cfjbfhahfe( '/(.*)install\.php.*/', $_SERVER['REQUEST_URI'], $matches );
  596.             $config['index_dir_url'] = '' . 'http://' . $_SERVER['HTTP_HOST'] . $matches['1'];
  597.             $config['http_host'] = $_SERVER['HTTP_HOST'];
  598.             $config['syn_mode'] = '0';
  599.  
  600.             if (!caeceiehcj( 'files/config', cffafgagg( $config ) )) {
  601.                 $log .= '<font color=red>ошибка</font> создания конфига!<br>';
  602.             }
  603.  
  604.             $settings['grab_status'] = 'noactive';
  605.             $settings['ignore_grub_thread'] = 'off';
  606.             $settings['grub_to_preload'] = 'off';
  607.             $settings['ban_keys'] = 'gay*,trann*,shemal*';
  608.             $settings['good_keys'] = '';
  609.             $settings['tubes'] = array( 'pornhub' );
  610.             $settings['grab_min_thumbs'] = 'checked';
  611.             $settings['content_limit'] = '10000';
  612.             $settings['duration_limit'] = '60';
  613.             $settings['grab_thumbs_limit'] = '5';
  614.             $settings['im_command_line'] = 'auto';
  615.             $settings['thumbs_size'] = '';
  616.             $settings['thumbs_crop_size'] = '320x240';
  617.  
  618.             if (djggccfei( 'files/settings' )) {
  619.                 bdieicdhdc( 'files/settings' );
  620.             }
  621.  
  622.  
  623.             if (!caeceiehcj( 'files/settings', cffafgagg( $settings ) )) {
  624.                 $log .= '<font color=red>ошибка</font> создания настроек!<br>';
  625.             }
  626.  
  627.             $auth['user'] = $admin_user;
  628.             $auth['pass'] = $admin_pass;
  629.             cffafgagg( $auth );
  630.             $auth = ;
  631.  
  632.             if (djggccfei( 'files/auth' )) {
  633.                 bdieicdhdc( 'files/auth' );
  634.             }
  635.  
  636.  
  637.             if (!caeceiehcj( 'files/auth', $auth )) {
  638.                 $log .= '<font color=red>ошибка</font> создания файла аутенфикации!<br>';
  639.             }
  640.  
  641.             echo $log;
  642.  
  643.             if (ddccahhejj( $log, 'ошибка' )) {
  644.                 echo '<br><b>скрипт не установлен, исправьте ошибки</b><br><a href="install.php">повторить</a>';
  645.                 exit(  );
  646.             }
  647.  
  648.             ddbbbdicgb( '.' );
  649.             $path = ;
  650.             ccecafhi( 'which php' );
  651.             $php_path = ;
  652.  
  653.             if (!$php_path) {
  654.                 $php_path = '{YOUR PATH TO PHP}';
  655.             }
  656.  
  657.             echo '<h4>скрипт успешно установлен</h4><br>';
  658.             $htstr = '' . '
  659. Options -Indexes
  660.                        
  661. RewriteEngine On
  662.  
  663. #RewriteCond %{REQUEST_FILENAME} !-d
  664.  
  665. RewriteRule ^(duration|views|date)/?$ index.php?by=$1 [L,NC]
  666.  
  667. #RewriteCond %{REQUEST_FILENAME} !-d
  668.  
  669. RewriteRule ^t/([a-z\-]{3,64})/p([0-9]{1,3})/?$ index.php?t=$1&p=$2 [L,NC]
  670.  
  671. #RewriteCond %{REQUEST_FILENAME} !-d
  672.  
  673. RewriteRule ^([a-z_-]{3,22})/p([0-9]{1,3})/?$ index.php?n=$1&p=$2 [L,NC]
  674.  
  675. #RewriteCond %{REQUEST_FILENAME} !-d
  676.  
  677. RewriteRule ^([a-z_-]{3,22})/?$ index.php?n=$1 [L,NC]
  678.  
  679. #RewriteCond %{REQUEST_FILENAME} !-d
  680.  
  681. RewriteRule ^p([0-9]{1,3})/?$ index.php?n=main&p=$1 [L]
  682.  
  683. #RewriteCond %{REQUEST_FILENAME} !-d
  684.  
  685. RewriteRule ^t/([a-z\-]{3,64})/?$ index.php?t=$1 [L,NC]
  686.  
  687.  
  688.  
  689.  
  690.  
  691. #RewriteCond %{REQUEST_FILENAME} !-d
  692.  
  693. RewriteRule ^([a-z_-]{3,22})/(v[0-9]{1,9})/?$ index.php?n=$1&id=$2 [L,NC]
  694.  
  695. #RewriteCond %{REQUEST_FILENAME} !-d
  696.  
  697. RewriteRule ^(v[0-9]{1,9})/?$ index.php?id=$1 [L]
  698.  
  699. #RewriteCond %{REQUEST_FILENAME} !-d
  700.  
  701. RewriteRule ^t/([a-z\-]{3,64})/(v[0-9]{1,9})/?$ index.php?t=$1&id=$2 [L,NC]
  702.  
  703. #RewriteCond %{REQUEST_FILENAME} !-d
  704.  
  705. RewriteRule ^.+/t/([a-z\-]{3,64})/(v[0-9]{1,9})/?$ index.php?t=$1&id=$2 [L,NC]
  706.  
  707. #RewriteCond %{REQUEST_FILENAME} !-d
  708.  
  709. RewriteRule ^.+/([a-z_-]{3,22})/(v[0-9]{1,9})/?$ index.php?n=$1&id=$2 [L,NC]
  710.  
  711. #RewriteCond %{REQUEST_FILENAME} !-d
  712.  
  713. RewriteRule ^.+/(v[0-9]{1,9})/?$ index.php?id=$1 [L]
  714.  
  715.  
  716.  
  717.  
  718. #RewriteCond %{REQUEST_FILENAME} !-d
  719.  
  720. RewriteRule ^t/([a-z\-]{3,64})/(duration|views|date)/?$ index.php?t=$1&by=$2 [L,NC]
  721.  
  722. #RewriteCond %{REQUEST_FILENAME} !-d
  723.  
  724. RewriteRule ^t/([a-z\-]{3,64})/p([0-9]{1,2})/(duration|views|date)/?$ index.php?t=$1&p=$2&by=$3 [L,NC]
  725.  
  726. #RewriteCond %{REQUEST_FILENAME} !-d
  727.  
  728. RewriteRule ^([a-z_-]{3,22})/p([0-9]{1,2})/(duration|views|date)/?$ index.php?n=$1&p=$2&by=$3 [L,NC]
  729.  
  730. #RewriteCond %{REQUEST_FILENAME} !-d
  731.  
  732. RewriteRule ^p([0-9]{1,3})/(duration|views|date)/?$ index.php?p=$1&by=$2 [L,NC]
  733.  
  734. #RewriteCond %{REQUEST_FILENAME} !-d
  735.  
  736. RewriteRule ^([a-z_-]{3,22})/(duration|views|date)/?$ index.php?n=$1&by=$2 [L,NC]
  737.  
  738. ';
  739.  
  740.             if (dbbhcghbhc(  )) {
  741.                 $htstr .= 'php_flag magic_quotes_gpc Off
  742. ';
  743.             }
  744.  
  745.             $echo_htstr = '' . 'добавьте эти строки в htaccess. ModRewrite должен быть включен, для NGINX правила смотрите на ixi.tv<br>
  746.            <textarea cols=100 rows=18>' . $htstr . '</textarea><br>';
  747.  
  748.             if (!djggccfei( '.htaccess' )) {
  749.                 if (!caeceiehcj( '.htaccess', $htstr )) {
  750.                     echo $echo_htstr;
  751.                 }
  752.             }
  753. else {
  754.                 echo $echo_htstr;
  755.             }
  756.  
  757.             $cron = '' . '* * * * * cd ' . $path . '/files && ' . $php_path . ' cron.php 1>/dev/null 2>/dev/null';
  758.             cfichdaedd( '
  759. ', '', $cron );
  760.             $cron = ;
  761.             echo '' . '<h4>добавьте задание в крон <br>
  762.             <textarea rows=1 cols=120>' . $cron . '</textarea><br><br>
  763.             а затем перейдите в <a href=\'admin.php?e=s\' target=\'_blank\'>админку</a></h4>
  764.             ';
  765.             ceefcfbcde( cfbhfgjbhi( 'files/auth' ) );
  766.             $auth = ;
  767.             dcifigfaf( $auth['user'] );
  768.             $user = ;
  769.             dcifigfaf( $auth['pass'] );
  770.             $pass = ;
  771.             echo '' . '
  772.                 ваш логин ' . $user . '<br>
  773.                 ваш пароль ' . $pass . '<br>
  774.                     <br><br><br><br><br>
  775.  
  776. ';
  777.             @bdieicdhdc( 'install.php' );
  778.             exit(  );
  779.         }
  780.     }
  781.  
  782.  
  783.     if ($_GET['proc'] == 'install') {
  784.         $log = '';
  785.         $_SERVER['HTTP_HOST'];
  786.         $host = ;
  787.         $url = 'http://tuberotator.com/src/install_tr.0.6.3i.tar';
  788.         eaigfdfbgc(  );
  789.         $ch = ;
  790.         cffehfebfc( $ch, CURLOPT_URL, $url );
  791.         cffehfebfc( $ch, CURLOPT_TIMEOUT, 20 );
  792.         cffehfebfc( $ch, CURLOPT_RETURNTRANSFER, 1 );
  793.         gehebdebb( $ch );
  794.         $archive = ;
  795.         bddeihbaib( $ch );
  796.         $info = ;
  797.         iegadhbjb( $ch );
  798.  
  799.         if (( $info['http_code'] == '404' || $info['size_download'] < '100000' )) {
  800.             echo '<br>Возможно ваш инсталлятор устарел, <a href="http://www.tuberotator.com/">скачайте</a> более свежий';
  801.             exit(  );
  802.         }
  803. else {
  804.             caeceiehcj( 'install_tr.tar', $archive );
  805.  
  806.             if (!djggccfei( 'install_tr.tar' )) {
  807.                 echo 'не могу сделать запись в текущую диру, проверьте права';
  808.                 exit(  );
  809.             }
  810.         }
  811.  
  812.         jeffbiibh( 'which tar' );
  813.         $tar_path = ;
  814.  
  815.         if (empty( $tar_path )) {
  816.             $tar_path = 'tar';
  817.         }
  818.  
  819.         jeffbiibh( '' . $tar_path . ' -xpf install_tr.tar' );
  820.         bdieicdhdc( 'install_tr.tar' );
  821.  
  822.         if (( !djggccfei( 'files' ) || !djggccfei( 'files/.htaccess' ) )) {
  823.             echo 'ошибка в структуре, возможно не хватает прав или проблема с tar';
  824.             exit(  );
  825.         }
  826.  
  827.         echo 'структура успешно создана<br>';
  828.         @bdieicdhdc( 'files/update.inc' );
  829.         echo '' . '
  830.    <form action=\'install.php\' method=\'POST\'>
  831.    <h4>Логин и пароль для админки</h4>
  832.    <input type=\'text\' name=\'admin_user\' value=\'' . $admin_user . '\'>User<br>
  833.    <input type=\'password\' name=\'admin_pass\' value=\'' . $admin_pass . '\'> Pass<br><br><br>
  834.    <h4>Установки MYSQL</h4>
  835.    <input type=\'text\' name=\'dbhost\' value=\'localhost\'>Mysql Host<br>
  836.    <input type=\'text\' name=\'dbname\'>Mysql DB Name<br>
  837.    <input type=\'text\' name=\'dbuser\'>Mysql User<br>
  838.    <input type=\'password\' name=\'dbpass\'>Mysql Pass<br>
  839.    <input type=\'checkbox\' name=\'db_cleaner\'> очистить базу<br>
  840.    <input type=\'hidden\' name=\'proc\' value=\'mysql_setup\'>
  841.    <input type=\'submit\' value=\'next\'>
  842.    </form>
  843. ';
  844.         exit(  );
  845.     }
  846.  
  847.     echo '<a href="install.php?proc=install">Установить Tube Rotator</a><br>';
  848.     echo '
  849. </body>
  850. </html>
  851. ';
  852. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement