PDA

View Full Version : index.php lightbox and overlib modification


bert
12-25-2006, 08:23 PM
Hi, I am new her.. A week ago I discovered pixelpost and since then I am playing around with it. Already did a lot of reading in the forum and wiki and solved many things with the thing I read. Thanks to all contributors!

My site I have now is an album site (the marginal hacks album script) and I wanted my pixelpost site also to be categorized so I concentrated on the browse page and the <CATEGORY_LINKS_AS_LIST> tag. but also wanted to stay in this page for viewing the images and show the image notes under eacht thumbnail so I found out about lightbox and overlib and managed to get something working.

so I hacked the index.php

first thing I had to do was to add the $body to the mysql query because I could get it working with <IMAGE_NOTES> or <IMAGE_NOTES_CLEAN> or $image_notes. did this where the query is used to create the $thumb_output .

//******string body toegevoegd - string body added

while(list($count,$id,$title,$name,$datetime,$body ) = mysql_fetch_row($query))

//*********definitie voor overlib toegevoegd-defined a overlib string

$overlib="onmouseover=\"return overlib('$title<br><br>$body',REF, '$name', REFC, 'LL', REFP, 'UL', NOJUSTY, REFX, -5, REFY, 2, WIDTH, 124, HEIGHT, 128, STICKY, TEXTPADDING, 7);\" onmouseout=\"nd();\"";


//*******rel='lightbox' en overlib string aan thumbnail output toegevoegd - added lightbox and overlib to thumbnail output

$thumb_output .= "<a href='images/$name' rel='lightbox' title='' $overlib onfocus='this.blur()'><img src='$thumbnail' name='$name' alt='$title' title='' class='thumbnails'/></a>";

Finally I got this working..after a lot of work because I am a php beginner
well working..first the overlib notes showed only up when browsing the 'ALL' category.. so I struggled some more and found two other ocassions where I had to add the 'body' part in this part

// Modified from Mark Lewin's hack for multiple categories
// ***** body als zoekveld toegevoegd, body added to search

$query = mysql_query("SELECT 1,t2.id,headline,image,datetime,body

so now it works in all categories. you can see it working on my blog.

www.bertsimons.nl/blog

one detail to solve..
lightbox uses the title argument <a href='images/$name' rel='lightbox' title=''.....
to retrieve the text to display. I left it blank because otherwise I have the standard tooltip appearing together with the overlib tooltip.

Is there a solution to disable the browsers standard tooltip?

otherwise I will try to get the image notes under the full size images with a second overlib command on a mouseover on the full size image.

okay.. thats enough for my first post. don't be to critic on my messy coding..

Dennis
12-26-2006, 01:30 PM
Interesting... but why not use an addon for this? The release of 1.6 is quite near and requires the hacking again. That's why we 'invented' addons.

bert
12-26-2006, 06:46 PM
would be better indeed but just haven't looked into this part of pixelpost yet..actually till last week I never used css so it maybe just a matter of time