Import comments in Disqus
Disqus Import class generates generic xml to import comments from any system into your Disqus forum.
Disqus is the best commenting platfom you will ever get. Seriously, the service it provides is awesome and I used it alot and always recommend to my clients.
But, importing existing comments from non supported platforms into Disqus is a huge pain!
Firstly the import can take up to 24 hours, so it means you can have up to 24 hours between tests. Secondly, sometimes it does not work for no apparent reason. Meaning if you got error, simply retry importing same xml document, it might work perfectly next time.
Thus I created this little script to generate proper generic xml document to be imported into Disqus system. Note, try creating test forum for your first imports ;)
- Disqus Generator - for generating xml file
- Disqus Article - to represent webpage/article/blog post objects
- Disqus Comment - to represent comment objects
Basically what you have to do is to create representing Article and Comment objects, add comments to articles, add articles to Generator and call generate method. Just don't forget to provide as much information as possible for all the objects.
- Examples in action
- Disqus Comment Method list
- Disqus Article Method list
- Disqus Generator Method list
- Latest changes
Example scripts provided with package in action:
- Set ID of comment
- Set author ID of comment
- Set author avatar
- Set author
- Set author email
- Set author url
- Set author IP address
- Set date of comment
- Set comment text
- Set comment status
- Set parent of the comment
Set your systems internal id of comment.
string $id - id of comment
Set unique ID of author only if you use SSO (Single Sign On) and can uniquely identify the user
string $id - unique id of author
Set avatar of author only if you use SSO (Single Sign On) and can uniquely identify the user
string $avatar - link to author avatar
Set display name of the author, can be unique ID if you use SSO or any other name you wish to display
string $author - display name of author
Set email address of author.
string $email - email of author
Set url author provided (displayed when clicking on their username)
string $url - author's url
Set IP address of the author
string $ip - author's ip address
Set date when comment was made. Must be YYYY-MM-DD HH:MM:SS 24-hour format.
string $date - date of the comment
Set text of comment
string $content - comment text
Set status of the comments, 0 - inactive, 1 - active.
int $approved - 0 or 1
If this commend was a reply to another one. Provde system's internal id of the other comment here.
int $parent - ID of the comment this reply was meant for
- Set title of webpage/article
- Set link to webpage/article
- Set contents of the webpage/article
- Set disqus ID webpage/article
- Set post date of webpage/article
- Set status of webpage/article
- Add comment to webpage/article
Set the title of your webpage/article.
string $title - title of webpage/article
Set canonical link to your webpage/article
string $link - link to webpage/article
Set the contents of the webpage/article. It can either be just a plain text of article, or whole HTML code of this specific webpage.
string $contents - contents of the webpage/article
If you are already using disqus and you set up disqus ID's for specific pages, or you are going to have disqus page ID's, then you can provide them here for each specific webpage/article.
string $disqus_id - disqus id of the webpage
Sets the post date of the webpage/article. Must be YYYY-MM-DD HH:MM:SS 24-hour format.
string $post_date_gmt - post date of webpage/article
Sets the current status of webpage/article. open/closed values are acceptable
string $status - status of webpage/article (open or closed)
Adds the Disqus Comment object to this specific webpage/article
Disqus Comment $comment - instance of Disqus Comment class
Adds the Disqus Article object to include in XML generation
Disqus Article $article - instance of Disqus Article class
Generates XML from all provided articles and comments and returns it as string
None for now
PHP classes support forum or comments below
You may also be interested in:
Powered by BlogAlike.com