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

Can Gravatar image be optimized for hi-res screens?
#1

Hello,

I'm trying to optimize my website for computers/tablets that have hi-res screens, so I'm wondering if I can get the gravatar to work in such a way.

For example, what I'd like to do is change the size of the gravatar in the Admin Panel to 140 px, and have Commentics fetch gravatars from gravatar.com at that size. Then, I go into the actual coding of Commentics and do some kind of inline CSS change such as style="width:70px;height:70px". I tried doing so on my own, and to help me find where to possibly do that I added in a custom default gravatar -- gravatar-140.png. But when I did a search through all the Commentics files there was no mention of such file in any of the coding. Perhaps I've done something wrong along the way, I don't know.

Anyway, would that somehow be possible?

Cheers,

Allan

p.s. Any word on a (rough) release date for Commentics 3.0?
Reply
#2

Hi Allan,

The place to add an inline style is in /upload/includes/functions/comments.php on line 222. The reason you couldn't find the filename of your custom gravatar in the code is because it's stored in a variable, so it doesn't appear in the code anywhere.

PHP Code:
<?php 
$cmtx_box
.= '<img src="http://www.gravatar.com/avatar/' . md5(strtolower(trim($email))) . '.png?s=' . cmtx_setting('gravatar_size') . $gravatar_parameter . '" alt="Gravatar" title="Gravatar"/>';

Really good progress is being made each day with Commentics v3.0. The main functionality is done. It's just small features here and there which need finishing. It's hard to give even a rough release date but I'd have to say between a few months to the end of this year.

Have you completed the interview?
Reply
#3

Hello Steven,

That worked great, thanks (although I obviously had my inline CSS description wrong in my first comment -- it should have read width="70px" and height="70px"). The images look really sharp now. The only problem with it though is that although the images size down to the 70px I wanted, they leave a 70px gap between the images and the comment fields. So I looked at the coding a bit, and although I have no idea what language that even is, on line 225 I tried taking away 70 away from 5, and so changed the + 5 to - 65, and what do you know but it worked! Thanks again, and thanks for the update on 3.0.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)