The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Big Picture messing up your design? Install this Details »» | |||||||||||||||||||||||||||
Big Picture messing up your design? Install this
Developer Last Online: Oct 2004
What does this hack do?
This hack will check if an image that a member of your forums has inserted in the post is below the allowable width. If not, the image will be replaced with a small button that basicly says "Image too big, click here to view". When clicked, the image will appear right in the post but without messing up your forum design one bit. Example? Working example can be found here: http://www.designworldwide.com/forum/t35-s.html (note: This is on VB2 but should have the same effect. If you installed it on Vb3, send me a link so I can post it here) VB2 thread if anyone wants it: https://vborg.vbsupport.ru/showthread.php?t=63429 Please post any bugs/comments/questions here. While making this hack I had some trouble with reg. expressions and had to go around them a little (php developers can see this). Ive been coding for years now but never had the need to learn those Image: https://vborg.vbsupport.ru/showthrea...725#post495725 (Image now included in ZIP) Anyways, Enjoy! Dimitry Show Your Support
|
Comments |
#47
|
|||
|
|||
Hi,
I just installed it, but vB 3.5.4 looks a little bit different. I had to change the code in includes/class_bbcode.php. The exact code that has to be replaced it there, but when trying to add a new thread I'm forwarded to an empty page. Any idea about it'll work with vB 3.5.4? Sven |
#48
|
|||
|
|||
Dimitrix, I am using this hack and even though it works as it should (I have modified it to suite my needs), I am still occasionally running in the need for a delay. It happens only when there are too many missing pictures in a post.
Could you please let me know on how you implemented the delay you mentioned here: https://vborg.vbsupport.ru/showpost....1&postcount=27 |
#49
|
|||
|
|||
A friend of mine sent me this code that invision users can use to resize images inline (images hosted elsewhere obviously).
Is there ANY way we can get this to work as a custom bb code for vbulletin? I don't understand the code, but I'm sure someone with more coding skills can figure it out. Here's the code: Code:
<!--=== *** START RESIZED IMG *** ===--> <script> tds=document.getElementsByTagName("td"); for (p=0; p<tds.length; p++) { if (tds[p].className.match(/post[0-4]/i)!=null) { tds[p].innerHTML=tds[p].innerHTML.replace(/\[img=([0-9]+?(?x|%)?),([0-9]+?(?x|%)?)\](.*?)\[\/img\]/ig,"<img src='$3' width='$1' height='$2' style='display:inline'>"); } } </script> <!--=== *** END RESIZED IMG *** ===--> |
#50
|
|||
|
|||
I am running vB 3.0.14, so I know this works in that version, I am not sure how 3.5 or 3.6 differ from the older versions, but here is a simpler method to handle this issue.
In your functions_bbcodeparse.php file, find this: Code:
function handle_bbcode_img_match($link) Code:
function handle_bbcode_img_match($link) { $img_max_width = 800; // <-- This is the maximum width that an image is allowed to be viewed safely. $img_max_height = 600; // <-- This is the maximum height that an image is allowed to be viewed safely. $link = strip_smilies(str_replace('\\"', '"', $link)); // remove double spaces -- fixes issues with wordwrap $link = str_replace(' ', '', $link); if ($imginfo=@getimagesize($link)) { if (($imginfo[0] > $imginfo[1] and ($imginfo[0] > $img_max_width or $imginfo[1] > $img_max_height)) or ($imginfo[0] < $imginfo[1] and ($imginfo[1] > $img_max_width or $imginfo[0] > $img_max_height)) or ($imginfo[0] == $imginfo[1] and ($imginfo[0] * $imginfo[1] > $img_max_width * $img_max_height))) { $inp_string="<a href=\"$link\" target=\"_blank\"><img src=\"images/misc/toobigimage.gif\" border=\"0\" alt=\"\"></A>"; return $inp_string; } else { return '<img src="' . $link . '" border="0" alt="" />'; } } else { if (!$allowimgsizefailure) { $inp_string="<img src='images/misc/notexistimage.gif'>"; return $inp_string; } } } You need to create two small images, as shown here: and Put these images in your images/misc directory and you are done. |
#51
|
|||
|
|||
Well after we run the above for a while, the delay it imposes on a page full of images make it undesirable.
I came up with a hack to check the images size during the posting of a message. If one image is larger than the specified file, then the message is not posted and an error is shown. If someone is interested, I can post it as a new hack, but since this is for vB 3.0.xx I am not sure if there is any interest. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|