making a top 100 with 5 star rating?
- oskillzzo
- Beginner


- Joined: Jul 04, 2008
- Posts: 50
- Status: Offline
im using HIOX Star Rating System Script and was wondering if i can make a page and create a script for the top 100 ratings. How would one go about setting something like this up?
This is what i have right now for the actual 5 star rating
<script language=javascript>
var name = new Array();
name[0]= "<?php echo($hm2);?>/images/star2.gif";
if(document.images)
{
var ss = new Image();
ss.src = name[0];
}
</script>
<?php
$start = $_GET['begin'];
if($start == "")
$start = 0;
$url = $_SERVER['SCRIPT_NAME'];
$host = $_SERVER['SERVER_NAME'];
$ser = "http://$host";
//echo "---------$ser<br>";
$url1 = $_SERVER['argv'];
//echo "--------$url1[0]";
$sss = count($url1);
$rip = $_SERVER['REMOTE_ADDR'];
$serpath = $ser.$url;
if($sss >= 1)
{
$argas = $url1[0];
$url="$url?$argas";
}
$url= $ser.$url;
/* if(strpos($url,"?begin=")){
$url = substr($url,0,strpos($url,"?begin="));
}else if(strpos($url,"&begin=")){
$url = substr($url,0,strpos($url,"&begin="));
}*/
include "$hm/auth/config.php";
$link = mysql_connect($hostname, $username,$password);
if($link)
{
$dbcon = mysql_select_db($dbname,$link);
}
//averaging rating
$qur1 = "select count(*) as dd, avg(rateval) as xx from hsrs where url='$url' group by url";
$result1 = mysql_query($qur1,$link);
if($line = @mysql_fetch_array($result1, MYSQL_ASSOC))
{
$count = $line['dd'];
$rateval = $line['xx'];
}
?>
<form name=rate method=post action="<?php echo($hm2); ?>/addrating.php">
<b></b>
<?php for($i=1;$i<=5;$i++)
{
if($rateval>=1)
{
echo "<img src=\"$hm2/images/star2.gif\">";
$rateval=$rateval-1;
}
else if($rateval>=0.5)
{
echo "<img src=\"$hm2/images/star3.gif\">";
$rateval=$rateval-1;
}
else if ($rateval<0.5 && $rateval>0)
{
echo "<img src=\"$hm2/images/star1.gif\">";
$rateval=$rateval-1;
}
else if($rateval<=0)
{
echo "<img src=\"$hm2/images/star1.gif\">";
}
}
?>
<b></b> <?php
echo "<b> $count <span style='font-size: 12px;'>votes</span></b>";
?>
<BR>
<style>
.star{cursor:pointer; }
</style>
<Script language=javascript>
function selstar(val)
{
for(var x=1;x<=val;x++)
{
document['i'+x].src="<?php echo "$hm2";?>/images/star2.gif";
}
}
function remstar(val)
{
for(var x=1;x<=val;x++)
{
document['i'+x].src="<?php echo "$hm2";?>/images/star1.gif";
}
}
function setrate(val)
{
document.rate.rating.value=val;
document.rate.submit();
}
</script>
<b>Rate This Anime</b>
<img name=i1 class=star onmouseover="selstar(1)" onmouseout="remstar(1)" onclick="setrate(1)" src="<?php echo "$hm2";?>/images/star1.gif">
<img name=i2 class=star onmouseover="selstar(2)" onmouseout="remstar(2)" onclick="setrate(2)" src="<?php echo "$hm2";?>/images/star1.gif">
<img name=i3 class=star onmouseover="selstar(3)" onmouseout="remstar(3)" onclick="setrate(3)" src="<?php echo "$hm2";?>/images/star1.gif">
<img name=i4 class=star onmouseover="selstar(4)" onmouseout="remstar(4)" onclick="setrate(4)" src="<?php echo "$hm2";?>/images/star1.gif">
<img name=i5 class=star onmouseover="selstar(5)" onmouseout="remstar(5)" onclick="setrate(5)" src="<?php echo "$hm2";?>/images/star1.gif">
<input type=hidden name="rating">
<input type=hidden value=<?php echo "$url"; ?> name=url>
<input type=hidden value=<?php echo "$rip"; ?> name=ip>
</form>
This is what i have right now for the actual 5 star rating
Code: [ Select ]
<script language=javascript>
var name = new Array();
name[0]= "<?php echo($hm2);?>/images/star2.gif";
if(document.images)
{
var ss = new Image();
ss.src = name[0];
}
</script>
<?php
$start = $_GET['begin'];
if($start == "")
$start = 0;
$url = $_SERVER['SCRIPT_NAME'];
$host = $_SERVER['SERVER_NAME'];
$ser = "http://$host";
//echo "---------$ser<br>";
$url1 = $_SERVER['argv'];
//echo "--------$url1[0]";
$sss = count($url1);
$rip = $_SERVER['REMOTE_ADDR'];
$serpath = $ser.$url;
if($sss >= 1)
{
$argas = $url1[0];
$url="$url?$argas";
}
$url= $ser.$url;
/* if(strpos($url,"?begin=")){
$url = substr($url,0,strpos($url,"?begin="));
}else if(strpos($url,"&begin=")){
$url = substr($url,0,strpos($url,"&begin="));
}*/
include "$hm/auth/config.php";
$link = mysql_connect($hostname, $username,$password);
if($link)
{
$dbcon = mysql_select_db($dbname,$link);
}
//averaging rating
$qur1 = "select count(*) as dd, avg(rateval) as xx from hsrs where url='$url' group by url";
$result1 = mysql_query($qur1,$link);
if($line = @mysql_fetch_array($result1, MYSQL_ASSOC))
{
$count = $line['dd'];
$rateval = $line['xx'];
}
?>
<form name=rate method=post action="<?php echo($hm2); ?>/addrating.php">
<b></b>
<?php for($i=1;$i<=5;$i++)
{
if($rateval>=1)
{
echo "<img src=\"$hm2/images/star2.gif\">";
$rateval=$rateval-1;
}
else if($rateval>=0.5)
{
echo "<img src=\"$hm2/images/star3.gif\">";
$rateval=$rateval-1;
}
else if ($rateval<0.5 && $rateval>0)
{
echo "<img src=\"$hm2/images/star1.gif\">";
$rateval=$rateval-1;
}
else if($rateval<=0)
{
echo "<img src=\"$hm2/images/star1.gif\">";
}
}
?>
<b></b> <?php
echo "<b> $count <span style='font-size: 12px;'>votes</span></b>";
?>
<BR>
<style>
.star{cursor:pointer; }
</style>
<Script language=javascript>
function selstar(val)
{
for(var x=1;x<=val;x++)
{
document['i'+x].src="<?php echo "$hm2";?>/images/star2.gif";
}
}
function remstar(val)
{
for(var x=1;x<=val;x++)
{
document['i'+x].src="<?php echo "$hm2";?>/images/star1.gif";
}
}
function setrate(val)
{
document.rate.rating.value=val;
document.rate.submit();
}
</script>
<b>Rate This Anime</b>
<img name=i1 class=star onmouseover="selstar(1)" onmouseout="remstar(1)" onclick="setrate(1)" src="<?php echo "$hm2";?>/images/star1.gif">
<img name=i2 class=star onmouseover="selstar(2)" onmouseout="remstar(2)" onclick="setrate(2)" src="<?php echo "$hm2";?>/images/star1.gif">
<img name=i3 class=star onmouseover="selstar(3)" onmouseout="remstar(3)" onclick="setrate(3)" src="<?php echo "$hm2";?>/images/star1.gif">
<img name=i4 class=star onmouseover="selstar(4)" onmouseout="remstar(4)" onclick="setrate(4)" src="<?php echo "$hm2";?>/images/star1.gif">
<img name=i5 class=star onmouseover="selstar(5)" onmouseout="remstar(5)" onclick="setrate(5)" src="<?php echo "$hm2";?>/images/star1.gif">
<input type=hidden name="rating">
<input type=hidden value=<?php echo "$url"; ?> name=url>
<input type=hidden value=<?php echo "$rip"; ?> name=ip>
</form>
- <script language=javascript>
- var name = new Array();
- name[0]= "<?php echo($hm2);?>/images/star2.gif";
- if(document.images)
- {
- var ss = new Image();
- ss.src = name[0];
- }
- </script>
- <?php
- $start = $_GET['begin'];
- if($start == "")
- $start = 0;
- $url = $_SERVER['SCRIPT_NAME'];
- $host = $_SERVER['SERVER_NAME'];
- $ser = "http://$host";
- //echo "---------$ser<br>";
- $url1 = $_SERVER['argv'];
- //echo "--------$url1[0]";
- $sss = count($url1);
- $rip = $_SERVER['REMOTE_ADDR'];
- $serpath = $ser.$url;
- if($sss >= 1)
- {
- $argas = $url1[0];
- $url="$url?$argas";
- }
- $url= $ser.$url;
- /* if(strpos($url,"?begin=")){
- $url = substr($url,0,strpos($url,"?begin="));
- }else if(strpos($url,"&begin=")){
- $url = substr($url,0,strpos($url,"&begin="));
- }*/
- include "$hm/auth/config.php";
- $link = mysql_connect($hostname, $username,$password);
- if($link)
- {
- $dbcon = mysql_select_db($dbname,$link);
- }
- //averaging rating
- $qur1 = "select count(*) as dd, avg(rateval) as xx from hsrs where url='$url' group by url";
- $result1 = mysql_query($qur1,$link);
- if($line = @mysql_fetch_array($result1, MYSQL_ASSOC))
- {
- $count = $line['dd'];
- $rateval = $line['xx'];
- }
- ?>
- <form name=rate method=post action="<?php echo($hm2); ?>/addrating.php">
- <b></b>
- <?php for($i=1;$i<=5;$i++)
- {
- if($rateval>=1)
- {
- echo "<img src=\"$hm2/images/star2.gif\">";
- $rateval=$rateval-1;
- }
- else if($rateval>=0.5)
- {
- echo "<img src=\"$hm2/images/star3.gif\">";
- $rateval=$rateval-1;
- }
- else if ($rateval<0.5 && $rateval>0)
- {
- echo "<img src=\"$hm2/images/star1.gif\">";
- $rateval=$rateval-1;
- }
- else if($rateval<=0)
- {
- echo "<img src=\"$hm2/images/star1.gif\">";
- }
- }
- ?>
- <b></b> <?php
- echo "<b> $count <span style='font-size: 12px;'>votes</span></b>";
- ?>
- <BR>
- <style>
- .star{cursor:pointer; }
- </style>
- <Script language=javascript>
- function selstar(val)
- {
- for(var x=1;x<=val;x++)
- {
- document['i'+x].src="<?php echo "$hm2";?>/images/star2.gif";
- }
- }
- function remstar(val)
- {
- for(var x=1;x<=val;x++)
- {
- document['i'+x].src="<?php echo "$hm2";?>/images/star1.gif";
- }
- }
- function setrate(val)
- {
- document.rate.rating.value=val;
- document.rate.submit();
- }
- </script>
- <b>Rate This Anime</b>
- <img name=i1 class=star onmouseover="selstar(1)" onmouseout="remstar(1)" onclick="setrate(1)" src="<?php echo "$hm2";?>/images/star1.gif">
- <img name=i2 class=star onmouseover="selstar(2)" onmouseout="remstar(2)" onclick="setrate(2)" src="<?php echo "$hm2";?>/images/star1.gif">
- <img name=i3 class=star onmouseover="selstar(3)" onmouseout="remstar(3)" onclick="setrate(3)" src="<?php echo "$hm2";?>/images/star1.gif">
- <img name=i4 class=star onmouseover="selstar(4)" onmouseout="remstar(4)" onclick="setrate(4)" src="<?php echo "$hm2";?>/images/star1.gif">
- <img name=i5 class=star onmouseover="selstar(5)" onmouseout="remstar(5)" onclick="setrate(5)" src="<?php echo "$hm2";?>/images/star1.gif">
- <input type=hidden name="rating">
- <input type=hidden value=<?php echo "$url"; ?> name=url>
- <input type=hidden value=<?php echo "$rip"; ?> name=ip>
- </form>
- Anonymous
- Bot


- Joined: 25 Feb 2008
- Posts: ?
- Loc: Ozzuland
- Status: Online
January 8th, 2009, 10:09 pm
Page 1 of 1
To Reply to this topic you need to LOGIN or REGISTER. It is free.
Post Information
- Total Posts in this topic: 1 post
- Users browsing this forum: No registered users and 115 guests
- You cannot post new topics in this forum
- You cannot reply to topics in this forum
- You cannot edit your posts in this forum
- You cannot delete your posts in this forum
- You cannot post attachments in this forum
