Search code examples
javascriptasp-classicratingrating-system

ASP rating system wont rate? - why?


I am using this ratingsystem: http://www.chrishardy.co.uk/asp/scripts/accessible-star-ratings/

The problem is that now that everything is set up and ready to use, I can't give any stars.

Check out this page to see what I mean: http://bit.ly/HQgxQq

I hope you can help :)


Solution

  • I got this error:

    POST http://klasse.aabc.dk/rating/rpc.asp?rating=5&url=/ve-aspnet/akemver1/test.asp 404 (Not Found) 
    

    I am assuming you have not uploaded the "rpc.asp" file. You must upload all files in order for everything to work correct. Please check if you have uploaded the "rpc.asp" in the same directory as the rest of the files.

    I found that /rating is wrong... I was able to get:

    http://klasse.aabc.dk/ve-aspnet/akemver1/rating/rpc.asp?rating=4&url=/ve-aspnet/akemver1/test.asp

    to not throw a 404 error. This means your virtual paths are wrong?

    I recommend you do this:

    1. Unpack .zip

    2. Update line 30 of "common.asp"

      ...
      Const NEAREST_HALF = false
      Const RATING_DIR = "ve-aspnet/akemver1/rating" 'This is line 30, you must edit it.
      
      '--- Database connection string ----------------------------------------------
      dim sConnectionString
      '-----------------------------------------------------------------------------
      ...
      
    3. Edit rating.css and make it look like this:

      .starlight {
          color: #e00;
      }
      #star-rating ul {
          list-style: none;
          margin: 3px;
          padding: 0px;
          width: 150px;
          height: 30px;
          position: relative;
          background: url(/ve-aspnet/akemver1/rating/rating.gif) top left repeat-x;
      }
      #star-rating li {
          padding: 0px;
          margin: 0px;
          /*\*/
          float: left;
          /* */
      }
      #star-rating li.current-rating {
          background: url(/ve-aspnet/akemver1/rating/rating.gif) left bottom;
          position: absolute;
          height: 30px;
          display: block;
          text-indent: -9000px;
          z-index: 1;
      }
      #star-rating li a {
          display: block;
          width: 30px;
          height: 30px;
          text-decoration: none;
          text-indent: -9000px;
          z-index: 20;
          position: absolute;
          padding: 0px;
          background-image: none;
      }
      #star-rating li a:hover {
          background: url(ve-aspnet/akemver1/rating/rating.gif) left center;
          z-index: 1;
          left: 0px;
      }
      #star-rating a.star-1 {
          left: 0px;
      }
      #star-rating a.star-1:hover {
          width: 30px;
      }
      #star-rating a.star-2 {
          left: 30px;
      }
      #star-rating a.star-2:hover {
          width: 60px;
      }
      #star-rating a.star-3 {
          left: 60px;
      }
      #star-rating a.star-3:hover {
          width: 90px;
      }
      #star-rating a.star-4 {
          left: 90px;
      }
      #star-rating a.star-4:hover {
          width: 120px;
      }
      #star-rating a.star-5 {
          left: 120px;
      }
      #star-rating a.star-5:hover {
          width: 150px;
      }
      
    4. Upload the entire .zip (edited, of course!) to /ve-aspnet/akemver1/rating

    5. Make your test.asp contain this code:

      <html>
      <head>
      <script type="text/javascript" src="/ve-aspnet/akemver1/rating/rating.js"></script>
      <link type="text/css" rel="stylesheet" href="/ve-aspnet/akemver1/rating/rating.css" />
      </head>
      <body>
      <h3>This is a test...</h3>
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam imperdiet varius magna, non molestie libero porttitor a. Fusce vel lorem at nisl egestas placerat eget non mauris. Fusce consequat tortor id nunc blandit id pretium libero egestas. Mauris egestas, nulla sed consequat congue, enim nibh ullamcorper nisl, id aliquam lectus urna ac nibh. Nunc in dolor justo, eu lacinia dolor. Donec velit augue, facilisis at interdum vel, sagittis id urna. Maecenas blandit mollis augue, sit amet ultrices mauris aliquam vitae. Nullam eu magna urna. Sed bibendum nunc ut nunc molestie ullamcorper. Vivamus ut erat ultrices elit tincidunt viverra id sed ligula. In in lorem arcu. Pellentesque varius mi egestas est vehicula vitae posuere arcu pharetra. Phasellus sodales ullamcorper bibendum. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum consequat justo eu arcu pharetra porttitor. Etiam condimentum lacus a dui blandit cursus eu in lorem.</p>
      <!--#include virtual="/ve-aspnet/akemver1/rating/rating.asp"-->
      </body>
      </html>
      
    6. Upload test.asp to "/ve-aspnet/akemver1"

    7. It should work :D

    Edit: On second thought, you could just put the entire content of the .zip in "/rating"