Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > Programming Articles
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Setting smilie alignment in posts
Tungsten's Avatar
Tungsten
Join Date: Jan 2002
Posts: 100

 

Nashville, TN
Show Printable Version Email this Page Subscription
Tungsten Tungsten is offline 04-24-2002, 10:00 PM

Something that had been bugging me for a while now was the fact that VBulletin didn't declare an alignment option for the "img src" tags used for smilies inserted into posts.

Why did this bug me?

Because some smilies cause the paragraph line spacing in a post to be fairly skewed, especially if the smilie is larger than 15x15 pixels. I tend to think that it looks better if the alignment is set to "absmiddle" in the IMG tag.

To change the default behavior, you need only edit one file and make one change.

Open the functions.php file in your VBulletin admin directory and do the following...

find this in the admin\functions.php file
PHP Code:
        $bbcode=str_replace(trim($smilie[smilietext]),"<img src=\"$smilie[smiliepath]\" border=\"0\" alt=\"\">",$bbcode); 
and replace it with this
PHP Code:
        $bbcode=str_replace(trim($smilie[smilietext]),"<img src=\"$smilie[smiliepath]\" border=\"0\" align=\"absmiddle\" alt=\"\">",$bbcode); 

Note the addition of the align=\"absmiddle\" in the img src tag. This will force the smilie to be aligned so that it's center is equal to the center of the line of text that surrounds it.

You could change the alignment value to any of the other viable HTML 4.0 options for the "img" tag. For more information on the alignment options available, visit this page:

http://www.htmlhelp.com/reference/ht...ecial/img.html

Hope this helps someone else!
Reply With Quote
  #2  
Old 04-25-2002, 12:52 PM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks, it does look better. The problem isn't completely solved (spaces between the lines are not homogenous) but it helps.
Reply With Quote
  #3  
Old 04-25-2002, 04:36 PM
Tungsten's Avatar
Tungsten Tungsten is offline
 
Join Date: Jan 2002
Location: Nashville, TN
Posts: 100
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by FireFly
Thanks, it does look better. The problem isn't completely solved (spaces between the lines are not homogenous) but it helps.
True, true. I haven't really decided what alignment value I prefer for my forums yet. absmiddle is cool so long as all smilies are 15x15 or less pixels, but larger smilies really muck up the "pagination" (for lack of a better word). :ermm:
Reply With Quote
  #4  
Old 04-27-2002, 04:09 AM
Velocd's Avatar
Velocd Velocd is offline
 
Join Date: Mar 2002
Location: CA University
Posts: 1,696
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This does make the smilies look much better, thanks
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:15 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03845 seconds
  • Memory Usage 2,228KB
  • Queries Executed 17 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_article
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (4)post_thanks_box
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit_info
  • (3)postbit
  • (4)postbit_onlinestatus
  • (4)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete