Alexa's Blog

Reliable $1 Web Hosting by 3iX

Reliable $1 Web Hosting by 3iX

SoMuch.com: Internet Links Directory



ArticleMs Sitemap Generator

May 5th, 2007

Hi guys,

Here is a sitemap generator for the ArticleMs CMS.He generates Google valid sitemaps based on your database structure.The sitemap is generated starting with the category structure, pages then articles.He use your ArticleMs database entries so is pretty fast.I didn´t tested it yet with a big number of categories and articles, because I don´t have them :) , but give´ it a try and let me know how is it working.

Installation in your ArticleMs CMS

This is pretty simple.You just have to copy the file in your ArticleMs root directory, then call from the browser at http://www.yourdomain.com/sitemap_cron.php . One more thing. You must have write permissions on the sitemap.xml file.To accomplish this, create an empty file named sitemap.xml in your ArticleMS root installation folder(if you don´t have one already), then change the access on it to chmod 777.That will make it work.
After the sitemap is generated he can ping Google and let it know that you have some changes in your website.For me works well. You jusy need to call the url by adding the ping=1 parameter in url.Something like this:
www.yourdomain.com/sitemap_cron.php?ping=1

If you wan to make the process in an automatic way, you can set a cron and calling the script with the following command:

curl http://www.yourdomain.com/sitemap_cron.php?ping=1

Set the interval as you like.I think best is once/day.

That´s it.If you have any troubles let´me a comment.You can do it also if you like´it or have any ideas :)

Download the file here

Enjoy!

19 Comments »

  1. Sree Prakash says

    Thanks for this great plugin!! I am using ArticleMS for some 1+ years and looking for a script to make a sitemap for my site. Very nice and working well with my site…. Thanks again…

    November 9th, 2007 | #

  2. stas bekman says

    Thanks for sharing it, Cornel. I’ve changed your script to support generation of sitemap.xml.gz

    Not being able to find your contact information, I’ll paste it here.

    $file = “sitemap.xml”;
    if (function_exists(”gzwrite”)) {
    $file = “sitemap.xml.gz”;
    $fHwnd=gzopen(”sitemap.xml.gz”,”w1″);
    if ($fHwnd) {
    gzwrite($fHwnd, $sXml);
    fclose($fHwnd);
    }
    else {
    die(”Unable to write the $file file. Please check if your folder is writable.”);
    }
    }
    else {
    $fHwnd=@fopen(”sitemap.xml”,”w+”);
    if ($fHwnd) {
    @fwrite($fHwnd, $sXml);
    fclose($fHwnd);
    }
    else {
    die(”Unable to write the sitemap.xml.gz file.Please check if your folder is writable.”);
    }
    }
    echo “Sitemap $file was created successfuly.\n”;

    //now ping google about our updated sitemap…
    if($articlems->get[”ping”])
    {
    $pingUrl=”http://www.google.com/webmasters/sitemaps/ping?sitemap=” . urlencode($articlems->settings[”sitelocation”].$articlems->settings[”relpath”].”$file”);
    $fHwnd=@fopen($pingUrl,”r”);
    if($fHwnd)
    {
    echo (”Google pinged with success.\n”);
    }
    fclose($fHwnd);
    }
    echo ‘OK’;

    November 30th, 2007 | #

  3. Blooobs says

    Yes this is really a great script
    it works fine for me too
    Thanks

    December 2nd, 2007 | #

  4. Tim Decker says

    Thanks for this script. I’ve recently started with articlems and anything that can help with search engines picking me up is a great tool to me. I’ve manually submitted my site map once when I just started but to have it done automatically every day is just great.

    January 30th, 2008 | #

  5. Anne Kirrin says

    the patch for the xml.gz file gives an error…maybe i’ve done something wrong?

    January 30th, 2008 | #

  6. michael says

    :mrgreen: Thank you for your script, will try it. I just installed articlems.

    January 31st, 2008 | #

  7. michael says

    it works! Thanks!
    but could you please tell me how to set a cron? where to add this code “curl http://www.yourdomain.com/sitemap_cron.php?ping=1″, i m sorry i knew little about php and building website

    January 31st, 2008 | #

  8. article dude says

    Thanks for the script! Haven’t used it yet but it seems straight forward enough. Michael, to set your cron, look in your C panel for cron jobs or something similar.
    You can enter an email address as well so you know the cron is working. I will set mine to run once each friday, to do this I enter * for each of the boxes and 5 for the weekday. To know more look for cron jobs on google.

    March 7th, 2008 | #

  9. PHP Encoder says

    Thanks for this PHP script! Works well for me.

    March 13th, 2008 | #

  10. ryac says

    The Script itself worked perfect. however when i submitted my map to Google i recieved a parse error so i did a bit of research and google said that the tag was incorrect so i changed the code in the sitemap_cron.php to this:

    //Google Go Url
    $sXml.='’. “\n”;

    to this:

    to Google i recieved a parse error so i did a bit of research and google said that the tag was incorrect so i changed this:

    //Google Go Url
    $sXml.=’

    And everything is A OK now
    thanks cornelalexa

    March 25th, 2008 | #

  11. ryac says

    oops sorry the code didn’t format correctly

    anyway i found the solution to my parse error here: https://www.google.com/webmasters/tools/docs/en/protocol.html#sitemapValidation

    March 25th, 2008 | #

  12. Anne Kirrin says

    Thanks again for the great script…

    As Google only allows 50000 pages or 10mb sitemaps files would it be possible for you to modify the script to allow for larger article directories. To include multiple sitemaps?

    March 25th, 2008 | #

  13. ITPiMP says

    VERY NICE! Wrote something similar for ArticleDashboard’s system (except that one generated it live). Mind if I modify it to the same and add some bells and whistles?

    Will also make the changes to be able to generate with size parameters, as I found that if you chop your SM up into 20,000 chunks instead of 50,000 chunks, Google indexes more pages.

    July 22nd, 2008 | #

  14. Dino says

    Wonderful script :mrgreen: i like the auto pinging thing :grin:

    July 24th, 2008 | #

  15. Christopher Phillips says

    I installed this script a few days ago and would like to thank you for a first class product.
    I had no trouble installing and it was accepted by Google without any problems. They have visited the site every day since submission.
    I also set up a cron job and it gets even better, I don’t have to do anything now as the xml file is updated automatically every 24 hours.
    Once again a very big thank you

    July 28th, 2008 | #

  16. Zax Stevens says

    I love your pinging sitemap script for ArticleMS. Works very very well. As Anne Kirrin states in a previous post, “would it be possible for you to modify the script to allow for larger article directories. To include multiple sitemaps?”

    Just wondering if you’ve had a chance to modify your script to allow for mulitple sitemaps, and if you have, where can I obtain your modified script?

    Excellent work BTW. Really appreciated.
    Zax.

    August 30th, 2008 | #

  17. Blisss says

    Great script :grin:
    I set up cron job and it gets even better.
    thank you

    September 18th, 2008 | #

  18. Pricilla says

    Recently i have been using ArticleMS. Thanks for the script. I have been looking for this.
    Regards

    September 29th, 2008 | #

  19. Pricilla says

    Thank you it works. I am using it for my site.

    September 30th, 2008 | #

Leave a comment

:mrgreen: :neutral: :twisted: :shock: :smile: :???: :cool: :evil: :grin: :oops: :razz: :roll: :wink: :cry: :eek: :lol: :mad: :sad:

RSS feed for these comments. | TrackBack URI

Your Ad Here