Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 03-03-2014, 09:05 PM
RedFoxy's Avatar
RedFoxy RedFoxy is offline
 
Join Date: Sep 2007
Location: Italy
Posts: 179
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default How to fix that all inline images are showed only as full?

Hello!
I've a strange trouble, all the inline images are shown at full size, untile the file is just inserted inline I can change image/thumbnail setting double clicking it, but after I post the message the images are shoe at full size.
I tried to use a CLEAN template and disable ALL mods but nothing... I've vBulletin 4.2.2 and I've that trouble on two different boards.

My template vars about thumbnail are:
Inline Attached Image Thumbnail Maximum Size: 150px
Inline Attached Image Medium Maximum Size: 300px
Inline Attached Image Large Maximum Size: 1024px

Any suggest to fix it?
Reply With Quote
  #2  
Old 03-03-2014, 09:28 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I assume the two forums are on the same server? Have you tried setting up a test site on that server - totally new install - and seeing if you have the same problem right out of the box?
Reply With Quote
  #3  
Old 03-03-2014, 11:18 PM
RedFoxy's Avatar
RedFoxy RedFoxy is offline
 
Join Date: Sep 2007
Location: Italy
Posts: 179
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No I haven't tried, but on vbulletin.com there are other people with same trouble.
I does a video of the trouble: http://www.redfoxy.it/vbulletin_inline.mp4
As you can see, the inline image was translated in [IMG] tag
Reply With Quote
  #4  
Old 03-04-2014, 02:53 PM
Barcham Barcham is offline
 
Join Date: Jan 2014
Location: Montreal
Posts: 146
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just out of curiosity, have you verified your image settings in the admincp under Message Attachment Options? There are a few settings there that can affect how images are displayed in posts on the board.
Reply With Quote
  #5  
Old 03-04-2014, 04:35 PM
RedFoxy's Avatar
RedFoxy RedFoxy is offline
 
Join Date: Sep 2007
Location: Italy
Posts: 179
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Barcham View Post
Just out of curiosity, have you verified your image settings in the admincp under Message Attachment Options? There are a few settings there that can affect how images are displayed in posts on the board.
Yes I do, it's all ok

I've an update for that trouble, looks like thats a trouble of the wysiwyg editor, when I insert inline a thumbnail with the wysiwyg disabled, it insert a [ATTACH ] tag but if I switch from textual editor to wysiwyg and than I switch again to text it change the attach tag to img tag!

--------------- Added [DATE]1393954791[/DATE] at [TIME]1393954791[/TIME] ---------------

Just to be sure, my Message Attachment Options are:
  • Limit Space Taken Up By Attachments (Total): 0
  • Attachments Per Post: 0
  • Attachment Upload Inputs: 10
  • Attachment URL Inputs: 10
  • Allow Deletion of Attachments Beyond Edit Time Limit: no
  • Allow Deletion of Attachments in Closed Threads: No
  • Allow Duplicate Attached Images: No
  • Resize Images: Yes
  • View Attached Images Inline: Yes, display thumbnails
  • CMS Thumbnail Override: Yes
  • Thumbnail Creation: Yes
  • Thumbnail Size: 100
  • Thumbnail Quality: 65
  • Thumbnails Per Row: 5
  • Thumbnail Color: #000000
  • Use Image Lightbox: Yes, click
  • Asset Manager - Enable: Yes, ajax upload by default
  • Asset Manager - Assets per Page: 20
  • Advanced Insert Image Popup - Enable: Yes

--------------- Added [DATE]1393992215[/DATE] at [TIME]1393992215[/TIME] ---------------

Ok, now there is something of weird...

Test 1: I tried to install a clean vBulletin 4.2.2 on my official server, using a new DB, after I installed it I tried to verify the inline trouble and that clean vBulletin have that trouble.

Test 2: I've a fresh installed local Virtual Machine with FreeBSD, like the official server, with about all package installed, I tried to installa a fresh vBulletin 4.2.2 but that installation have inline image trouble too...

Test 3: Fresh install of lastes stable Debian with Apache 2 (not Nginx as official server), than I've installed a fresh vBulletin 4.2.2 and... It goes! There isn't inline trouble!

After a fast debug I found similar errors on test 1 and 2:
Code:
Warning: preg_match() [function.preg-match]: Compilation failed: invalid range in character class at offset 23 in ..../includes/class_wysiwygparser.php on line 481
Than I tried to understand it and editing includes/class_wysiwygparser.php at 481 I find:
Code:
		if (preg_match('#attachment.php\?attachmentid=(\d+)#si', $img_url, $matches) AND preg_match('#class=(\'|"|)([a-z0-9_-\s]+)?\s*previewthumb\s*([a-z0-9_-\s]+)?(\\1)#si', $fullurl))
		{
			return '[ATTACH=CONFIG]' . $matches[1] . '[/ATTACH]';
		}
To test it I got the 2 variables ($img_url and $fullurl) and I make a file test.php
<?php
$img_url ='http://192.168.1.55/attachment.php?attachmentid=36&amp;stc=1';
$fullurl ='<img src="http://192.168.1.55/attachment.php?attachmentid=36&amp;stc=1" attachmentid="36" alt="" id="vbattach_36" class="previewthumb">';

if (preg_match('#attachment.php\?attachmentid=(\d+)#s i', $img_url, $matches) AND preg_match('#class=(\'|"|)([a-z0-9_-\s]+)?\s*previewthumb\s*([a-z0-9_-\s]+)?(\\1)#si', $fullurl))
{
echo "it's ok";
}
?>

If I run that file on freebsd server it give error:
Warning: preg_match(): Compilation failed: invalid range in character class at offset 23 in x.php on line 5

But if I run it on the Debian server it goes!
That's really strange, some suggest to fix it?
Reply With Quote
  #6  
Old 03-05-2014, 07:14 PM
RedFoxy's Avatar
RedFoxy RedFoxy is offline
 
Join Date: Sep 2007
Location: Italy
Posts: 179
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok I got it! PCRE 8.34 have a bug, it's all ok with PCRE 8.33
Reply With Quote
4 благодарности(ей) от:
Barcham, Lynne, RichieBoy67, tbworld
  #7  
Old 03-05-2014, 07:59 PM
Barcham Barcham is offline
 
Join Date: Jan 2014
Location: Montreal
Posts: 146
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Glad to see you got it worked out! :up:
Reply With Quote
  #8  
Old 03-06-2014, 02:11 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by RedFoxy View Post
Ok I got it! PCRE 8.34 have a bug, it's all ok with PCRE 8.33
Wow! That's quite interesting. Thank you so much for letting us know what was going on!
Reply With Quote
  #9  
Old 03-06-2014, 02:30 AM
tbworld tbworld is offline
 
Join Date: Oct 2008
Posts: 2,126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by RedFoxy View Post
Ok I got it! PCRE 8.34 have a bug, it's all ok with PCRE 8.33
Thanks for letting us know!

I am looking into the changelog for PCRE 8.34 against the expression to see what has changed. If it is not a bug, I will post a new updated expression. Great work!
Reply With Quote
  #10  
Old 03-20-2014, 09:24 PM
RedFoxy's Avatar
RedFoxy RedFoxy is offline
 
Join Date: Sep 2007
Location: Italy
Posts: 179
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok I fixed it, in the regex you must change _- with -_

Change:
Quote:
if (preg_match('#attachment.php\?attachmentid=(\d+)#s i', $img_url, $matches) AND preg_match('#class=(\'|"|)([a-z0-9_-\s]+)?\s*previewthumb\s*([a-z0-9_-\s]+)?(\\1)#si', $fullurl))
With:
Quote:
if (preg_match('#attachment.php\?attachmentid=(\d+)#s i', $img_url, $matches) AND preg_match('#class=(\'|"|)([-_a-z0-9\s]+)?\s*previewthumb\s*([-_a-z0-9\s]+)?(\\1)#si', $fullurl))
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:52 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06863 seconds
  • Memory Usage 2,270KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (4)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete