Author Topic: [MOD] Top 25 uploader  (Read 54382 times)

0 Members and 1 Guest are viewing this topic.

Offline ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
[MOD] Top 25 uploader
« on: April 29, 2005, 12:47:16 AM »
Hi Every one this MOD was here before the hack attack but then disapear so I'm going to re-post it I not the one who made this MOD so don't ask me for Support.

 :arrow: Files to edit:

includes/page_header.php
templates/<your templates>/home.html

 :arrow: Step 1 If you have The MOD Memberlist you don't need to do this step. Add a new field in the database called user_t_images [Propieties: Type: smallint; Lenght: 6; Null: not null; Default: 0. (from my phpAdmin)]

Or

you can use the table update from the MOD Memberlist.

 :arrow: Step 2

In includes/page_header.php

Find:

Code: [Select]
?>
Add before:
Code: [Select]
$last_action_user_list = "";
$sql = "SELECT user_t_images, user_name, user_id FROM ".USERS_TABLE."
WHERE user_level >= '".USER."'
ORDER BY user_t_images DESC
LIMIT 25";
$result = $site_db->query($sql);

while ($row = $site_db->fetch_array($result)) {
$last_action_user_list .= '<a href ="'.ROOT_PATH.'member.php?action=showprofile&user_id='.$row['user_id'].'"><b>'.$row['user_name'].'</b></a> <span class="smalltext">'.$row['user_t_images'].'</span><br>';
}

$site_template->register_vars(array(
"user_uploaders_list" => $last_action_user_list,
));
unset($user_uploaders_list);

 :arrow: Step 3:

 In templates/<your templates>/home.html:

Add this:

Code: [Select]
<table border="0" cellspacing="1" cellpadding="1" background="{template_url}/images/cat.gif" width="100%">
  <tr>
    <td height="20" background="{template_url}/images/back1.gif">
       <b>Top 25 Usuarios</b></td>
  </tr>
  <tr>
    <td class="row1">{user_uploaders_list}<br></td>
  </tr>
</table>

If u want to change from top 25 uploader to top 10 uploader just change this
Code: [Select]
LIMIT 25"; to this
Code: [Select]
LIMIT 10";


« Last Edit: November 10, 2005, 01:24:20 AM by V@no »

Offline ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
Re: [MOD] Top 25 uploader
« Reply #1 on: April 29, 2005, 04:52:13 AM »
I have try to upgrade the list to show the image gender of the user but i don't how so if any body knows please post it this can be useful to others too :)

Offline mightyaf

  • Newbie
  • *
  • Posts: 24
    • View Profile
Top 25 uploaders - Count is still Zero- not counting image uploads
« Reply #2 on: May 07, 2005, 12:36:15 PM »
The problem is I see 25 users with zeros next to the usernames like this
Guest 0
admin 0
phantom 0
mwenja 0
dhakari 0
bensonn 0
Even after installation I tried to upload pictures to see if the count would increment but no luck. Isn't the zero suppossed to be replaced by the number of pictures uploaded?
I wonder what I did wrong. All the help is greatly appreciated.

Offline JensF

  • Addicted member
  • ******
  • Posts: 1.028
    • View Profile
    • http://www.terraristik-galerie.de
Re: [MOD] Top 25 uploader
« Reply #3 on: May 07, 2005, 03:01:03 PM »
Mit freundlichem Gruß
Jens Funk



-> Sorry for my bad English <-

Offline mightyaf

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: [MOD] Top 25 uploader
« Reply #4 on: May 07, 2005, 04:27:05 PM »
Thanks I had to replace the code
Quote
$sql = "SELECT user_t_images, user_name, user_id FROM ".USERS_TABLE."
WHERE user_level >= '".USER."'
ORDER BY user_t_images DESC
LIMIT 25";
with this one
Quote
$sql = "SELECT COUNT(i.image_id) AS user_t_images, u.user_name, u.user_id
        FROM ".USERS_TABLE." u
        LEFT JOIN ".IMAGES_TABLE." i ON (i.user_id = u.user_id)
        WHERE u.user_level > ".GUEST."
        GROUP BY u.user_id
        ORDER BY user_t_images DESC
        LIMIT 5";
in page_header.php

Thank you very much.

Offline mightyaf

  • Newbie
  • *
  • Posts: 24
    • View Profile
How do i not include Admin and Guest in Top 25?
« Reply #5 on: May 07, 2005, 08:06:26 PM »
I have the top 25 mod working, but how do I not include admin and Guest?
Thank you.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Top 25 uploader
« Reply #6 on: May 07, 2005, 08:10:41 PM »
replace
Code: [Select]
        WHERE u.user_level > ".GUEST."with
Code: [Select]
        WHERE u.user_level = ".USER."
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline mightyaf

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: [MOD] Top 25 uploader
« Reply #7 on: May 08, 2005, 05:57:57 PM »
That got rid of admin. Thanks. I can live with that however how can I also remove Guest? Is guest considered a user? (technically). Can i fake the database by addind a zero so that guest does not appear. How do i do this?
Thank you V@no!!!

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Top 25 uploader
« Reply #8 on: May 08, 2005, 09:34:43 PM »
alright, then use >= instead of =

no, guests are guests, users are registered members and admins are administrators - three different groups (well, there is one more group: not activated registered members but that group has no affect on anything in 4images :( )
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline terryjianlin

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
    • http://www.2ufj.com
Re: [MOD] Top 25 uploader
« Reply #9 on: June 03, 2005, 07:00:58 AM »
This mod does not work in my site, which is Integration 4images 1.7 / phpBB . Unfortunally, the data does not update after uploaded more pictures after installed the mod.   any way to get it work?
Quote
$sql = "SELECT user_t_images, username, user_id FROM ".USERS_TABLE."
WHERE user_level ='".USER."'
ORDER BY user_t_images DESC
LIMIT 10";

Michael

  • Guest
Re: [MOD] Top 25 uploader
« Reply #10 on: September 29, 2005, 11:39:10 AM »
Hallo, wie bekommt man das mit den Top Kommentaren hin?
Ich habe versucht user_t_images gegen user_comments auszutauschen doch das klappte leider nicht.

Gruß, Michael

Offline Nasser

  • Full Member
  • ***
  • Posts: 105
    • View Profile
Re: [MOD] Top 25 uploader
« Reply #11 on: October 27, 2005, 11:39:01 AM »
wonderful MOD .. thanks

Offline zaisk

  • Jr. Member
  • **
  • Posts: 93
    • View Profile
Re: [MOD] Top 25 uploader
« Reply #12 on: February 18, 2006, 02:43:18 PM »
I have tried all the thing like <= ;  =  ;  >= ;

but the Guest from the top do not disapear :/

What to write in this line: WHERE u.user_level <= ".USER." that the top 25 do not show admin and guest

Thanks.

Offline IcEcReaM

  • Hero Member
  • *****
  • Posts: 714
    • View Profile
    • My little Testboard
Re: [MOD] Top 25 uploader
« Reply #13 on: February 18, 2006, 06:03:47 PM »
use this (as vano already mentioned)
Code: [Select]
WHERE u.user_level = ".USER."if you want that only users/members are displayed
Coding is a everlasting competition between programmers who tries to write larger, better and idiot-safe programs and the universe producing larger and stupider idiots...
...so far the universe won
bump

Offline zaisk

  • Jr. Member
  • **
  • Posts: 93
    • View Profile
Re: [MOD] Top 25 uploader
« Reply #14 on: February 19, 2006, 01:43:09 AM »
use this (as vano already mentioned)
Code: [Select]
WHERE u.user_level = ".USER."if you want that only users/members are displayed


I tried this also, but guest is still showen :/ Maybe it is happening for the reason, that the Guests can upload images at my website ? o
Is there any other way to do that ?

And it will be perfect if it is possible to make a top in this way:

Top 25 users:
Member 1 (124)
Member 2 (68)
Member 3 (44)
Member 4 (21)
<..others>
and Guests (7893)

I need this to show that all images are uploaded by users.


Thank you.
« Last Edit: February 19, 2006, 11:10:41 AM by zaisk »