WordPress.org

Support

Support » Plugins and Hacks » [Thumbs Mod] Shows The Thumbs Ratings With Different Colors

[Thumbs Mod] Shows The Thumbs Ratings With Different Colors

  • In render.php(line 810) replace the $rating_text line with:

    //            $rating_text = '<div id="gdsr_thumb_text_'.$comment_id.'_c" class="gdt-size-'.$unit_width.($already_voted ? " voted" : "").($allow_vote ? "" : " inactive").' gdthumbtext">'.$rating_text.'</div>';
    if ($score > 0) {
              $rating_text = '<div id="gdsr_thumb_text_'.$comment_id.'_c" class="text-center verde gdt-size-'.$unit_width.($already_voted ? " voted" : "").($allow_vote ? "" : " inactive").' gdthumbtext">'.$rating_text.'</div>';
     } elseif ($score < 0) {
              $rating_text = '<div id="gdsr_thumb_text_'.$comment_id.'_c" class="text-center rojo gdt-size-'.$unit_width.($already_voted ? " voted" : "").($allow_vote ? "" : " inactive").' gdthumbtext">'.$rating_text.'</div>';
    } else {
              $rating_text = '<div id="gdsr_thumb_text_'.$comment_id.'_c" class="text-center gdt-size-'.$unit_width.($already_voted ? " voted" : "").($allow_vote ? "" : " inactive").' gdthumbtext"></div>';
    }

    http://wordpress.org/plugins/gd-star-rating/

Viewing 6 replies - 1 through 6 (of 6 total)
  • add to the css:

    .gdthumbtext strong {
    font-size: 33px;
    margin-left: 20px;
    }
    
    .verde{
    color: #336600;
    }
    
    .rojo{
    color: #cc3300;
    }

    Or a better way in render.php, same line:

    //            $rating_text = '<div id="gdsr_thumb_text_'.$comment_id.'_c" class="gdt-size-'.$unit_width.($already_voted ? " voted" : "").($allow_vote ? "" : " inactive").' gdthumbtext">'.$rating_text.'</div>';
    // if ($score > 0) {
    if ($votes_plus > $votes_minus) {
              $rating_text = '<div id="gdsr_thumb_text_'.$comment_id.'_c" class="text-center verde gdt-size-'.$unit_width.($already_voted ? " voted" : "").($allow_vote ? "" : " inactive").' gdthumbtext">'.$rating_text.'</div>';
    // } elseif ($score < 0) {
    } elseif ($votes_plus < $votes_minus) {
              $rating_text = '<div id="gdsr_thumb_text_'.$comment_id.'_c" class="text-center rojo gdt-size-'.$unit_width.($already_voted ? " voted" : "").($allow_vote ? "" : " inactive").' gdthumbtext">'.$rating_text.'</div>';
    } else {
              $rating_text = '<div id="gdsr_thumb_text_'.$comment_id.'_c" class="text-center gdt-size-'.$unit_width.($already_voted ? " voted" : "").($allow_vote ? "" : " inactive").' gdthumbtext"></div>';
    }

    Geoffrey Hale
    Member

    @geoffreyhale

    How could this be done from functions.php?

    from functions.php?
    If you update the plugin, the code will be overwrite, but you only need to modify 1 line in:
    wp-content\plugins\gd-star-rating\code\t2\render.php
    line810

    I have an easier solution : just do this template :

    <div class"left">%CMM_THUMBS_TEXT%</div><span class=" right red thumblock %CMM_CSS_BLOCK%">%THUMB_DOWN% %VOTES_DOWN%</span><span class="green right thumblock %CMM_CSS_BLOCK%">%THUMB_UP% %VOTES_UP% </span>

    and in CSS :

    .red {color:red}
    .green {color:green}

    there is an example here on my site :

    Good work CAMEO172!
    More clean and inside template.
    I didnt thought on it because the templates dont support php code.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Thumbs Mod] Shows The Thumbs Ratings With Different Colors’ is closed to new replies.