Author Topic: [Mod Req] Latest Image In Each Category  (Read 8924 times)

0 Members and 1 Guest are viewing this topic.

Offline Yegor

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
    • http://www.planetboredom.net
[Mod Req] Latest Image In Each Category
« on: February 14, 2006, 12:01:11 AM »
Im wondering if such mod already exists.

Basically, on the main page, instead of showing x latest images, I want to show 1 image from each catgeory that was updated. So lets say I upload 10 images into 5 different categories (so 50 images in total), only the last image uploaded into each category will be displayed on index.php, instead of just the lastest 5 images in a single category.

I'd be willing to pay someone to code this mod for me real quick if it doesn't already exist.
PlanetBoredom.net
 - Things to do when you are bored.  [ Advertise ]

Offline Yegor

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
    • http://www.planetboredom.net
Re: [Mod Req] Latest Image In Each Category
« Reply #1 on: February 16, 2006, 07:46:49 PM »
Come on, Im offering money to someone who will develop this mod for me.
PlanetBoredom.net
 - Things to do when you are bored.  [ Advertise ]

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: [Mod Req] Latest Image In Each Category
« Reply #2 on: February 16, 2006, 07:48:12 PM »
Well, to be honnest - it is much simpler to request it than to code it. ;)

Offline Yegor

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
    • http://www.planetboredom.net
Re: [Mod Req] Latest Image In Each Category
« Reply #3 on: February 16, 2006, 11:51:49 PM »
Yah, thats why Im offering money to whoever does.
PlanetBoredom.net
 - Things to do when you are bored.  [ Advertise ]

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 Req] Latest Image In Each Category
« Reply #4 on: February 17, 2006, 01:39:55 AM »
In index.php find:
Code: [Select]
SELECT i.image_id, i.cat_idReplace with:
Code: [Select]
SELECT DISTINCT(i.cat_id), i.image_idThen a couple lines below find:
Code: [Select]
        ORDER BY i.image_date DESCInsert above:
Code: [Select]
        GROUP BY i.cat_id
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 Yegor

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
    • http://www.planetboredom.net
Re: [Mod Req] Latest Image In Each Category
« Reply #5 on: February 17, 2006, 08:11:20 PM »
Spasibo!  :lol:
PlanetBoredom.net
 - Things to do when you are bored.  [ Advertise ]

Offline IcEcReaM

  • Hero Member
  • *****
  • Posts: 714
    • View Profile
    • My little Testboard
Re: [Mod Req] Latest Image In Each Category
« Reply #6 on: February 17, 2006, 08:49:39 PM »
[Offtopic Mode On]
Quote
Spasibo!
Which language is that?
I only know spasiba, which is russian.

[Offtopic Mode Off]
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 Yegor

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
    • http://www.planetboredom.net
Re: [Mod Req] Latest Image In Each Category
« Reply #7 on: February 17, 2006, 10:15:41 PM »
That was russian. :)

Btw V@no, your mod works well, but Im kinda confused how it selects the images from categories. Some of them are the first image in the category, and others seem to be randomly chosen from that category.
PlanetBoredom.net
 - Things to do when you are bored.  [ Advertise ]

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 Req] Latest Image In Each Category
« Reply #8 on: February 18, 2006, 04:30:14 AM »
Btw V@no, your mod works well, but Im kinda confused how it selects the images from categories. Some of them are the first image in the category, and others seem to be randomly chosen from that category.
Unless the mysql query you have was changed, this code should not affect the way you've discribed...
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)