This is the community forum. For a developer response use the Client Area.
Follow us on Facebook, Twitter and YouTube!

smaller rating stars
#1
Star 

Hi, I have changed the png images of the stars to be smaller and they appear smaller in in the avg. rating but the ones inside the comment box do not change and I can't figure out where are they generated. Huh can someone help?
Reply
#2

Hi,

What method did you use to make the stars smaller?

The raw code which generates all of the star images is in comments/includes/functions/comments.php

In that file the functions cmtx_star_full() and cmtx_star_empty() are used for the comment ratings, while the functions cmtx_star_full_avg(), cmtx_star_half_avg() and cmtx_star_empty_avg() are used for the average ratings.

But if you're talking about the CSS stylesheet then the .star_image_avg class is used for the average ratings and the .star_image class is used for the comment ratings.

Have you completed the interview?
Reply
#3

Thanks a lot for the reply. I made smaller the size in pixels of the png files with an image editing program and I expected the stars to appear smaller everywhere. This worked for the average rating appearing just below the "Comments" header and the stars there appeared smaller. But inside the comment box the stars remained "big".
Now I just looked at the functions you mentioned and the img tags do not have a width and height set so it remains a mystery why the stars inside the comment_box_1 remain "big". I was hoping for a fast solution without having to go through all the code. Maybe I will add width and height to all the img tags inside the functions.
Where are the css classes you mention? I can't find them in the style.css. Do they affect the stars dimensions?
Thanks again for the help!
Reply
#4

Hi,

Sorry about the late reply. You might have fixed this by now.

The CSS classes are in the file comments/css/stylesheet.css, but they don't affect the star dimensions.

In theory just changing the image files should update all of the stars.

Have you tried clearing your web browser's cache?

Have you completed the interview?
Reply
#5

Finally, it was sth stupid. All the stars got smaller but the ones inside the comment box were on a light background while the average rating stars were on a dark background and that made the stars inside the box appear bigger maybe because the grey border of the stars became one with the dark background while it made a contrast with the light background. So it was an illusion!

Thanks a lot!
Reply
#6

Smaller stars in action, see kakteja_com.
============================================


1) find functions like these:


for ($counter=1; $counter<=$amount; $counter++) {
$star_full .= "<img src='" . $url_to_comments_folder . "star_full.png' title='" . "Full Star" . "' alt='Full Star' class='stv' />";
}

return $star_full;

} //end of star-full-avg function


function cmtx_star_half_avg ($amount) { //star half for average rating

global $url_to_comments_folder; //globalise settings

$star_half = '';

for ($counter=1; $counter<=$amount; $counter++) {
$star_half .= "<img src='" . $url_to_comments_folder . "star_half.png' title='" . "Half Star" . "' alt='Half Star' class='stv' />";
}

return $star_half;

} //end of star-half-avg function


function cmtx_star_empty_avg ($amount) { //star empty for average rating

global $url_to_comments_folder; //globalise settings


for ($counter=1; $counter<=$amount; $counter++) {
$star_empty .= "<img src='" . $url_to_comments_folder . "star_empty.png' title='" . "Empty Star" . "' alt='Empty Star' class='stv' />";
}

return $star_empty;

==============================================================

2) add class 'stv' (or other class name ...) to every <img ... class='stv' />

==============================================================

3) add class 'stv' to css_file_of_commentics

.stv {
position: relative;
height: 18px;
}

=====================================================

4) solution can also be seen in thread about Star Ratings.

lp, stariocek
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by Seven Thunders
20-Jun-2019, 03:56 AM
Last Post by Seven Thunders
21-Aug-2018, 04:05 AM
Last Post by cecilia
15-Jun-2014, 01:08 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)