[phpBB Debug] PHP Warning: in file [ROOT]/ext/tas2580/seourls/event/listener.php on line 213: Undefined array key "FORUM_NAME"
REDAXO Forum • Google Sitemaps - Seite 1
Seite 1 von 1

Startartikel und Kategorien

Verfasst: 30. Jul 2005, 01:54
von demer
Hay hoppel,

vielleicht verstehe ich dein Problem nicht ganz richtig,
kannst du mir dies in einer PM genauer beschreiben?
Ich würde auf jedenfall einen Fix oder eine Config-Option dafür bauen
wenn die Categories (wie heissen die auf deutsch?) auch in die
SiteMap müssten.

gr
roman

Addon

Verfasst: 30. Jul 2005, 01:57
von demer
Hay kills,

vielleicht hast du recht. Ich werde mir nochmal gedanken machen ob das ein AddOn sein könnte. Ich glaube das würde es vielleicht einfacher machen für die Leute.

Nun jetzt sind ja schon ein paar Anregungen da. (Danke übrigens allen für das Feedback). Dann könnte ich an einem scheisswettersonntag wie dem kommenden ja eigentlich daraus ein Plugin machen. .....

Gruss
roman

Verfasst: 21. Aug 2005, 15:37
von Markus.Staab
Wäre schön, wenn dieses Modul auch auf der REDAXO Seite verfügbar wäre.

Dazu sollte der Ersteller es einfach unter myREDAXO -> meine Module einstellen.

Gruß,
Markus

Slash fehlt

Verfasst: 8. Okt 2005, 17:34
von Hooksieler
Bei mir sieht das so aus:
Es fehlt ein / hiner der Domain das scheint mir nicht richtig.
Muss ich noch etwas beim Template einstellen?

http://www.domain.deindex.php?article_id=2&clang=0 monthly 2005-01-01 0.5

Verfasst: 1. Dez 2005, 16:50
von Thomas.Blum
Hej,

ich habe mal die Google-Sitemap validieren lassen. Leider kommt da ein Fehler der da lautet:
Das Dokument ist nicht valide.
Benutzte Zeichensatzkodierung: utf-8

Quelle: Zeichensatzkodierung aus XML-Deklaration
utf-8 wird aber im template verwendet.

Was läuft hier verkehrt?

Danke und vg Thomas

Verfasst: 30. Jul 2009, 21:22
von Weissenborn
Ich hab's heute auch bei mir eingebaut. Dabei musste ich ein paar Code-Anpassungen/Aktualisierungen vornehmen. Ich hoffe es hilft Euch weiter. Danke an den Urheber! - Klasse Script! Viel Spaß auch weiterhin daran! So sieht das jetzt bei mir aus:

Code: Alles auswählen

<?  
  // Execution Code    
  $rsb = new RexSitemapBuilder(); 
  $rsb->setUrlPrefix("http://" . $_SERVER["HTTP_HOST"]."/");  
    
  // dump to requestor (the start category level as param) 
  echo $rsb->buildXML( OOCategory::getRootCategories() ); 

// Object Definitions 

   /** 
    * Class RexSitemapBuilder is a Component that does faciliate 
    * the URLSet and URL classes to build the SiteMap for Redaxo.    
    **/ 
   class RexSitemapBuilder  { 
       
      var $xml=""; 
      var $urlprefix=""; 
      var $document=""; 
      
      function RexSitemapBuilder() { 
         $this->xml = ""; 
         $this->document = new URLSet(); 
      } 
      
      function setUrlPrefix( $urlprefix ) { 
         $this->urlprefix=$urlprefix; 
      }          
      
      function buildXML( $categories ) { 
     foreach ($categories as $category) {      
         
      $articles = $category->getArticles(); 
      foreach ($articles as $article) { 
        if( $article->isOnline() ) { 
setlocale(LC_NUMERIC, 'en_GB.ISO8859-1');
          $this->document->addURL(new URL( $this->urlprefix . $article->getUrl(), "daily", date('Y-m-d'), (1 / $article->getId() ), $article->getName() )); 
        } 
      }    
       
        //recurse 
        if( sizeof( $category->getChildren() ) > 0) { 
           $this->buildXML( $category->getChildren() ); 
        }     
   } 
   return $this->document->getAsXML(); 
      }    
      
   } 

   /** 
    * Class URLSet does implement the Parent object 
    * that can host as many URL objects as required 
    **/ 
   class URLSet { 

      var $urls = ""; 
      var $opentag = "<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">"; 
      var $closetag = "</urlset>"; 
      var $xmlheader = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; 

      /** 
       * construct me please 
       **/ 
      function URLSet () { 
        $this->urls = array(); 
      } 
      
      /** 
       * allows to add URL Objects. And just those. 
       * okay. I could explicitly type-safe it, but 
       * i use it internally anyway. 
       **/ 
      function addURL($url) { 
        $this->urls[$url->loc] = $url; 
      } 
      
      /** 
       * returns this Artifact of the XML document 
       * which is in fact the entire one. 
       **/ 
      function getAsXML() { 
        $xml = ""; 
        $xml .= $this->xmlheader . "\n"; 
        $xml .= $this->opentag . "\n"; 
        foreach($this->urls as $url) { 
            $xml .= $url->getAsXML(); 
        } 
        $xml .= $this->closetag . "\n"; 
        return $xml; 
      } 
   } 


   /** 
    * The URL Class does represent a URL SubElement 
    * that handles an entire url Element in itself 
    **/ 
   /*public*/ class URL { 
    
      var $loc = ""; 
      var $changefreq = ""; 
      var $lastmod = ""; 
      var $priority = ""; 
      var $name = ""; 
      
      /** 
       * Constructor Method for a new URL Artifact 
       **/ 
      /*public*/ function URL($u, $c, $l, $p, $n) { 
        $this->loc = $u; 
        $this->changefreq = $c; 
        $this->lastmod = $l; 
        $this->priority = $p; 
        $this->name = $n; 
      } 
      
      /** 
       * returns this object as XML Artifact 
       **/ 
      /*protected*/ function getAsXML() { 
        $xml = ""; 
        $xml .= " <!-- " . htmlentities( $this->name ) . " -->\n"; 
        $xml .= " <url>\n"; 
        $xml .= "  <loc>" . $this->loc . "</loc>\n"; 
        $xml .= "  <changefreq>" . $this->changefreq . "</changefreq>\n"; 
        $xml .= "  <lastmod>" . $this->lastmod . "</lastmod>\n"; 
        $xml .= "  <priority>" . $this->priority . "</priority>\n";
        $xml .= " </url>\n"; 
        return $xml; 
      } 
   } 

?>