Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function s_cookie()
- {
- global $host;
- echo " <script type='text/javascript' language='javascript'>function createCookie(name,value,min) {if (min) {var date = new Date();date.setTime(date.getTime()+(min*60*1000));var expires = \"; expires=\"+date.toGMTString();}else var expires =\"\";document.cookie = name+\"=\"+value+expires+\"; path=/\\ ;do" . __FILE__ . "=.{$host}\";}createCookie('adminlog','ok',20);</script>";
- }
- function curent_date($var, $var2)
- {
- date_default_timezone_set("Europe/Dublin");
- return date($var, $var2);
- }
- function html_header()
- {
- echo "<html> <title>TubeRotator</title> <meta content=\"text/html; charset=UTF-8\" http-equiv=\"content-type\"><script>function iskim(name){var vname = name+\"v\";var ivalue = document.getElementsByClassName(vname);var elems = document.getElementsByClassName(name);for(i=0; i<elems.length; i++) { elems[i].value = ivalue[0].value;}}</script><style>#r_t_tr a { color: white;}#r_t_vers { color: snow;}#r_t_tr td { padding: 7px;}#r_t_tr { background-color: lightslategrey; font-weight: bold;}#r_table { font-family: fantasy; font-size: x-small;}#mass_field { background-color: PowderBlue;}#errors { background-color: red; float: right; font-size: 13px; margin-bottom: 5px; padding: 2px; position: relative; top: 0; width: 100%;}#ads_tab textarea { width: 98%;}#ads_tab { float: left; width: 33%;}#content { left: 0; width: 98%;}#grab_status { color: Red; font-size: 16px; left: 374px; top: 1px;}#prod b { color: green;}#prod { font-size: 12px; left: 50px; position: relative;}#plz_update { color: red; font-size: medium; position: absolute; right: 60px; text-transform: uppercase; top: 10px;}body { background-color: MintCream; color: black; font-family: helvetica; font-size: large; padding-left: 10px; padding-top: 3px;}a { color: SlateGray; font-weight: bolder; text-transform: capitalize;}#table_w { background-color: white; border: medium solid Red; bottom: 35px; position: absolute; right: 15px;}#table_check_perf a { background-color: Navy; border: medium solid Grey; bottom: 162px; color: OldLace; padding: 3px; position: absolute; right: 12px; text-decoration: none;}#last_perf_check { bottom: 192px; font-size: 11px; position: absolute; right: 12px;}#cron_info { font-size: 10px;}input { font-family: arial; font-size: 11px; height: 18px;}</style>";
- if (!empty($flgs['errors']) && "0" < count($flgs['errors'])) {
- echo "<div id=\"errors\">";
- foreach ($flgs['errors'] as $id => $error) {
- echo $error;
- }
- echo "</div>";
- }
- echo " <body><a href=\"admin.php?e=t\">templates</a> / <a href=\"admin.php?e=a\">a-blocks</a> / <a href=\"admin.php?e=n\">niches</a> /<a href=\"admin.php?e=s\">settings</a> /<a href=\"admin.php?e=r\">rotators</a> /<a href=\"http://www.tuberotator.com/docs_ru.html\" target=\"_blank\">help</a> /<a href=\"admin.php?e=news\">news</a> ";
- }
- function get_url($var)
- {
- $host = $_SERVER['HTTP_HOST'];
- if ($var != __FILE__) {
- $sub = str_replace("/admin.php", "/{$var}", $_SERVER['SCRIPT_NAME']);
- } else {
- $sub = str_replace("/admin.php", "", $_SERVER['SCRIPT_NAME']);
- }
- $url = "http://{$host}{$sub}/";
- return $url;
- }
- function fix_chmod()
- {
- chmod("files/tmp/cache/caches", 438);
- chmod("files/config", 438);
- chmod("files/settings", 438);
- chmod("files/tubes", 438);
- chmod("files/auth", 438);
- }
- function redir($url, $time = 1)
- {
- echo " <meta http-equiv='refresh' content='{$time};{$url}'>";
- }
- function cron($name, $time)
- {
- global $dir;
- if (!file_exists("{$dir}/files/tmp/cron_{$name}") || filemtime("{$dir}/files/tmp/cron_{$name}") < time() - $time) {
- if (file_exists("{$dir}/files/tmp/cron_{$name}")) {
- unlink("{$dir}/files/tmp/cron_{$name}");
- }
- file_put_contents("{$dir}/files/tmp/cron_{$name}", "");
- return TRUE;
- }
- return FALSE;
- }
- function get_stats()
- {
- global $dir;
- $curent_hour = curent_date("G", time());
- @$next_hour = @curent_date("G", time() + 3600);
- @$prev_hour = @curent_date("G", time() - 3600);
- $prev_prev_hour = curent_date("G", time() - 7200);
- $q = mysql_query("select * from `stats_h` where prod>0");
- $n = mysql_num_rows($q);
- while ($r = mysql_fetch_array($q)) {
- @$prod_avr = $prod_avr + $r['prod'];
- @$hits_avr = $hits_avr + $r['hits'];
- $arr['hours'][$r['hour']] = $r;
- @$arr['hits_total'] = $arr['hits_total'] + $r['hits'];
- }
- $arr['prod_avr'] = round($prod_avr / $n, 2);
- $arr['hits_avr'] = round($hits_avr / $n, 2);
- $arr['free_space'] = disk_free_space($dir);
- $arr['la'] = sys_getloadavg();
- foreach (sys_getloadavg() as $imformer) {
- $arr['la_str'][] = round($imformer, 1);
- }
- $arr['la_str'] = implode("|", $arr['la_str']);
- @$arr['prod_avr_last'] = round(($arr['hours'][$prev_hour]['prod'] + $arr['hours'][$prev_prev_hour]['prod']) / 2, 0);
- @$arr['hits_avr_last'] = round(($arr['hours'][$prev_prev_hour]['hits'] + $arr['hours'][$prev_hour]['hits']) / 2, 0);
- $q = mysql_query("SELECT count( * ) FROM `w_content` WHERE STATUS = '1'");
- $r = mysql_fetch_row($q);
- $arr['total_active'] = $r['0'];
- $q = mysql_query("SELECT count(*) FROM `w_content` WHERE `rs`>0 limit 1");
- $r = mysql_fetch_row($q);
- $arr['num_rs'] = $r['0'];
- return $arr;
- }
- function check_updates()
- {
- global $script_version;
- global $config;
- global $avr_stats;
- $domain = str_replace("www.", "", getenv("HTTP_HOST"));
- if (empty($config['lic_key'])) {
- $lic = "none";
- } else {
- $lic = $config['lic_key'];
- }
- $update['archive'] = file_get_contents("http://tuberotator.com/src/check.php?v={$script_version}&d={$domain}&lh={$avr_stats['hits_total']}&pr={$avr_stats['prod_avr']}&lic={$lic}");
- preg_match("/start_install_(.*)_install_end/", $update['archive'], $matches);
- @$update['archive'] = base64_decode($matches['1']);
- if (empty($update['archive'])) {
- $update['status'] = "notfound";
- } else {
- $update['status'] = "ok";
- }
- return $update;
- }
- session_start();
- ini_set("max_execution_time", "120");
- ini_set("expose_php", "off");
- ini_set("display_errors", "off");
- ini_set("display_startup_errors", "off");
- ini_set("session.gc_maxlifetime", "86400");
- $host = str_replace("www.", "", getenv("HTTP_HOST"));
- $tmp_dir = sys_get_temp_dir();
- $dir = realpath(".");
- $tf = array();
- $flgs = unserialize(file_get_contents("files/flgs"));
- if (file_exists("install.php")) {
- echo "please remove install.php";
- exit();
- } else if ($_GET['s'] == "exit") {
- session_unset();
- session_destroy();
- header("location:admin.php");
- exit();
- } else {
- $auth = unserialize(file_get_contents("files/auth"));
- $auth_ips = "";
- $tf['ip_protect'] = "";
- if (file_exists("files/auth_ips")) {
- $auth_ips = unserialize(file_get_contents("files/auth_ips"));
- if ($_SERVER['REMOTE_ADDR'] != $auth_ips['ip_admin_protect']) {
- session_unset();
- session_destroy();
- $tf['ip_protect'] = "block";
- }
- }
- $username = md5(stripslashes($auth['user']));
- $password = md5(stripslashes($auth['pass']));
- $hash = md5($password);
- if (isset($_POST['u'], $_POST['p'])) {
- $u = md5($_POST['u']);
- $p = md5($_POST['p']);
- if ($u == $username && $p == $password && $tf['ip_protect'] != "block") {
- $_SESSION['up'] = $hash;
- header("location:admin.php?e=news");
- } else {
- echo "error";
- sleep(2);
- }
- }
- if ($_SESSION['up'] != $hash) {
- echo "<form method='POST' action='admin.php'> <input name='u' value='' size='30'><br> <input name='p' type='password' size='30' value=''> <input type='submit'> </form> ";
- exit();
- } else {
- $config = unserialize(file_get_contents("files/config"));
- $settings = unserialize(file_get_contents("files/settings"));
- $script_version = $settings['script_version'];
- fix_chmod();
- $link = mysql_connect($config['host'], $config['user'], $config['pass']);
- mysql_select_db($config['dbname'], $link);
- if (!empty($_REQUEST['s']) && $_REQUEST['s'] == "rotating_dump") {
- $dump_file = "files/tmp/rotating_dump.gz";
- if (file_exists($dump_file)) {
- unlink($dump_file);
- }
- $fp = gzopen($dump_file, "w3");
- $q = mysql_query("select * from `w_content` where `status`='1' and `clicks`>'9' order by `ctr` DESC limit 0,1000");
- $host = $_SERVER['HTTP_HOST'];
- $sub = str_replace("admin.php", "content", $_SERVER['SCRIPT_NAME']);
- $url = "http://{$host}{$sub}";
- while ($r = mysql_fetch_array($q)) {
- $arr['id'] = $r['id'];
- $arr['oid'] = $r['oid'];
- $arr['prov'] = $r['prov'];
- $arr['url'] = $r['url'];
- $arr['title'] = $r['title'];
- $r['thumbs'] = unserialize($r['thumbs']);
- $arr['thumbs'] = str_replace("/content", $url, $r['thumbs']);
- $arr['embed'] = $r['embed'];
- $arr['duration'] = $r['duration'];
- $arr['r'] = $r['r'];
- $arr['t_r'] = $r['t_r'];
- $arr['clicks'] = $r['clicks'];
- $arr['t_clicks'] = $r['t_clicks'];
- $arr['l_clicks'] = $r['l_clicks'];
- $arr['ctr'] = $r['ctr'];
- $arr['rs'] = $r['rs'];
- $arr['at'] = $r['at'];
- $arr = serialize($arr);
- $arr = "{$arr}";
- gzwrite($fp, $arr);
- $arr = "";
- }
- $q = mysql_query("select * from `niches`");
- while ($r = mysql_fetch_assoc($q)) {
- $r['skim_url'] = unserialize($r['skim_url']);
- $dump['dump_niches'][] = $r;
- }
- $dump['dump_settings'] = $settings;
- $dump['dump_config']['skim_status'] = $config['skim_status'];
- $dump = serialize($dump);
- $dump = "{$dump}";
- gzwrite($fp, $dump);
- gzclose($fp);
- header("Content-Disposition: attachment; filename=rotating_dump.gz");
- header("Content-Type: application/force-download");
- header("Content-Type: application/download");
- header("Content-Description: File Transfer");
- header("Content-Transfer-Encoding: binary");
- header("Expires: 0");
- header("Cache-Control: must-revalidate");
- header("Pragma: public");
- header("Content-Length: " . filesize($dump_file));
- readfile($dump_file);
- ob_clean();
- flush();
- exit();
- } else {
- echo "";
- if (!empty($_REQUEST['e']) && $_REQUEST['e'] == "news") {
- html_header();
- $news = file_get_contents("http://tuberotator.com/src/news.php");
- echo "<br>";
- echo $news;
- }
- html_header();
- $avr_stats = get_stats();
- echo "<span id='prod'>total prod:<b>{$avr_stats['prod_avr']}</b> / last hour <b>{$avr_stats['prod_avr_last']}</b> <i>LA {$avr_stats['la_str']}</i></span>";
- if (!empty($_REQUEST['e']) && $_REQUEST['e'] == "a") {
- echo "<div id=\"content\">";
- echo "<form action=\"admin.php\" method=\"post\">";
- $q = mysql_query("SELECT * from `niches` order by `name`");
- while ($r = mysql_fetch_assoc($q)) {
- $r['ads'] = htmlspecialchars($r['ads']);
- echo "<div id='ads_tab'>{$r['name']}<br> <textarea name='vars[{$r['name']}]' rows='10'>{$r['ads']}</textarea></div>";
- }
- echo "<input type=\"submit\" value=\"save\"></input><input type=\"hidden\" name=\"e\" value=\"as\"></input>";
- if ($config['a_block_flg'] == "on") {
- $checked = "checked";
- } else {
- $checked = "";
- }
- echo "<input type='checkbox' name='a_block_flg' value='on' {$checked}><font color='gray'>use " . __FILE__ . " if field empty</font> ";
- echo "</div></form>";
- }
- if (!empty($_REQUEST['e']) && $_REQUEST['e'] == "as") {
- foreach ($_POST['vars'] as $key => $value) {
- $value = mysql_real_escape_string($value);
- mysql_query("update `niches` set `ads`='{$value}' where `name`='{$key}'");
- }
- if (isset($_REQUEST['a_block_flg'])) {
- $config['a_block_flg'] = $_REQUEST['a_block_flg'];
- }
- file_put_contents("files/config", serialize($config));
- echo "<br><br>ok";
- redir("admin.php?e=a");
- }
- if (!empty($_REQUEST['e']) && $_REQUEST['e'] == "t") {
- $q = mysql_query("select * from `templates` order by name desc");
- echo "<form action=\"admin.php\" method=\"post\">";
- while ($r = mysql_fetch_array($q)) {
- $str = "";
- $template = htmlspecialchars($r['template']);
- $rows = "30";
- if (preg_match("/sub/i", $r['name'])) {
- $rows = "10";
- }
- if ($r['name'] == "categories") {
- $checked = "";
- if ($config['categories_order'] == "abc") {
- $checked = "checked";
- }
- $str = "<input type='checkbox' name='categories_order' value='abc' {$checked}><font color='gray'>sort by abc</font> ";
- }
- echo "{$r['name']} {$str}<br> <textarea name='{$r['name']}' cols='150' rows='{$rows}'>{$template}</textarea><br><br>";
- }
- echo "<input type=\"submit\"></input><input type=\"hidden\" name=\"e\" value=\"ts\"></input></form>";
- }
- if (!empty($_REQUEST['e']) && $_REQUEST['e'] == "ts") {
- $q = mysql_query("select `name` from `templates`");
- while ($r = mysql_fetch_array($q)) {
- $template = mysql_real_escape_string($_POST["{$r['name']}"]);
- $name = $r['name'];
- mysql_query("update `templates` set `template`='{$template}' where `name`='{$name}'");
- }
- if (!empty($_REQUEST['categories_order'])) {
- $config['categories_order'] = "abc";
- } else {
- $config['categories_order'] = "ctr";
- }
- file_put_contents("files/config", serialize($config));
- s_cookie();
- echo "<br><br>ok";
- redir("admin.php?e=t");
- }
- if (!empty($_REQUEST['e']) && $_REQUEST['e'] == "n") {
- $q = mysql_query("select * from `niches` order by `name`");
- if ($config['skim_status'] == "on") {
- $checked = "checked";
- } else {
- $checked = "";
- }
- if ($settings['grab_status'] == "noactive") {
- echo "<div id=\"grab_status\">Grabber is noactive - click <a href=\"admin.php?s=grab_change\">here</a> for activate</div>";
- }
- echo "<form action='admin.php' method='post'><table> <tr> <td><b>niche</b></td> <td></td> <td>title</td> <td>description</td> <td><b>keywords *</b></td> <td><b>skim urls</b> <small>(http://cj.com,http://sex.com)...</small></td> <td><b>skim</b><input type='checkbox' name='skim_status' value='on' {$checked} title='skim activator'></td> <td><input type='text' name='skim_prod_keeper' value='{$config['skim_prod_keeper']}' size='3' title='skim prod keeper'></input></td> </tr>";
- while ($r = mysql_fetch_array($q)) {
- $str = "";
- $r['skim_url'] = implode(",", unserialize($r['skim_url']));
- if ($r['name'] == __FILE__) {
- $str = "readonly='readonly' style='background-color: YellowGreen' ";
- }
- echo " <input type='hidden' name='arr[]' value='{$r['id']}'></input> <tr> <td><input type='text' name='arr[]' {$str} value='{$r['name']}' size='15'></input></td> <td>({$r['num']})</td> <td><input type='text' name='arr[]' value='{$r['title']}' size='20'></input></td> <td><input type='text' name='arr[]' value='{$r['desc']}' size='35'></input></td> <td><input type='text' name='arr[]' value='{$r['keys']}' size='45' maxlength='250'></input></td> <td><input class='iskimurl' type='text' name='arr[]' value='{$r['skim_url']}' size='45'></input></td> <td><input class='iskim' type='text' name='arr[]' value='{$r['skim_prc']}' size='3'></input></td> <td><a href='index.php?n={$r['name']}' target='_blank'>link</a></td> </tr> ";
- }
- echo "<tr> <td> <input type='text' name='new[name]' size='15'></input></td> <td></td> <td><input type='text' name='new[title]' size='20'></input></td> <td><input type='text' name='new[desc]' size='35'></input></td> <td><input type='text' name='new[keys]' size='45'></input></td> <td><input id='mass_field' class='iskimurlv' onchange='iskim(\"iskimurl\");'type='text' name='new[skim_url]' size='45'></input></td> <td><input id='mass_field' class='iskimv' onchange='iskim(\"iskim\");' type='text' name='new[skim_prc]' size='3'></input></td> </tr>";
- echo "</table><input type=\"submit\" value=\"Save\"></input><input type=\"hidden\" name=\"e\" value=\"ns\"></input></form>";
- }
- if (!empty($_REQUEST['e']) && $_REQUEST['e'] == "ns") {
- do {
- if (file_exists("files/tmp/cron_recalc_n")) {
- unlink("files/tmp/cron_recalc_n");
- }
- $i = 0;
- foreach ($_REQUEST['arr'] as $value) {
- $f[$i] = mysql_real_escape_string($value);
- ++$i;
- if (!($i == 7)) {
- continue;
- }
- $i = 0;
- if (preg_match("/[+|(|)]/", $f[4])) {
- preg_match("/[a-z0-9\\+\\(\\)\\|\\s]{3,255}[a-z\\)]/i", $f[4], $matches);
- $f[4] = $matches[0];
- } else {
- preg_match_all("/([a-z]{3,12}\\*?)/i", $f[4], $arr);
- $f[4] = implode(",", $arr[0]);
- }
- if ($f[4] == "" && $f[1] != __FILE__) {
- preg_match_all("/([a-z]{3,12}\\*?)/i", $f[1], $arr);
- $f[4] = implode(",", $arr[0]);
- $f[4] = "{$f[4]}";
- if (strlen($f[4] < 3)) {
- $f[4] = "sex";
- }
- }
- if (!preg_match("/^http/i", $f['5']) && $f['5'] != "") {
- echo "<br>error - bad format for skim URL (niche {$f['1']})";
- break;
- exit();
- } else {
- $f['5'] = serialize(array_unique(explode(",", $f['5'])));
- $f['6'] = intval($f['6']);
- if (100 < $f['6'] || $f['6'] < 0) {
- $f['6'] = "100";
- }
- if ($f[4] == "" && $f[1] == __FILE__) {
- $f[4] = "*";
- }
- if ($f[1] != "" && $f[4] != "") {
- if ($f[2] == "") {
- $f[2] = str_replace("_", " ", $f[1]);
- }
- $niche_url = get_url("{$f[1]}");
- mysql_query("update `niches` set `name`='{$f['1']}',`title`='{$f['2']}',`desc`='{$f['3']}',`keys`='{$f['4']}',`url`='{$niche_url}',`skim_url`='{$f['5']}',`skim_prc`='{$f['6']}' where `id`='{$f['0']}'");
- } else if ($f[1] == "") {
- mysql_query("delete from `niches` where `id`='{$f['0']}'");
- }
- continue;
- }
- break;
- }
- if (!empty($_REQUEST['skim_status'])) {
- $config['skim_status'] = $_REQUEST['skim_status'];
- } else {
- $config['skim_status'] = "";
- }
- if (!empty($_REQUEST['skim_prod_keeper'])) {
- $config['skim_prod_keeper'] = intval($_REQUEST['skim_prod_keeper']);
- } else {
- $config['skim_prod_keeper'] = "";
- }
- file_put_contents("files/config", serialize($config));
- echo "<br><br>ok<br>";
- if ($_REQUEST['new']['keys'] == "") {
- $_REQUEST['new']['keys'] = $_REQUEST['new']['name'];
- }
- if ($_REQUEST['new']['name'] != "" && $_REQUEST['new']['keys'] != "") {
- $new_name = mysql_real_escape_string($_REQUEST['new']['name']);
- $new_title = mysql_real_escape_string($_REQUEST['new']['title']);
- if (empty($new_title)) {
- $new_title = str_replace("_", " ", $new_name);
- }
- $new_desc = mysql_real_escape_string($_REQUEST['new']['desc']);
- if (preg_match("/[+|(|)]/", $_REQUEST['new']['keys'])) {
- preg_match("/[a-z0-9\\+\\s\\(\\)\\|]{3,255}[a-z\\)]/i", $_REQUEST['new']['keys'], $arr);
- $new_keys = $arr['0'];
- } else {
- preg_match_all("/([a-z]{3,12}\\*?)/i", $_REQUEST['new']['keys'], $arr);
- $new_keys = implode(",", $arr['0']);
- }
- $new_skim_url = serialize(array_unique(explode(",", $_REQUEST['new']['skim_url'])));
- if (!preg_match("/^http/i", $_REQUEST['new']['skim_url']) && $_REQUEST['new']['skim_url'] != "") {
- echo "error - bad format for skim URL";
- exit();
- } else {
- $new_skim_prc = intval($_REQUEST['new']['skim_prc']);
- if (100 < $new_skim_prc || $new_skim_prc < 0) {
- $new_skim_prc = "100";
- }
- if (strlen($new_keys) < 3) {
- $new_keys = "sex";
- }
- $new_keys = mysql_real_escape_string($new_keys);
- $niche_url = get_url("{$new_name}");
- mysql_query("insert into `niches` (`name`,`title`,`desc`,`keys`,`url`,`skim_url`,`skim_prc`) values('{$new_name}','{$new_title}','{$new_desc}','{$new_keys}','{$niche_url}','{$new_skim_url}','{$new_skim_prc}')");
- }
- }
- if (file_exists("files/tmp/cron_recalc_n")) {
- @unlink("files/tmp/cron_recalc_n");
- }
- if (file_exists("files/tmp/cron_select_niche_thumb")) {
- @unlink("files/tmp/cron_select_niche_thumb");
- }
- if (!empty($new_name)) {
- echo "added - {$new_name}<br>";
- }
- redir("admin.php?e=n");
- exit();
- } while (0);
- } else {
- if (!empty($_REQUEST['e']) && $_REQUEST['e'] == "s") {
- if ($settings['grab_status'] == "active") {
- $wr_change = "stop";
- } else {
- $wr_change = "start";
- }
- function decodeSize($bytes)
- {
- $types = array(
- "B",
- "KB",
- "MB",
- "GB",
- "TB"
- );
- $i = 0;
- while (1024 <= $bytes && $i < count($types) - 1) {
- $bytes /= 1024;
- ++$i;
- }
- return round($bytes, 2) . " " . $types[$i];
- }
- @$free_size = @decodeSize(@disk_free_space("content"));
- echo "<form action='admin.php' method='get'><h6>ban content(keys) : <input type='text' name='ban_keys' size='80' value='{$settings['ban_keys']}'></input><br><br> grab only if keys : <input type='text' name='good_keys' size='80' value='{$settings['good_keys']}'></input><br><br><br> content limit, no more than : <input type='text' name='content_limit' size='8' value='{$settings['content_limit']}'></input><br> time limit, only if duration more than(sec) : <input type='text' name='duration_limit' size='4' value='{$settings['duration_limit']}'></input><br> grabb max gals per cron : <input type='text' name='grab_thumbs_limit' size='4' value='{$settings['grab_thumbs_limit']}'></input><br> level of cache : <input type='text' name='cache_step' size='4' value='{$config['cache_step']}'></input><br> </h6> ";
- if ($config['rotation_mode'] == "max_perfomance") {
- $checked = "checked";
- } else {
- $checked = "";
- }
- echo "<br><input type='checkbox' name='rotation_mode' value='max_perfomance' {$checked}><b><font color='blue'>keep max prod</font> <a href='http://www.tuberotator.com/docs_ru.html#Keep_max_prod'>???</a> </b>";
- if ($config['new_page_for_raw_hits'] == "on") {
- $checked = "checked";
- } else {
- $checked = "";
- }
- $tubes = explode(",", file_get_contents("files/tubes"));
- echo "<br><br>Get content only from:";
- foreach ($tubes as $tube) {
- if (@in_array($tube, $settings['tubes'])) {
- $checked = "checked";
- } else {
- $checked = "";
- }
- echo "<br><input type='checkbox' name='tubes[]' value='{$tube}' {$checked}>{$tube}";
- }
- if ($config['mode'] == "out") {
- $checked = "checked";
- } else {
- $checked = "";
- }
- echo "<br><br><br><input type='checkbox' name='mode' value='out' {$checked}>Don't use embed and send to tube url<br><br>";
- echo "<table> <tr> <td>New User:</td> <td><input type='text' name='user' size='10' value=''></input></td> <td>New Password:</td><td><input type='text' name='pass' size='10' value=''></input></td>";
- if (empty($auth_ips['ip_admin_protect'])) {
- $auth_ips['ip_admin_protect'] = "";
- }
- echo "<td>IP <font color='red'>protect:</font></td> <td><input type='text' name='ip_admin_protect' size='12' value='{$auth_ips['ip_admin_protect']}'></input> <small>your curent ip: {$_SERVER['REMOTE_ADDR']} - use only if it is static IP </small></td> </tr>";
- echo "<tr><td>Mysql User:</td><td><input type='text' name='mysqluser' size='10' value=''></input></td><td>Password:</td> <td><input type='text' name='mysqlpass' size='10' value=''></input></td> <td>mysql base:</td> <td><input type='text' name='mysqlbase' size='10' value='{$config['dbname']}'></input> Mysql Host<input type='text' name='mysqlhost' size='10' value='{$config['host']}'></input></td> </tr></table><br>";
- function check_lic()
- {
- global $config;
- $domain = preg_replace("/^www./i", "", getenv("HTTP_HOST"));
- if (!preg_match("/{$domain}/i", getenv("SCRIPT_FILENAME"))) {
- $domain = mt_rand(999, 999999);
- }
- $str_to_key = "E45RtGD1Nb5 & +&7?r/Gt%4w8g5-^f1v#2@1xkjdpenDortmg)grF{$domain}T4G1fd-Qafuy6*D1cu&ld";
- $key = sha1($str_to_key);
- $key = "{$domain}_{$key}";
- if ($key == $config['lic_key']) {
- return true;
- }
- return false;
- }
- if (check_lic() == false) {
- echo "license key:<input type='text' name='lic_key' size='100' value=''></input>";
- } else {
- echo "<font color=\"green\">license status: ok</font>";
- }
- @$perf_arr = @unserialize(@file_get_contents("files/tmp/last_check_perf"));
- echo " <br><br><input type='hidden' name='e' value='ss'></input> <br> <input type='submit' value='Save settings'></input> </form> <span id='last_perf_check'> <span title='pages per sec'>{$perf_arr['per_sec']}</span>/<span title='average generation time of a single page'>{$perf_arr['per_page']}</span> or {$perf_arr['per_day']} </span> <table id='table_check_perf'> <tr> <td> <a href='admin.php?s=check_perfomance'>Check site perfomance</a><br> </td> </tr> </table> <table id='table_w'> <tr> <td> <a href='admin.php?s=reset'>reset ALL DB stat</a><br> <a href='admin.php?s=reset_cache'>reset Cache</a><br> <br><a href='admin.php?s=remove_all'>Remove ALL content</a> </td> </tr> </table> Build {$script_version} - <a href='admin.php?s=get_updates'><font color='blue'>Update script</font></a> <br> <br>Free disk space = {$free_size} <br><br><br><br><a href='admin.php?s=rotating_dump'>export dump</a><br><br> <form ENCTYPE='multipart/form-data' action='admin.php' method='post' > <input type='file' name='rotating_dump'> <input type='hidden' name='s' value='upload_rotating_dump'> <input type='submit' value='import dump'> </form> <br>Grabber status - {$settings['grab_status']} <a href='admin.php?s=grab_change'>{$wr_change}</a> ";
- $dir = realpath(".");
- $php_path = exec("which php");
- if (!$php_path) {
- $php_path = "{PATH TO PHP}";
- }
- echo "<h5>Cron</h5><div id='cron_info'> * * * * * cd {$dir}/files;{$php_path} cron.php 1>/dev/null 2>/dev/null</div><br>";
- }
- if (!empty($_REQUEST['e']) && $_REQUEST['e'] == "r") {
- echo "<br><br>";
- echo "User - {$flgs['server_user']}<br>";
- echo "<table id=\"r_table\">";
- echo "<td>Site</td><td>Traffic</td><td>Prod</td><td>Version</td>";
- function network_stats()
- {
- global $tmp_dir;
- global $flgs;
- $file = "{$tmp_dir}/tuberotator_net_{$flgs['server_user']}";
- $arr = unserialize(file_get_contents($file));
- ksort($arr);
- foreach ($arr as $url => $array) {
- echo "<tr id=\"r_t_tr\">";
- echo "<td><a href='{$array['admin_url']}?e=n'>{$url}</a></td><td>{$array[hits]}</td><td>{$array[prod]}</td><td id='r_t_vers'>{$array[script_version]}</td>";
- echo "</tr>";
- $total['hits'] = $total['hits'] + $array['hits'];
- }
- echo "<tr>";
- echo "<td>total</td><td>{$total['hits']}</td><td></td>";
- echo "</tr>";
- echo "</table>";
- }
- network_stats();
- }
- if (!empty($_REQUEST['e']) && $_REQUEST['e'] == "ss") {
- $_GET['cache_step'] = intval($_GET['cache_step']);
- if (empty($_GET['cache_step']) || $_GET['cache_step'] < 1 || 10 < $_GET['cache_step']) {
- $_GET['cache_step'] = 1;
- }
- $config['cache_step'] = $_GET['cache_step'];
- if (!empty($_GET['mysqluser']) && !empty($_GET['mysqlpass'])) {
- $config['host'] = $_GET['mysqlhost'];
- $config['user'] = $_GET['mysqluser'];
- $config['pass'] = $_GET['mysqlpass'];
- $config['dbname'] = $_GET['mysqlbase'];
- }
- preg_match_all("/([a-z3]+\\*?)/i", $_GET['ban_keys'], $matches);
- $s['ban_keys'] = implode(",", $matches[0]);
- preg_match_all("/([a-z3]+\\*?)/i", $_GET['good_keys'], $matches);
- $s['good_keys'] = implode(",", $matches[0]);
- if ($s['ban_keys'] != $settings['ban_keys'] || $s['good_keys'] != $settings['good_keys']) {
- mysql_query("update `w_content` set `status`='7' where `status`='9'");
- }
- $settings['ban_keys'] = $s['ban_keys'];
- $settings['good_keys'] = $s['good_keys'];
- preg_match_all("/([0-9]{1,8})/", $_REQUEST['content_limit'], $matches);
- $settings['content_limit'] = $matches[0][0];
- if (preg_match("/([0-9\\.]{7,15})/", $_REQUEST['ip_admin_protect'], $matches)) {
- $auth_ips['ip_admin_protect'] = $matches['1'];
- $auth_ips = serialize($auth_ips);
- file_put_contents("files/auth_ips", $auth_ips);
- } else if (file_exists("files/auth_ips")) {
- unlink("files/auth_ips");
- }
- //========================================= PAYMENT ==================================//
Add Comment
Please, Sign In to add comment