vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Auto Image Resize (https://vborg.vbsupport.ru/showthread.php?t=59166)

RaceJunkies 12-14-2003 02:09 PM

Auto Image Resize
 
Hello anyone,

I need a script or hack that will automaticaly resize images posted by a user with the [IMG] tags...

So any huge images will not screw up my forum tables....

I tried some that I found here but none worked with me...

I am running 2.3.0....

Thank in advance!

Gary King 12-14-2003 06:14 PM

An alternative would be to simply disable the [img] tags, but that's just a suggestion.

vietfancy 03-19-2005 03:03 AM

Open includes/functions_bbcodeparse.php

search for:
PHP Code:

function handle_bbcode_img_match($link

    
$link strip_smilies(str_replace('\\"''"'$link)); 

    
// remove double spaces -- fixes issues with wordwrap 
    
$link str_replace('  '''$link); 

    return 
'<img src="' .  $link '" border="0" alt="" />'


Replace with this code:
PHP Code:

function handle_bbcode_img_match($link

    global 
$vboptions
      
    
$link strip_smilies(str_replace('\\"''"'$link)); 

    
// remove double spaces -- fixes issues with wordwrap 
    
$link str_replace('  '''$link); 

    if (
$vboptions['legacypostbit']) 
    { 
        return 
'<a href=' $link ' target="_blank"><img src="' $link '" onload="if(this.width>screen.width-255) {this.width=screen.width-255;this.alt=\'Full View\';}" onmouseover="if(this.alt) this.style.cursor=\'hand\';" border="0"></a>'
    } 
    else 
    { 
        return 
'<a href=' $link ' target="_blank"><img src="' $link '" onload="if(this.width>screen.width-80) {this.width=screen.width-80;this.alt=\'Full View\';}" onmouseover="if(this.alt) this.style.cursor=\'hand\';" border="0"></a>'
    } 



mustang_lex 06-04-2005 08:24 PM

It worked but not in preview thread. only after submit. Anywhere else we need to post this?


All times are GMT. The time now is 07:23 AM.

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.01006 seconds
  • Memory Usage 1,725KB
  • 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)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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