Forum Index
RegisterSearchFAQMemberlistUsergroupsLog in
Topcommenters

 
Reply to topic    Forum Index » Additional Downloads View previous topic
View next topic
Topcommenters
Author Message
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2801
Location: Germany

Post Topcommenters Reply with quote
This hack either shows a list of commenters ordered by the number of comments made in a certain month (list).

Month and year can be selected with the help of dropdowns.



Or it simply shows the top commenter of a certain month (top).



Installation:

1. Copy topcommenters.php to your main CuteNews.RU directory.

2. Put this where you want to show the list:

<? $topstyle = 'list'; include('path_to/topcommenters.php'); ?>



3. Put this where you want to show the top commenter:

<? $topstyle = 'top'; $topmonth = 12; $topyear = 2006; include('path_to/topcommenters.php'); ?>



For example, use this to show the top commenter of the current month:

<? $topstyle = 'top'; $topmonth = date('m'); $topyear = date('Y'); include('path_to/topcommenters.php'); ?>



topcommenters.zip
 Description:
Topcommenters

Download
 Filename:  topcommenters.zip
 Filesize:  1 KB
 Downloaded:  224 Time(s)



Last edited by FI-DD on Tue Dec 05, 2006 1:19 am; edited 2 times in total
Mon Dec 04, 2006 9:28 pm View user's profile Send private message
Guest








Please login to hide the ads.

scottdallas



Joined: 04 May 2006
Posts: 1943
Location: US

Post Reply with quote
Oh this is niceeeeee FI-DD you're the man.

_________________
www.scottdizzle.com uses cnr Smile
last update: 07-22-08: 8:30 pm
Mon Dec 04, 2006 11:16 pm View user's profile Send private message Visit poster's website AIM Address
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2801
Location: Germany

Post Reply with quote
Modified it a little bit to make it show the single top commenter instead of the list.
Mon Dec 04, 2006 11:38 pm View user's profile Send private message
Saszoo



Joined: 07 Jun 2006
Posts: 410
Location: Norway

Post Reply with quote
Genious, really this is Smile

Just what I've wanted Very Happy

Hm... I discovered that I get some errors with this, it seems it got some problems with enable/disable comments and custom quick tags plugins.

Cannot redeclare cqt_variables. Did you guys get any errors like this?

TIA

_________________
My cute.ru site
Mon Dec 04, 2006 11:40 pm View user's profile Send private message Visit poster's website
astrostart



Joined: 11 Feb 2007
Posts: 124
Location: The Netherlands

Post Reply with quote
Can I make a request?



Now it shows the 'author' name of the users.



However, in Cutenews they can register a username (author) and a nickname for on the site.



Can it show the nicknames of the users and not the usernames?

_________________
My site: http://www.astrostart.nl | Thanks to everyone here who has helped me!
Tue Feb 20, 2007 9:26 pm View user's profile Send private message Visit poster's website
asson



Joined: 24 Nov 2006
Posts: 46
Location: Karlstad, Sweden

Post Reply with quote
Thanks FI-DD Wink
Tue Feb 20, 2007 10:31 pm View user's profile Send private message
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2801
Location: Germany

Post Reply with quote
astrostart wrote:
Now it shows the 'author' name of the users.


It shows what the users put in the name field when leaving a comment, doesn't it?

If they put in their nickname it shows the nickname, if they put in their username it shows the username.
Tue Feb 20, 2007 10:46 pm View user's profile Send private message
astrostart



Joined: 11 Feb 2007
Posts: 124
Location: The Netherlands

Post Reply with quote
You're right, but I have the loginbox hack on my site. So visitors don't have to fill in there name everytime they make a comment.



They just have to register themself with a:

- Username (a name to log in)

- Password

- Nickname (the nickname)

- E-mail



With the username & password the users log in, but if they leave a comment (when logged in), the nickname appears next to it.

_________________
My site: http://www.astrostart.nl | Thanks to everyone here who has helped me!
Tue Feb 20, 2007 11:17 pm View user's profile Send private message Visit poster's website
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2801
Location: Germany

Post Reply with quote
1. Open topcommenters.php and add this at the end of the file:

Code:
function get_nick_by_author($author){

global $sql;



   $query = reset($sql->select(array('table' => 'users', 'where' => array("username = ".$author))));

   

   return $query['name'];



}




2. Change this:

Code:
echo $author.': '.$comments.'<br />';




to this:

Code:
echo get_nick_by_author($author).': '.$comments.'<br />';




(Not tested.)
Tue Feb 20, 2007 11:28 pm View user's profile Send private message
astrostart



Joined: 11 Feb 2007
Posts: 124
Location: The Netherlands

Post Reply with quote
You're absolutely brilliant! It works!



I have one final request. Embarassed I know, I'm annoying.



Could you make something within this plugin that doesn't show the topcommentor of the month, but the five topcommentors of the month?



So instead of this:

User: 49



You get this:

1. User: 49

2. Piet: 48

3. Jan: 13

4. Kees: 10

5. Nop: 9



Is that somehow possible? Can you make something like this with the numbers 1 till 5?



It would be great if you could do this! Very Happy

_________________
My site: http://www.astrostart.nl | Thanks to everyone here who has helped me!
Wed Feb 21, 2007 12:45 am View user's profile Send private message Visit poster's website
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2801
Location: Germany

Post Reply with quote
Change this:

Code:
$i = 0;

   foreach($result as $author => $comments){

      if($i == 0){

         echo $author.': '.$comments.'<br />';

      }




to this:

Code:
$i = 1;

   foreach($result as $author => $comments){

      if($i <= 5){

         echo $i.'. '.$author.': '.$comments.'<br />';

      }

Wed Feb 21, 2007 7:29 pm View user's profile Send private message
astrostart



Joined: 11 Feb 2007
Posts: 124
Location: The Netherlands

Post Reply with quote
OMG! Thank you very much! It works! Very Happy

_________________
My site: http://www.astrostart.nl | Thanks to everyone here who has helped me!
Wed Feb 21, 2007 8:33 pm View user's profile Send private message Visit poster's website
eberswine



Joined: 26 Apr 2007
Posts: 148

Post Reply with quote
Code:
Fatal error: Cannot redeclare cn_calendar() (previously declared in /home/content/r/u/n/site/html/admin/plugins/etc.php:13) in /home/content/r/u/n/site/html/admin/plugins/etc.php on line 12



are there any plugins you need to activate or deactivate for this?
Sat Nov 08, 2008 4:35 pm View user's profile Send private message
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2801
Location: Germany

Post Reply with quote
Make sure that you include head.php only once. If you put topcommenters.php into a page which already has head.php included you can remove head.php from topcommenters.php. I hope this makes sense. Cool
Thu Nov 13, 2008 7:07 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    Forum Index » Additional Downloads All times are GMT + 1 Hour
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
You cannot attach files in this forum
You can download files in this forum



Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Music Lyrics.