PDA

View Full Version : help needed: displaying last submitted images


BlazeQ
21st of June 2002 (Fri), 12:42
My problem is this, I want to have (on a separate page from the EE) the LATEST FIVE images from ALL the exibitions.

I am not versed in coding (my specialty is digital art) and I would greatly appreciate help in this problem.

Thank you,
BlazeQ :)

Pekka
21st of June 2002 (Fri), 14:08
Here's how to modify indexpage to show last 5 photos for each exhibition. It takes sorting from photo editor's "CREATED" date. If there are more photos on same date it shows 5 of them (chosen by SQL), you can change photo create dates in editor to achieve correct sorting (I can add there a datetime field for second-accurate sorting criteria if this kind of feature is needed). Here's how to modify it:

In indexstyles folder you have 1.php

there you see at line 223:

----------------------------------
ORDER by RAND()
LIMIT 10
----------------------------------

change those lines to:

----------------------------------
ORDER by ee_photo_sql_created DESC
LIMIT 5
----------------------------------

Also, on line 312 you see code:

----------------------------------
better_shuffle($photolinks);

for ($n=0;$n

BlazeQ
23rd of June 2002 (Sun), 15:48
Thanks Pekka.

I'm updating to 1.22 right now so I haven't had the chance to implement this yet.

Thanks again :)

BlazeQ

BlazeQ
27th of June 2002 (Thu), 22:45
I've done what you've said. And it works just like it should except for one problem. Some of the image links point to the wrong exhibition. So when I click the link it says there is no photo in that exhibition.

i.e. all the images link to exhibition number 6 (photo.php?photo=362&size=default&exhibition=6) even though the image is in exhibition 5

Thanks so much for your help :)
BlazeQ

Pekka
28th of June 2002 (Fri), 04:16
leave

AND ee_photo_to_exhibition.ee_exhibition_id = '$e'

there for now. I'll make you a separate script for "last five in all" on next version.

BlazeQ
28th of June 2002 (Fri), 11:12
Thanks!! I'm looking forward to the next update :-)

BlazeQ