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 - CES Dynamic [IMG] Resize (Plugin Version) (https://vborg.vbsupport.ru/showthread.php?t=157428)

thincom2000 09-08-2007 10:00 PM

CES Dynamic [IMG] Resize (Plugin Version)
 
CES DYNAMIC [IMG] RESIZE
Version: 1.2.2

This mod is based on TECK's Dynamic Picture Resize for [IMG] tag mod. I made this mod after seeing a discussion in the thread about the potential number of file edits necessary to add some requested features, and then realized the entire mod could be accomplished with essentially just 1 plugin. TECK suggested that for ease of support I release my updated product file in a new thread, so here it is.

*** NEWS ***
7/8/2009 - v1.2.2 released
9/23/2007 - v1.2.1 released
9/21/2007 - v1.2.0 released
9/13/2007 - v1.1.0 released
9/11/2007 - v1.0.4 released
9/9/2007 - support thread opened, v1.0.1 - 1.0.3 released
9/8/2007 - v1.0.0 released

Products to Install: 1
Plugins Included: 7
Files to Upload: 0
New Templates: 1
Template Edits: 0
Files to Edit: 0

What It Does:
When using the [IMG] bbcode tag, a user may add an image to his/her post that is too ginormous for your intended vBulletin style, pushing things out of the way, and not looking particularly nice. This hack resizes oversized images to specified acceptable dimensions, anywhere that the [IMG] tag is used.

Current Features:
  • show a disclaimer when an image has been resized (option)
  • clicking the image opens in parent or new window (option)
  • multiple images on a line will be resized so their total width is below the set max

Known Issues:
- None

*** Changelog ***
As of Version 1.2.2:
- bug fix: XSS flaw

As of Version 1.2.1:
- bug fix: table explosion

As of Version 1.2.0:
- new feature: max width sharing for multiple images on a line
- bug fix: onclick interferes with [url]
- bug fix: onclick properties not passed to resize disclaimer
- bug fix: images separated by line breaks
- bug fix: [img] ignores [noparse]

As of Version 1.1.0:
- new feature: maximum height
- extended: maximum width can be in pixels or percentage
- bug fix: resize message class not set in Internet Explorer
- updated templates: dynamicpic_script

xandizitxu 09-09-2007 07:53 PM

Thanks! I will test soon and post results!

Not working man!

see here what is happening FIXED NOT NEEDED MORE THE URL! please help =) this mod is really needed the image is that -> FIXED NOT NEEDED MORE THE URL!

thincom2000 09-09-2007 08:19 PM

Okay, thank you. This issue occurs when you have HTML disabled in posts. I will look into this and see why this made any difference. Also, it looks as though you haven't fixed the word-wrap bug in 3.6.8. See this thread: http://www.vbulletin.com/forum/proje...?issueid=22752

xandizitxu 09-09-2007 08:47 PM

Okay thanks for informing, i didn't know this

thincom2000 09-09-2007 09:01 PM

Okay, the new version converts the [IMG] tag to a BB-Code first, so the HTML issue is averted.

xandizitxu 09-09-2007 09:07 PM

It worked but now a bug appeared

FIXED NOT NEEDED MORE THE URL! take a look again

thincom2000 09-09-2007 09:10 PM

Aha, okay. Seems to be a size issue :rolleyes:. Should be an easy one to fix.

xandizitxu 09-09-2007 09:12 PM

\o/ Well with this I think my board is complete!

ITs working, now its a minor bug, not so BUG i can say, if i change the dimension on AdminCP the only thing that changes is the red text alert, only when updating the thread it works ^^ but its not a problem thanks for the hard working !

thincom2000 09-09-2007 09:36 PM

Zip updated. Everything should be correct now. I'm going out for the night, so if there are any bugs remaining I probably won't get to them until tomorrow.

mktrilogy 09-10-2007 08:21 AM

signature now only displays url

is it possible to only resize the post and not the sig?

thincom2000 09-10-2007 10:41 AM

Quote:

Originally Posted by mktrilogy (Post 1336048)
signature now only displays url

is it possible to only resize the post and not the sig?

I was unable to duplicate this behavior. The only thing I can think of is that your sig permissions are not set. First let me know if you are using any mods that modify permissions, such as Advanced BBCode Permissions or CES Parser Permissions. Also, please check your Usergroup Permissions under Signature Permissions. In vBulletin Options make sure [IMG] Code is enabled.

But to answer your other question: resizing the images in only one area would almost defeat the purpose of using this mod at all. If you're concerned about the alert "This image was resized," it doesn't appear in signatures or private messages.

sadiq6210 09-10-2007 03:11 PM

Thanks
But
Is there a screenshot ?

thincom2000 09-10-2007 03:40 PM

No screenshot (not sure what it would prove). You can view the dev testing thread here: http://www.crackedeggstudios.com/project.php?issueid=36

Computer Guru 09-10-2007 10:00 PM

Thanks. Installed.

mktrilogy 09-11-2007 01:19 AM

in my case it only changes the image into url into thus images are not displayed.

thincom2000 09-11-2007 03:08 AM

That's not really too helpful. What are the settings I asked about earlier?

mktrilogy 09-11-2007 05:07 AM

Quote:

Originally Posted by thincom2000 (Post 1336120)
I was unable to duplicate this behavior. The only thing I can think of is that your sig permissions are not set. First let me know if you are using any mods that modify permissions, such as Advanced BBCode Permissions or CES Parser Permissions. Also, please check your Usergroup Permissions under Signature Permissions. In vBulletin Options make sure [IMG] Code is enabled.

But to answer your other question: resizing the images in only one area would almost defeat the purpose of using this mod at all. If you're concerned about the alert "This image was resized," it doesn't appear in signatures or private messages.

using bbcode manager
image code is enabled of course.

It does not resize my sig, it makes them url. no alert message, just url. all images that uses img code becomes url

nickypoooo 09-11-2007 06:11 AM

Quote:

Originally Posted by mktrilogy (Post 1336757)
using bbcode manager
image code is enabled of course.

It does not resize my sig, it makes them url. no alert message, just url. all images that uses img code becomes url

I'm having the same problem, It make my sig UR.
same here all images that uses img code becomes url.

Uninstalled.

thincom2000 09-11-2007 12:21 PM

Quote:

Originally Posted by mktrilogy (Post 1336757)
using bbcode manager
image code is enabled of course.

It does not resize my sig, it makes them url. no alert message, just url. all images that uses img code becomes url

I can only figure that there is a conflict since I have messed with the settings ad nauseum and can't figure out why this is occurring on your install. Please list any mods that hook into bbcode_parse_start (check the Plugin Manager, and sort by hook location instead of product).

Stoebi 09-11-2007 02:18 PM

Hi

Really nice hack, thank you. :) I have some little problems.
My option for your hack:
'Enable/disable a message above each image that has been resized' is Off (value = 0)

If this option turned off, firefox displays an error message. Please see the image attached with this post (2nd line).

Code:

.resizeimage { max-width: $vboptions[ces_dynamicpic_width]px; }
* html .resizeimage, .resizednote { width: expression((this.width > intval($vboptions[ces_dynamicpic_width] - 1))) ? '$vboptions[ces_dynamicpic_width]px' : 'auto'); }

IE, Firefox and Opera have problems with this peace of code. Please see the image attached with this post (1st line).

IE 7 does not display the background-color for $dynamicpic['note_true'] if this option 'Enable/disable a message above each image that has been resized' enabled.



My wish:
Allow to resize if 'Enable/disable a message above each image that has been resized' disabled.


Kind Regards,

Stoebi

thincom2000 09-11-2007 03:05 PM

I hate IE. I have managed to fix everything you mentioned above except the background color. The problem is that IE is inheriting the background-color from the postbit, and then ignoring anything afterwards.

Stoebi 09-11-2007 03:31 PM

Hi

thank you very much for your quick answer. :)
To solve the background-color for IE 7 you need to add this peace of code to this line:
Code:

return ($dynamicpic['note_true'] ? "<div class=\"resizednote\" id=\"$link\">" : "") . "<img src=\"$link\" border=\"0\" alt=\"\" $dynamicpic[image] />" . ($dynamicpic['note_true'] ? "</div>" : "");

Regards,

Stoebi

thincom2000 09-11-2007 03:40 PM

But that is not the resized note div. That is a containing div... Doing that makes a huge undesired color splotch, if your image is smaller than necessary to be resized.

Also that causes the message not to display at all in IE7.

Stoebi 09-11-2007 03:53 PM

Hm

you need to re-edit and save your post with your image. Suspect, i will searching for another way :)


Regards,

Stoebi

thincom2000 09-11-2007 04:55 PM

Hm... I found another bug when the resize message is enabled. If you click to View Selection Source in Firefox, it runs onload() again, and duplicates the image every time you do this. This bug has been addressed in the next release.

Still clueless about the IE background... Maybe it has something to do with the order IE runs CSS and Javascript. Does anyone know anything about IE?

xandizitxu 09-11-2007 05:05 PM

For me works great! I use firefox

Use FIREFOX and be happy!

PS: On IE don't work O.O

Stoebi 09-11-2007 06:09 PM

IE and setAttribute() :(
http://www.quirksmode.org/dom/w3c_core.html#attributes

I've no ideas or workaround atm. :(

Thx for 1.0.4 :)

thincom2000 09-11-2007 06:33 PM

Thanks for the link. I was able to get the class to set in IE.

In the template, find:
HTML Code:

                        wrap.setAttribute('class', 'resizednote');
Replace with:
HTML Code:

                        wrap.setAttribute('class', 'resizednote');
                        wrap.attributes['class'].value = 'resizednote';

This will be included in the next build.

xandizitxu 09-11-2007 06:41 PM

I will wait for the next so! \o/

Great mod!

Stoebi 09-11-2007 06:52 PM

Thx a lot, it works for IE now :)


Regards, Stoebi

mrghostno1 09-11-2007 07:45 PM

Is there a way to make this work with % ? Because i saw in the code something like
Code:

+ 'px'
So this would not allow me to use a % resize. I mean, there's not need for user with 1600 screen to see an 1200 image resizes, as it is for a 800 screen user...
Thats why i would like to resize according to each user screen resolution.

Ted S 09-12-2007 12:20 AM

I'm having a similar issue. New images posted with the IMG tag are resized while old ones are not.

thincom2000 09-12-2007 12:35 AM

Quote:

Originally Posted by mrghostno1 (Post 1337208)
Is there a way to make this work with % ?

I will make this an option in the next release. Also the next release will allow setting a max height (but I don't think this would work desirably in % and it will have to use px).

Quote:

Originally Posted by Ted S (Post 1337333)
New images posted with the IMG tag are resized while old ones are not.

In the AdminCP, use your Maintenance Tools' Update Counters and Rebuild the Post & Sig Caches.

mrghostno1 09-12-2007 02:55 AM

Really thnks dude! Ultra fast support! I'll download this one, for sure.

thincom2000 09-13-2007 01:41 PM

The new version is now available. Supports setting a max height in pixels and using % for the max width.

Dave_W 09-13-2007 02:07 PM

I'm installing this just now. Great job. Haven't tested but judging from your feedback here it's going to work fine. I'll let you know If I come across a problem.

-Dave

xandizitxu 09-13-2007 04:43 PM

update installed!

EDIT: BUGGED MY SITE :/

ON FIREFOX THE IMAGE BECOMES a 1px
[FIXED!!! JUST REMOVED THE OLD TEMPLATE OF DYNAMIC PIC AND GOT IT WORKING!]
ON IE THE IMAGE TRUE SIZE DON'T OPEN IN NEW WINDOW AND NO DISCLAIMER [NOT FIXED :(]


Well ^^ thats only it

mrghostno1 09-13-2007 07:30 PM

every time i enable it, all images turn in to url to the image, they dont show anymore.
Using fixed width, and fluid %. showing disc. or not. doesnt work anyway. :(

thincom2000 09-14-2007 01:07 AM

Quote:

Originally Posted by mrghostno1 (Post 1338553)
every time i enable it, all images turn in to url to the image, they dont show anymore.
Using fixed width, and fluid %. showing disc. or not. doesnt work anyway. :(

A number of users reported this in earlier builds, though no one ever got back to me when I started asking them about various settings. This is likely to be a conflict with some other mod. What mods are you using with plugins using the bbcode_parse_start hook?

thincom2000 09-14-2007 01:09 AM

Quote:

Originally Posted by xandizitxu (Post 1338442)
ON IE THE IMAGE TRUE SIZE DON'T OPEN IN NEW WINDOW AND NO DISCLAIMER [NOT FIXED :(]

I checked your site and it seems to be working as designed in IE.


All times are GMT. The time now is 06:45 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.01407 seconds
  • Memory Usage 1,830KB
  • 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_html_printable
  • (9)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
  • (40)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