Getting graphic stars on Blue Jimmy Template.

Working on a new template and need help? Come here for support.

Moderator: Help Desk Team

Getting graphic stars on Blue Jimmy Template.

Postby thrashmodule » March 28th, 2012, 12:59 pm

Ok, I suck at scripting so if someone can get the normal stars to show up where the [*]'s are and post the workaround I would be ever so grateful. I have tried just pasting the default code over the Blue Jimmy functions but it comes out funky with black dots and major vertical spacing.
Image
User avatar
thrashmodule
 
Posts: 4
Joined: March 16th, 2012, 9:20 am

Re: Getting graphic stars on Blue Jimmy Template.

Postby trenton_dawn » March 28th, 2012, 1:40 pm

In the Comic Page portion of the template, find the following code:

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

function build_vote()
{
   for (n = 1; n<= 5; n++)
   {
        document.write('<a href="#" id="star-'+ n +'" onClick="vote(' + n + '); return false;" onMouseOver="rateover(' + n + ');" onMouseOut="rateover(0);">[*]</a>');
   }
};

function rateover(star_num)
{
   for (n = 1; n <= 5; n++)
   {
   if (n <= star_num)
      {
                var executa = "document.getElementById('star-"+ n +"').innerHTML = '["+n+"]'"}
                else {
           var executa = "document.getElementById('star-"+ n +"').innerHTML = '[*]'"}
   eval(executa)}
}

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>


You'll want to change it like so:
Code: Select all
<script language="JavaScript">

function build_vote()
{
   for (n = 1; n<= 5; n++)
   {
        document.write('<a href="#" id="star-'+ n +'" onClick="vote(' + n + '); return false;" onMouseOver="rateover(' + n + ');" onMouseOut="rateover(0);"><img src="http://www.smackjeeves.com/templates/default/images/star-unselected.gif"></a>');
   }
};

function rateover(star_num)
{
   for (n = 1; n <= 5; n++)
   {
   if (n <= star_num)
      {
                var executa = "document.getElementById('star-"+ n +"').innerHTML = '<img src=\"http://www.smackjeeves.com/templates/default/images/star-selected.gif\">'"}
                else {
           var executa = "document.getElementById('star-"+ n +"').innerHTML = '<img src=\"http://www.smackjeeves.com/templates/default/images/star-unselected.gif\">'"}
   eval(executa)}
}

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
Ghost, an online novel — Sketchbook thread — deviantArt
Need assistance with anything? Feel free to PM me.
Seven Rain wrote:Trenton speaks words of wisdom.
Cave wrote:GOD, trenton.... why u so awesome? :(
User avatar
trenton_dawn
 
Posts: 2601
Joined: December 14th, 2006, 7:59 pm
Location: Auberdine, Darkshore (Alliance Territory)

Re: Getting graphic stars on Blue Jimmy Template.

Postby thrashmodule » March 28th, 2012, 1:43 pm

Thank you kindly for the fast response and the awesome code! Works like a champ!
Image
User avatar
thrashmodule
 
Posts: 4
Joined: March 16th, 2012, 9:20 am


Return to Template Development & Support

Who is online

Users browsing this forum: No registered users and 0 guests