vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Auto resize large image (https://vborg.vbsupport.ru/showthread.php?t=99286)

DanLai 10-24-2005 10:00 PM

Auto resize large image
 
In fact this is a work around for the auto resize feature to work with the WYSIWYG editor.

Step1. In includes/class_bbcode.php

Find (in line around 18xx):
Code:

return '<img src="' .  $link . '" border="0" alt="" />';
Replace with:
Code:

return '<img src="' . $link . '" onload="if(largerThan(this.width,700)) {this.width=700;this.alt=\'Click here to see a large version\';}" onmouseover="if(this.alt) this.style.cursor=\'pointer\';" onclick="if(this.alt) window.open(\'' . $link . '\');" border="0" />';
Step2. Modify the common template of your template set

Add this to the headinclude section:
Code:

<script type="text/javascript">
function largerThan(a,b)
{
return a>b;
}
</script>

Demo:
http://talkmusic.org/showthread.php?t=3165

swantonio 10-25-2005 05:28 PM

good grazie ... .-)

Allan 10-25-2005 05:41 PM

Simple effective, I like ;)

congratulation

"Click Install" ;)

nokturno 10-25-2005 06:30 PM

congratulation

Pramodinfo 10-25-2005 07:23 PM

*Clicks Install* :) Thanks

CBE 10-25-2005 08:47 PM

This is the best image resizer i have seen,,
thank u very much

COBRAws 10-25-2005 09:25 PM

What's the way for adding a text that says something like "Click on the image to see orginial size"?

ORIGINAL MOD:
Code:

return '<img src="' . $link . '" onload="if(largerThan(this.width,700)) {this.width=700;this.alt=\'Click here to see a large version\';}" onmouseover="if(this.alt) this.style.cursor=\'hand\';" onclick="if(this.alt) window.open(\'' . $link . '\');" border="0" />';

WITH TEXT BELOW:
Code:

return '<img src="' . $link . '" onload="if(largerThan(this.width,700)) {this.width=700;this.alt=\'Click here to see a large version\';}" onmouseover="if(this.alt) this.style.cursor=\'hand\';" onclick="if(this.alt) window.open(\'' . $link . '\');" border="0" /><br /><p>Click on the image to see original size<p />';
Someone please tell me if this is ok.

Barakat 10-25-2005 11:48 PM

iam useing this and its usefull also .
in the same file and the same code just find this code :-

PHP Code:

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

replace it with :-

PHP Code:

return '<div style="width: 800px; overflow: auto;"><img src="' .  $link '" border="0" alt="" /></div>'

it will give u a frame on large pictures and will save ur style as it is .
just choose the width as u want the picture to be shown and thats all ...

any way i will try ur code also

Xplorer4x4 10-26-2005 07:57 AM

This belongs in the code modification forum as it it edits one of the orignal vB scripts.

Snake 10-26-2005 08:24 AM

I've been looking for this. Thanks!


All times are GMT. The time now is 04:41 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.01298 seconds
  • Memory Usage 1,735KB
  • 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
  • (5)bbcode_code_printable
  • (2)bbcode_php_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