Dynamische XML Sitemap

Adult Hosting

N20

Schneeglöckchen
Hall of Fame
VIP
Beiträge
1.403
Punkte
38
kennt jemand nen script ausser dem offizellen google sitemap_gen das konforme XML sitemaps dynamsich generieren kann? idealerweise per cronjob regelmäßig ausführbar...
 
Ja, meine Willigkeit - eigene Kreation, Pingdienst habe ich auch, allerdings alles auf eigene Sachen abgestimmt.
 
magst das mal teilen? evtl. kann ichs umstricken... hab ich deine icq nr.?
 
N20 schrieb:
magst das mal teilen? evtl. kann ichs umstricken... hab ich deine icq nr.?
Du wirst da nicht viel von haben, ist auf Zend aufgebaut, außerdem auf einer eigenen Bibliothek zur DB-Optimierung, die ich niemandem raus gebe. Anschreiben kannst du mich ja, eventuell finden wir ja eine Lösung.
 
almalibertad schrieb:
http://www.xml-sitemaps.com/


Allerbester Kram - Sehr komfortabel

20$ für nen xml sitemapgenerator den google kostenlos anbietet... nee sowas mein ich nicht ;)
 
ja, das tool kenn ich... ich such aber eher was automatisiertes
 
Code:
<?php
header("Content-type: text/xml");

echo "<?xml version='1.0' encoding='UTF-8'?>\n";
echo "<urlset xmlns='http://www.google.com/schemas/sitemap/0.84' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.google.com/schemas/sitemap/0.84 http://www.google.com/schemas/sitemap/0.84/sitemap.xsd'>\n";

echo "User-agent: *\n";

//text pick out of robots
if (is_file("robots.txt"))
{
$site = file("robots.txt");  //robot text datein wird durch sucht
   for ($i=0;$i<count($site);$i++)
   {
   $pos = stristr($site[$i], "Disallow:" );
     if ($pos)
     {
     $pos = substr($pos, 9);
     $pos2 = strpos($pos, "/" );
     $pos3 = substr($pos, $pos2 +1);
     $all[] = trim($pos3) ;         
     }   
   }
}//is_file end  
else
{
echo "keine robots.txt gefunden!\n";
} 
//text pick out of robots "END"


//all files select
 $number =2;
  for ($e=0;$e<=$number;++$e) 
  {
    if (glob("$var_folder*",GLOB_ONLYDIR|GLOB_MARK)==true)
    {
    $folder_url = '';
       foreach (glob("$var_folder*",GLOB_ONLYDIR|GLOB_MARK) as $folder_url)  
       {
       $folder_url =preg_replace('/.$/', '/', $folder_url);                   
          for ($r =0; $r <= count($all);$r++)
          {
            if ($folder_url == $all[$r])
            {
            $var_folder = $folder_url;       
            }
          }//for end
       
         if ($var_folder != $folder_url) 
         {
         
                
 //file exclusion by hand  
 $out_fold ="";
 //end
                 	
           if($folder_url != $out_fold) //
       	   {
           $array_folder[] = $folder_url;
           $array_folder  =array_unique($array_folder);          
           $number =count($array_folder)+1;
          }
         }
       }
   }
 $var_folder = $array_folder[$e];         
 }
    $var = '';
    $array_php='';
    $array_html='';      
    for ($i=0;$i<$number;$i++)
    {      
      if (glob("$var*.php")==true)
      {
      $file_php ='';
        foreach (glob("$var*.php") as $file_php) 
        {
        
          for ($p =0; $p <= count($all);$p++)
          {
          if ($file_php == $all[$p])
          {
          $var_php = $file_php;       
          }
        }//for
       
           if ($var_php != $file_php) 
           {   

             if ($file_php != "sitemap.php")
             {               
             $array_php[] = $file_php;
             }
           }//if
         }
      }
     
       if (glob("$var*.html")==true)
       {
       $file_html ='';
         foreach (glob("$var*.html") as $file_html)
         {
          for ($j =0; $j <= count($all);$j++)
          {
             if ($file_html == $all[$j])
             {
             $var_html = $file_html;       
             }
          }//for
       
             if ($var_html != $file_html) 
             {       
             $array_html[] = $file_html;
             }
         }
}
$array_all ='';

if ( (!empty($array_html)) && (!empty($array_php)) )
{
@$array_all = array_merge($array_html, $array_php);
}
  elseif (!empty($array_html))
  {
  $array_all = $array_html;
  }
    elseif (!empty($array_php))
    {
    $array_all = $array_html;
    }
$var = $array_folder[$i];
 }              

// end of search adress


// search noindex of website
$head="";
$site_="";

       for($t=0;$t<=count($array_all);$t++)
       {
       
           if (is_file($array_all[$t]))
           {

           $site_ = file_get_contents($array_all[$t]); 
                          
           preg_match('/<meta name="robots(.*)<\/head>/is',$site_, $head);  
            if ($head)
            {
            $head2[$t] = $head[1];
       
                 if (stristr($head2[$t], "noindex"))
                 {
                 $nourl[] = $array_all[$t];      
                 }    
             }
         }
         
         else
         {
         $nourl[] ="";
         }
       }
       
// search noindex of website END! 
$robot_text ="";     
$robot_text = (array_diff($array_all,$nourl)); //join array_all and nourl

   $e = 0;
       foreach($robot_text as $_text)   
       {  
       $e++;       
       $_text = $_SERVER['HTTP_HOST']."/". $_text;
         if ($_text != $_SERVER['HTTP_HOST']."/") //change for localhost
         {        
         $_text  = str_replace("//", "/", $_text );
         $_text ="http://".$_text;
         $robot[] = $_text ; 
         $robot_text[] = $robot_text[$e]; 
         }
       }

$g =0;
//time
foreach($robot as $site_robots)
{

$g++;

if (!empty($site_robots))
{
echo "<url><loc>".$site_robots."</loc><lastmod>";
$filename =$robot_text[$g]; // variable von oben
if (file_exists($filename)) {
    echo date ("Y-m-d\TH:i:s", filemtime($filename));
    echo "+00:00";
}
else 
{
echo "2007-08-10T10:00:47+00:00" ;
}
 
echo "</lastmod><changefreq>daily</changefreq><priority>";
if ( (stristr($site_robots, "index.html")) or (stristr($site_robots, "index.php")) or (stristr($site_robots, "index.xhtml")) )
{
echo "1.00";
}
else
{
echo "0.50";
}


echo "</priority></url>\n";

}//if von oben
}//schleifen ende

echo "</urlset>";
?>

und in der robots.txt angeben wo die sitemap zu finden ist, mal angenommen man speichert sie als "sitemap.php" (muss im doc root liegen) sieht die robots so aus:

Code:
Sitemap: [url]http://www.meine-website.de/sitemap.php[/url]

schönes ding du...
 
google selbst bietet eine kostenlose lösung an... ausserdem bin ich abgebrannt und pleite... :D

nee, mal im ernst... ich wollt nix wo ich erst noch ne halbe stunde setup's machen muss... das script was ich da gefunden habe macht genau das was ich will... file hochladen, automatisch bei aufruf eine konforme sitemap erzeugen... feddich...
 
sehr cool, habe das script nicht wirklich gesehen... gute alternative, danke !
 

Erotik Webmaster Forum Dating Affiliates

Zurück
Oben Unten