Uutiset:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu
Advertisement:

Lightbox Mod?

Aloittaja Dumpling, lokakuu 22, 2007, 06:56:04 AP

« edellinen - seuraava »

Dumpling

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.

KGIII

How 'bout a link to more "lightbox" stuff so we can see what you mean?

My PC Support Forum
Please ask in-thread before PMing
                   SMF Help
                   Visit My Blog

How can we improve the support process?:
http://www.simplemachines.org/community/index.php?topic=163533.0

SMF vs. Godzilla? Who do you think will win?

Paracelsus

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

Oldiesmann

#3
I assume you're talking about Lightbox JS v2?

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).
Michael Eshom
Christian Metal Fans

KGIII

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?

My PC Support Forum
Please ask in-thread before PMing
                   SMF Help
                   Visit My Blog

How can we improve the support process?:
http://www.simplemachines.org/community/index.php?topic=163533.0

SMF vs. Godzilla? Who do you think will win?

Paracelsus

The benefit is just the beauty of the opening ;D ;D.

Dumpling

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 ;)


karlbenson

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.

Paracelsus

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/

Dumpling

:'( 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?

Paracelsus

// 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.

Yağız...

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)',
),

ALEJO

i still doesnt understand what is a "lightbox"... some one can explain?
solo el mas paranoico sobrevive

karlbenson

basically you have reduced/thumbnail size images on the page.

When you click the image it appears to float on the screen in fullsize.

ALEJO

ohhh thats so WEB 2.0 :P (thx for explain)
solo el mas paranoico sobrevive

karlbenson

yeah, its ajax/javascript.

The only thing that concerns me is some of the free ajax/javascript (under various licences) are not very secure.

grodo

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

karlbenson

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

grodo

#18
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".

karlbenson

#19
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

Advertisement: