making a top 100 with 5 star rating?

  • oskillzzo
  • Beginner
  • Beginner
  • oskillzzo
  • Posts: 50

Post 3+ Months Ago

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

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>&nbsp;$count&nbsp; <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>&nbsp;&nbsp;
 
 
 
  1.  
  2. <script language=javascript>
  3.     var name = new Array();
  4.     name[0]= "<?php echo($hm2);?>/images/star2.gif";
  5.     if(document.images)
  6.     {
  7.         var ss = new Image();
  8.         ss.src = name[0];      
  9.     }          
  10. </script>
  11. <?php
  12.  
  13.   $start = $_GET['begin'];
  14.   if($start == "")
  15.     $start = 0;
  16.   $url = $_SERVER['SCRIPT_NAME'];
  17.   $host = $_SERVER['SERVER_NAME'];
  18.   $ser = "http://$host";   
  19.   //echo "---------$ser<br>";
  20.   $url1 = $_SERVER['argv'];
  21.   //echo "--------$url1[0]";
  22.   $sss = count($url1);
  23.   $rip = $_SERVER['REMOTE_ADDR'];
  24.   $serpath = $ser.$url;
  25.  
  26. if($sss >= 1)
  27.   {
  28.      $argas = $url1[0];
  29.      $url="$url?$argas";
  30.   }
  31.   $url= $ser.$url;
  32.  
  33. /*  if(strpos($url,"?begin=")){
  34.     $url = substr($url,0,strpos($url,"?begin="));
  35.   }else if(strpos($url,"&begin=")){
  36.     $url = substr($url,0,strpos($url,"&begin="));
  37.   }*/
  38.  
  39.  
  40.   include "$hm/auth/config.php";
  41.  
  42.   $link = mysql_connect($hostname, $username,$password);
  43.   if($link)
  44.   {
  45.     $dbcon = mysql_select_db($dbname,$link);
  46.   }
  47.  
  48. //averaging rating
  49.  
  50.   $qur1 = "select count(*) as dd, avg(rateval) as xx from hsrs where url='$url' group by url";
  51.   $result1 = mysql_query($qur1,$link);
  52.   if($line = @mysql_fetch_array($result1, MYSQL_ASSOC))
  53.   {
  54.     $count = $line['dd'];
  55.     $rateval = $line['xx'];
  56.   }
  57.  
  58. ?>
  59.  
  60.  
  61.  
  62.  
  63.  
  64.         <form name=rate method=post action="<?php echo($hm2); ?>/addrating.php">
  65.              <b></b>
  66.              <?php for($i=1;$i<=5;$i++)
  67.                      {
  68.                     if($rateval>=1)
  69.                     {
  70.                    echo "<img src=\"$hm2/images/star2.gif\">";
  71.                            $rateval=$rateval-1;
  72.                     }
  73.                     else if($rateval>=0.5)
  74.                     {
  75.                    echo "<img src=\"$hm2/images/star3.gif\">";
  76.                    $rateval=$rateval-1;
  77.                     }
  78.                     else if ($rateval<0.5 && $rateval>0)
  79.                     {
  80.                    echo "<img src=\"$hm2/images/star1.gif\">";
  81.                    $rateval=$rateval-1;
  82.                     }
  83.                     else if($rateval<=0)
  84.                     {
  85.                    echo "<img src=\"$hm2/images/star1.gif\">";
  86.                     }
  87.                     }   
  88.            ?>
  89.    <b></b> <?php
  90.      echo "<b>&nbsp;$count&nbsp; <span style='font-size: 12px;'>votes</span></b>";
  91.     ?>
  92.  
  93. <BR>
  94.  
  95.  
  96.      <style>
  97.        .star{cursor:pointer; }
  98.  
  99.      </style>
  100.  
  101.  
  102.      <Script language=javascript>
  103.       function selstar(val)
  104.       {
  105.     for(var x=1;x<=val;x++)
  106.     {
  107.         document['i'+x].src="<?php echo "$hm2";?>/images/star2.gif";
  108.     }
  109.    
  110.       }
  111.       function remstar(val)
  112.       {
  113.     for(var x=1;x<=val;x++)
  114.     {
  115.         document['i'+x].src="<?php echo "$hm2";?>/images/star1.gif";
  116.     }
  117.       }
  118.  
  119.       function setrate(val)
  120.       {
  121.     document.rate.rating.value=val;
  122.     document.rate.submit();
  123.       }
  124.      </script>
  125.  
  126.  
  127.  
  128.  
  129.  
  130.             <b>Rate This Anime</b>
  131.             <img name=i1 class=star onmouseover="selstar(1)" onmouseout="remstar(1)" onclick="setrate(1)" src="<?php echo "$hm2";?>/images/star1.gif">
  132.             <img name=i2 class=star onmouseover="selstar(2)" onmouseout="remstar(2)" onclick="setrate(2)" src="<?php echo "$hm2";?>/images/star1.gif">
  133.             <img name=i3 class=star onmouseover="selstar(3)" onmouseout="remstar(3)" onclick="setrate(3)" src="<?php echo "$hm2";?>/images/star1.gif">
  134.             <img name=i4 class=star onmouseover="selstar(4)" onmouseout="remstar(4)" onclick="setrate(4)" src="<?php echo "$hm2";?>/images/star1.gif">
  135.             <img name=i5 class=star onmouseover="selstar(5)" onmouseout="remstar(5)" onclick="setrate(5)" src="<?php echo "$hm2";?>/images/star1.gif">
  136.             <input type=hidden name="rating">
  137.             <input type=hidden value=<?php echo "$url"; ?> name=url>
  138.             <input type=hidden value=<?php echo "$rip"; ?> name=ip>
  139.         </form>&nbsp;&nbsp;
  140.  
  141.  
  142.  
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

Post Information

  • Total Posts in this topic: 1 post
  • Users browsing this forum: No registered users and 87 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
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.