Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Mod Requests => Aiheen aloitti: Dumpling - lokakuu 22, 2007, 06:56:04 AP

Otsikko: Lightbox Mod?
Kirjoitti: Dumpling - lokakuu 22, 2007, 06:56:04 AP
Hi,

I'm sorry if someone has already requested for or asked about a Lightbox mod. I've already tried searching for "lightbox" in the forum, but couldn't find anything useful. The Mod Site doesn't have a lightbox mod.

If a "lightbox mod" is not necessary, then how can I implement Lightbox into SMF? I'm currently using SMF 1.1.4 (with quite a few mods installed). How would I set up the BB Codes and/or "button"?

Thanks in advance. :) Any help would be much much much appreciated.
Otsikko: Re: Lightbox Mod?
Kirjoitti: KGIII - lokakuu 22, 2007, 04:01:10 IP
How 'bout a link to more "lightbox" stuff so we can see what you mean?
Otsikko: Re: Lightbox Mod?
Kirjoitti: Paracelsus - lokakuu 22, 2007, 04:12:15 IP
I've installed Lightbox in my forum (the one on the signature ;)) and after that changed it to Slimbox to be lighter... but just on the attached images.

It's not that difficult... you just have to put the script they give you in index.template.php and put rel="lightbox" in the link that is created in Display.template.php.

I can give you a direct link for you to see it:
http://www.forumscp.com/index.php?topic=6900.msg231153#msg231153 (http://www.forumscp.com/index.php?topic=6900.msg231153#msg231153)
Otsikko: Re: Lightbox Mod?
Kirjoitti: Oldiesmann - lokakuu 22, 2007, 04:31:28 IP
I assume you're talking about Lightbox JS v2 (http://www.huddletogether.com/projects/lightbox2/)?

I'm going to be implementing that in the form of a bbcode tag in the next version of my SMF+G2 bridge and do plan to release it as a separate mod as well (assuming it works the way I want it to).
Otsikko: Re: Lightbox Mod?
Kirjoitti: KGIII - lokakuu 22, 2007, 05:13:23 IP
This is just a personal request/question - does anyone have a site that where this is used that will give me a good understanding of the benefits?
Otsikko: Re: Lightbox Mod?
Kirjoitti: Paracelsus - lokakuu 22, 2007, 05:57:59 IP
The benefit is just the beauty of the opening ;D ;D.
Otsikko: Re: Lightbox Mod?
Kirjoitti: Dumpling - lokakuu 25, 2007, 02:44:36 AP
Wow! Thanks for all the great response, everyone! :)

I don't allow attachments on my forum. :P

I think I have an idea about how to implement Lightbox into SMF. Thanks Paracelsus :D

Can't wait to see your mod, Oldiesmann ;)

Otsikko: Re: Lightbox Mod?
Kirjoitti: karlbenson - lokakuu 25, 2007, 12:22:29 IP
This is like Greybox and the other ones.

If Oldiesmann doesn't managed to package it into a mod. I'll have a go at this.
I have been trying unsuccessfully to get Greybox working with smf.
Otsikko: Re: Lightbox Mod?
Kirjoitti: Paracelsus - lokakuu 25, 2007, 01:06:53 IP
Actually I have to see if I'm going to continue with Slimbox or change to Lightbox... although Lightbox is pretty heavier, I would like to try the jQuery for the "Forum Spy" thing for the recent forum posts (I think mootools still doesn't have it :():

http://leftlogic.com/lounge/articles/jquery_spy2/ (http://leftlogic.com/lounge/articles/jquery_spy2/)
Otsikko: Re: Lightbox Mod?
Kirjoitti: Dumpling - lokakuu 25, 2007, 09:30:10 IP
:'( BooHooHoo. Attempt failed.

I put the given script into index.template.php, but I don't know where to put rel="lightbox" in Display.template.php

Where did you put yours, Paracelsus?
Otsikko: Re: Lightbox Mod?
Kirjoitti: Paracelsus - lokakuu 26, 2007, 02:21:35 AP
// Assuming there are attachments...
if (!empty($message['attachment']))
{
echo '<hr width="100%" size="1" class="hrcolor" /><div style="overflow: auto; width: 100%;">';
foreach ($message['attachment'] as $attachment)
{
if ($attachment['is_image'])
{
if ($attachment['thumbnail']['has_thumb'])
echo '<a href="', $attachment['href'], ';image" id="link_', $attachment['id'], '" onclick="', $attachment['thumbnail']['javascript'], '"><img src="', $attachment['thumbnail']['href'], '" alt="" id="thumb_', $attachment['id'], '" border="0" /></a><br />';


Try to put it somewhere in the generated link for thumbnails... before the id="link_', $attachment['id'] for example.
Otsikko: Re: Lightbox Mod?
Kirjoitti: Yağız... - lokakuu 26, 2007, 01:17:03 IP
Search in Sources/Subs.php
array(
'tag' => 'img',
'type' => 'unparsed_content',
'parameters' => array(
'alt' => array('optional' => true),
'width' => array('optional' => true, 'value' => ' width="$1"', 'match' => '(\d+)'),
'height' => array('optional' => true, 'value' => ' height="$1"', 'match' => '(\d+)'),
),
'content' => '<img src="$1" alt="{alt}"{width}{height} border="0" />',
'validate' => create_function('&$tag, &$data, $disabled', '$data = strtr($data, array(\'<br />\' => \'\'));'),
'disabled_content' => '($1)',
),
array(
'tag' => 'img',
'type' => 'unparsed_content',
'content' => '<img src="$1" alt="" border="0" />',
'validate' => create_function('&$tag, &$data, $disabled', '$data = strtr($data, array(\'<br />\' => \'\'));'),
'disabled_content' => '($1)',
),

Change with this:
array(
'tag' => 'img',
'type' => 'unparsed_content',
'parameters' => array(
'alt' => array('optional' => true),
'width' => array('optional' => true, 'value' => ' width="$1"', 'match' => '(\d+)'),
'height' => array('optional' => true, 'value' => ' height="$1"', 'match' => '(\d+)'),
),
'content' => '<a href="$1" rel="lightbox"><img src="$1" alt="{alt}"{width}{height} border="0" /></a>',
'validate' => create_function('&$tag, &$data, $disabled', '$data = strtr($data, array(\'<br />\' => \'\'));'),
'disabled_content' => '($1)',
),
array(
'tag' => 'img',
'type' => 'unparsed_content',
'content' => '<a href="$1" rel="lightbox"><img src="$1" alt="" border="0" /></a>',
'validate' => create_function('&$tag, &$data, $disabled', '$data = strtr($data, array(\'<br />\' => \'\'));'),
'disabled_content' => '($1)',
),
Otsikko: Re: Lightbox Mod?
Kirjoitti: ALEJO - lokakuu 27, 2007, 06:13:36 IP
i still doesnt understand what is a "lightbox"... some one can explain?
Otsikko: Re: Lightbox Mod?
Kirjoitti: karlbenson - lokakuu 27, 2007, 06:15:50 IP
basically you have reduced/thumbnail size images on the page.

When you click the image it appears to float on the screen in fullsize.
Otsikko: Re: Lightbox Mod?
Kirjoitti: ALEJO - lokakuu 27, 2007, 06:20:14 IP
ohhh thats so WEB 2.0 :P (thx for explain)
Otsikko: Re: Lightbox Mod?
Kirjoitti: karlbenson - lokakuu 27, 2007, 06:31:44 IP
yeah, its ajax/javascript.

The only thing that concerns me is some of the free ajax/javascript (under various licences) are not very secure.
Otsikko: Re: Lightbox Mod?
Kirjoitti: grodo - marraskuu 28, 2007, 05:46:04 IP
I would like to code a mod for smf that I just like light box however, I do not know how to detect attachments.  Meaning the code to make it bigger is just a standard javascript div.  I will make this mod distributable for both commerical and non comerical
Otsikko: Re: Lightbox Mod?
Kirjoitti: karlbenson - marraskuu 28, 2007, 06:01:04 IP
Recently i have submitted a mod to integrate lightbox 2 into smf for attachments and posted images.

However it has not yet been approved, so it is not possible to download.
http://custom.simplemachines.org/mods/index.php?mod=1019
Otsikko: Re: Lightbox Mod?
Kirjoitti: grodo - marraskuu 28, 2007, 06:14:17 IP
hmmmm.... My version would allow commercial use for free :-P  Also the lightbox code that is used, is actually not coded by the author :x It was ripped from dynamic drive (all he did was just add the animation effect).  The code was all "free-use".
Otsikko: Re: Lightbox Mod?
Kirjoitti: karlbenson - marraskuu 28, 2007, 06:31:04 IP
My mod will allow free commercial use under the Creative Commons ATTRIBUTION license.

http://creativecommons.org/licenses/by/2.5/
http://creativecommons.org/licenses/by/2.5/legalcode
Otsikko: Re: Lightbox Mod?
Kirjoitti: grodo - marraskuu 28, 2007, 06:36:31 IP
Ok fine you win.....  LOL  Happy?  I just tried to contribute.... You shattered my dreams!  I just wanted to be a hero.