<!--
/*************************************************************
* This script is developed by Arturs Sosins aka ar2rsawseen, http://webcodingeasy.com
* Fee free to distribute and modify code, but keep reference to its creator
*
* Star rating class can be used to display rating using empty and full star graphics
* (user defined or default package graphic) and allow visistors to rate items
* from 1 to user defined value, by displaying full/empty stars on mouse movement
* and passing value through get or post
*
* For more information, examples and online documentation visit:
* http://webcodingeasy.com/JS-classes/Star-rating-class
**************************************************************/
--><?php
print_r($_POST);
?>
<html>
<head>
</head>
<body>
<!--- Display rating --->
<p>Display rating: </p>
<div id='rating'></div>
<!--- Rate item --->
<p>Rate item: </p>
<div id='rate_star'></div>
<script type="text/javascript"
src="./star_rating.packed.js" ></script>
<script type="text/javascript">
//create rating instance
//parameter json with configuration values
var rate = new star_rating(
{
/*********************
* Example of configuration
* options and default values
*********************/
//maximal rating(value greater than 0)
max: 5,
//graphic for empty star
graphic_empty : "./empty.png",
//graphic for full star
graphic_full : "./full.png",
//how to send data (possible values: post, get)
send_type : "post"
}
);
//creating ratable element
//parameter id of an element
rate.rate_item("rate_star");
//display rating
//parameter id of an element
rate.display_rating(2.5, "rating");
</script>
</body>
</html> |