Results 1 to 2 of 2

Thread: Help with site map

  1. #1
    Join Date
    Feb 2009
    Posts
    62
    Thanks
    15
    Thanked 0 Times in 0 Posts

    Default Help with site map

    Ok so according to Google your sitemap shoul be as follows.

    I need help with the Lastmod tag

    Code:
    <url>
        <loc>http://www.example.com/</loc>
        <lastmod>2005-01-01</lastmod>
        <changefreq>monthly</changefreq>
        <priority>0.8</priority>
    </url>
    My current function is like this.

    PHP Code:
    function genSiteMap() {
        global $baza, $clear;
        $xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd\">\n";
        
    $xml .= "\t<url>\n\t\t<loc>" ROOT "</loc>\n\t\t";
                      
    $xml .= "<priority>1</priority>\n\t\t";
        
    $xml .= "<changefreq>" $clear "</changefreq>\n\t";
        
    $xml .= "</url>\n";
        
    $xml .= "\t<url>\n\t\t<loc>" ROOT "index.php</loc>\n\t\t";
                      
    $xml .= "<priority>0.9</priority>\n\t\t";
        
    $xml .= "<changefreq>" $clear "</changefreq>\n\t";
        
    $xml .= "</url>\n";
        
    $sql "SELECT query, cat FROM cache";
        
    $baza -> izvrsiUpit($sql);
        
    $baza -> stvoriNiz();
        while(
    $red $baza -> noviRed()) {
            
    $xml .= "\t<url>\n\t\t<loc>" ROOT "txt/1/10/" urlencode($red["query"]) . ".html</loc>\n\t\t";
                                        
    $xml .= "<priority>0.8</priority>\n\t\t";
                          
    $xml .= "<changefreq>" $clear "</changefreq>\n\t";
                          
    $xml .= "</url>\n";
        }
        
    $xml .= "</urlset>";
        
    file_put_contents('sitemap.xml'$xml);
    }
    Which doesnt include the lastmod tag.

    Can anyone help me add it?

    Tim..

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    That part is optional, but to help you we would need to see an example, and a database structure please.
    Jeremy | jfein.net

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •