vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Stopping images in signatures from making the page really wide (https://vborg.vbsupport.ru/showthread.php?t=74192)

UK Jimbo 01-10-2005 10:00 PM

Stopping images in signatures from making the page really wide
 
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 


boo.3 01-11-2005 07:38 PM

screen shots?

what does it do with the rest of the image?

UK Jimbo 01-12-2005 01:17 PM

screenshots added :)

cinq 01-12-2005 01:29 PM

Those are some HUGE sigs :p

Soto 01-12-2005 02:32 PM

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?

UK Jimbo 01-13-2005 09:43 AM

Quote:

Originally Posted by cinq
Those are some HUGE sigs :p

That wasn't a real sig - I just dropped it in to demo this feature :)

UK Jimbo 01-13-2005 09:56 AM

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.

DES.deViant 01-23-2005 03:03 AM

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.

UK Jimbo 01-23-2005 03:29 PM

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

We certainly have the wrapping problem in sigs on our forum. Have a look at the screenshots.


All times are GMT. The time now is 05:11 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.01058 seconds
  • Memory Usage 1,740KB
  • 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
  • (3)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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