WPG2 and LightBox problems

torchbone
torchbone's picture

Joined: 2007-03-11
Posts: 16
Posted: Mon, 2008-07-28 17:42

I'm having problems getting WPG2 to work. Questions:

1) Lightbox doesn't seem to work at all. Thumbnails link to a full-size image in a page of its own. I am using the G2 menu button > insert "Thumbnail with LightBox link..." assume this is correct, but couldn't seem to find a step-by-step instruction (I did try...)

2) If I hit "back" from trying to view an image I sometimes briefly see a "cannot be displayed, because the... contains errors"

3) Links still have a "g2_GALLERYSID=TMP_SESSION_ID_DI_NOISSES_PMT" in them, even though I've put a / in the cookies path in Gallery2.

4) Cosmetically I think I'd like to have the shadow frame AND the LightBox link, but it seems I either use "WPG2 tag of image" (and get the shadow) OR "Lightbox" and no shadow... is this correct?

Notes:

-I've put in the Gallery paths and validated WPG2 successfully.
-I have added a / to the Cookies Path in my Gallery2 Site admin.
-I've turned on Lightbox options (I do note that my LightBox option screen looks different than in the Wiki documentation; I have much fewer options).
-I have recently upgraded to the newest versions of WordPress, Gallery2, and the WPG2 plugin.
-I've cleared browser cache and cookies.

Site:
http://journal.nomadicfrog.com

The items in the first (TEST) post are what I'm trying to get to work (the other posts are old and without any of the WPG2 stuff).

Thanks for any pointers. Hope I'm in the right place and have provided enough information.

-Mark

Gallery version = 2.2.5 core 1.2.0.7
PHP version = 5.2.5 cgi-fcgi
Webserver = Apache
Database = mysqlt 5.0.45-log, lock.system=flock
Toolkits = Gd, ImageMagick, Exif, ArchiveUpload, LinkItemToolkit, Getid3, Thumbnail
Acceleration = full/900, none/900
Operating system = Linux linhost127.prod.mesa1.secureserver.net 2.4.21-53.ELsmp #1 SMP Wed Nov 14 03:54:12 EST 2007 i686
Default theme = carbon
gettext = enabled
Locale = en_US
Browser = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1
Rows in GalleryAccessMap table = 5308
Rows in GalleryAccessSubscriberMap table = 8090
Rows in GalleryUser table = 3
Rows in GalleryItem table = 8053
Rows in GalleryAlbumItem table = 251
Rows in GalleryCacheMap table = 104

 
ozgreg
ozgreg's picture

Joined: 2003-10-18
Posts: 1378
Posted: Mon, 2008-07-28 23:16

torchbone,

In a totally random order :-)

You have a number of JS already running on your site which most likely could be stopping Slimbox from firing. Please have a read of this thread.

The lack of Shadow frame will be caused by the CSS Stylesheet in the Wordpress Theme you are using, I have lightbox and image frames without any issues (you can test this by switching back to the Wordpress Default theme and you should have a shadow effect then)

The TMP_SESSION_ID_DI_NOISSES_PMT is a security feature of Gallery2 appended to the URL when Gallery2 cannot find an existing Session which will happen in certain cases (session expiration, accessing the website as guest then logging in etc) WPG2 will stop this from happening on existing sessions but a newly created embedded session will always have this..

____________________________________
Wordpress / Gallery2 (WPG2) Plugin, , WPG2 Documentation, WPG2 Demo

 
OzDamian

Joined: 2008-04-30
Posts: 35
Posted: Tue, 2008-07-29 02:45

What I would do:
Install the slimbox plugin for wordpress http://wordpress.org/extend/plugins/slimbox-plugin/
Activate it. (no need to do any other steps as in the readme file in the slimbox-plugin folder), go to wp dashboard / wgp2 / lightbox and set "yes" to the options you want
check to see if every thing is working for you

In My Opinion Only:
Slimbox is much faster than lightbox
Using the plugin will make it easier to check your version and keep up to date via the plugins page in wp admin

 
torchbone
torchbone's picture

Joined: 2007-03-11
Posts: 16
Posted: Tue, 2008-07-29 08:09

Hi! Thank you both for your quick responses!

Quote:
You have a number of JS already running on your site which most likely could be stopping Slimbox from firing.

Apologies in advance for being a JS noob. </disclaimer>

ozgreg, after you mentioned this I looked at the source, and while I did see a lot of JS lines in the header, I did not see anything about lightbox or slimbox! Should I?

To follow on your idea, though, I tried making a clean simple page just calling the lightbox script and an image, and it doesn't work either:

<HTML>
<HEAD>
<script type="text/javascript" src="http://www.nomadicfrog.com/journal/wp-content/plugins/wpg2/js/lightbox.js"></script>
</HEAD>
<BODY>
<a href="http://www.nomadicfrog.com/portfolio/main.php?g2_view=core.DownloadItem&g2_itemId=8785" rel="lightbox" title="my caption">image #1</a>
</BODY>
</HTML>

I tried to mimic other JS calls, but perhaps I didn't do it correctly. If I did, though, this tells me that it's not a conflict with other JS, but rather something wrong with the plugin itself?

I'll worry about the shadow frame later - thanks for the explanation, I think I can figure that out. And if I understand your final point, I can ignore the TMP_SESSION... stuff.

OzDamian: I have now installed Slimbox and activated it.... and... let me double check that before I say something stupid... NO! It wasn't activated. Apparently Plugin Central installs but does not activate, and I didn't notice.

I activated the plugin and everything works!

I know I could have deleted most of this post and just replied "Installing the Slimbox plugin fixed it", but I do have the feeling that there is something else wrong that I should perhaps fix. Unfortunately I can't say what - if you guys see something in what I've said then I will fix it, otherwise I will continue with things.

THANKS a bunch! :-)

-Mark

 
OzDamian

Joined: 2008-04-30
Posts: 35
Posted: Tue, 2008-07-29 08:52

Thanks for the update!

The slimbox/lightbox function within wpg2 does not work for me either, I have been using external slimbox and lightbox script for some time, prior to WPG2 come packed with them.
I haven't bothered looking at why they are not working for me, but just today I had a quick look.
The mootools and slimbox js are not loading, I started looking at the wpg2functions to ensure paths etc are pointing to the correct path... haven't check for page errors etc.... had to go and do other stuff.
I may have a look agian later and see why its not working.
I recently set up a new install of WP with WPG2 for testing, however I use an existing G2 istall for this site, problem may be in G2

 
torchbone
torchbone's picture

Joined: 2007-03-11
Posts: 16
Posted: Tue, 2008-07-29 10:50

Update:

Using the same image selected from the Insert dialog...

==Insert as "WPG2 tag"==

Yields:
<wpg2>25955</wpg2>

Result:
Lightbox = YES
Shadow frame = YES
Title for image = file name (NOT ideal)

==Insert as "Thumbnail with Lightbox..."==

Yields:

<a title="Dad. Yashica A (ca. 1957) medium format 120 film camera, Ilford 400 BW film." rel="lightbox" href="http://www.nomadicfrog.com/portfolio/main.php?g2_view=core.DownloadItem&amp;g2_itemId=25955"><img title="Dad, taken with his old Yashica A (ca. 1957) medium format film camera." src="http://www.nomadicfrog.com/portfolio/main.php?g2_view=core.DownloadItem&amp;g2_itemId=25956" alt="0226212-R1-E011.jpg" width="148" height="150" /></a>

Result:
Lightbox = YES
Shadow frame = NO
Title for image = Good text (PREFERABLE)

It seems odd that the different methods choose different attributes of the photo to be the "title", but maybe that is the desired functionality. I would think text metadata ("This is me at the beach") would be more useful than the filename ("1234.jpg"), if available.

I think what I need to do is Insert as thumbnail with Lightbox..." since this seems logical and does what I want best. I don't know how to get the theme's CSS to allow the shadow frames though.

I tried switching to the default theme and that did not seem to have an effect.

I also tried commenting out these lines in my theme's CSS but only see the standard image border around the non-WPG2-tag image.

a img {
border: none;
}

img {
border: none;
}

How can I allow Shadow frames for these images without putting shadows around every single image on the page?

If there is a "CSS for dummies" site you can point me to I'd be happy to RTFM, but between WordPress, Gallery, plug-ins, php, CSS, JS... I'm not sure where to look or what to learn. It is taking me some time to understand the interactions. I can google for stand-alone CSS stuff, but it isn't always clear how to proceed in the context of all these other inter-dependencies.

Fairly unrelated items:

-When I initially insert the image as a WPG2 tag then I see it, but after saving the post I subsequently see a "<WPG2> Image" icon, which is unfortunate (but I can certainly live with).

-I just noticed this - should I be worried?

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
<rdf:Description rdf:about="http://www.nomadicfrog.com/journal/2008/07/29/test"
dc:identifier="http://www.nomadicfrog.com/journal/2008/07/29/test"
dc:title="Test"
trackback:ping="http://www.nomadicfrog.com/journal/2008/07/29/test/trackback" />

-Mark

 
torchbone
torchbone's picture

Joined: 2007-03-11
Posts: 16
Posted: Tue, 2008-07-29 11:33

I think I answered one of my own questions: the "WPG2 tag" insert links to the item in Gallery and is therefore always current (there is only one source of data: the Gallery2 database). The "Insert thumbnail with Lightbox" grabs the meta data at post creation time and "hardcodes" it into the WordPress post. It is only in that way that it has the meta data to serve to Lightbox.

So, the "WPG2 tag" is more normalized, but all it has available at page creation time to tell Lightbox is "filename", whereas the other method has more meta data available for Lightbox at the expense of risking that data changes in Gallery are not reflected in WordPress.

Did I get that right?

So all I need to do is figure out the CSS thing...

-Mark

 
torchbone
torchbone's picture

Joined: 2007-03-11
Posts: 16
Posted: Tue, 2008-07-29 16:43

Now I've somehow screwed up something with my links / permalinks... I'm so lost... But I realise this is a WordPress issue and not WPG2 or Gallery. :-(

 
ozgreg
ozgreg's picture

Joined: 2003-10-18
Posts: 1378
Posted: Wed, 2008-07-30 04:04

Yeah the WPG2 Tag is a much better way to insert links, WPG2 will automatically build the URL (Dynamically) so you will never get a problem with outdated links. BTW In the next release we are going to expose a lot of the static metadata data for frames etc so you can better control the settings from post to post..

To answer the post above you cannot switch on and off frames for a particular post, not yet, very soon we can do this..

____________________________________
Wordpress / Gallery2 (WPG2) Plugin, , WPG2 Documentation, WPG2 Demo

 
torchbone
torchbone's picture

Joined: 2007-03-11
Posts: 16
Posted: Thu, 2008-07-31 14:35

Hi again!

If I understand correctly the frames are built in the HTML generated by the WPG2 tag. If I take that HTML and put it around my "Insert as lightbox" image then I get shadows AND and a textual title (but no, not dynamic).

(third image in this Test post)
http://www.nomadicfrog.com/journal/?p=87

Is there an easy way that I can add an item to the insert image dialog like "Insert lightbox link WITH SHADOW", and add the corresponding code (below) to the plugin for that myself? If so which file(s) do I modify?

<!--THIS MAKES THE SHADOW FRAME-->
<div class="wpg2tag-image">
<table class="ImageFrame_shadow" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="LLT"></td>
<td class="IMG" colspan="2" rowspan="2">
<!--IMAGE GOES HERE-->
<a title="Dad, blah blah blah." rel="lightbox" href="http://www.nomadicfrog.com/portfolio/main.php?g2_view=core.DownloadItem&amp;g2_itemId=25955"><img title="Dad, blah blah blah." src="http://www.nomadicfrog.com/portfolio/main.php?g2_view=core.DownloadItem&amp;g2_itemId=25956" alt="0226212-R1-E011.jpg" width="148" height="150" /></a></td>
<td class="RRT"></td>
</tr>
<tr>
<td class="LL" style="height: 140px;"></td>
<td class="RR" style="height: 140px;"></td>
</tr>
<tr>
<td class="BL"></td>
<td class="BBL"></td>
<td class="BB" style="width: 139px;"></td>
<td class="BR"></td>
</tr>
</tbody></table>
</div>
<!--END THIS MAKES THE SHADOW FRAME-->

I could manually add it for each post, but... Or is this a planned change that I should be patient for? :-)

-Mark

 
ozgreg
ozgreg's picture

Joined: 2003-10-18
Posts: 1378
Posted: Thu, 2008-07-31 23:01

The plan and it is just a plan is to have a extra set of post fields with WPG2 Values.. (Copied from Defaults)

I am been playing with a prototype on WP now on how to actually do this..

____________________________________
Wordpress / Gallery2 (WPG2) Plugin, , WPG2 Documentation, WPG2 Demo