First. @kongondo, thank you for these modules.
I have encountered a small bug in the MarkupBlog module (I believe).
When I invoke renderPosts() with just default options, it renders my example set of posts just fine.
When I use the API to invoke the option to make comments (and categories) appear in a post's footer, however, renderPosts() creates some broken content. Specifically, the $numCommentsStr (line 965 in MarkupBlog.module) comes back with HTML-as-text.
Background:
I installed a new server with PW 2.6, which I then used to DL and install (the latest?) ProcessBlog via the Admin interface. I chose the demo-files option in phase 2, then switched to my own template code, just using the API (and here's my blog.php ):
$blog = $modules->get("MarkupBlog");
$myOptions = array(
'post_comments' => 2,
'post_author' => 0,
'post_categories' => 2,
'post_large_headline_tag' => 'h3',
);
$content = $blog->renderPosts("limit=11", false, $myOptions);
Straight forward and simple, (inheriting the same appearance code as the main PW example site).
Meanwhile, rendering a single post with the same option (put the comment count in the post's footer) works just fine. Here's that file ('blog-post.php'):
$blog = $modules->get("MarkupBlog");
$blogConfigs = $modules->getModuleConfigData('ProcessBlog');
$renderComments = $blogConfigs['commentsUse'] == 1 ? $blog->renderComments($page->blog_comments) : '';
$myOptions = array(
'post_comments' => 2,
'post_author' => 0,
'post_categories' => 2,
'post_large_headline_tag' => 'h3',
);
$content = $blog->renderPosts($page, false, $myOptions) . $renderComments . $blog->renderNextPrevPosts($page);
I examined the module code and couldn't determine what is corrupting the $numCommentsStr. I did notice a difference in the syntax used to render the same element (top uses an if statement and just appends to $out, while bottom uses a ternary op and temp var and concats a bunch of stuff at once), and the odd re-usage of a var $comments (which everywhere else is used to hold an array of comments),
It is interesting to recognize that the badly-rendered post (the one with comments) renders out HTML that actually belongs to the post from the previous iteration.
Here's the screenshots (multiple page with bad content and single page with good render):
I'm a vet C++ programmer, just ramping up to really learn PHP, so forgive me if I'm missing something obvious. Maybe it's a combination of having two non-default options (no Author output + bottom comment count)-- I haven't tried all combos to help with the debugging. I thought I'd call on more experienced PHP folk first...
TIA for any comments.