Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Big Picture messing up your design? Install this Details »»
Big Picture messing up your design? Install this
Version: 1.00, by Dimitrix Dimitrix is offline
Developer Last Online: Oct 2004 Show Printable Version Email this Page

Version: 3.0.0 Rating:
Released: 04-04-2004 Last Update: Never Installs: 21
 
No support by the author.

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

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #32  
Old 04-17-2004, 04:37 PM
vau7 vau7 is offline
 
Join Date: Mar 2004
Posts: 199
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks, i think it works!
Reply With Quote
  #33  
Old 04-17-2004, 09:20 PM
mikeee mikeee is offline
 
Join Date: Dec 2002
Posts: 23
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can anyone tell me why this doesnt work on my board? The install is quite simple, I double checked everything and it is installed correctly on my VB3

I am not getting any java error, no board error, it's as if I never modified anything. Any ideas? :ermm:
Reply With Quote
  #34  
Old 05-16-2004, 06:19 PM
mtha's Avatar
mtha mtha is offline
 
Join Date: Jul 2002
Location: US
Posts: 775
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Raimund
to check if the file/image exists, replace the following in functions_bbcodeparse.php
Code:
...
	$image= ($link);
 
	if (@fclose(@fopen("$image", "r"))) { 
	$img_width = getimagesize($link);
...
	}
Raimund
this is nice, but I run into another problem. My member sometime post WRONG images, they post html links as image something like [img]http://w.w.w/a.html[/img]
which would give errors:
"Unable to add cookies, header already sent..."
and
"Warning: getimagesize(): stream does not support seeking ..."

how should I check if the link IS image (based on image extension?), before checking if it exist?

should I use
$ext = strrchr($image, ".");
or use
exif_imagetype("$image")
or something else?
Reply With Quote
  #35  
Old 05-18-2004, 12:56 PM
alkahf alkahf is offline
 
Join Date: Mar 2004
Location: Moscow
Posts: 49
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello
Quote:
Originally Posted by Raimund
to check if the file/image exists, replace the following in functions_bbcodeparse.php
with

Code:
// ###################### Start handle_bbcode_img_match #######################
// this is only called by handle_bbcode_img
function handle_bbcode_img_match($link)
{
	// IMPORTANT - REPLACE THE FOLLOWING 3 VARIALBS WITH YOUR INFORMATION
	$img_replacement = "images/buttons/imagebig.gif"; // <-- This is the button/image that will be displayed instead of the big image.
	$img_replacement2 = "images/buttons/imagenotexist.gif"; // <-- This is the button/image that will be displayed if file does not exist.
	$img_max_width = 640; // <-- This is the maximum width 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);
	$image= ($link);

	if (@fclose(@fopen("$image", "r"))) { 
	$img_width = getimagesize($link);
	if ($img_width[0] > $img_max_width) {
		srand((double)microtime()*1000000);
		$number = rand(10,100);

		$inp_string = "<a href=\"javascript:toggle_imgview('bigimg".$number."')\"><img src=\"".$img_replacement."\" alt=\"\" border=\"0\" /></a><br />\n";
		$inp_string .= "<div style=\"position:absolute;display:none;z-index:1;\" id=\"bigimg".$number."\"><img src=\"".$link."\" border=\"0\" alt=\"\" /></div>";

		return $inp_string;
		
		} else return '<img src="' .  $link . '" border="0" alt="" />';
 	} else { 
		return '<img src="' .  $img_replacement2 . '" border="0" alt="" />';
 	}
}
Raimund

What about these errors?

Code:
Warning: getimagesize(): stream does not support seeking in /home/client/public_html/vb/includes/functions_bbcodeparse.php on line 1023

Warning: getimagesize(): stream does not support seeking in /home/client/public_html/vb/includes/functions_bbcodeparse.php on line 1023

Warning: getimagesize(): stream does not support seeking in /home/client/public_html/vb/includes/functions_bbcodeparse.php on line 1023

Warning: getimagesize(): stream does not support seeking in /home/client/public_html/vb/includes/functions_bbcodeparse.php on line 1023
Thank you
alkahf
Reply With Quote
  #36  
Old 05-24-2004, 04:13 AM
WEForums WEForums is offline
 
Join Date: Apr 2003
Location: Jacksonville, Florida
Posts: 195
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed this and got errors galore. I'm guessing it has to do with my server, though.

What is required?

(I'd post the errors but there were so many that I had to fix it immediately. I'll post them later if you're interested)
Reply With Quote
  #37  
Old 06-16-2004, 05:06 PM
marcjd marcjd is offline
 
Join Date: Jan 2003
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It would be nice to have a feature like this for signatures. I want to allow the use of the image tag in sigs., but would also like to control the size of the displayed image. Thanks.
Reply With Quote
  #38  
Old 06-26-2004, 06:41 PM
Sir_Yaro's Avatar
Sir_Yaro Sir_Yaro is offline
 
Join Date: Jun 2004
Location: Ireland
Posts: 98
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Raimund
to check if the file/image exists, replace the following in functions_bbcodeparse.php

Code:
// ###################### Start handle_bbcode_img_match #######################
// this is only called by handle_bbcode_img
function handle_bbcode_img_match($link)
{
	// IMPORTANT - REPLACE THE FOLLOWING 3 VARIALBS WITH YOUR INFORMATION
	$img_replacement = "images/buttons/imagebig.gif"; // <-- This is the button/image that will be displayed instead of the big image.
	$img_replacement2 = "images/buttons/imagenotexist.gif"; // <-- This is the button/image that will be displayed if file does not exist.
	$img_max_width = 640; // <-- This is the maximum width 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);
	$image= ($link);

	if (@fclose(@fopen("$image", "r"))) { 
	$img_width = getimagesize($link);
	if ($img_width[0] > $img_max_width) {
		srand((double)microtime()*1000000);
		$number = rand(10,100);

		$inp_string = "<a href=\"javascript:toggle_imgview('bigimg".$number."')\"><img src=\"".$img_replacement."\" alt=\"\" border=\"0\" /></a><br />\n";
		$inp_string .= "<div style=\"position:absolute;display:none;z-index:1;\" id=\"bigimg".$number."\"><img src=\"".$link."\" border=\"0\" alt=\"\" /></div>";

		return $inp_string;
		
		} else return '<img src="' .  $link . '" border="0" alt="" />';
 	} else { 
		return '<img src="' .  $img_replacement2 . '" border="0" alt="" />';
 	}
}
Raimund
after this modyfication i can see right pictures but after clicking on them nothing is happening
Reply With Quote
  #39  
Old 06-27-2004, 03:26 PM
NuclioN's Avatar
NuclioN NuclioN is offline
 
Join Date: Aug 2002
Posts: 955
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It shows the image correct but text under the image is underlined a behaves as a link. (??)
Reply With Quote
  #40  
Old 06-28-2004, 08:53 AM
Sir_Yaro's Avatar
Sir_Yaro Sir_Yaro is offline
 
Join Date: Jun 2004
Location: Ireland
Posts: 98
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<a href="http://justget.org/showpost.php?p=102313&postcount=18" target="_blank">http://justget.org/showpost.php?p=102313&postcount=18</a>
Reply With Quote
  #41  
Old 07-13-2004, 11:53 PM
jugo jugo is offline
 
Join Date: Feb 2004
Location: Reading your emails.
Posts: 573
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by tnguy3n
interesting, but does it work for images that link from other servers?

YES.....BUT READ THIS:

If the image is not found on the remote host wether it be that the image was deleted or the host no longer responds, 2 things happen:

1. The thread takes forever to load.
2. It errors out and it does not display the thread.

I tried to get the correct error in here but while trying to get the error to display I lost my patience and put my mouse through my monitor.

I just got back from CompUSA (sale on 19inch monitors by the way...good deals)....and I was not going to risk losing it again.

P.S. the mouse survived.
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 12:40 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.09047 seconds
  • Memory Usage 2,309KB
  • Queries Executed 25 (?)
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
  • (4)bbcode_code
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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_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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete