vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Miscellaneous Hacks - Image Resizer - Using nCode Script (https://vborg.vbsupport.ru/showthread.php?t=237650)

Seven Skins 06-19-2011 03:05 PM

For some reason vBulletin added P tags around the images and this P tag is causing issue with this hack. For now keep your images aligned to left while I try to fix this, if I can.

Sworm 06-19-2011 03:46 PM

I hope that you'll able to solve this issue.... this is the best resize for vb 4

Josjua 06-22-2011 03:11 PM

Quote:

Originally Posted by haidm (Post 2209549)
I have the problem when centered the images in 4.1.4 (see the attach), how can I fix this?

I have the same problem, fix please! thanks!

morgano 06-26-2011 07:59 PM

If you could show me how to call the Java part and tell it to align: left, center or right I'll be able to code the PHP part to find out if the image is encased in a P tag and to what alignment it's justified and then call the appropriate Java.

BUDIMAN 06-26-2011 08:35 PM

Quote:

Originally Posted by haidm (Post 2209549)
I have the problem when centered the images in 4.1.4 (see the attach), how can I fix this?

me too..waiting for update

Seven Skins 06-28-2011 04:29 PM

Update coming soon, Just need to optimize the code and then I will release it, may be tomorow.

morgano 06-29-2011 05:15 PM

Thanks, waiting eagerly as this is a real pain for the look of the site :)

Sworm 06-29-2011 05:32 PM

Is it ready? :D We have need of this great hack :)

Seven Skins 06-29-2011 08:08 PM

This has been updated.

AusPhotography 06-29-2011 10:24 PM

Can I suggest a fix to the .js file...

Added
Code:

        if(NcodeImageResizer.MAXWIDTH > 0 && this.img.width > NcodeImageResizer.MAXWIDTH) {
                this.img.height = (NcodeImageResizer.MAXWIDTH / this.img.width) * this.img.height;
                this.img.width = NcodeImageResizer.MAXWIDTH;
        } // keep proportions if both options set

Giving....
Code:

NcodeImageResizer.prototype.scale = function() {
        this.img.height = this.originalHeight;
        this.img.width = this.originalWidth;
       
        if(NcodeImageResizer.MAXWIDTH > 0 && this.img.width > NcodeImageResizer.MAXWIDTH) {
                this.img.height = (NcodeImageResizer.MAXWIDTH / this.img.width) * this.img.height;
                this.img.width = NcodeImageResizer.MAXWIDTH;
        }
       
        if(NcodeImageResizer.MAXHEIGHT > 0 && this.img.height > NcodeImageResizer.MAXHEIGHT) {
                this.img.width = (NcodeImageResizer.MAXHEIGHT / this.img.height) * this.img.width;
                this.img.height = NcodeImageResizer.MAXHEIGHT;
        }
        if(NcodeImageResizer.MAXWIDTH > 0 && this.img.width > NcodeImageResizer.MAXWIDTH) {
                this.img.height = (NcodeImageResizer.MAXWIDTH / this.img.width) * this.img.height;
                this.img.width = NcodeImageResizer.MAXWIDTH;
        } // keep proportions if both options set
       
        this.warning.width = this.img.width;
        this.warning.onclick = function() { return this.resize.unScale(); }
       
        if(this.img.width < 400) {
                this.setText(vbphrase['ncode_imageresizer_warning_small']);
        } else if(this.img.fileSize && this.img.fileSize > 0) {
                this.setText(vbphrase['ncode_imageresizer_warning_filesize'].replace('%1$s', this.originalWidth).replace('%2$s', this.originalHeight).replace('%3$s', Math.round(this.img.fileSize/1024)));
        } else {
                this.setText(vbphrase['ncode_imageresizer_warning_no_filesize'].replace('%1$s', this.originalWidth).replace('%2$s', this.originalHeight));
        }
       
        return false;
}



All times are GMT. The time now is 06:47 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.01378 seconds
  • Memory Usage 1,741KB
  • 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_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)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