session_start();
require "admin/common/config.inc.php";
require "admin/common/common.php";
require "common/common.php";
/*************************************************************
Simple site crawler to create a search engine XML sitemap
Version 0.2
Free to use, without any warranty
Written by Elmar Hanlhofer http://www.plop.at 01/Feb/2012
ChangeLog:
----------
Version 0.2 2013-01-16
* curl support - by Emanuel Ulses
* write url, then scan url - by Elmar Hanlhofer
*************************************************************/
// $file = "sitemap.xml"; // output file
$url = "http://ww.lng.gr"; // url to scan
// $skip[1] = "http://www.plop.at/slide";
$extension = ".html"; // scan files with extension
$freq = "daily"; // scan frequency
$priority = "0.5"; // site priority
function Path ($p)
{
$a = explode ("/", $p);
$len = strlen ($a[count ($a) - 1]);
return (substr ($p, 0, strlen ($p) - $len));
}
function GetUrl($url)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
function Scan($url)
{
global $scanned, $pf, $extension, $skip, $freq, $priority, $site_url;
$href=$site_url;
echo "\n $href\n" .
" $freq\n" .
" $priority\n\n";
echo "
";
$sql="SELECT id,title_el AS title,caption,template
FROM content_categories
WHERE LENGTH(id)=3 AND active=1 AND (mainmenu=1 OR bottommenu=1)";
$res=Find_Data2($sql);
for($i=0; $i\n $href\n" .
" $freq\n" .
" $priority\n\n";
echo "
";
}
}
$sql="SELECT id,title_el AS title,caption
FROM news
WHERE active=1";
$res=Find_Data2($sql);
for ($i=0; $i\n $href\n" .
" $freq\n" .
" $priority\n\n";
echo "
";
}
}
/*
$pf = fopen ($file, "w");
if (!$pf)
{
// echo "cannot create $file\n";
return;
}
*/
echo"
";
$scanned = array();
Scan ($url);
echo "\n";
// fclose ($pf);
?>