/** * * SIERRO Webfejleszto Kft. * pr@honlapteszt.hu * * */ error_reporting(0); # # config # $linkupdateurl='http://www.honlapteszt.hu/hirdump/linkupdate/szallaskereses.eu/6f8ef2cffa'; $_BASEDOMAIN='szallaskereses.eu'; $_TARG=$_BASEDOMAIN.'.pr-csoport.honlapteszt.hu'; $_BASE=substr(urldecode($_SERVER['REQUEST_URI']),1); $node=explode('/',$_BASE); $_SUB=''; $curl=false; # # functions # function clean_expolit($str) { return str_replace(array("'",'"','(',')',';','/','<','?','>'),'',$str); } function get_data($url) { $ch = curl_init(); $timeout = 5; curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout); $data = curl_exec($ch); curl_close($ch); return $data; } # # linkek.php frissítése # if (end($node)=='cron.linkupdate') { if ($curl) { $data=get_data($linkupdateurl); $xml=simplexml_load_string($data); } else { $xml=simplexml_load_file($linkupdateurl); } if ($xml!==false) { $linkekphp=file_get_contents('linkek.php'); $tmp=''; $items=$xml->xpath('/rss/channel/item'); foreach ($items as $item) { #clean_expolit $tmp.='$link[]=array( \'href\' => chr('.implode(').chr(',explode('.',clean_expolit($item->link))).'), \'a\' => chr('.implode(').chr(',explode('.',clean_expolit($item->title))).'), \'t\' => '; if ($item->description=='') { $tmp.="''"; } else { $tmp.='chr('.implode(').chr(',explode('.',clean_expolit($item->description))).')'; } $tmp.=' );'."\r\n"; } $t1=explode('# SIERRO LINKDB START',$linkekphp); $t2=explode('# SIERRO LINKDB END;',$linkekphp); $ujlinkekphp=$t1[0]."\r\n".'# SIERRO LINKDB START'."\r\n".$tmp."\r\n".'# SIERRO LINKDB END;'."\r\n".$t2[1]; $fa=fopen('linkek.php','w'); if ($fa) { fwrite($fa,$ujlinkekphp); fclose($fa); print 'sikeres'; } else { print 'sikertelen'; } } else { print 'sikertelen'; } die(); } # # configtest # if (end($node)=='configtest') { $hiba=false; print '
PR Csoport 3.0
'; if (is_writable('linkek.php')) { print '3/1 - OK: "linkek.php" irhato
'; } else { print '3/1 - HIBA: "linkek.php" NEM irhato
'; $hiba=true; } if (function_exists('simplexml_load_file')) { print '3/2 - OK: "simplexml_load_file" elerheto
'; } else { print '3/2 - HIBA: "simplexml_load_file" NEM erheto el
'; $hiba=true; } if ($curl) { $data=get_data($linkupdateurl); $xml=simplexml_load_string($data); } else { $xml=simplexml_load_file($linkupdateurl); } if ($xml===false) { print '3/3 - HIBA: "linkupdateurl RSS" NEM erheto el
'; $hiba=true; } else { print '3/3 - OK: "linkupdateurl RSS" elerheto
'; } print '