vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   [RELEASE vB2.0b2] Get/set smilie height/width (https://vborg.vbsupport.ru/showthread.php?t=10666)

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:
PHP Code:

    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:
PHP Code:

    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.

Quote:

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 :)



All times are GMT. The time now is 03:29 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04421 seconds
  • Memory Usage 1,727KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete