Can't get Lightbox to work with customized Matrix, Gallery 2

afterdark

Joined: 2008-09-10
Posts: 56
Posted: Mon, 2009-10-19 20:13
Quote:
Gallery version = 2.2.5 core 1.2.0.7
PHP version = 4.4.9 cgi-fcgi
Webserver = Apache
Database = mysqlt 4.1.20-max-log, lock.system=flock
Toolkits = NetPBM, Gd, ImageMagick, SquareThumb
Acceleration = none, none
Operating system = Linux web164.opentransfer.com 2.6.28.7 #16 SMP Thu Mar 5 06:17:30 CST 2009 i686
Default theme = afterdark
gettext = enabled
Locale = en_GB
Browser = Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_4_11; en) AppleWebKit/531.9 (KHTML, like Gecko) Version/4.0.3 Safari/531.9
Rows in GalleryAccessMap table = 12
Rows in GalleryAccessSubscriberMap table = 113
Rows in GalleryUser table = 2
Rows in GalleryItem table = 111
Rows in GalleryAlbumItem table = 1
Rows in GalleryCacheMap table = 0

Theme: Customized Matrix embedded into my own page
Lightbox version 2.04

I'm trying to make my embedded gallery page work with lightbox. I'm following this tutorial but am hitting 2 problems.

1. When I add the stylesheet and js lines (point 8 on the tutorial) it totally screws my final page (big black square over top half of screen and a permanent empty lightbox box at the bottom). It's like the lightbox stylesheet and my own stylesheet are clashing. I tried including the lightbox stylesheet contents at the bottom of my own stylesheet but the same thing happened. I'm really in the dark on what I'm doing here. You can see the mess I've made here (it should be a 3x3 thumb grid!)
http://www.afterdarkmodels.com/gallery/gallery2Embedded.php :-/

2. Even with the above page-wrecking lightbox stylesheet in place, the actual functionality isn't working. When you click thumbnails it still loads the gallery HTML page of that image, not the lightbox version.

In the tutorial (point 10 and 11) the 2 lines of code it advises to replace seems a little out of date:

<a href="{g->url arg1="view=core.ShowItem" arg2="itemId=`$child.id`"}">

the code in my Matrix theme is:

{capture assign=linkUrl}{g->url arg1="view=core.ShowItem"
arg2="itemId=`$child.id`"}{/capture}

I changed it to:
{capture assign=linkUrl}{g->url arg1="view=core.DownloadItem" arg2="itemId=`$child.id`"}" rel="Lightbox[gallery]"}{/capture}

and for the second link:

{g->url arg1="view=core.DownloadItem" arg2="itemId=`$child.id`"}" rel="Lightbox[gallery]"}

But it didn't work. I've no idea if the syntax is right, I was just using my best guess.

Any help on this would be muchly appreciated.

 
afterdark

Joined: 2008-09-10
Posts: 56
Posted: Thu, 2009-10-22 01:04

bump - anyone, please?
I'm kinda really stuck with this one. :(

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 22883
Posted: Thu, 2009-10-22 03:19

Perhaps the tutorial was not written for your version:

Quote:
Gallery version = 2.2.5 core 1.2.0.7

Either way you should upgrade as there is security and other bug fixes sine then.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
afterdark

Joined: 2008-09-10
Posts: 56
Posted: Wed, 2009-11-04 10:54

OK, am about to brave an upgrade - just a bit puzzled on doing backups.

I've backed up the database via phpMyAdmin and have an sql file and a zip of the sql file.

Do I need to back anything else up - eg the photos and themes?
Is this just a case of downloading my 'gallery' folder from my webserver to my local drive via ftp?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 22883
Posted: Wed, 2009-11-04 14:22
Quote:
Do I need to back anything else up - eg the photos and themes?

Yes

Quote:
Is this just a case of downloading my 'gallery' folder from my webserver to my local drive via ftp?

That will work but might take some time. Don't forget the g2data folder and all the hidden files ( they start with a dot ).

Dave

_____________________________________________
Blog & G2 || floridave - Gallery Team

 
afterdark

Joined: 2008-09-10
Posts: 56
Posted: Wed, 2009-11-04 15:40
floridave wrote:
That will work but might take some time

What would be a quicker way?

I'm on a Mac. If there's some line I can type into Terminal to zip the whole site up, I imagine that'd be better than downloading as OSX will just hide all the hidden files as soon as they hit my HD.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 22883
Posted: Thu, 2009-11-05 00:26

http://codex.gallery2.org/Gallery2:FAQ#How_do_I_backup_G2.3F
Yes if you have some utility to zip up the data it will go faster.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
afterdark

Joined: 2008-09-10
Posts: 56
Posted: Thu, 2009-11-05 16:08

Think I've got it all backed up - are there likely to be any other hidden files other than .htaccess I should check for?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 22883
Posted: Fri, 2009-11-06 04:14

Not that I can remember. Some people miss the versions.dat file int eh g2data direcotry.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
afterdark

Joined: 2008-09-10
Posts: 56
Posted: Thu, 2009-11-19 23:29

I've copied the unzipped gallery 2.3 onto my server ready to run the installer.

I'm currently using a custom theme (a duplicate of Carbon, renamed) in my gallery 2.2.5 version - should I copy that renamed theme folder over to the new 2.3 folder before running the installer?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 22883
Posted: Fri, 2009-11-20 01:10

If your DB on the old install was using a theme then the new location needs it as well.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
afterdark

Joined: 2008-09-10
Posts: 56
Posted: Sat, 2009-11-21 01:51

Ok, I'm at step 4 of the installation. It's saying to pick a g2data folder with a random string appended.

Do I point it to my old g2data folder which includes a random string (currently sitting in my original gallery directory, now called 'gallery_old'), or do I need to copy that g2data folder to the new 2.3 folder?

Or do I need to let it create a whole new g2data folder with a completely different string?

...oh, and regarding the modules installed, I additionally had things like watermark and imageframe installed with custom graphics - should I just copy those folders over to the new 2.3 modules folder, or do i need to reinstall them via the site admin?

 
afterdark

Joined: 2008-09-10
Posts: 56
Posted: Sun, 2009-11-22 23:13

any help on this appreciated. I know they're the stoopidest questions, but I don't wanna mess this up! Ta.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 22883
Posted: Mon, 2009-11-23 02:03

I'm a bit confused as to why you are running the installer and not the upgrade?

Dave

_____________________________________________
Blog & G2 || floridave - Gallery Team

 
afterdark

Joined: 2008-09-10
Posts: 56
Posted: Mon, 2009-11-23 11:40

I didn't realise there was a difference! I followed the instructions here http://codex.gallery2.org/Gallery2:Download#Upgrades which say to download, unpack and go to your gallery site. When I went there it automatically starts the installer.

Anyway, I changed the url to inlcude '/upgrade' and found the upgrader. :) I've run the upgrade but ran into errors at 'Upgrade Plugins'.

This was the stack trace it threw out:

Quote:
Stack Trace:
Error (ERROR_BAD_PATH) : Invalid path: modules/imageframe/classes/ImageFrameImpl.class

* in modules/core/classes/helpers/GalleryFactoryHelper_simple.class at line 171 (gallerycoreapi::error)
* in modules/core/classes/GalleryCoreApi.class at line 161 (galleryfactoryhelper_simple::newinstance)
* in modules/core/classes/GalleryTheme.class at line 227 (gallerycoreapi::newfactoryinstance)
* in modules/core/classes/GalleryTheme.class at line 516 (ajaxiantheme::getsettings)
* in modules/core/classes/GalleryPlugin.class at line 298 (ajaxiantheme::activate)
* in modules/core/classes/GalleryTheme.class at line 610 (ajaxiantheme::reactivate)
* in upgrade/steps/UpgradeOtherModulesStep.class at line 119 (ajaxiantheme::installorupgrade)
* in upgrade/index.php at line 186 (upgradeothermodulesstep::processrequest)

Error (ERROR_BAD_PATH) : Invalid path: modules/imageframe/classes/ImageFrameImpl.class

* in modules/core/classes/helpers/GalleryFactoryHelper_simple.class at line 171 (gallerycoreapi::error)
* in modules/core/classes/GalleryCoreApi.class at line 161 (galleryfactoryhelper_simple::newinstance)
* in modules/core/classes/GalleryTheme.class at line 227 (gallerycoreapi::newfactoryinstance)
* in themes/carbon/theme.inc at line 69 (gallerytheme::getsettings)
* in modules/core/classes/GalleryTheme.class at line 516 (carbontheme::getsettings)
* in modules/core/classes/GalleryPlugin.class at line 298 (carbontheme::activate)
* in modules/core/classes/GalleryTheme.class at line 610 (carbontheme::reactivate)
* in upgrade/steps/UpgradeOtherModulesStep.class at line 119 (carbontheme::installorupgrade)
* in upgrade/index.php at line 186 (upgradeothermodulesstep::processrequest)

Error (ERROR_BAD_PATH) : Invalid path: modules/imageframe/classes/ImageFrameImpl.class

* in modules/core/classes/helpers/GalleryFactoryHelper_simple.class at line 171 (gallerycoreapi::error)
* in modules/core/classes/GalleryCoreApi.class at line 161 (galleryfactoryhelper_simple::newinstance)
* in modules/core/classes/GalleryTheme.class at line 227 (gallerycoreapi::newfactoryinstance)
* in modules/core/classes/GalleryTheme.class at line 516 (matrixtheme::getsettings)
* in modules/core/classes/GalleryPlugin.class at line 298 (matrixtheme::activate)
* in modules/core/classes/GalleryTheme.class at line 610 (matrixtheme::reactivate)
* in upgrade/steps/UpgradeOtherModulesStep.class at line 119 (matrixtheme::installorupgrade)
* in upgrade/index.php at line 186 (upgradeothermodulesstep::processrequest)

At my gallery website I now just get a page saying an error occured (http://afterdarkmodels.com/gallery)

I think it may have had problems with missing files for Ajaxian, Carbon and Matrix theme, though I don't remember deleting any files.
What should be my next step?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 22883
Posted: Mon, 2009-11-23 13:49
Quote:
Error (ERROR_BAD_PATH) : Invalid path: modules/imageframe/classes/ImageFrameImpl.class

Does this file exist? If not replace it with the files that you got from the download page.

FAQ: How can I make sure that my installation files are all intact?
Warnings about missing or modified files should not be ignored.

You might have to deactivate the image frame module manually:
FAQ: How can I deactivate a module when I am unable to login?

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
afterdark

Joined: 2008-09-10
Posts: 56
Posted: Mon, 2009-11-23 20:17

Thanks, seems a couple of folders got missed in the FTP. Upgrade now successful.

I'm still left puzzling over the Lightbox problem though.

I realised what the clash was in point 1 of my first post. It was coz I'd left a few Lightbox script calls in the head of my page (it was butchered from another page). Also, I didn't realise you had to download a G2 Lightbox module till I read right to the bottom of the instructions. That's now d/l'd and installed.

But point 2 of my first post remains. The code I'm advised to change has different syntax to the latest Carbon theme code.

It says to find the two lines in album.tpl that contain this:

<a href="{g->url arg1="view=core.ShowItem" arg2="itemId=`$child.id`"}">

Those lines now looks like this:

{capture assign=linkUrl}{g->url arg1="view=core.ShowItem"
arg2="itemId=`$child.id`"}{/capture}

and:

{if $theme.params.dynamicLinks == 'jump'}
{g->url arg1="view=core.ShowItem" arg2="itemId=`$child.id`"}
{else}

It says to replace it with this:

<a href="{g->url arg1="view=core.DownloadItem" arg2="itemId=`$child.id`"}" rel="Lightbox[gallery]">

Which I've interpreted as:

{capture assign=linkUrl}{g->url arg1="view=core.DownloadItem"
arg2="itemId=`$child.id`"} rel="Lightbox[gallery]{/capture}

and:

{if $theme.params.dynamicLinks == 'jump'}
{g->url arg1="view=core.DownloadItem" arg2="itemId=`$child.id`"} rel="Lightbox[gallery]
{else}

Anyone know if my syntax correct, coz the page just sits there? No Lightbox functionality at all.

 
alecmyers

Joined: 2006-08-01
Posts: 4338
Posted: Mon, 2009-11-23 20:43
Quote:
{capture assign=linkUrl}{g->url arg1="view=core.DownloadItem"
arg2="itemId=`$child.id`"} rel="Lightbox[gallery] *{/capture}

and:

{if $theme.params.dynamicLinks == 'jump'}
{g->url arg1="view=core.DownloadItem" arg2="itemId=`$child.id`"} rel="Lightbox[gallery] *
{else}

Aside from anything else, it looks like you're missing two "-marks, at the places indicated by *.

You should be able to examine the html of the page in your browser and see if what is being sent looks like sensible html or not.

 
afterdark

Joined: 2008-09-10
Posts: 56
Posted: Mon, 2009-11-23 21:06

Thanks alec, have amended that, still no joy though.

In Point 8 of the instructions (http://codex.gallery2.org/Gallery2:Modules:Lightbox#Basics) it says to include a few paths to the js files in the head of templates/theme.tpl.

Quote:
<link rel="stylesheet" type="text/css" media="screen" href="{g->theme url="includes/css/lightbox.css"}" />
<script type="text/javascript" src="{g->theme url="includes//js/prototype.js"}"></script>
<script type="text/javascript" src="{g->theme url="includes/js/effects.js"}"></script>
<script type="text/javascript" src="{g->theme url="includes/js/lightbox.js"}"></script>

I've been working in a copied theme.tpl file in a 'local' directory within the theme's templates folder, so does that mean the paths to the js files need altering too?

 
afterdark

Joined: 2008-09-10
Posts: 56
Posted: Mon, 2009-12-28 18:54

Yay... finally managed to get Lightbox to work by taking pieces of script from this guy's examples and pasting it into my theme.tpl and album.tpl

http://www.chavers.us/content/view/21/42/

Took many attempts and much guesswork but eventually sorted it. :))))

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 22883
Posted: Mon, 2009-12-28 19:27

Glad you got it all sorted.
Perhaps you can post the files that you changed to benefit others.

Dave

_____________________________________________
Blog & G2 || floridave - Gallery Team