View Full Version : Photo of the Month?
December 12th, 2004, 02:06 PM
Any chance of getting a Photo of the Month feature in later versions or as an addon / hack?
I'm not sure exactly how it would work, but it would make it easier than trying to do it manually. :p
December 16th, 2004, 12:35 PM
Just a little friendly bump :)
December 16th, 2004, 02:45 PM
It could be a simple query to the db to select from the most voted photos in the previous month, the one with higher score.
But if it is going to be displayed for an entire month without changing, it's a waste of db queries to me =) Just my 2 cents.
December 16th, 2004, 04:25 PM
Like I said, I haven't really thought about how it should work, but here is one example how this could work:
It could be a vBcron that is set to run monthly and only be a couple to a few queries.
One query (I think) to pull the images that have been posted in the last 30 days and sort it by (selectable) views, replies, or ratings and limit it to 1
And one query (again, I think) to copy or move that image to another category, such as Photos of the Month.
I'm not a programmer, but I really don't see this being a problem with performance.
December 20th, 2004, 02:37 PM
Nobody else is interested in this? :(
December 20th, 2004, 03:33 PM
Nobody else is interested in this? :(Actually, I am. I just haven't had time to work on it. For a 'site to be someday worked on' I'd like to do a "Hot Rod of the Month" type thing (restoring classics is a big thing in the area where I'm living now) so it's something I'm definitely interested in (and will be doing) but just haven't had a chance.
Off the type of my head I was thinking along the same lines you were..... create a new table and/or field somewhere to store the value and then once a month run a cron job to pull a pic based upon X values and then store that image's ID in the new field. I'd be hesitant about trying to tackle copying the image to a second category because then you start getting your hands dirty, so to speak, in that you would need to physically copy the file to a different users folder (or copy it within the same folder with a different name) in order to get it to show up in a different category because right now Gallery doesn't support having the same image appear in multiple categories. I think it'd be cleaner to just grab the current value. Although it would be pretty cool to be able to track past winners, etc. OK, I've got to think about this a bit more. :)
December 20th, 2004, 03:54 PM
Well, another way you could do it would be to add a field to each image and then duplicate the newest replies and newest images to display all images with photoofmonth=1 and get the month from the dateline of the image to display it as a row in the image bits.
Still with the cron set up, just instead of copying or moving it, it would change the value or photoofmonth (of whatever name you give it) :)
December 20th, 2004, 04:06 PM
Hmm... What about serializing the info in the datastore table, and then creating an array to store the month/year and imageid that would look something like this:
'01_04' => imageid,
'02_04' => imageid2,
'03_04' => imageid3
That way you could keep track of past winners as well. Something like that could prevent having to even create a cron script as well... Just some simple code to tell it to update if it can't find an image that corresponds with the current month from that array.
December 20th, 2004, 04:17 PM
Well... I'm not sure exactly what you said... but you said it so it sounds good to me :)
December 20th, 2004, 04:30 PM
Brian: Ah, good idea! That way the same query that grabs the value would also be the updater so the first time the query is ran for the new month it'll grab the new value for the month, update the datastore, and then continue and then everybody else after that will just grab the newest value. The wheels are spinning..... :D
Shon: Essentially he said that we could do what we want (the picking of a 'pic of the month', the storing of it's value, the historizing of it, and the grabbing the current value) all from within the same PHP file instead of having seperate components. Would be a lot cleaner.... should be a 'doable' project. :)
December 20th, 2004, 05:08 PM
k, I think I understand now, and that should work even better :)
December 24th, 2004, 10:13 AM
This turns out to be more problematic than I thought. The sql may be beyond my skill level. Anyone here able to take a crack at it?
We need a slice of the posts table given by date rate, joined with the rate info.
Now it's like we need another query on that result to determine the highest rated. Nested selects are beyond me (but I can learn if someone here is patient).
I also wonder what the results might look like. We have some photos that are favourites. Due to new members, these may show up as pic of the month again and again. Ever been in a burger joint where the employee of the month is twelve photos of the same face? The criteria may need to be tweaked somehow. Exclude past winners? Only query photos posted in the given month?
In playing with it, I also notice we have "Worst photo". High number of votes but very low score.
I can do it in code with loops, but it wouldn't be terribly efficient. But then maybe with all these extra consideration, that kind of sift and sort is required.
Certainly want to see results for variable periods: photo of the day, week, month, year. Might not use them all but might be surprised...
Appreciate more feedback.
December 24th, 2004, 11:51 AM
This turns out to be more problematic than I thought. The sql may be beyond my skill level. Anyone here able to take a crack at it? .... I'll be working on my own version but not for at least two weeks. :( I'm totally tied up with projects at work (that actually pay the bills ;) ). Taking Brian's suggestion into account, though, it shouldn't be that bad for one of the usual SQL guys to come up with something in a rush if it's really needed that quickly.
January 25th, 2005, 06:23 PM
Any monthly updates? :p
April 7th, 2005, 09:50 PM
Is this still being worked on?
April 11th, 2005, 11:29 PM
I need this. Hope someone can figure it out
April 25th, 2005, 06:31 PM
Yea this would be sweet if it can get done! :D
April 26th, 2005, 01:07 PM
Brian has coded specific SQL statements for those that want to get dirty with this:
vBulletin® v3.8.1, Copyright ©2000-2014, Jelsoft Enterprises Ltd.