vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Show Thread Enhancements - Dynamic Picture Resize for [IMG] tag (https://vborg.vbsupport.ru/showthread.php?t=157228)

Alibass 12-30-2007 03:40 PM

Nice little hack and it works well on 3.7.0 b3 for me also. :) **Installed**

gforce75 12-30-2007 06:44 PM

Awesome hack. Should be in vb by default.

gforce75 12-30-2007 07:08 PM

hmm, it messed up vb. The .js modificatiom made my chatbox stop working. The img sized rework. Just make sure u pay attention to this.

Alien 12-30-2007 11:54 PM

Has this been resolved yet? :)

Quote:

Originally Posted by mask31
hi Teck, the images are not uploaded into database. like i said i set it to 600 x200 max for images in signatures, using the bbcode tag [img]. and it was running fine before inserting your hack, but now we don't get the error when it's bigger than 600 x 200, it's just resizing it.
so no , images are not uploaded into database.

thanks , i'll wait for your help on this


CCV_Pinto 01-06-2008 05:07 AM

teck,

do you know if is easy to modificate your javascript to do enlarge the image inside the post, like this mod:

https://vborg.vbsupport.ru/showthrea...118048&page=49

(see the javascript attached at the mod)

what I want to do is use my mod of your mod (quoted below)

but with this functionality of enlargement

I know that for the javascript work properly it has to:

1. when loading the images, add an "identifier" to each one that exceeds the max width and saving the original width (and it would be good to add the warning like the link above)


2. if the user click on the image, just restore the original size (and changing the warning text)

3. if the user click it again, then resize it again


I think this can be easy.. and it would be less "destructive" than the mod which I posted the link... and I have seen that all javascript is done on that post... and it make exactly what I have said... i just dont know how it manages the identifier of the images..

Quote:

Originally Posted by CCV_Pinto (Post 1379410)
hi..
great work here..

but I would like to resize the images depending of the user resolution...

i thinked about setting a maximum width like a percentage of the resolution or the width like the resolution - K (where K is a constant that I want configure through admin cp)

i choosed the second option... because its better at my case...

so, I did this modification at vbulletin_global.js

Code:

function resize_image(obj, link, k)
{

    var browserwidth = window.document.body.clientWidth;
    var maxwidth = browserwidth - k;

        if (obj.width > maxwidth)
        {
                obj.style.cursor = 'pointer';
                obj.style.width = maxwidth + 'px';
                obj.style.height = parseInt(obj.height * maxwidth / obj.width) + 'px';
                obj.onclick = function()
                {
                        window.open(link, '_blank');
                        return false;
                };
        }
}

I think this will work fine.. i am posting before trying...

but I dont know why I have to modify the CSS... thats for resizing when javascript is disabled?

I will try to make my mod and use it without the CSS mods... then I post here the results... but if someone knows the answer then can help me...

thnks

ps: it worked fine!
but I am curious about what that css will do... i think thats because of javascript desabled.. or that avoid to load the image and then resize it.... but i am not sure...


ParsianSat_Net 01-06-2008 10:29 AM

Please
give me screen hosts

TECK 01-13-2008 01:28 AM

Quote:

Originally Posted by Alien (Post 1412288)
Has this been resolved yet? :)

See post 108.

kiennt718 01-14-2008 10:57 PM

I've tried this mod, thanks TECK, it works well.

But I need some enhancements, pls help !

In my forum, users send a lot of image in posts, and I want the images have better layout:

1. Don't touch the small in-line image like this https://vborg.vbsupport.ru/external/2008/01/437.gifone
2. For the image that larger than 200 px wide, I would like to have them center-aligned,




so i did some modifications in the code

PHP Code:

$dynimage '';
        if (
$this->registry->options['dynamicpic_enabled'])
        {
            
$dynwidth intval($this->registry->options['dynamicpic_width']) - 1;
            
$dynimage = ($dynwidth 0) ? 'class="resizeimage" onload="resize_image(this, \'' .  $link '\', ' .  $dynwidth ');" ' '';
            list(
$width$height$type$attr) = getimagesize($link);
         }
      if (
$width >200
      {
      
       return 
'<div align="center"><img src="' .  $link '" style="border: 12px solid #EBEBEB" alt="" ' $dynimage '/></div>';
      }
         else
     {
     return 
'<img src="' .  $link '" border="0" alt="" ' $dynimage '/>';
     } 

Live demo at: http://forum.vietpet.com/showthread.php?p=3198#post3198

But here, I used php getimagesize(), which connects to remote server to get actual width of the image. It slows the page load EXTREMELY.

May be CSS can help? But I don't know how to modify CSS :)

CAN YOU GIVE A SOLUTION?

Thanks a lot in advance

Kien, NT

Chevy II 01-14-2008 11:43 PM

I have one skin that does not resize the images, I made the same changes to all skins. What could the problem be?

Thanks for your assistance!

kiennt718 01-15-2008 03:27 AM

Quote:

Originally Posted by Chevy II (Post 1421588)
I have one skin that does not resize the images, I made the same changes to all skins. What could the problem be?

Thanks for your assistance!

May be, you install the skin AFTER the mod has been installed? Do import product again, overwrite = YES


All times are GMT. The time now is 06:48 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.01356 seconds
  • Memory Usage 1,759KB
  • 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
  • (1)bbcode_code_printable
  • (1)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (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