Joomla Google news sitemap generator for sh404

What’s that?

This is a simple script to generate a Google news sitemap (not the common google sitemap) from a Joomla installation usign sh404 as url rewrite manager.

How to use

Just download, extract and upload to your website root folder. Open the config file and edit just the ‘keywords’ and ‘your_site_root’ variables. For a more detailed explanation please read the OpenSef plugin page. The configuration step is the same.

Licence

You can freely use, modify and redistribute this script under the terms of the Gnu General Public Licence v 3.0.

Downloads

Joomla 1.5.x
Joomla 1.0.x

  • I'm using Joomla 1.5.9 - sh404sef

    Hey Andrea; First of all let me personally say a big thank you for tackling this project. It will doubtless become a big hit on the joomla extensions directory, and will bring a lot of traffic to your blog. I hope so anyway.

    I have installed your joomla news script but I am having a small problem with the following error message; ""Error connecting to Database Server : Unknown MySQL server host '0org' (1)""

    I have tried changing the server host under "$db_host" in the config_googlenews_sitemap.php file, using host, localhost, mydomain.com, www.mydomain.com and http://www.mydomain.com, but all to no avail.

    If you have a moment spare I would very much appreciate any advice you can give.

    Once again thank you for creating this much needed google news sitemap script.

    Ian - UK
  • Hi Ian,
    thanks for your feeding back!

    About your problem it seems quite strange...usually those settings are imported directly from your Joomla config file (which is included in my config).

    It's difficult for me to understand what's exactly going wrong... the first check I would do is being sure if you downloaded the right version of the plugin (I released 2 sh404 plugins, one for joomla 1.x and the other for 1.5.x)...

    If you're sure I don't really know what it could be... it seems like the db_host was set to '0org' which is really strange...do you have any strange charachter on that variable on your joomla config file? Is Joomla connecting correctly to the database?.
  • Hi Andrea:
    I have a query. Google news accepted several categories (world, local, nation, sport). How to manage the keywords in this case? Thank you. Aldo
    Sorry for my english
  • Hi Aldo,

    You can specify the keywords modifying the config file of my script. Unfortunately it is not possible, using my script, to assign different keywords to different categories....
  • Hi Andrea: Thank for your fast reply.
    I'm no programmer, but I have an idea. You can change the file names (ex: sitemap_world.php) and in the query to the database, specify the category in each and send different sitemaps. Is it possible?
  • Yes that's surely possible but it seems quite uncomfortable as you should add a file for each category.
  • thank you Andrea!! I try this solution.
  • Aldo
    Hi Andrea:
    How do I change the keywords for the articles tags?
  • Hi,

    I made some modifications to the script, as we had too many articles using the original. The modifications make sense if you have large numbers of articles but could also be an advantage for others. Furthermore, I formatted

    The key here is to select only articles from the last $no_days then find the corresponding articles in the redirection table, then output the results.

    I added $no_days to the config file.

    Maybe someone will find it useful...

    $query = "SELECT id, DATE_FORMAT(jos_content.created,'%Y-%m-%dT%TZ') AS created FROM ".$tables_prefix."content WHERE created >= current_date()-".$no_days." AND sectionid21 AND sectionid28;";
    $result = mysql_query($query);
    while ($row = mysql_fetch_assoc($result)) {
    $query2 = "SELECT oldurl FROM ".$tables_prefix."redirection WHERE newurl LIKE('%id=".$row['id']."%') LIMIT 1;";
    $result2 = mysql_query($query2);
    while ($row2 = mysql_fetch_assoc($result2)) {
    //echo $your_site_root."/".$row2['oldurl']."\t".$row['created']."\t".$keywords."\n";
    echo'

    '.$your_site_root."/".$row2['oldurl'].'

    '.$row['created'].'
    '.$keywords.'


    ';
    }
    }
  • Thanks for your code Niklas I will review it as soon as possible.

    @everyone sorry for leaving questions unanswered but got lots to do those days...
blog comments powered by Disqus