Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Image Resize using Lytebox ( 3.6.x ) Details »»
Image Resize using Lytebox ( 3.6.x )
Version: 1.5, by Lost Heaven Lost Heaven is offline
Developer Last Online: Mar 2008 Show Printable Version Email this Page

Category: Forum Display Enhancements - Version: 3.6.8 Rating:
Released: 03-03-2008 Last Update: Never Installs: 53
Auto-Templates
Translations  
No support by the author.

This's simple hack for resize large images using Lytebox,also integration with vB attachments for vbb 3.6.x.You can find this mod for vbb 3.7.x at HERE.I used it on my forum http://Hoiquantinhoc.com and i didnt see any problem with it.Here you can see online demo
Here we go !

/////////////////////////////////////////////////////////////////////////
HISTORY
Ver 1.5
  • Using lytebox instead lightbox.
  • Fixed conflict javascripts.
Ver 1.0
  • First release.
/////////////////////////////////////////////////////////////////////////
INSTALLATION
  • Upload files from folder upload.
  • Import Product ImageResize_MK.xml
  • Edit file includes/class_bbcode.php,find
PHP Code:
return '<img src="' .  $link '" border="0" alt="" />'
Replace with
PHP Code:
return '<a target="_blank" href="' $link '" rel="lytebox"><img src="' $link '" border="0" alt="" /></a>'
Default max width available of images is 500px,you can change it in ACP => Image Resize Using Lytebox.

Show Your Support

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

Comments
  #22  
Old 03-20-2008, 03:43 PM
RedFoxy's Avatar
RedFoxy RedFoxy is offline
 
Join Date: Sep 2007
Location: Italy
Posts: 179
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Using the template mod with:

<a target="_blank" href="attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&amp;stc=1&amp;d=$attachment[dateline]" rel="lytebox">
<img class="attach" src="attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&amp;stc=1&amp;d=$attachment[dateline]" border="0" alt="" />&nbsp;</a>

that mod RULEZ!

Can I have the img in PSD or similar to translate it in italian?

Just a lil suggest, can you add a code to resize image that are linked and are more big then a specified size? to see it in full size just click on it to show it in Lytebox
Reply With Quote
  #23  
Old 03-20-2008, 04:42 PM
RedFoxy's Avatar
RedFoxy RedFoxy is offline
 
Join Date: Sep 2007
Location: Italy
Posts: 179
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok i do it!

Follow that instructions to enable the autoresieze of images that are linked directly:

follow that instructions ONLY AFTER installed "Image Resize using Lytebox" and edit file includes/class_bbcode.php

Edit file clientscript/lytebox.js and ADD at end of file:
Code:
/*

   "RedFoxy Resize Image" based on "Resize Avatars Based on Max Width and Height" for phpBB (c) Christian Fecteau 2005

	WebSite:	http://www.redfoxy.it
				http://www.forum.redfoxy.it
				http://www.softairmania.it

	Original Credits must be given with my full name (Christian Fecteau)
	and a link to my portfolio: http://portfolio.christianfecteau.com/

	Removal or alteration of this notice is strongly prohibited.

*/

function rfrs_im(rfrs_obj, rfrs_max_width, rfrs_max_height)
{
	if (!document.getElementsByTagName || !document.createElement)
	{
		return;
	}
	var rfrs_real_width = rfrs_real_height = rfrs_offset_width = rfrs_offset_height = false;
	if (rfrs_obj.width && rfrs_obj.height)
	{
		rfrs_real_width = rfrs_obj.width;
		rfrs_real_height = rfrs_obj.height;
	}
	if (!rfrs_real_width || isNaN(rfrs_real_width) || (rfrs_real_width <= 0) || !rfrs_real_height || isNaN(rfrs_real_height) || (rfrs_real_height <= 0))
	{
		var rfrs_rand1 = String(rfrs_count++);
		eval("rfrs_retry" + rfrs_rand1 + " = rfrs_obj;");
		eval("rfrs_x" + rfrs_rand1 + " = rfrs_max_width;");
		eval("rfrs_y" + rfrs_rand1 + " = rfrs_max_height;");
		eval("window.setTimeout('rfrs_img_loaded(rfrs_retry" + rfrs_rand1 + ",rfrs_x" + rfrs_rand1 + ",rfrs_y" + rfrs_rand1 + ")',1000);");
		return;
	}
	if (rfrs_real_width > rfrs_max_width)          { rfrs_offset_width = rfrs_real_width - rfrs_max_width; }
	if (rfrs_real_height > rfrs_max_height)        { rfrs_offset_height = rfrs_real_height - rfrs_max_height; }
	if (!rfrs_offset_width && !rfrs_offset_height) { return; }

	if (rfrs_offset_width > rfrs_offset_height)
	{
		rfrs_obj.style.width = String(rfrs_max_width) + 'px';
		document.all ? rfrs_obj.style.cursor = 'hand' : rfrs_obj.style.cursor = 'pointer';
	}
	else
	{
		rfrs_obj.style.height = String(rfrs_max_height) + 'px';
		document.all ? rfrs_obj.style.cursor = 'hand' : rfrs_obj.style.cursor = 'pointer';
	}
}
Edit file includes/class_bbcode.php and find:
Code:
return '<a target="_blank" href="' . $link . '" rel="lytebox"><img src="' . $link . '" border="0" alt="" /></a>';
Replace with:
Code:
return '<a target="_blank" href="' . $link . '" rel="lytebox"><img onload="rfrs(this, 200, 200)" src="' . $link . '" border="0" alt="" /></a>';
Save all

Note: to change max width and max height for resize, just change the value in includes/class_bbcode.php at rfrs(this, 200, 200)
Reply With Quote
  #24  
Old 03-20-2008, 05:00 PM
RedFoxy's Avatar
RedFoxy RedFoxy is offline
 
Join Date: Sep 2007
Location: Italy
Posts: 179
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

sorry... i do an useless work...

BTW i see that if i've an image with a link, the link doesn't goes anymore

Like i've:
[ url=http://www.domain.com/my/home/page.html][img ]http://www.domain.com/img.jpg[/img][/url]

with that plugin that link is replaced with the Lytebox link
Reply With Quote
  #25  
Old 03-28-2008, 09:41 PM
Michael Biddle Michael Biddle is offline
 
Join Date: Apr 2004
Location: Anaheim, CA
Posts: 774
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have a problem with this modification on a clients website. If I have it on, it alters a gif that I manually placed into his postbit template for an ad after the first post. Any ideas on a way around this?
Reply With Quote
  #26  
Old 04-03-2008, 04:23 PM
jiggle jiggle is offline
 
Join Date: Jan 2002
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I noticed, that this isn't working for me with IE6 ? Only in Firefox, Opera and IE7. Also my users have the same problem with the IE6. Can someone confirm that this is not running with IE6 ? Someone knows a solution for this ??
Reply With Quote
  #27  
Old 04-05-2008, 12:21 AM
Walter Ronny Walter Ronny is offline
 
Join Date: Apr 2008
Posts: 47
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

works great, maybe little slow but works! and looks good!
Reply With Quote
  #28  
Old 04-06-2008, 02:03 PM
scatro scatro is offline
 
Join Date: Sep 2007
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks is this very beatiful hacks
Reply With Quote
  #29  
Old 04-08-2008, 05:42 PM
jiggle jiggle is offline
 
Join Date: Jan 2002
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No one has Problems with IE6 ? For me it does not resize the images, but adds the link on the image and I also can click on it and it shows again the image in original size.
Reply With Quote
  #30  
Old 04-09-2008, 06:59 AM
ovnnet ovnnet is offline
 
Join Date: Nov 2007
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

@Lost Heaven: Demo gì mà die vậy trời? Chơi vbseo bản quyền ko vậy? hehe

This mod quite good.
Reply With Quote
  #31  
Old 04-20-2008, 03:41 AM
ericmaslowski ericmaslowski is offline
 
Join Date: Sep 2007
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

very nice mod. Is there a way to show the fullsize image (not resized by this mod) if the user uses the [ATTACH] tags? Otherwise, this mod is perfect.
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 09:00 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.10512 seconds
  • Memory Usage 2,312KB
  • 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
  • (3)bbcode_code
  • (2)bbcode_php
  • (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