RSS Feed

Blog

Exporting Comments from CMS Made Simple as Generic WXR XML for Importing Into DISQUS

Exporting Comments from CMS Made Simple as Generic WXR XML for Importing Into DISQUS
Posted on Jun 2, 2012 by Stephen R. Owens
Tutorial and Code category
   [ Return ]

This is a brief overview of how I exported comments from CMS Made Simple as a Generic WXR XML file for importing into DISQUS.

I've been using the Comments Module for CMS Made Simple for years, and it finally broke with version 1.10 of CMSMS.

I setup DISQUS on my site first and made a determination about what was going to be in the DISQUS indetifier of each embeded comment thread. I'm using the hierarchy of the URL (minus the domain name) as the identifier.

While messing around in DISQUS I noticed they had an import option. The Generic WXR option seemed the best fit for this CMS Made Simple site.

I performed a quick Google search to see if anyone had a script already made for CMS Made Simple comment exporting. Nothing. I did find the Generic WXR XML file specification on the Sumedh K website, which also covers the process of importing the XML file into DISQUS if you need more info on how that works. 

Next I jumped to the DISQUS documentation and searched for wxr and found verification of the wxr xml file specification.

Then I created this PHP script (which is licensed under the GNU GPL) that loads the CMS Made Simple config.php file and exports all of the CMSMS comments to the generic WXR XML file from the MySQL database.

I setup the script to export the comments related to the News articles and Pages content. Since I'm using hierarchy on this site there wasn't much else needed besides grabbing the hierarchy link stored in the database with each page and news article.

Before importing I removed all the blank lines at the begining of the document. The opening XML tag has to be on the very first line.

The import page of DISQUS http://import.disqus.com/ is the best way I found to import the WXR XML document (or at lest check on the status of your import as it will list errors).

If you are going to try my script you will most likely need to modify it to fit your CMS Made Simple installation. You may also need to add a few more cases to the switch for modules other than News and Pages.

Share
Like what you read? Get updates for free!
comments powered by Disqus