Freelancers Network
 
skill list top cap
Homepage
Join the Freelancer's Network
Update your details
Find a freelancer
Post a project
Find a project
Projects Archive
Post a job
Find a job
Jobs Archive
See Dan's Pages
See Andy's Pages
Link to this site
Resources
Join/Leave Forum
Forum Messages
+Additions+ Adverts
Advertising
Contact Us
Subscribe to our newsletter - enter your email address and hit return
Freelancers.net is owned and operated by Andy Stowell and Dan Winchester
skill list end cap
guru web hostcom

Find me again on Freelancers.net

Re: FN-FORUM: Image upload and rating site

date posted 27th April 2008 10:23

Paul Young wrote:
> Hello everyone,
>
> Just wondered if you could help me out.
>
> I've just been asked if I could have a look at doing a site that people
> would upload their images to and then other users would rate them.
>
> It's not a boy/girl, hot or not type of site as it's peoples own artwork
> that they'll be uploading.
>
> Does anyone know of a pre-built script that I could use as a basis to start
> on.
>
> Any suggestions would be really gratefully received.
>
> Paul Young.
>
>
>
>
Actually, this kind of thing is pretty easy - you might want to just
write your own, rather than using anything else.

The bits you really need are (obviously) the image upload and rating
parts. Will it be only signed-in users that can rate? Or is it
"World+Dog" ?

Upload is easy - you're taking the file, adding it to a file structure
(there's endless tutorials about that on t'internet already if you
haven't done it before) and adding data to a database table about the
image. (For example, image_id, image_name, image_description,
image_uploaded_by )

For the ratings, you have a rating out of 10. When the rating is
selected, it's added to a database table, along with the image_id, the
user_id of the person rating the image (assuming it's only registered
users doing the rating, otherwise you'll be wanting to store something
like the IP address) and the date/time of the rating. (That way, if
someone re-rates the image, the re-rating either overwrites the previous
one, or is ignored, depending on your client's preference - in the case
of unregistered users, you're probably going to want to block/update a
re-rate from the same IP address within twenty or thirty minutes, I
would estimate)

When the image displays, you need to query the rating table for all
ratings with the id of image_id, then average them out to get the rating
to display. That's one query, and maybe some server-side maths (I can't
offhand remember if MySQL will do the average score easily in the query)

Ta-da, pretty much all you need. I know I could knock that up in about
24 hours max - including testing.

Hope that helps.

Alex
http://www.ozbon.com



Messages by Day
April 30th 2008
April 29th 2008
April 28th 2008
April 27th 2008
April 26th 2008
April 25th 2008
April 24th 2008
April 23rd 2008
April 22nd 2008
April 21st 2008
April 20th 2008
April 19th 2008
April 18th 2008
April 17th 2008
April 16th 2008
April 15th 2008
April 14th 2008
April 13th 2008
April 12th 2008
April 11th 2008
April 10th 2008
April 9th 2008
April 8th 2008
April 7th 2008
April 6th 2008
April 5th 2008
April 4th 2008
April 3rd 2008
April 2nd 2008
April 1st 2008


Messages by Month
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008


Messages by Year
2008
2007
2006
2005
2004
2003
2002
2001
2000