

| |||||||
| | LinkBack | Article Tools | Display Modes |
| ||||
| Story.php Reserved for future use. Need a Web Host ? Save up to $84 when you purchase hosting from Dreamhost.com. Use the coupon code PLIGG when buying a web hosting package from Dreamhost.com Last edited by Yankidank; 09-03-2007 at 06:11 PM. |
|
#2
Story.php | ||||||
| How comments work (story.php) This is a small guide for anyone trying to learn about the current template, understand it, implement it and possibly give solutions to making it more efficient. It’s more of a walk through if you were looking at the code. Please download the latest code and unravel the secrets of Pligg.
story.phpIt gets the ID or title and reads the data from the database. Code: $link->read(); Code: $main_smarty->assign('tpl_center', $the_template . '/story_center');
$main_smarty->display($the_template . '/pligg.tpl');
In the case of story.php it will be story_center.tpl. story_center.tplCode: $link->print_summary(); Further down the page you will see Code: get_comments(); get_comments is declared in story.php, so back we go. story.phpget_comments will retrieve all the comments which are the parent. It prints the parent first using $comment->print_summary($link); And then it finds all the comments that replied to the parent comment, and prints them using $comment->print_summary($link); So we have Parent Comment -Child comment -Child comment -Child comment Parent Comment -Child comment -Child comment $comment->print_summary is declared in /libs/comment.php /libs/comment.phpIt reads the comment from the database using the $link that is passed from story.php Code: if(!$this->read) return; Code: $smarty->assign('comment_id', $this->id);
$smarty->assign('comment_author', $this->author);
$smarty->assign('comment_link', $this->link);
Code: $smarty->display($the_template . '/comment_show.tpl'); OverviewPligg.tpl is the main layout. Story_center.tpl is the story layout which prints the story, get_comments, and shows the comment form Comment_show.tpl is the layout of an individual comment.
| ||||||
| Article Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| adding traffic stats to story.php | bbrian017 | General Help | 2 | 11-26-2007 09:48 AM |
| Set the story.php page title | spuds | General Help | 0 | 11-10-2007 02:02 PM |
| story.php forum like feature | noyp | Suggestions | 2 | 12-06-2006 02:58 PM |