I've been working on a new layout for my site, and thought the star rating was worth implementing. Doesn't need much code, but it still needs some polish. I've added a couple of columns to the pictures table to capture total votes and current rating - this way you can access the current rating when a picture is loaded.
When voting, the page then calls an ajax function to write the new values then display the new rating.
This is not my work I only adopt script for plogger. Install and screenshot included.
Each person can rate once (based on the ip number). You can choose how many stars you want. And ajax makes it possible to vote without reloading the page.
You can get it here: http://rapidshare.com/files/103123991/ajax_vote_system_1.2.rar
slashMS - it does work...quite well in fact, but i've got a problem in some versions of i.e. with the stars not displaying correctly. Its set to display 10, and yet it will display 14 i think, and when you rate a pic, it puts the solid stars in the middle or on the right....
firefox, as always behaves itself and works well though.
thebluebus - yes, you are right about IE. Change the line: <div align="center"><p><?php rating_bar(plogger_get_picture_id()); ?></p></div> to: <div style="padding-left:300px;" align="left"><p><?php rating_bar(plogger_get_picture_id()); ?></p></div> You need change style="padding-left:300px;" depending how many stars you want.
Now is OK. Tested in (Windows): IE 5.01 IE 5.5 IE 6.0 IE 7.0 Firefox/1.5.0.12 Flock/1.1.1 Netscape/8.1.3 Opera/8.5
slashMS - have you managed to make say a top 10 list of most rated pics? i think its the obvious transition from this mod, but wouldnt know where to begin.
i keep on getting a syntax error in the www.yoursite.com/plogger/themes/your_theme/picture.php entering the <div align="center"><p><?php rating_bar(plogger_get_picture_id()); ?></p></div> i recieve Parse error: syntax error, unexpected '<'