NineChime forum

Furry stuff, oekaki stuff, and other stuff.

You are not logged in.

#1 04-01-2007 16:12:17

Albel
Member

Way to Enable Lightbox2 for Thumbnail Viewing?

http://www.huddletogether.com/projects/lightbox2/

I assume this would be a relatively easy hack --- just needing to add the proper attributes to the image thumbnail.

If someone could show me what file creates the thumbnails/full image view, I could easily add this function in, and write up a post explaining how to do it step by step.

Offline

#2 04-06-2007 01:47:53

sfox8
Member

Re: Way to Enable Lightbox2 for Thumbnail Viewing?

i was wondering about this too. i never had the time to figure out how to do it but it would be a nice little addition. i don't know for sure but i thought picture saving was done in the functions file. or the picturesave file. I think its one of those.

Offline

#3 04-06-2007 18:27:28

Albel
Member

Re: Way to Enable Lightbox2 for Thumbnail Viewing?

All we need to do is find what creates the image links.

I think I *might* have found something in the index.php file...I'll mess around with it in a few days and see if I can get it to work. smile

Offline

#4 04-09-2007 03:53:20

Waccoon
Administrator

Re: Way to Enable Lightbox2 for Thumbnail Viewing?

Doesn't look too hard to support, actually.  It is a lot of code, though (150K+), and I'd have to make sure it won't interfere with the JavaScript already being used in the oekaki.  JavaScript tends to be very tempermental, so be on your toes.

The JavaScript files should be included in "header.php".  The thumbnail layout section in "index.php" is where the links should be made.  Obviously, only thumbnails have to be changed.  Images that are already shown at 100% size don't need to be changed, even though they are already linked so they pop-up in a new window.

Offline

#5 04-10-2007 07:15:17

Albel
Member

Re: Way to Enable Lightbox2 for Thumbnail Viewing?

I'll make a proper post in the "Mods" forum for this, but here's a simple explanation of how to do this...

1) Download Slimbox. This is basically the same thing as Lightbox2, but it requires FAR less JavaScript (slimbox.js is 7KB, and it doesn't need as many CSS images to run, like that 1x1 transparent pixel Lightbox2 needs.

2) Download the required mootools.

http://www.digitalia.be/software/slimbox wrote:

Slimbox 1.3 requires the mootools framework, version 1.0 or more recent. Because mootools is modular, you can make your download smaller by only downloading the modules your scripts are actually using. Here are the modules required by Slimbox:

    * Native: Array, String, Function, Element
    * Window: Window.Base, Window.Size
    * Effects: Fx.Style, Fx.Styles (optionally Fx.Transitions)

3) Add this...

Code:

<link rel="stylesheet" href="css/slimbox.css" type="text/css" media="screen" />
    
<script type="text/javascript" src="js/mootools.js"></script>
<script type="text/javascript" src="js/slimbox.js"></script>

...after the Oekaki stylesheet tag in the <head>...</head> tag.

4) Find...

Code:

        // Print image

...and replace the the code up till the EOF with this...

Code:

        // Print image
if ($adult_block_mode == 0) {
echo <<<EOF
            <a href="$master_image" rel="lightbox" title="Pic #{$outerrow['PIC_ID']}"><img src="$thumbnail_image" class="$img_class_type" {$scale_size} alt="Pic #{$outerrow['PIC_ID']}" /></a><br />

EOF;
} elseif ($adult_block_mode == 1) {
echo <<<EOF
            <a href="$master_image" rel="lightbox" title="Pic #{$outerrow['PIC_ID']}"><img src="{$cfg['res_path']}/{$cfg['porn_img']}" class="$img_class_type" alt="Pic #{$outerrow['PIC_ID']}" /></a><br />

EOF;
} else {
echo <<<EOF
            <img src="{$cfg['res_path']}/{$cfg['porn_img']}" alt="Pic #{$outerrow['PIC_ID']}" title="Pic #{$outerrow['PIC_ID']}" /><br />

EOF;

(If you want the "Next/Prev", just follow the instructions on the Slimbox website.)

SH's Oekaki <- In case anyone wanted to see how it worked.

Last edited by Albel (04-10-2007 19:10:39)

Offline

#6 04-10-2007 19:14:22

Albel
Member

Re: Way to Enable Lightbox2 for Thumbnail Viewing?

Code:

                // Print image
if ($adult_block_mode == 0) {
echo <<<EOF
            <a href="$master_image" rel="lightbox" title="{$outerrow['title']}"><img src="$thumbnail_image" class="$img_class_type" {$scale_size} alt="{$outerrow['title']}" /></a><br />

EOF;
} elseif ($adult_block_mode == 1) {
echo <<<EOF
            <a href="$master_image" rel="lightbox" title="{$outerrow['title']}"><img src="{$cfg['res_path']}/{$cfg['porn_img']}" class="$img_class_type" alt="{$outerrow['title']}" /></a><br />

EOF;
} else {
echo <<<EOF
            <img src="{$cfg['res_path']}/{$cfg['porn_img']}" alt="{$outerrow['title']}" title="{$outerrow['title']}" /><br />

EOF;

If you prefer to have the ALT and TITLE text take the title the artist gave it, instead of something like "Pic ID #202", use that code instead of the one in my previous post. This could even work to replace just the ALT text in a non-Slimbox Oekaki if you wanted. smile

Offline

#7 04-11-2007 03:22:36

Waccoon
Administrator

Re: Way to Enable Lightbox2 for Thumbnail Viewing?

Oh yeah, Slimbox is more like it.  MUCH smaller and fewer parts to go wrong.

I'll definately consider including this, though with faster transisions.

Offline

#8 04-11-2007 10:33:19

Pinkie
Member

Re: Way to Enable Lightbox2 for Thumbnail Viewing?

Thank you so much for this, I've been trying to include the lightbox script ages ago into my oekaki.

Offline

#9 04-13-2007 16:26:50

Albel
Member

Re: Way to Enable Lightbox2 for Thumbnail Viewing?

Pinkie wrote:

Thank you so much for this, I've been trying to include the lightbox script ages ago into my oekaki.

No problem. smile

Offline

#10 05-09-2007 09:18:20

Albel
Member

Re: Way to Enable Lightbox2 for Thumbnail Viewing?

MooTools 1.1 moves around some of the needed effects for this.

Window.Base is no longer available, but I'm pretty sure Element.Dimensions is the replacement. If someone could do some testing to see if this is the case, I would greatly appreciate it. smile

Offline

#11 08-02-2007 19:06:00

AlkseeyaKC
Member

Re: Way to Enable Lightbox2 for Thumbnail Viewing?

I was going to put this on my Oekaki. But Slimbox site seems to be down or something. Is there a way I can still get the download?

Offline

#12 08-02-2007 20:09:30

Albel
Member

Re: Way to Enable Lightbox2 for Thumbnail Viewing?

That's weird...it loads just fine for me.

BTW, all of the needed effects have been updated on Slimbox's website, in case anyone didn't know that.

Offline

#13 08-05-2007 23:10:45

AlkseeyaKC
Member

Re: Way to Enable Lightbox2 for Thumbnail Viewing?

The site must have been down that day or something. Its working now.

I was trying to do the codes But I'm having a hard time figure out were they go. I'm putting the first code into the header.php and the second code into the Index.php. But I keep getting this on my oekaki:

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/.quadraticsdryer/divagate/Oekamie.Divagate.com/index.php on line 376

I'm not sure what is going on. I drooped the Css, Js, and the Moottools.vl.ll.js files in the main area. I'm not sure if thats were they go.

Offline

#14 08-06-2007 15:59:02

Albel
Member

Re: Way to Enable Lightbox2 for Thumbnail Viewing?

Part of the issue is likely due to not having the CSS and JS files in the /css and /js folders.

That error sounds like you put the code in a wrong place. The PHP and HTML is probably merged together by accident, and your server is accidentally parsing HTML as PHP by accident due to that. Check your file(s) again, to make sure you didn't insert it in the wrong place.

Offline

#15 08-07-2007 06:34:31

Waccoon
Administrator

Re: Way to Enable Lightbox2 for Thumbnail Viewing?

T_ENCAPSED_AND_WHITESPACE

This is a PHP syntax error.  Most likely there's something in double quotes that is not terminated properly.

Note that anything following echo <<<EOF is HERE_DOCUMETNS syntax, and is treated as if it were double quoted.  Also note that keyed arrays such as $array['key'] must be delimited by curly brackets when encased in double quotes, like this: $stuff = "number: {$array['number']}";

Offline

#16 08-07-2007 13:32:11

AlkseeyaKC
Member

Re: Way to Enable Lightbox2 for Thumbnail Viewing?

I have no clue what is wrong or what Waccoon said. ^_^;;;
I really don't know CSS besides switching out images and colors.

Here are screen shots of that I have done. If you could point to whats wrong and how to fix it would be good for me.
http://s6.photobucket.com/albums/y212/A … cture2.png
http://s6.photobucket.com/albums/y212/A … cture3.png
http://s6.photobucket.com/albums/y212/A … cture4.png

If this ends up too much trouble I can not do it. Its ok with me. XD I don't want to trouble you guys to much. smile

Last edited by AlkseeyaKC (08-07-2007 13:33:31)

Offline

#17 08-08-2007 20:50:05

Nathal
New member

Re: Way to Enable Lightbox2 for Thumbnail Viewing?

Does this work for the “Wax Poteto” 5.6.0 version?

Love it btw.

Offline

#18 08-09-2007 07:37:36

Albel
Member

Re: Way to Enable Lightbox2 for Thumbnail Viewing?

It probably uses a similar structure. The includes for the CSS and JS should be universal, but you may have to poke around a little bit, in case the code that creates the thumbnails is different that how Wac does it.

Offline

#19 08-09-2007 18:41:15

Nathal
New member

Re: Way to Enable Lightbox2 for Thumbnail Viewing?

Alright, maybe time to get off my duff and see how to get it implemented. My daughter and her friends seem to like that version so maybe this will get me to learn this stuff.



Thanks all for everything.

Offline

#20 08-29-2007 17:52:25

acwitness
Member

Re: Way to Enable Lightbox2 for Thumbnail Viewing?

I love this! Has anyone gotten it to work on wax 5.6?

Offline

Board footer

Yep, still running PunBB
© Copyright 2002–2008 PunBB