1

Topic: Plug in like TOP 20 most active users

Can someone create module or plug-in for top 20 or 10 most active users to be showed before footer

Here is sample:

http://www.maglaj.net/forum.jpg


This is on Bosnian language but it's like SomeNick (number of posts), ...

Thanks ...

it's just me...

Re: Plug in like TOP 20 most active users

this would have to be a modification, it wouldn't be that hard you just need to do an extra sql query

3

Re: Plug in like TOP 20 most active users

posible make it?

it's just me...

4 (edited by ultime 2005-06-14 15:43)

Re: Plug in like TOP 20 most active users

As soon as I come back from work, I'll make this small update for you!
It's really quite simple to create..

Re: Plug in like TOP 20 most active users

Here you go:

<!--- "Top 20 most active users" Script by ultime (ultime@omgultime.com) created for PunBB --->
<div id="announce" class="block">
    <h2><span><b>Top 20 most active users</b></span></h2>
    <div class="box">
        <div class="inbox">
            <div>
<?php

$result = $db->query('SELECT id, username, num_posts FROM '.$db->prefix.'users ORDER BY num_posts DESC LIMIT 20') or error('Unable to fetch user data', __FILE__, __LINE__, $db->error());
while ($data = $db->fetch_assoc($result))
{
echo "\t\t\t\t\t\t".'<a href="profile.php?id='.$data['id'].'">'.pun_htmlspecialchars($data['username']).'</a>('.$data['num_posts'].') '."\n";
}

?>
        </div>
    </div>
</div>
</div>
<!--- End for "Top 20 most active users" --->

For an example, go to www.cash4posts.com and scroll down a little..

6

Re: Plug in like TOP 20 most active users

Were do i have to put the code?

7

Re: Plug in like TOP 20 most active users

i'ill put before footer ...

it's just me...

8 (edited by faax 2005-06-15 12:12)

Re: Plug in like TOP 20 most active users

thanks alot ultime ... i put this modification on my punbb it's work perfect. There is some modifications here is sample for anyone who need this option
open index.php
------------------
find

<?php

$footer_style = 'index';
require PUN_ROOT.'footer.php';

replace with

<!--- "Top 20 most active users" Script by ultime (ultime@omgultime.com) created for PunBB --->
<div id="announce" class="block">
    <h2><span><b>Top 20 most active users</b></span></h2>
    <div class="box">
        <div class="inbox">
            <div>
<?php

$result = $db->query('SELECT id, username, num_posts FROM '.$db->prefix.'users ORDER BY num_posts DESC LIMIT 20') or error('Unable to fetch user data', __FILE__, __LINE__, $db->error());
while ($data = $db->fetch_assoc($result))
{
echo "\t\t\t\t\t\t".'<a href="profile.php?id='.$data['id'].'">'.pun_htmlspecialchars($data['username']).'</a>('.$data['num_posts'].') '."\n";
}

?>
        </div>
    </div>
</div>
</div>
<!--- End for "Top 20 most active users" --->
<?php
$footer_style = 'index';
require PUN_ROOT.'footer.php';
it's just me...

Re: Plug in like TOP 20 most active users

No problem faax, if you really want the commas between usernames, just create an array and use the implode() function..

Have fun with this script smile

10

Re: Plug in like TOP 20 most active users

ultime thanks alot for this modification

it's just me...

11

Re: Plug in like TOP 20 most active users

Hi. Thanks for the code.
What shall i change if I want top 20 for the number of topics?

Re: Plug in like TOP 20 most active users

Added to the punres wiki smile http://punres.org/doku.php?id=how-tos:t … tive_users

13

Re: Plug in like TOP 20 most active users

cool little mod thx!

14

Re: Plug in like TOP 20 most active users

Hi. Thanks for the code.
What shall i change if I want top 20 for the number of topics?
Can anyone help please?

15

Re: Plug in like TOP 20 most active users

Cool!
But how do i get it to work in MyPunBB?

-AssD-

Re: Plug in like TOP 20 most active users

If you're guaging how 'active' users are by their number of posts - this is a great script.. but how hard would it be to write a 'karma' system of sorts where users get karma for posting... but lose it if they dont post over a long period of time, so 'active' users have to remain active?

Any ideas?

Re: Plug in like TOP 20 most active users

AssD wrote:

Cool!
But how do i get it to work in MyPunBB?

you can't

Re: Plug in like TOP 20 most active users

I tried to make this mod for people who had colored usergroups. But for some reason it wasn't working. Can someone help me with this? I want the 20 most active users to have their corresponding usergroup color. Thanks.

--Blueorb

19

Re: Plug in like TOP 20 most active users

i put the code in a txt file and then in main.tpl i put

<pun_include "file.txt">

were i wanted it

20 (edited by gleb 2006-01-26 09:05)

Re: Plug in like TOP 20 most active users

I´m using the miniportal and it would be really nice if I can add the 20 most active users in the top of my forum.php How do I do that? I´ve tried to just copy/paste the code further up in the forum.php file but I only get the result that everything below the pasted code disapers.

I also tried this in the viewtopic.php file...copied and pasted the moste 20 active users code and it now shows/works1. How come it doesn´t work in the forum.php file?

21

Re: Plug in like TOP 20 most active users

thanks for the code big_smile

http://www.smashingpumpkins.com.ar/board/