[Solved] Troubles listing every comment of every post

Found something that doesn't work as expected? Encountered PHP errors? Submit your bug reports here!
tiagobugarin
Posts: 3
Joined: Tue Mar 26, 2013 5:50 am

[Solved] Troubles listing every comment of every post

Postby tiagobugarin » Tue Mar 26, 2013 6:34 am

This is my first experience with Nucleus CMS so I do not fully understand it. I also am not a programmer/developer so I have very little understanding of PHP. Keep that in mind.

I am trying to create an WXR file to export a blog from Nucleus to Wordpress. I got most of it but the comments.
BTW, this is a huge site with more than 4500 posts and more than 18k comments since 2003!

What and how I am trying to do.

Duplicated the xml-rss2.php to wxr.php;
Inside wxr.php changed the line from

Code: Select all

$CONF['Self'] = "xml-rss2.php";

to

Code: Select all

$CONF['Self'] = "wxr.php";


Created a template called 'wxr'
In the body of this template among other things i used the variable: <%comments%> to call the comments block right below this main block.

In the block comments body I inserted the content I want to repeat to each comment for every item.

The result is a xml file that entirely misses the <%comments%> block.

The link to the XML is http://www.zeno.com.br/wxr.php?blogid=1

The complete wxr.php is in http://pastebin.com/WLCgR3R8

The wxr skin is in http://pastebin.com/XA476KBY

The wxr template post body is in http://pastebin.com/XwTVBAwF

The wxr template comments body is in http://pastebin.com/LZePCvYz
Last edited by tiagobugarin on Wed Mar 27, 2013 7:29 pm, edited 1 time in total.
User avatar
WillyP
Nucleus Guru
Nucleus Guru
Posts: 872
Joined: Sun Aug 30, 2009 3:29 am
Location: Pembroke, NH
Contact:

Postby WillyP » Tue Mar 26, 2013 4:01 pm

I have never heard of a wxr file... is this proprietary to Wordpress?
tiagobugarin
Posts: 3
Joined: Tue Mar 26, 2013 5:50 am

Postby tiagobugarin » Tue Mar 26, 2013 4:48 pm

WillyP wrote:I have never heard of a wxr file... is this proprietary to Wordpress?


WXR stands for Wordpress Extended RSS and it is, as the name said, an extension to RSS specification.

I have never found any information regarding the licensing nor any oficial Wordpress documentation about it.
ftruscot
Nucleus Guru
Nucleus Guru
Posts: 7430
Joined: Wed Feb 22, 2006 6:19 pm
Location: Massachusetts
Contact:

Postby ftruscot » Tue Mar 26, 2013 6:01 pm

The rss feed is like an "index" page which does not show comments by default. In the template post body use <%comments(10)%> to show up to 10 comments. Adjust that number to show more or less. So it might look like this:

Code: Select all

    <item>
            <title><%title%></title>
            <link><%blogurl%>index.php?itemid=<%itemid%></link>
            <pubDate><%date(rfc822)%></pubDate>
            <dc:creator><%author(realname)%></dc:creator>
            <guid isPermaLink="false"><%blogurl%>?p=<%itemid%></guid>
            <content:encoded><![CDATA[<%body%><!--more--><%more%>]]></content:encoded>
            <excerpt:encoded><!-- <![CDATA[]]> --></excerpt:encoded>
            <wp:post_id><%itemid%></wp:post_id>
            <wp:post_date><%date(%Y-%m-%d %H:%M:%S)%></wp:post_date>
            <wp:post_date_gmt><%date(utc)%></wp:post_date_gmt>
            <wp:status>publish</wp:status>
            <wp:post_type>post</wp:post_type>
            <category domain="category" nicename="<%categoryname%>"><![CDATA[<%category%>]]></category>
            <%comments(100)%>
    </item>
Is your question not solved yet?
Search our FAQ,
read the Documentation, or
browse the list of available plugins.

Check out my plugins
tiagobugarin
Posts: 3
Joined: Tue Mar 26, 2013 5:50 am

Postby tiagobugarin » Wed Mar 27, 2013 7:34 pm

Thanks ftruscot, it solved the issue.

Return to “Bug Reports & Feature Requests”