Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Stopping images in signatures from making the page really wide Details »»
Stopping images in signatures from making the page really wide
Version: 1.00, by UK Jimbo UK Jimbo is offline
Developer Last Online: Mar 2013 Show Printable Version Email this Page

Version: 3.0.0 Rating:
Released: 01-10-2005 Last Update: Never Installs: 7
 
No support by the author.

This is a hack we've used on visordown.com in version 3.0.0 up to 3.0.5

It prevents users from having images in their sigs that push the width of the page larger than the template should be by adding some whitespace between each of the images.

You just need to edit one file includes/functions_showthread.php

On line 459 find:
PHP Code:
$post['signature'] = parse_bbcode($post['signature'], 'nonforum'$vboptions['allowsmilies']); 
add on the line below it:
PHP Code:
$post['signature'] = preg_replace('/(<img[^<>]+>)(<img)/i',"\$1 \$2",$post['signature']); 

The block of code should now look like:
PHP Code:
                        if (!isset($sigcache["$post[userid]"]))
                        {
                                
$parsed_postcache['skip'] = true;
                                
$post['signature'] = parse_bbcode($post['signature'], 'nonforum'$vboptions['allowsmilies']);
                                
$post['signature'] = preg_replace('/(<img[^<>]+>)(<img)/i',"\$1 \$2",$post['signature']);
                                
$sigcache["$post[userid]"] = $post['signature'];
                        }
                        else 

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 01-11-2005, 07:38 PM
boo.3 boo.3 is offline
 
Join Date: Nov 2004
Posts: 232
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

screen shots?

what does it do with the rest of the image?
Reply With Quote
  #3  
Old 01-12-2005, 01:17 PM
UK Jimbo's Avatar
UK Jimbo UK Jimbo is offline
 
Join Date: Sep 2002
Posts: 249
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

screenshots added
Reply With Quote
  #4  
Old 01-12-2005, 01:29 PM
cinq's Avatar
cinq cinq is offline
 
Join Date: Oct 2002
Posts: 1,398
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Those are some HUGE sigs
Reply With Quote
  #5  
Old 01-12-2005, 02:32 PM
Soto Soto is offline
 
Join Date: Dec 2004
Posts: 25
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What happens if it's a really wide single image - does it still display?

Is there a hack to limit the actual dimensions so that say, in admin panel you specify that a single sig image should not exceed 600 wide and 100 tall it would output a warning message rather than the image?
Reply With Quote
  #6  
Old 01-13-2005, 09:43 AM
UK Jimbo's Avatar
UK Jimbo UK Jimbo is offline
 
Join Date: Sep 2002
Posts: 249
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by cinq
Those are some HUGE sigs
That wasn't a real sig - I just dropped it in to demo this feature
Reply With Quote
  #7  
Old 01-13-2005, 09:56 AM
UK Jimbo's Avatar
UK Jimbo UK Jimbo is offline
 
Join Date: Sep 2002
Posts: 249
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Soto
What happens if it's a really wide single image - does it still display?

Is there a hack to limit the actual dimensions so that say, in admin panel you specify that a single sig image should not exceed 600 wide and 100 tall it would output a warning message rather than the image?
Yup it will still display and push the width of the page out.

I've got a feeling that I've seen a hack which checks image dimensions but following a quick search I can't find it. Might be worth trawling the forum for it.
Reply With Quote
  #8  
Old 01-23-2005, 03:03 AM
DES.deViant DES.deViant is offline
 
Join Date: Oct 2004
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't understand what this hack does. When images are lined up horizontally in a post like that (in both Firefox and IE), it already automatically wraps them down to the next line when you have a small resolution or a huge row of images.

The single-image dimensions-checking hack sounds like a good idea though. That's what I was hoping this was.
Reply With Quote
  #9  
Old 01-23-2005, 03:29 PM
UK Jimbo's Avatar
UK Jimbo UK Jimbo is offline
 
Join Date: Sep 2002
Posts: 249
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by DES.deViant
I don't understand what this hack does. When images are lined up horizontally in a post like that (in both Firefox and IE), it already automatically wraps them down to the next line when you have a small resolution or a huge row of images.
It does what it says on the tin

We certainly have the wrapping problem in sigs on our forum. Have a look at the screenshots.
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 10:57 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.04756 seconds
  • Memory Usage 2,291KB
  • Queries Executed 22 (?)
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
  • (3)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (8)postbit
  • (9)postbit_onlinestatus
  • (9)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