October 2009
Beginner
408 pages
7h 27m
English
With retrieveComments() functional, you can now display the entries loaded when a user views an entry on the blog.
You can do this by creating a new showComments() method that accepts the blog ID as an argument ($blog_id). This method begins by initializing an empty variable ($display) to contain the formatted comments, then calls the retrieveComments() method to get the entry's comments loaded into memory.
With the comments loaded into $display, you can loop through each comment and create HTML markup to display them. Inside the loop, you want to check whether retrieveComments() has returned the default value, which means no comments exist for the entry. To do this, you set up a conditional statement ...
Read now
Unlock full access