PDA

View Full Version : [RELEASE vB2.0b2] Get/set smilie height/width


JWS
03-07-2001, 01:59 AM
Tired of that funny rendering jumpiness when your screen is painting on threads/posts that are full of smilies? There's a simple hack to set the size of those so that rendering goes much more quickly....

In functions.php, look for the function called bbcodeparse2(). Look for the lines:
while ($smilie=$DB_site->fetch_array($smilies)) {
if(trim($smilie[smilietext])!="") {
$bbcode=str_replace(trim($smilie[smilietext]),"<img src=\"$smilie[smiliepath]\" border=0>",$bbcode);
}
}

... and change it to:
while ($smilie=$DB_site->fetch_array($smilies)) {
if(trim($smilie[smilietext])!="") {
$smilie_size = getimagesize($smilie[smiliepath]);
$bbcode=str_replace(trim($smilie[smilietext]),"<img src=\"$smilie[smiliepath]\" border=0 width=\"$smilie_size[0]\" height=\"$smilie_size[1]\">",$bbcode);
}
}

Now when your smilies are displayed, you'll have the width and height already fixed for you. When you resize your smilie, it'll automatically be resized where it's used!

03-07-2001, 06:09 PM
That's really useful. I was looking for something like that. Now when you click on the, "Go To First New Post" arrow, it will actually stay at that "bookmark" post, instead of the smilies making it fly up to another post.

However, come to think of it, this won't really help. I forgot the avatars don't have a fixed width and height.

Can you do something about that :)

03-07-2001, 06:36 PM
I'll see what I can whip up. It'll be a tad slower for remotely stored avatars vs. local ones since it has to go check the size remotely before actually displaying it.

Originally posted by webwizard
That's really useful. I was looking for something like that. Now when you click on the, "Go To First New Post" arrow, it will actually stay at that "bookmark" post, instead of the smilies making it fly up to another post.

However, come to think of it, this won't really help. I forgot the avatars don't have a fixed width and height.

Can you do something about that :)