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

0 Members and 1 Guest are viewing this topic.

Offline IcEcReaM

  • Hero Member
  • *****
  • Posts: 714
    • View Profile
    • My little Testboard
Re: [MOD] Top 25 uploader
« Reply #15 on: February 20, 2006, 07:48:15 AM »
You tried this?

Code: [Select]
$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 = ".USER."
        GROUP BY u.user_id
        ORDER BY user_t_images DESC
        LIMIT 5";

Maybe you tried it with the other sql query.
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 #16 on: February 20, 2006, 07:39:44 PM »
You tried this?

Code: [Select]
$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 = ".USER."
        GROUP BY u.user_id
        ORDER BY user_t_images DESC
        LIMIT 5";

Maybe you tried it with the other sql query.

Yes, I tried this also. I tired with the correct sql query, becasue the limit was 25 and now changed into 5, but the Guest is still shown :/
Any ideas how to remove Guest from the top list ?
Maybe it is possible to move Guest at the bottom for example if there is top 25 uploaders at my index, so I want to see top 25 uploaders and guest at the bottom.
Example:
TOP 25
Member 1 (154)
<..>
Member 25 (9)
and (5546) uploaded by Guests


Thank you for help.

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 #17 on: February 21, 2006, 12:33:37 AM »
Yes, I tried this also. I tired with the correct sql query, becasue the limit was 25 and now changed into 5, but the Guest is still shown :/
Then you do something esle wrong. This query will not return any guests.
Perhaps you could attach as a zip file your top.php (or whatever file your are trying to modifyed)
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 cookie

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: [MOD] Top 25 uploader
« Reply #18 on: June 07, 2006, 09:54:17 PM »
How does the user_t_images field get populated and incremented?

I have installed the mod and it shows fine on the home page, but all users have a (0) next to them instead of the actual number of uploads.

I went into the database and manually updated the field for one of the users to 1, and reloaded the index page with a browser.

That users now shows a (1) instead of a zero.

So I'm guessing that my problem is that this field is not incremented when a user uploads a new image.

FYI:
I'm using the "check images in all categories" MOD, and the "agree to terms before upload" MOD which is here -->
http://www.4homepages.de/forum/index.php?topic=7113.0

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 #19 on: June 08, 2006, 02:38:46 AM »
basicaly you have to have members list mod installed, it only updates when opening memberlist page...

anyways, here is a fixed database query that doesnt need any extra user_t_images field in the database:
Code: [Select]
$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 >= ".USER." AND i.image_activated = 1
        GROUP BY u.user_id
        ORDER BY user_t_images DESC
        LIMIT 25
        ";


[EDIT]
...ops...didnt see IcEcReaM's post... :lol:
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 cookie

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: [MOD] Top 25 uploader
« Reply #20 on: June 08, 2006, 10:15:00 AM »
Thanks V@no and sorry for asking so many questions.  The original post did not clearly state that the other Member's list MOD was required.

I had seen the post referencing the other SQL statement, but it did not clearly state that it was a replacement SQL query if you did not have the Member's list MOD installed.

The new query does the trick. It works fine for me now.

The one question that I have is that in the new SQL query, the first line states:
Code: [Select]
$sql = "SELECT COUNT(i.image_id) AS user_t_images, u.user_name, u.user_id
as you can see user_t_images is clearly part of the SQL query.

Is that so that this will work for both following scenarios:
1. You have the member's list MOD installed.
2. You don't have the member's list MOD installed, but you want to use this mod?

In other words, 1 SQL statement for two scenarios that will work for both.

Thanks again!
« Last Edit: June 08, 2006, 11:31:25 PM by cookie »

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 #21 on: June 08, 2006, 02:50:58 PM »
Correct
Basicaly it just tells MySQL to count images for each member, and the number of images return into "user_t_images" variable.
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 dado supremo

  • Newbie
  • *
  • Posts: 31
    • View Profile
Re: [MOD] Top 25 uploader
« Reply #22 on: August 06, 2006, 04:24:54 AM »
how I make for the ADM of the gallery to enter in top 25 concurring with the members?

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 #23 on: August 06, 2006, 06:12:03 AM »
Your question is not clear, please explain.
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 dado supremo

  • Newbie
  • *
  • Posts: 31
    • View Profile
Re: [MOD] Top 25 uploader
« Reply #24 on: August 06, 2006, 06:25:05 PM »
how I make administrator to participate it of top 25?

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 #25 on: August 06, 2006, 10:28:48 PM »
The original code already included admins
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 dado supremo

  • Newbie
  • *
  • Posts: 31
    • View Profile
Re: [MOD] Top 25 uploader
« Reply #26 on: August 06, 2006, 11:48:14 PM »
have as you to repass codigo certain?  because he has other different in others topics


the administrator this not appearing in top
« Last Edit: August 07, 2006, 04:43:45 PM by dado supremo »

Offline nacho-lopez

  • Newbie
  • *
  • Posts: 48
    • View Profile
    • Photoshop Designs
Re: [MOD] Top 25 uploader
« Reply #27 on: August 26, 2006, 04:31:54 PM »
Great MOD
Thanks a lot for it...
I wonder...
How Could I show the 25 uploaders just in a simple row?
I see it now this way:
carpin 25
DARKLUKY 18
mikelo 17
Carlos Valcarcel 13
Oscar 11

And I would like to see it this way:
carpin 25, DARKLUKY 18, mikelo 17, Carlos Valcarcel 13, Oscar 11
Do you understand what I mean?
Thanks a lot and best regards from Spain

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 #28 on: August 26, 2006, 06:46:24 PM »
Remove <br> from step 2
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 nacho-lopez

  • Newbie
  • *
  • Posts: 48
    • View Profile
    • Photoshop Designs
Re: [MOD] Top 25 uploader
« Reply #29 on: August 26, 2006, 06:56:01 PM »
Thank you  :D
What should I do if I want to add a comma between each member name?
Remove <br> from step 2