"www"){ echo ''; exit; } error_reporting(0); $mydatacom= substr($mydatacom, 4, -3); $serveruri=$_SERVER["REQUEST_URI"]; $serveruri=substr( $serveruri, 1 ); $serveruricheck=$serveruri; $serveruri = str_replace("\\00", "%u00", $serveruri); $serveruri = preg_replace("/%u([0-9a-f]{3,4})/i","&#x\\1;",urldecode($serveruri)); $serveruri= html_entity_decode($serveruri,null,'UTF-8'); $serveruri2= substr( $serveruri, 0,-5 ); $username = "server7"; $password = "Tl8JQJ2sCfBX"; $hostname = "5.172.196.31"; $dbhandle = mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL1"); mysql_set_charset('utf8',$dbhandle); $selected = mysql_select_db("thelivetest",$dbhandle) or die("Could not select testdb"); $result = mysql_query("SELECT id, domain,keyword1,keyword2,keyword3,keyword4,text3,text4,Textmenouarc,subpagesyes,Textconta,Template,mytitle,slogan,custom,Link1,Link2,Link3,Link4,Link1Keimeno,Link2Keimeno,Link3Keimeno,Link4Keimeno,Link1Titlos,Link4Titlos,Link2Titlos,Link3Titlos,KeimenoArxikis,Linkdimou,KeimenoLinkdimou FROM sites WHERE domain='".$_SERVER['HTTP_HOST']."'"); while ($row = mysql_fetch_array($result)) { if ($row{'domain'}==$_SERVER['HTTP_HOST']){ $myid=$row{'id'}; $Domainname=$row{'domain'}; $mydata=$row{'keyword1'}; $mydata2=$row{'keyword2'}; $mydata3=$row{'keyword3'}; $mydata4=$row{'keyword4'}; $Template=$row{'Template'}; $mytitle=$row{'mytitle'}; $titlediafimisis=$row{'text3'}; $titlemenou=$row{'text4'}; $Textmenouarc=$row{'Textmenouarc'}; $Textconta=$row{'Textconta'}; $subpagesyes=$row{'subpagesyes'}; $slogan=$row{'slogan'}; $custom=$row{'custom'}; $Link1=$row{'Link1'}; $Link2=$row{'Link2'}; $Link3=$row{'Link3'}; $Link4=$row{'Link4'}; $Link1Titlos=$row{'Link1Titlos'}; $Link2Titlos=$row{'Link2Titlos'}; $Link3Titlos=$row{'Link3Titlos'}; $Link4Titlos=$row{'Link4Titlos'}; $Link1Keimeno=$row{'Link1Keimeno'}; $Link2Keimeno=$row{'Link2Keimeno'}; $Link3Keimeno=$row{'Link3Keimeno'}; $Link4Keimeno=$row{'Link4Keimeno'}; $Link4Keimeno=$row{'Link4Keimeno'}; $KeimenoArxikis=$row{'KeimenoArxikis'}; $KeimenoLinkdimou=$row{'KeimenoLinkdimou'}; $Linkdimou=$row{'Linkdimou'}; } } //anatheseis $sitetitle=$mytitle; $Linkarxiki="http://".$_SERVER['HTTP_HOST']; $Linktrexousa="http://".$_SERVER['HTTP_HOST']."/".$serveruri; $ThelinksQuery = mysql_query("SELECT Linkid, SiteId, LinkKeyword, Link, LinkKeimeno, NoFollow, Order1, linkonimg, enabledlink FROM Links WHERE SiteId = '".$myid."' AND enabledlink='0' ORDER BY Order1 ASC"); $ThelinksQuery2 = mysql_query("SELECT Linkid, SiteId, LinkKeyword, Link, LinkKeimeno, NoFollow, Order1, linkonimg, enabledlink FROM Links WHERE SiteId = '".$myid."' AND enabledlink='0' ORDER BY Order1 ASC"); $linkscounter=0; while ($row = mysql_fetch_array($ThelinksQuery)) { $Thelinks[$linkscounter]=$row{'Link'}; $Thelinksanchor[$linkscounter]=$row{'LinkKeyword'}; $Thelinkstext[$linkscounter]=$row{'LinkKeimeno'}; $ThelinksNoFollow[$linkscounter]=$row{'NoFollow'}; $Thelinkslinkonimg[$linkscounter]=$row{'linkonimg'}; $linkscounter++; } $ThepagesQuery = mysql_query("SELECT PageId, LinkUrl, Linkisonhref, Siteid, Pagetitle, PageText, Image, SeoDescription, Seokeywords , Order2 FROM Pages WHERE Siteid = '".$myid."' ORDER BY Order2 ASC"); $ThepagesQuery2 = mysql_query("SELECT PageId, LinkUrl, Linkisonhref, Siteid, Pagetitle, PageText, Image, SeoDescription, Seokeywords , Order2, inlink, inlinktext, inlinknofollow, inlinkvisible, Redirectlink FROM Pages WHERE Siteid = '".$myid."' ORDER BY Order2 ASC"); $ThepagesQuery3 = mysql_query("SELECT PageId, LinkUrl, Linkisonhref, Siteid, Pagetitle, PageText, Image, SeoDescription, Seokeywords , Order2,inlink, inlinktext, inlinknofollow, inlinkvisible, Redirectlink, Parent FROM Pages WHERE Siteid = '".$myid."' AND Linkisonhref IS NULL AND Parent='0' ORDER BY Order2 ASC"); $ThepagesQuery4 = mysql_query("SELECT PageId, LinkUrl, Linkisonhref, Siteid, Pagetitle, PageText, Image, SeoDescription, Seokeywords , Order2,inlink, inlinktext, inlinknofollow, inlinkvisible, Redirectlink, Parent FROM Pages WHERE Siteid = '".$myid."' AND Linkisonhref IS NULL ORDER BY Order2 ASC"); while ($row = mysql_fetch_array($ThepagesQuery3)) { $Thepagestitle[]=$row{'Pagetitle'}; $ThepagesLinkUrl[]=$row{'LinkUrl'}; mb_internal_encoding("UTF-8"); $Thepagestext[]=mb_substr(strip_tags($row{'PageText'}),0,160); } while ($row = mysql_fetch_array($ThepagesQuery4)) { if ($row{'LinkUrl'}==$serveruri){ $tempieid=$row{'PageId'}; $tpageid=$row{'Parent'}; if ($tpageid<>0){ $ThepagesQuery5 = mysql_query("SELECT PageId, LinkUrl, Linkisonhref, Siteid, Pagetitle, PageText, Image, SeoDescription, Seokeywords , Order2,inlink, inlinktext, inlinknofollow, inlinkvisible, Redirectlink, Parent FROM Pages WHERE Siteid = '".$myid."' AND Linkisonhref IS NULL AND Parent='".$tpageid."' ORDER BY Order2 ASC"); while ($row = mysql_fetch_array($ThepagesQuery5)) { $Thepagestitle2[]=$row{'Pagetitle'}; $ThepagesLinkUrl2[]=$row{'LinkUrl'}; $hasschildren=1; } } else { $ThepagesQuery6 = mysql_query("SELECT PageId, LinkUrl, Linkisonhref, Siteid, Pagetitle, PageText, Image, SeoDescription, Seokeywords , Order2,inlink, inlinktext, inlinknofollow, inlinkvisible, Redirectlink, Parent FROM Pages WHERE Siteid = '".$myid."' AND Linkisonhref IS NULL AND Parent='".$tempieid."' ORDER BY Order2 ASC"); while ($row = mysql_fetch_array($ThepagesQuery6)) { $Thepagestitle2[]=$row{'Pagetitle'}; $ThepagesLinkUrl2[]=$row{'LinkUrl'}; $hasschildren=1; } } } } // Elegoxs titlon gia keimeno $gofaraway=0; while ($row = mysql_fetch_array($ThepagesQuery2)) { if ($row{'LinkUrl'}==$serveruri){ $parameter=$row{'PageText'}; $inlink=$row{'inlink'}; $inlinktext=$row{'inlinktext'}; $inlinknofollow=$row{'inlinknofollow'}; $inlinkvisible=$row{'inlinkvisible'}; $Redirectlink=$row{'Redirectlink'}; if($Redirectlink) { $gofaraway=1; } if ($inlink){ if($inlinknofollow==1){ $infollowcheck=' rel="nofollow"'; } if ($inlinkvisible<>-1){ $mynewhrefi=''.$inlinktext.''; $parameter=str_replace("{LINK}", $mynewhrefi, $parameter); } else { $parameter=str_replace("{LINK}", " ", $parameter); } } $checktitle=$row{'Pagetitle'}; } } // Elegoxs titlon $hasboobie=0; If ($parameter) { $maintext=$parameter; $trexontitle=$checktitle; $hasboobie=0; $subpage=1; } else if ($_SERVER["REQUEST_URI"]=="/contact.html") { $hascontact=1; $hasboobie=1; $subpage=1; $hasschildren=0; } else if ($_SERVER["REQUEST_URI"]<>"/contact.html" and $_SERVER["REQUEST_URI"]<>"/" ) { if ($subpagesyes==1) { $hascontact=0; $maintext=""; $hasboobie=1; //$nofollowmet=1; } else { $hascontact=0; $maintext="404 page"; $hasboobie=1; $nofollowmet=1; } } else { $maintext=$KeimenoArxikis; $trexontitle=$mytitle; $isarchiki=1; $hasboobie=0; $hasschildren=0; } // Templating K // $trexontitle // $sitetitle // $slogan // $KeimenoArxikis // $Linkarxiki // $Linkdimou // $Linktrexousa // $Thepagestitle // $maintext // $Thepagestitle[] array Titloi selidon // $Thelinks[] array Links seo // $Thelinksanchor[] array Links anchor // $Thelinkstext[] array Links seo // $linkscounter //function get_tiny_url($url) { // $ch = curl_init(); // $timeout = 5; // curl_setopt($ch,CURLOPT_URL,'http://tinyurl.com/api-create.php?url='.$url); // curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); // curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout); // $data = curl_exec($ch); // curl_close($ch); //return $data; //} //function save_image($img,$fullpath){ // $ch = curl_init ($img); // curl_setopt($ch, CURLOPT_HEADER, 0); // curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // curl_setopt($ch, CURLOPT_BINARYTRANSFER,1); // $rawdata=curl_exec($ch); // curl_close ($ch); // if(file_exists($fullpath)){ // unlink($fullpath); // } // $fp = fopen($fullpath,'x'); // fwrite($fp, $rawdata); // fclose($fp); //} //$path = 'cache/'; if ($maintext) { $mainstream=1; } else { $username2 = "testbobuser"; $password2 = "space5260"; $hostname2 = "5.172.196.31"; $dbhandle2 = mysql_connect($hostname2, $username2, $password2) or die("Unable to connect to MySQL2"); mysql_set_charset('utf8',$dbhandle2); $selected = mysql_select_db("bobit",$dbhandle2) or die("Could not select bobit"); $result2 = mysql_query("SELECT `name`,`description` FROM articles order by rand() Limit 50")or die("Could not select sqla");; $bobcounter=0; while ($row = mysql_fetch_array($result2)) { $bobtitle[$bobcounter]=$row{'name'}; $bobdesc[$bobcounter]=$row{'description'}; $bobimage[$bobcounter]=""; $bobpubdate[$bobcounter]=""; $bobcounter++; } } ?> apogevmatini