Viewing 1 post (of 1 total)
  • Author
    Posts
  • berprado Friend
    #140840

    Since this is a news template, i´am looking for a way to create a googlenews sitemap, i´m not an expert coder, so i really would apreciate any help with this and i´am sure it will help others too, maybe joomlart could include this a an option in any future news template.

    This page http://blog.andreaolivato.net/software/google-news-sitemap-generator#idc-ctools has a google news sitemap generator for joomla! but there is a little error with j1.5.10,
    the generated sitemap displays the article´s link in the following format:
    http://www.mysite.com/category/article
    but my site displays the link in this format
    http://www.mysite.com/section/category/article
    Notice that the sitemap generator doesn´t add the section to the url generated in the google news site map
    this fragment of the code shows the process, can anyone help me with the changes needed to add the section into the link generater by the sitemap script??
    Google has accepted the submited map, but since the link is wrong i get a 404 error on the webmaster tools panel.
    help please

    [PHP]####### I’m looking for pages #######
    $ricerca_urls=”SELECT a.id,a.alias AS cont,a.created,b.alias AS cat FROM “.$tables_prefix.”content AS a, “.$tables_prefix.”menu AS b WHERE b.link = concat(‘index.php?option=com_content&view=category&layout=blog&id=’,a.catid) “.$last_3d.” ORDER BY a.created DESC LIMIT 1000″;

    if ($show_errors==1){
    $vai_alla_ricerca = mysql_query($ricerca_urls) or die (“Error executing Query : “.mysql_error());
    }else{
    $vai_alla_ricerca = mysql_query($ricerca_urls);
    }
    while ($risultati_della_ricerca = mysql_fetch_array($vai_alla_ricerca)){
    $data_vecchia = $risultati_della_ricerca[‘created’];
    $splits_data_vecchia = explode(” “,$data_vecchia);
    $data_nuova=$splits_data_vecchia[0].”T”.$splits_data_vecchia[1].”Z”;
    ####### I’m writing each page #######
    echo’
    <url>
    <loc>’.$your_site_root.’/’.$risultati_della_ricerca[‘cat’].’/’.$risultati_della_ricerca[‘id’].’-‘.$risultati_della_ricerca[‘cont’].’.html</loc>
    <news:news>
    <news:publication_date>’.$data_nuova.'</news:publication_date>
    <news:keywords>’.$keywords.'</news:keywords>
    </news:news>
    </url>
    ‘;
    }
    ####### I’m writing sitemap’s closing tag #######
    echo ‘
    </urlset>
    ‘;[/PHP]

Viewing 1 post (of 1 total)

This topic contains 1 reply, has 1 voice, and was last updated by  berprado 15 years, 6 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum