Can we install 2 galleries on one domain?

JimBeam

Joined: 2003-05-01
Posts: 24
Posted: Tue, 2003-05-27 03:21

I wanted to try but I decided to ask for instructions as I do not hope to mess up my datas in the original album. Thank you

 
beckett
beckett's picture

Joined: 2002-08-16
Posts: 3474
Posted: Tue, 2003-05-27 04:03

Sure! Use a separate gallery directory for each gallery, and have a separate albums directory for each. You can share the NetPBM/ImageMagick binaries if you like, though.

-Beckett (

)

 
JimBeam

Joined: 2003-05-01
Posts: 24
Posted: Tue, 2003-05-27 06:18

Ok. So eg, it is installed in modules/gallery. I just setup and put the alblum name on a different folder and I'll have 2 different galleries. I'll try it, thanks for your time.

 
JimBeam

Joined: 2003-05-01
Posts: 24
Posted: Tue, 2003-05-27 08:24

problem. When i used the same setup and changed the album directory my old album is being over written. Lucky when i changed the back to original folders all back to normal

 
beckett
beckett's picture

Joined: 2002-08-16
Posts: 3474
Posted: Tue, 2003-05-27 08:57

You need to read my post more closely. ;)

beckett wrote:
Use a separate gallery directory for each gallery, and have a separate albums directory for each.

So, you need to copy the code to a new directory as well. (In fact, the only things in the gallery directory that need to be unique are your .htaccess and config.php, but the codebase isn't very large, so it's probably simpler to just duplicate the whole directory).

-Beckett (

)

 
JimBeam

Joined: 2003-05-01
Posts: 24
Posted: Tue, 2003-05-27 10:21

OPS!! hahha Sorry I missed it, :) Thanks

 
JimBeam

Joined: 2003-05-01
Posts: 24
Posted: Wed, 2003-05-28 12:46

ok the thing is that it worls on seperate folders but this appeared under the 2nd gallery, which is working fine.

Fatal error: Cannot redeclare fs_copy() (previously declared in /home/hsphere/local/home/locutus/katoots.com/modules/toys_gallery/platform/fs_unix.php:22) in /home/hsphere/local/home/locutus/katoots.com/modules/gallery/platform/fs_unix.php on line 22

 
beckett
beckett's picture

Joined: 2002-08-16
Posts: 3474
Posted: Wed, 2003-05-28 13:06

?!??

Please provide a URL. I want to see how you're using the galleries. Are you using both on one page or something? (Which you shouldn't be doing).

-Beckett (

)

 
JimBeam

Joined: 2003-05-01
Posts: 24
Posted: Wed, 2003-05-28 14:10
 
beckett
beckett's picture

Joined: 2002-08-16
Posts: 3474
Posted: Wed, 2003-05-28 14:27

Ooh! That's a messy situation!

The problem comes from the random photo block, which calls code from the first gallery to initialise it.
In the second gallery, it's still calling the init code from the first gallery, and generating the error.

You'll need to add some code to only call init.php inside the random block code if you're not on a second gallery page. You can't ever call init.php more than once on a page. Use that as the guiding principle. It's getting called again for the random block.

 
JimBeam

Joined: 2003-05-01
Posts: 24
Posted: Sun, 2003-06-01 09:46

hmm a bit too profound. Could you give some eg? Sorry I'm kinda blur with such.

 
beckett
beckett's picture

Joined: 2002-08-16
Posts: 3474
Posted: Tue, 2003-06-03 08:37

Er.. okay. There's this line in block-random.php:

require($GALLERY_BASEDIR . "init.php");

First, try changing it to :

require_once($GALLERY_BASEDIR . "init.php");

Does that fix it? If not, then you'll need to adjust the $GALLERY_BASEDIR variable depending on whether you're looking at the first gallery or the second. :(

-Beckett (beck@beckettmw.com )

 
JimBeam

Joined: 2003-05-01
Posts: 24
Posted: Wed, 2003-06-04 21:57

ok thks will try it. sorry for late reply. bad health of late has kept me down.

 
JimBeam

Joined: 2003-05-01
Posts: 24
Posted: Wed, 2003-06-04 22:06

it is require_once($GALLERY_BASEDIR . "init.php");
by default.

 
beckett
beckett's picture

Joined: 2002-08-16
Posts: 3474
Posted: Thu, 2003-06-05 05:00

Well the problem is that in the *second* gallery, init.php gets run *twice*, because the second gallery loads a *different* init.php, and PHP spews warnings if you load it more than once.

Ideally what you should do is in the block you have that calls the random block, have an if/else statement. In the second gallery code somewhere, add a flag like $inSecondGallery = true. Then have:

if ($inSecondGallery) {
   include("/path/to/second/gallery/block-random.php");
} else
   include("/path/to/first/gallery/block-random.php");
}

There are a million ways to solve the problem, but this seems to be the most straightforward I can think of.

-Beckett (

)

 
kenweb

Joined: 2003-05-24
Posts: 2
Posted: Sun, 2003-06-08 19:05

I want to do the same thing: "set up a separate gallery under the same domain." I am a bit lost following this thread and look at other post in the forum. . Can someone summarize?

If I copy the existing gallery directory to gallery2 and run the setup again. will it do it?
Is the problem discussed in this thred only happen during configuration? I went to http://www.katoots.com/modules.php?op=m ... file=index and the two galleries seem to work fine. so my question is: what mod is necessary to make it work like katoots site? Thank you.

 
joan
joan's picture

Joined: 2002-10-21
Posts: 3473
Posted: Mon, 2003-06-09 08:50

If you arent using featured photos, then just having a separate gallery directory and albums directory is all you need. It's as simple as it seems.

[I'm running 6 different galleries on my home machine to test different versions. No problems]

 
archerkit

Joined: 2003-06-04
Posts: 3
Posted: Mon, 2003-06-09 12:01

I think I'm looking for something similar as some other folks here. Ideally, a person's album(s) would be in their home directory, and the Gallery account would actually be based on their existing unix account. Is such a thing possible? Given that we'd want this to be usable campus-wide for lots of users?

an alternative..
Right now on the "main page" of the Gallery I have 1 album per user. Unless I'm missing something completely, I don't see a way to adjust permissions on the main page - I really only want admins to be able to see it, whereas normal users and the public would have to go link directly to an album. In other words:
myhost.com/gallery - only admins can see it
myhost.com/gallery/album01 - works like normal

Is that possible?

Thanks!!!
Doug

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Tue, 2003-06-10 03:03
archerkit wrote:
I think I'm looking for something similar as some other folks here. Ideally, a person's album(s) would be in their home directory, and the Gallery account would actually be based on their existing unix account. Is such a thing possible? Given that we'd want this to be usable campus-wide for lots of users?

Gallery is not designed to do that; it'd take a lot of work to add that capability. Sorry. :-(

archerkit wrote:
an alternative..
Right now on the "main page" of the Gallery I have 1 album per user. Unless I'm missing something completely, I don't see a way to adjust permissions on the main page - I really only want admins to be able to see it, whereas normal users and the public would have to go link directly to an album. In other words:
myhost.com/gallery - only admins can see it
myhost.com/gallery/album01 - works like normal

Is that possible?

You want to get the "gated community" effect where each person looks like they have their own Gallery but it's really just an album inside a much bigger Gallery, though nobody but admins can see the whole picture. Right?

I believe that you can do this by creating this structure:

gallery/ <--- top of your gallery
gallery/users <--- a top level album where only admins have perms
gallery/users/jdoe <--- a nested album that jdoe owns

Everybody could still see the top level of Gallery, but it would appear
to be empty.

You could further modify albums.php so that if the user isn't an admin it
automatically redirects to some other page (like a login page).
You could further modify login.php so that after the user logs in it
takes them directly to the album that they own. Both of these would
require understanding PHP and the Gallery code and doing a little tweaking.

 
JimBeam

Joined: 2003-05-01
Posts: 24
Posted: Thu, 2003-06-12 01:02
beckett wrote:
Well the problem is that in the *second* gallery, init.php gets run *twice*, because the second gallery loads a *different* init.php, and PHP spews warnings if you load it more than once.

Ideally what you should do is in the block you have that calls the random block, have an if/else statement. In the second gallery code somewhere, add a flag like $inSecondGallery = true. Then have:

if ($inSecondGallery) {
   include("/path/to/second/gallery/block-random.php");
} else
   include("/path/to/first/gallery/block-random.php");
}

There are a million ways to solve the problem, but this seems to be the most straightforward I can think of.

-Beckett (

)

hmm trying to digest this. I'm not from programming background. Will let you know if ok or not. thanks

 
archerkit

Joined: 2003-06-04
Posts: 3
Posted: Fri, 2003-06-13 17:44
Quote:
You want to get the "gated community" effect where each person looks like they have their own Gallery but it's really just an album inside a much bigger Gallery, though nobody but admins can see the whole picture. Right?

I believe that you can do this by creating this structure:

gallery/ <--- top of your gallery
gallery/users <--- a top level album where only admins have perms
gallery/users/jdoe <--- a nested album that jdoe owns

Everybody could still see the top level of Gallery, but it would appear
to be empty.

Thanks, that worked very well! :P

Quote:
You could further modify albums.php so that if the user isn't an admin it
automatically redirects to some other page (like a login page).
You could further modify login.php so that after the user logs in it
takes them directly to the album that they own. Both of these would
require understanding PHP and the Gallery code and doing a little tweaking.

Beyond my capabilities at the moment. Right now this is just a "few people" using it, but I've shown it to some other folks and they were impressed. So it might be a need in the future. What a great project!
:D

 
m1a1lt

Joined: 2003-06-17
Posts: 9
Posted: Tue, 2003-06-17 16:30

Warning: copy(/home3/battle/public_html/strikers/gallery/config.php) [function.copy]: failed to create stream: Permission denied in /home3/battle/public_html/strikers/gallery/setup/write.inc on line 10
Unable to write to /home3/battle/public_html/strikers/gallery/config.php

Any idea why it is saying this?

 
beckett
beckett's picture

Joined: 2002-08-16
Posts: 3474
Posted: Tue, 2003-06-17 22:16

m1a1lt, please follow the instructions in the README. You must create config.php yourself, then CHMOD it to 666 before running the Config. Wizard.

 
m1a1lt

Joined: 2003-06-17
Posts: 9
Posted: Wed, 2003-06-18 01:24

OK I did that then ran config the I get this error now .....
Unable to write to /home3/battle/public_html/strikers/gallery/.htaccess

Any idea what to do next?

 
joan
joan's picture

Joined: 2002-10-21
Posts: 3473
Posted: Wed, 2003-06-18 07:12

Follow the readme again.

 
m1a1lt

Joined: 2003-06-17
Posts: 9
Posted: Thu, 2003-06-19 17:01

I do follow "readme" I have looked at it 5 times now. Obviously the "readme" A. Does not pertain to my problem or B. It does but I am just not understanding it. Now beckett said earlier I had to chmod my config.php to 666 and look at "readme" now no where in "readme" does it say to chmod config.php to 666.

chmod 777 .htaccess
chmod 777 config.php
chmod 755 setup

Now you're all set to configure gallery so go to the Gallery web
page. When you're done and it prompts you to make the gallery secure
again, you need to change your permissions back again:

chmod 644 config.php
chmod 644 .htaccess
chmod 0 setup

Where does it say chmod to 666 in "readme"? Now I have chmod both .htaccess to 777 and 644 and 666 and each time I do this I get a different error. If it is so easy and uncomplicated to run multiple galleries under same domain why am I having so much trouble?

Jeff

 
beckett
beckett's picture

Joined: 2002-08-16
Posts: 3474
Posted: Fri, 2003-06-20 00:12

Sorry. 666, 777... either will do. For consisency, use the ones listed in the README. I was pulling from my head, so apologies for any confusion.

Can you post a URL to your Gallery (after you CHMOD the three files to 777, 777, and 755 as indicated). Then we can go in and see what other errors might be popping up and help you get this running. Also tell us where the albums directory for that Gallery is located. :)

-Beckett (

)

 
beckett
beckett's picture

Joined: 2002-08-16
Posts: 3474
Posted: Fri, 2003-06-20 00:13

BTW, if you need some help understanding CHMOD better, here's a quick and informative guide written by one of our support people:

    http://www.eclecticpixels.com/tutorials/chmod/

 
dyoung

Joined: 2003-05-28
Posts: 7
Posted: Fri, 2003-06-20 05:59

Ok..... so my version of the problem.... and maybe the answer is the same. I have a multisite PostNuke installation..... and two copies of Gallery in the modules directory each pointing to a different album directory....

Problem cones in the random block. I want to use the random block from one installation into one, and the second installation into the other. Always, when I go to install the second random block, I get:

Fatal error: Cannot redeclare readcache() in .../modules/ac2-gallery/pnblocks/gallery_rand_fullsize.php on line 285

And this is on the multi-site where i'd want to load ".../main-gallery/..."

Now, I've been reading up on multiple galleries... and I know there's a way to configure Gallery that's based on the Postnuke Multisite setup, but I decided on two seperate installations for ease of configuring (in the "multisite" setup I'd have to had change config.php on each). So... am I running into the same Random Block issue that Beckett outlines above? Maybe I'll just have to go with the postnuke multi-site solution and bite the bullet on confiuration and upgrades.

Thanks for any help.

 
Norrin
Norrin's picture

Joined: 2003-06-20
Posts: 6
Posted: Fri, 2003-06-20 20:34

Hi,

i'm running an eNvolution-Site and I would like to integrate the 'Random Picture Block'.

Gallery 1.3.4 is installed and initiallized as module 'Gallery' only once.

Still, making my first steps using the 'picture block' I ran into the same errors as JimBeam did earlier on:

Fatal error: Cannot redeclare fs_copy() (previously declared in /www/mydomain/com/modules/Gallery/platform/fs_unix.php:22) in /www/mydomain/com/modules/Gallery/platform/fs_unix.php on line 22

So I tried the hint from becket, posted on the 3rd of june, even though I'm only using one gallery:

require($GALLERY_BASEDIR . "init.php");

changed into

require_once($GALLERY_BASEDIR . "init.php");

After that the above mentioned errors were gone. The 'picture block' also seemed to work allright showing the desired picture/album.

BUT on top of the block I get the following error

Warning: fopen("/block-random.cache", "w") - Permission denied in /www/mydomain/com/modules/Gallery/platform/fs_unix.php on line 53

as soon as the new page is fully loaded.

I suppose the solution is quite easy, but I'm really stuck. Can anybody help me out, please?

TIA
Norrin

 
m1a1lt

Joined: 2003-06-17
Posts: 9
Posted: Fri, 2003-06-20 21:18

beckett,

Hey np was just starting to get a little irrated because every one was posting "readme." Any ways I just wiped out all the files reupload everything and started all over. This time everything went smoothly minus the netpbm thingy which I have bypassed because I have imagemagick. Not sure what the difference between the two are but ok. Thanks for what help you could give. Keep up the good work on the gallery.

Jeff

 
bourdett

Joined: 2003-03-15
Posts: 23
Posted: Tue, 2003-06-24 21:13

I'm trying to do this same thing.

I have root folder with "albums" and "Gallery" in it. I copied all the code from "Gallery" into a new folder and during the setup I was going to change the album folder to something else like "album2"

but on the setup page It say i have errors with my htaccess

says to add to my apache config
<Directory C:\Program Files\Apache Group\Apache2\htdocs\jay_meg>
AllowOverride Options FileInfo
</Directory>

I already have an entry like this in apache config for "Gallery" directory. If i try to add the one above then my apache service wont start back up.

like this

<Directory C:\Program Files\Apache Group\Apache2\htdocs\Gallery>
AllowOverride Options FileInfo
</Directory>
<Directory C:\Program Files\Apache Group\Apache2\htdocs\jay_meg>
AllowOverride Options FileInfo
</Directory>

Can anyone give me some ideas?
Thanks
Jason

 
alindeman
alindeman's picture

Joined: 2002-10-06
Posts: 8194
Posted: Tue, 2003-06-24 21:16

Quote the directory name, i.e. "C:\Program Files\Apache Group...."

 
bourdett

Joined: 2003-03-15
Posts: 23
Posted: Tue, 2003-06-24 21:37

Thanks, I got it going fine now.

I was just wondering is there an easy way to move some photos from one gallery to a new gallery..

Basically I was spliting a gallery into 2 gallerys. I copied the albums, i wanted under the "albums" folder into the "albums2" and when i go to the site it says I have 32 pics but no albums so they dont show up.

Jay

 
JimBeam

Joined: 2003-05-01
Posts: 24
Posted: Mon, 2003-07-07 23:33
kenweb wrote:
I want to do the same thing: "set up a separate gallery under the same domain." I am a bit lost following this thread and look at other post in the forum. . Can someone summarize?

If I copy the existing gallery directory to gallery2 and run the setup again. will it do it?
Is the problem discussed in this thred only happen during configuration? I went to http://www.katoots.com/modules.php?op=m ... file=index and the two galleries seem to work fine. so my question is: what mod is necessary to make it work like katoots site? Thank you.

Well you need to install the gallery folder with different names. Eg. You want 3 albums say u call it Cats Dog and mouse. Thus in ur module you'll find Modules/Cat , modules/dog and modules/mouse. seperately. Do not put them together. From there you can perform your setup in a breeze.

My problem is complicated because of a random block. I'm still cracking my head to solve it. If you need help on multiple gallery just let me know.

 
JimBeam

Joined: 2003-05-01
Posts: 24
Posted: Mon, 2003-07-07 23:39
Norrin wrote:
Hi,

i'm running an eNvolution-Site and I would like to integrate the 'Random Picture Block'.

Gallery 1.3.4 is installed and initiallized as module 'Gallery' only once.

Still, making my first steps using the 'picture block' I ran into the same errors as JimBeam did earlier on:

Fatal error: Cannot redeclare fs_copy() (previously declared in /www/mydomain/com/modules/Gallery/platform/fs_unix.php:22) in /www/mydomain/com/modules/Gallery/platform/fs_unix.php on line 22

So I tried the hint from becket, posted on the 3rd of june, even though I'm only using one gallery:

require($GALLERY_BASEDIR . "init.php");

changed into

require_once($GALLERY_BASEDIR . "init.php");

After that the above mentioned errors were gone. The 'picture block' also seemed to work allright showing the desired picture/album.

BUT on top of the block I get the following error

Warning: fopen("/block-random.cache", "w") - Permission denied in /www/mydomain/com/modules/Gallery/platform/fs_unix.php on line 53

as soon as the new page is fully loaded.

I suppose the solution is quite easy, but I'm really stuck. Can anybody help me out, please?

TIA
Norrin

hmm by right it shouldn't happen with one gallery. Could u pm me ur url?

 
dmolavi
dmolavi's picture

Joined: 2002-12-05
Posts: 573
Posted: Wed, 2003-07-09 16:58

search the forums at www.yankeesinthesouth.org . this issue has been addressed and resolved many times there.