[Plugin] Sidebar comments

 
Post new topic   Reply to topic   printer-friendly view    b2evolution Forum Index -> Plugins & Extensions
View previous topic :: View next topic  
Author Message
personman
SuperGuru
SuperGuru

Joined: 09 Feb 2005
Posts: 2178
Reputation: 116.9 add or subtract from this member's reputationadd or subtract from this member's reputation
votes: 15

PostPosted: Tue Nov 22, 2005 9:39    Post subject: [Plugin] Sidebar comments Reply with quote

This plugin is for the Phoenix version of b2evolution. It's very simple. It displays the most recent comments in the sidebar of a blog. The comment author name is given, followed by the title of the post, which is a permalink to the comment on that post. It uses the code from the _lastcomments.php file in the skins folder, but it provides a quicker look at who is commenting on what.

If you're running the unreleased version (or reading this in the future when it has been released), here's how to install:

1. Download the plugin file: _sidebarcomments.plugin.php.txt and remove the .txt from the end of the filename.

2. Place it in your plugins directory, then go to the back office, Settings->Plugins and click install next to Sidebar Comments.

3. Copy this code into your evoskin where you want the comments to appear:
Code:
 <?php
                // -------------------------- SIDEBAR COMMENTS INCLUDED HERE --------------------------
                // Call the Sidebar Comments plugin:
                $Plugins->call_by_code( 'SBcommnt', array(
                // Add parameters below:
                // 'n_comments'=>5
                        ) );
                // -------------------------- END OF SIDEBAR COMMENTS -------------------------------
        ?>


You can uncomment the 'n_comments'=>5 line to change the number of comments that are displayed. You can also add other values to the array to customize the way things are displayed. See the plugin file for more information.

If you want to be minimalist, then you can use this instead of the code block above:
Code:
<?php $Plugins->call_by_code( 'SBcommnt', array() ); ?>


I'm still trying to get the feel for the right way to put a plugin together, so if you find any mistakes, please let me know. I'm hoping to work my way up to more complicated things.

_________________
RTFM
Back to top
View user's profile Send private message Visit poster's website
personman
SuperGuru
SuperGuru

Joined: 09 Feb 2005
Posts: 2178
Reputation: 116.9 add or subtract from this member's reputationadd or subtract from this member's reputation
votes: 15

PostPosted: Tue Nov 22, 2005 14:02    Post subject: Reply with quote

YaBBa already has a very similar plugin ready to go. There are a few more params in that one and it displays things a little differently. It, along with the others YaBBa's making won't be released until Phoenix is out. This was a good learning experience for me, though. If looking at the code helps you at all, then all the better.
_________________
RTFM
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    b2evolution Forum Index -> Plugins & Extensions All times are GMT - 5 Hours
Page 1 of 1


 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
b2evolution Support Forum RSS Feed Forums powered by php Bulletin Board