Re: Integrating a new system of rating by stars for WFDownloads (ajaxstarrater_v122)

Posted by McDonald on 1231101574
In imLinks the rating system is incompatible with the rating system of WF-Links.
Adding this to WF-Downloads the way I've done with imLinks would mean a new rating system and losing the old original votes. Maybe we can add an option to WF-Downloads preferences what rating system should be used: the current rating system (default) or the AJAX rating system.

The AJAX rating in imLinks consist of the following files:
_drawrating.php
db.php
rpc.php
js/behavior.js
js/rating.php
images/icon/starrating.gif

This part in style.css
/* styles for the unit rater --------------------------------------------------------- ryan masuga, masugadesign.com ryan@masugadesign.com Licensed under a Creative Commons Attribution 3.0 License. http://creativecommons.org/licenses/by/3.0/ See readme.txt for full credit details. --------------------------------------------------------- */ #container { width: 50%; border: 1px solid #CCC; padding: 20px; } .ratingblock { } .loading { height: 30px; background: url(images/icon/working.gif) 50% 50% no-repeat; } .unit-rating { /* the UL */ list-style:none; margin: 0px; padding:0px; height: 30px; position: relative; background: url(images/icon/starrating.gif) top left repeat-x; } .unit-rating div { text-indent: -90000px; padding:0px; margin:0px; float: left; } .unit-rating div a { outline: none; display:block; width:30px; height: 30px; text-decoration: none; text-indent: -9000px; z-index: 20; position: absolute; padding: 0px; } .unit-rating div a:hover{ background: url(images/icon/starrating.gif) left center; z-index: 2; left: 0px; } .unit-rating a.r1-unit{left: 0px;} .unit-rating a.r1-unit:hover{width:30px;} .unit-rating a.r2-unit{left:30px;} .unit-rating a.r2-unit:hover{width: 60px;} .unit-rating a.r3-unit{left: 60px;} .unit-rating a.r3-unit:hover{width: 90px;} .unit-rating a.r4-unit{left: 90px;} .unit-rating a.r4-unit:hover{width: 120px;} .unit-rating a.r5-unit{left: 120px;} .unit-rating a.r5-unit:hover{width: 150px;} .unit-rating a.r6-unit{left: 150px;} .unit-rating a.r6-unit:hover{width: 180px;} .unit-rating a.r7-unit{left: 180px;} .unit-rating a.r7-unit:hover{width: 210px;} .unit-rating a.r8-unit{left: 210px;} .unit-rating a.r8-unit:hover{width: 240px;} .unit-rating a.r9-unit{left: 240px;} .unit-rating a.r9-unit:hover{width: 270px;} .unit-rating a.r10-unit{left: 270px;} .unit-rating a.r10-unit:hover{width: 300px;} .unit-rating div.current-rating { background: url(images/icon/starrating.gif) left bottom; position: absolute; height: 30px; display: block; text-indent: -9000px; z-index: 1; } .voted {} .thanks {color:#36AA3D;} .static {}


And this part in include/linkload.php:
include_once ICMS_ROOT_PATH . '/modules/' . $mydirname . '/_drawrating.php'; $link['ratingbar'] = rating_bar( $link_arr['lid'], '5', $cid );


The rating is stored in a new table:
CREATE TABLE imlinks_ratings ( id int(11) NOT NULL, total_votes int(11) NOT NULL default '0', total_value int(11) NOT NULL default '0', used_ips longtext, PRIMARY KEY (id) ) TYPE=MyISAM;

This Post was from: https://www.impresscms.org/iforum/viewtopic.php?topic_id=2985&post_id=27776