Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > php image voting script (like amihotornot)

php image voting script (like amihotornot)
Thread Tools
Occasionally Useful
Join Date: Jun 2001
Location: Liverpool, UK
Status: Offline
Reply With Quote
May 10, 2002, 12:43 PM
 
i'm in the middle of doing a new site and i'm in need of another php-enabled brain on the job.

this site has pictures of people on it (no, it's not a pr0n site), which i want to add a voting script to, as mentioned in the topic's title. now, i've found 2 free scripts that do this kind of thing, but they work on a random basis and i don't want that. i want to be able to add the script like on stile's camwhores.com site (yeah, i had to research stuff *cough*).

if anybody can lend their brain to this task, i'd be grateful. if you live in england (derbs, etc), there's beers in it too

thanks in advance
"Have sharp knives. Be creative. Cook to music" ~ maxelson
     
Professional Poster
Join Date: Oct 2000
Location: Toronto, ON
Status: Offline
Reply With Quote
May 10, 2002, 04:14 PM
 
Sounds like you want to read/write a text file that holds an array with the picture number and the vote when the Submit button is clicked. I'm off to the pub momentarily (yeah Friday!) but I can help out on the weekend if you still need it.

In essence, here's what you want, right? :

1) display picture
2) person clicks on rating, hits submit
3) vote value and picture number recorded

Sounds pretty straightforward.
The Lord said 'Peter, I can see your house from here.'
     
Occasionally Useful
Join Date: Jun 2001
Location: Liverpool, UK
Status: Offline
Reply With Quote
May 10, 2002, 11:48 PM
 
shall we sort this after the weekend? i'm wankered now

anyone else is welcome to help though! *glares at derbs*
"Have sharp knives. Be creative. Cook to music" ~ maxelson
     
Professional Poster
Join Date: Oct 2000
Location: Toronto, ON
Status: Offline
Reply With Quote
May 11, 2002, 11:25 PM
 
Me too, old pal in for a weekend.
The Lord said 'Peter, I can see your house from here.'
     
Mac Elite
Join Date: Mar 2001
Status: Offline
Reply With Quote
May 12, 2002, 07:26 PM
 
It should be pretty easy to do. I did something similar - well, a poll question that rotates monthly and with a database. Instead of a poll question, I'm sure I can pop up an image and stuff. It's all the same. I did it with ASP and SQL Server 2000 but it's the same with PHP and MySQL. If you want to do it with a text file, just make sure you account for the fact that more than 1 person on your website can be voting at the exact same time or your textfile WILL get corrupted (i.e. lock the application or block access to the textfile for that nanosecond that the write's happening).

localshell.com if you wanna see the poll questions
     
Occasionally Useful
Join Date: Jun 2001
Location: Liverpool, UK
Status: Offline
Reply With Quote
May 12, 2002, 07:39 PM
 
yeah dude, i already have a poll going on there (which i'm leading, raaar!). i was just wondering if anyone else has done this and can help me out, or if i'm going to have to get down to some serious work and sort it myself. i'd rather the former, than the latter. i just can't afford the headaches right now, i'm too stressed with other stuff
"Have sharp knives. Be creative. Cook to music" ~ maxelson
     
Senior User
Join Date: May 2001
Location: Nottingham, UK
Status: Offline
Reply With Quote
May 13, 2002, 04:23 AM
 
Hey Phil, sorry been struck down with the plague since last Wednesday

I've never actually done this before, i'm just in the process of thinking.......

do you need a 1-10 vote scale?

I think a SQL database with 2 tables would fit the bill. One table would have:

codenumber | filename | personsname | anything else...

and the other table would have

codenumber | votenumber

Obviously there would be just one entry per person in the 1st table, then there would be multiple entries in the second table corresponding to how many votes each person gets, along with the vote of 1-10. A simple inner join on the two tables would link them.

You could then work out average score, number of votes etc...

Is this what you're after? If so, leave it with me, i'm sure it would come in useful for a few of my projects as well.
     
Occasionally Useful
Join Date: Jun 2001
Location: Liverpool, UK
Status: Offline
Reply With Quote
May 13, 2002, 06:46 AM
 
Originally posted by derbs:
<STRONG>Is this what you're after? If so, leave it with me, i'm sure it would come in useful for a few of my projects as well.</STRONG>
you can get shut of that plague, if i'm to be buying you beer!

i can show you the site, but i'm not posting it on here. it's not ready enough for a mass nerd invasion yet. i'll pm you a url or two, okay?
"Have sharp knives. Be creative. Cook to music" ~ maxelson
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 06:00 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2