My Ratings Don't Work

Is something wonky on the site? Describe the problem to us, and we'll fix it ASAP.
Forum rules
Bug Reporting Guidelines

Before Posting
Please make sure someone hasn't already reported the problem you're experiencing before creating a new topic. Confirmed issues have been stickied in this forum.

Rules

    1) Use a descriptive title when starting a bug topic. Example: "Comic images not showing up" Do not use vague titles like, "problem" or "uh ohh"

    2) Describe your problem in detail. Explain exactly what is wrong. Post images, screen shots, links, code snippets - whatever is relevant. The better the information you provide, the better the solution you will receive.

    3) Be polite and patient. We fix these issues as fast as we can. Please be patient with us as we work toward a solution.

My Ratings Don't Work

Postby MK_Wizard » November 16th, 2017, 8:39 pm

Hello

At first, it was just a suspicion, but now someone has confirmed that the ratings button on my comic doesn't work. It only refreshes. Is this a bug or a problem with my code? If it is a problem with my code, can you please provide me with one that works instead of just refreshing the page?

Thanks!
User avatar
MK_Wizard
 
Posts: 129
Joined: September 19th, 2017, 3:33 pm
Location: Canada

Re: My Ratings Don't Work

Postby Campion » November 16th, 2017, 10:32 pm

Your page is calling a function that doesn't exist in your CSS.

Put this somewhere on your comic page (preferably up near the top):

Code: Select all
<script language="JavaScript">



var dir = "http://www.smackjeeves.com/templates/default/images/";

var pic_unselected = "star-unselected.gif";

var pic_selected = "star-selected.gif";



// "Buffers" the image to the browser

document.write('<img style="display: none" src="' + dir + pic_unselected + '" />');

document.write('<img style="display: none" src="' + dir + pic_selected + '" />');



<!-- BEGIN switch_user_has_voted -->

var default_rating = {switch_user_has_voted.RATING};

<!-- END switch_user_has_voted -->

<!-- BEGIN switch_user_hasnt_voted -->

var default_rating = 0;

<!-- END switch_user_hasnt_voted -->



function build_vote()

{

   document.write('<b>Rate this Comic:</b> ');

   for (n = 1; n<= 5; n++)

   {

      if (n <= default_rating)

      {

         default_pic = pic_selected;

      } else {

         default_pic = pic_unselected;

      }



      document.write('<a href="#" onClick="vote(' + n + '); return false;" onMouseOver="rateover(' + n + ');" onMouseOut="rateover(default_rating);"><img src="' + dir + default_pic + '" name="star_' + n + '" border=0></a> ');

   }

   document.write('</ul>');

}



function rateover(star_num)

{

   

   for (n = 1; n <= 5; n++)

   {

      if (n <= star_num)

      {

         da_code = 'document.star_' + n + '.src="' + dir + pic_selected + '"';

      } else {

         da_code = 'document.star_' + n + '.src="' + dir + pic_unselected + '"';

      }

     

      eval(da_code);

   }

}



function vote(rating)

{

   var new_window = window.open("/ratecomic.php?cid={COMIC_ID}&rating=" + rating, "sj_ratecomic", "height=300, width=400");

   new_window.focus();

}



</script>

Image
User avatar
Campion
 
Posts: 74
Joined: September 14th, 2011, 4:11 pm

Re: My Ratings Don't Work

Postby MK_Wizard » November 17th, 2017, 9:09 am

Thanks a lot, Campion!
User avatar
MK_Wizard
 
Posts: 129
Joined: September 19th, 2017, 3:33 pm
Location: Canada


Return to Bugs & Glitches

Who is online

Users browsing this forum: No registered users and 1 guest

cron