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)
-   -   Auto resize Huge images for [IMG] bbcode (https://vborg.vbsupport.ru/showthread.php?t=68677)

007pig 08-23-2004 10:00 PM

Auto resize Huge images for [IMG] bbcode
 
I find lots of people are looking for [IMG] hack. So i share mine now.

The hack modifies only a few lines and the images are resized automaticly by javascript.

Open functions_bbcodeparse.php

Search:
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:
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>';
    }


All done. Enjoy!

???`S?LV?R???` 08-24-2004 09:01 PM

nice.

Symbian.info 08-24-2004 10:08 PM

Would be a great hack if it works.. pics are gone on he front of vBadvanced CMPS.. Small pics are still there.. In the message it self it is still there, but still big size..

But how can I adjust the limits? Wat is a big picture??

It would be great if it works! To often members post to big pics of other webistes...

007pig 08-25-2004 10:03 AM

the key is
Code:

onload="if(this.width>screen.width-255) {this.width=screen.width-255;this.alt='Full View';}"
you can adjust the number 255 to what you like.
increasing it makes your pics smaller.

duncan99 08-25-2004 12:54 PM

Installed, thanks for the hack.

SVTBlackLight01 08-25-2004 10:30 PM

Has anyone tried this with the WYSIYG editor. It doesn't seem to be compatible as it posts part of the javascript.

007pig 08-26-2004 04:42 AM

Quote:

Originally Posted by SVTBlackLight01
Has anyone tried this with the WYSIYG editor. It doesn't seem to be compatible as it posts part of the javascript.

i have tested in WYSIWYG without problem.

note:
Code:

onload="if(this.width>screen.width-255)
you shouldn't put
Code:

javascript:
before "if"

SVTBlackLight01 08-26-2004 10:54 PM

Here is an example:

https://vborg.vbsupport.ru/

007pig 08-27-2004 05:44 AM

Quote:

Originally Posted by SVTBlackLight01
Here is an example:

https://vborg.vbsupport.ru/

how do you post images?
select - copy - paste?

if you paste a image with javascript code, it will appear like that. for example, you paste an image which is already autoresized.

Use [img] code instead.

HiDeo 08-27-2004 06:30 AM

Thanks for the hack


All times are GMT. The time now is 03:10 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.01197 seconds
  • Memory Usage 1,747KB
  • 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_code_printable
  • (2)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete