How does Gallery 2 integrate with Drupal 6?

rvan1
rvan1's picture

Joined: 2009-02-17
Posts: 2
Posted: Thu, 2009-02-19 17:06

I have a multisite setup, where I want to use Gallery2 in one of the sites.

I have Gallery2.3 setup in '../webroot/gallery2/' and have setup the multisite copy in '../webroot/gallery/', as well as in '../webroot/sites/gallerysite.com/gallery2/'.

I've installed the Drupal 6 'gallery' module and in the settings it says this:

..........
PHP Memory Limit OK Your PHP is configured to limit the memory to 64M (memory_limit parameter in php.ini). This should be fine for embedded Gallery2 operation.

Gallery2 locations OK The Gallery2 location settings appear to be correct.

Drupal Modules / Gallery2 Plugins Error You may have some loss in functionality in your embedded Gallery2 (see below for details). You should check the details and if the functionality is not important for your site you can just ignore this.

Clean URL / URL Rewrite Warning

Initial User Synchronization Error
..........

Sometimes it will say there's a problem with my location and that I should install gallery within Drupal. I don't have a 'drupal' folder. My setup is the kind where Drupal is installed at webroot, rather than in a sub-directory.

I don't have a full understanding of mod-rewrite and htaccess rewrite rules. My phpinfo doesn't indicate that a mod-rewite module is installed, but my webhost says it is. It appears that this is so you can implement virtual URLs or have the URLs appear differently than what actually exists on the webserver.

So to use this, I would need to create an htaccess file in gallery2 full of patterns for translating URLs, but I don't know what those patterns should be. This file also needs to be compatible with the htaccess file at webroot.

.........

In the Gallery2 admin, the URL rewrite, Ffmpeg, ImageMagick, and NetPBM plugins are all inactive.

Gallery2 seems to work OK, and I don't know if I need URL rewrite or the other plugins.

So my questions are:

Assuming my install is OK, how would I go about adding Gallery content into a Drupal page?

Do I need to start with creating a 'gallery' content type or block?

To build a site this way, I need to customize a theme and embed gallery2 into it. Why not just customize the gallery2 theme and use it directly, rather than embedding it into Drupal?

Is it to give Drupal control over the theme, so with multisite, you can skin the same Gallery2 in different ways, as well as have a wider selection of themes you can use?

I'm using a Linux Apache/MySQL/PHP setup.

Regards,
Bob Van

 
rvan1
rvan1's picture

Joined: 2009-02-17
Posts: 2
Posted: Fri, 2009-02-20 16:55

After more searching I found more of the core info on integrating gallery into drupal and what happens when its all setup.
I can see the benefits of integrating the two now.
I went back and forth a bit in determining the gallery location within drupal multisite, but have it in '/sites/exampledomain.com/gallery'. Others appear to have issues with setting up URL rewrite in Gallery, so the trick is just to click 'skip' which sets the status as 'manually disabled'. Then I was able to finish the install and sync users.
So it seems to mostly work. I have the image grid blocks 'most viewed' in 'home > sidebar left', 'random image' in 'home > sidebar right' and 'gallery navigation' in 'sidebar left' of all gallery pages.

When in the Gallery, the toggle 'Sidebar' link appears but doesn't work anymore. I tried to comment it out in 'theme.tpl' but is doesn't go away. I know I need that nav bar in there because it renders the 'site admin' link when logged in.

So I'm looking into this issue now.

 
fotonut

Joined: 2009-02-21
Posts: 74
Posted: Tue, 2010-02-09 16:26

Let me know what you find. I am new to all this but I got to where you are by some miracle and now the sidebar is all I see that doesn't work in my implementation as well. I have Gallery2 in another subdirectory, used the simlink call from a PHP file I created only to create the simlink (don't have shell access on my host) which gave me a duplicate image
/drupal/gallery2
that was a duplicate of my source directory
/mygallery
see http://drupal.org/node/250549

From there I went to Drupal admin, Site Configuration, Gallery settings, General, Links to relavent Drupal galler2, Embedded URL..., Rules, Show Item, change to "gallery/v/%path%" by adding gallery to front of existing text.
see http://gallery.menalto.com/node/81643

Now everything works except the side-bar, at least technically. Aesthetically I find now that my Copper theme in gallery 2.3 extends greatly beyond the boundaries it now overlays using my most recent Marinelli-Giordani Drupal 6.15 theme. Not sure where to go from here but I do know the route is a severe learning curve for me.

 
fotonut

Joined: 2009-02-21
Posts: 74
Posted: Fri, 2010-09-17 16:03

I am looking for just one person who has set up Drupal 6 with the Gallery2 module to integrate Gallery 2.3 into Drupal where Gallery is NOT a sub directory off of Drupal.

Has anyone done this?

I set up on my virtual hosting provider 3 directories:

/MyDrupal (pointed by by www.mydomain.com)

/MyGallery2 (pointed to by gallery.mydomain.com)

/GalleryData (data directory accessed by MyGallery2)

- Drupal and Gallery 2 work flawlessly stand alone

Drupal installed: Gallery 2 module + more

Gallery2 installed: URL rewrite, Image Block, Image Frame + more

Linux mod: ln -s /path/to/Mygallery2
(this creates a simlink which makes /MyGallery2 appear as a subdirectory of /MyDrupal)
Note, this is not the actual command, I would have to research deep into my notes to remember the context of the ln -s command I used, not my area of expertise or understanding
actually)

Now, I have Drupal and Gallery2 working stand-alone flawlessly. Let us check what happens when I try to access the simlinked Gallery directory from Drupal by following my URL to Drupal with the cloaked sub-directory:

www.mydomain.com/MyGallery2

Which results in:
- the contents of my root album of Gallery2 are shown in the frame I have chosen in the
Gallery2 module setting within Drupal (as expected - PERFECT!)

Two issues:

1) From my Drupal application, when I navigate to www.mydomain.com/MyGallery2 to my delight and framed within the context of my Drupal window, within that frame I see thumbnails of all my albums and comments. I can expand comments, navigate comments, move from page to page of album thumbnails but I CANNOT NAVIGATE TO AN ALBUM BY CLICKING THE THUMBNAIL. When I click the thumbnail the URL switches to:
http://www.mydomain.com/Mygallery2/v/album-name/
but the screen does not move off the root view of all the albums (the expected response is for clicking on an album icon to open up a view of all the photo thumbnails that are in inside that album)

2) From the Gallery2 application, I was assuming that I should be auto-logged into Gallery2 once I log into Drupal. I know the feature to sync IDs is working because once I create an ID on Drupal, it also appears in the ID list on Gallery2 and I can manually log in to Gallery2 using this ID I created in Drupal.
(This feature I believe worked in the past but I would like to be able to switch to Gallery2 from Drupal without having to manually log into Gallery2 again with the same synced ID and password. Is this possible?)

Any help would be appreciated, i.e. a look at your URL Redirect entry in the .htaccess or the Gallery2 page defining your redirects. I think this may be where my problem is.

Again, this is only a request for info from a configuration where a simlink has been used to dummy up or "cloak" the /MyGallery2 being in a sub directory of Drupal /MyDrupal/MyGallery2 when in reality it is not.

Thank you in advance!!!

Historical note: I set up a rather large gallery on Gallery 2 before I decided to install Drupal, so thus I am not anxious to move my Gallery to a sub-directory of Drupal but that may indeed by the only answer. I seem so close to what I am looking for, I can almost smell it ;-)

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Fri, 2010-09-17 16:52
Quote:
Gallery2 installed: URL rewrite, Image Block, Image Frame + more

You don't want to setup rewrite standalone when you are trying to integrate. Setup rewrite from the integrated gallery.

Quote:
where Gallery is NOT a sub directory off of Drupal.

Why??? its so very very easy to move the gallery directory to a sub-directory(you don't need to move the data directory) - especially if that's what Drupal requires.
FAQ: How can I move my gallery installation from one folder to another?

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2FAQ: How can I move my gallery installation from one folder to another?

 
fotonut

Joined: 2009-02-21
Posts: 74
Posted: Fri, 2010-09-17 20:16

Deleted due to issue with format from moderator

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Fri, 2010-09-17 19:06

never attach that much text to any forum ever.

copy it to a txt file and attach it properly.

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
fotonut

Joined: 2009-02-21
Posts: 74
Posted: Fri, 2010-09-17 20:23

Well in the process of messing with this, I can no longer access the Admin menu for Gallery. Not sure where to go from here. When I click on admin menu I get a 404 page,
http://www.mydomain.com/admin/?g2_return=%2Fmain.php => Error 404 NOT FOUND

Looks like it's going to be an interesting journey from here :-(

What I did was went into the admin function of Gallery2 while I was in Drupal and disabled and reenabled the URL rewrite, then I did a refresh and could no longer get to Admin in Gallery2 from Drupal. At that point I signed directly into Gallery2 and clicked on Site Admin option and the admin menu had disappeared from there as well.

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Fri, 2010-09-17 20:42

if you disabled rewrite, did you remove the rules from .htaccess?
shouldn't your gallery admin be at http://www.mydomain.com/MyGallery2/main.php?g2_view=core.SiteAdmin

the rewrite rules you previously setup would no longer apply.
disable rewrite again, make sure everything is working standalone again, and follow the rewrite setup instructions.

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
fotonut

Joined: 2009-02-21
Posts: 74
Posted: Fri, 2010-09-17 20:50

That link you suggest gets me now to a pure white page (no longer a 404) .....

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Fri, 2010-09-17 21:21

you may have to remove .htaccess from your gallery directory.
Also non-fictional urls to your super top secret site will help us not have to guess.

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
fotonut

Joined: 2009-02-21
Posts: 74
Posted: Fri, 2010-09-17 21:46

I have another gallery site that is not attached to Drupal. This one has URL redirect . I grabbed the .htaccess from it (with just straight URL redirect block in it and tired it (I get the 404 error) then I deleted the .htaccess all together and when I do that and use the admin link you suggest, I get the blank screen.

Thank you.

 
fotonut

Joined: 2009-02-21
Posts: 74
Posted: Fri, 2010-09-17 23:36

I fixed it!

Here is what I did; searches led to "White Screen of Death" http://drupal.org/node/158043

- added the code to turn on debugging in index.php; still got a white screen of death with no trace of error message
- found no error logs on my generic hosted /log directory
- tried the link http://www.mydomain.comm/lib/support/index.php?cache
with a small user login block asked for the admin ID, I entered it and I fell over to a 404 again. But I noticed my URL had changed to some wild stuff so I re-entered the http://www.mydomain.comm/lib/support/index.php?cache .....
Yea! The cache cleared but the problem still existed

Still had the white screen of death so I tried this: created new .htaccess file with this info:

AddType x-mapp-php5 .php
Options -MultiViews
 RewriteEngine on

Now this time when I went to this URL I got to the admin page!!!!
http://www.mydomain.com/MyGallery2/main.php?g2_view=core.SiteAdmin
(at this point the SiteAdmin buttons were still pointing to some bogus long URL string left from the Drupal module)

Still no photo thumbnails and most of the links on the home page were still all wrong. I finally figured out that I could look at another gallery site and discover what the url should look like to access various services so followed that each time to find the URL rewrite setup and the plugins directory (had to manually key it in browser each time: http://www.mydomain.com/main.php?g2_view=core.SiteAdmin&g2_subView=core ).

AdminPlugins displayed now and with this I was able to set off and back on the URL rewrite on the plugins page and then I re enabled the URL Rewrite and went to the URL Rewrite options from admin options panel. Here I de-configured and re-configured the tables.

Now almost everything was working again, then I went to the Admin/Maintenance panel and cleared out all the caches and now my system is working again.

WOW! What a nightmare.