Search Help Board

PHP Articles
PHP Help
Bulletin Board

PHP Manual (NEW!)
First Time PHP'ers
Help with programming
Sql assignment help
PHP Homework Help

C# Help

?Re: image rating script?
Date:???06-11-03 01:27

You can try www.hotscripts.com
but the best thing would be to build it your self, that way you can get it just like you want it.

If you are using a sql database like mySQL it should not take to long to build some thing like that.

I would create two tables with the following fields:

| Users |
UserId - UserName - Password

remember to allways crypt() the password when storing it in a database.

| Picture |
PictureId - PictureUrl - UploadedBy - Date

| ImageRating |
RatingId - PictureId - Rating

When a user uploads a picture use the php file upload function to store and/or resize the picture (for tumbnails).
Add a row in the table Picture. Set PictureId to be primary key and auto_increment - add the url to the picture in the PictureUrl field - UploadedBy should be the same vale us the UserId in the Users table. And a date function is allways good the have, if you want to delete all pictures older then 1 month or someting.

When someone rates a picture add a row in the ImageRating table. RatingId should be primary key and auto_increment - PictureId shoud be the same as PictureId in the Picture table. The rating is up to you what values you want to store. From 1 - 10 or 1, 0, -1.

Use the sum function in your sql database to sum the value of the rating if a picture - if you want to use a 1-10 scale you may also want to count the fields and divide the sum on the count value!

?Topics Author? Date
?image rating script???new
TomEk 06-10-03 23:21?
?Re: image rating script???new
? 06-11-03 01:27?
Go to Top??|??Go to Topic??|??Flat View??|??Search?
New Topic
?Reply To This Message
?Your Name:
?Your Email:
Email replies to this thread, to the address above.

Provided By