Integrating G2 in my own site

Zlaxzzor

Joined: 2005-03-12
Posts: 7
Posted: Sat, 2005-03-12 14:13

Hi,

First of all, thanks for a great product.

I'm having a problem that you have seen in this forum a lot of times already, and I can understand that you are sick and tired of getting this question again. Though, I have been reading the docs/embedding file and I have also been searching these forums a couple of hours for a simple working code snippet.

The only thing I'm asking for here is a code snippet that makes gallery2 "integrated" in a simple plain php file, I think I should be able to do the rest myself after that to integrate it in my own code. So please just give me a working code from the top to the bottom that should be located in the root (and gallery2 is located in the folder gallery2 from there). What I'm looking for is for example to have a file in my root called gallery.php that has gallery2 integrated, and if I'm not totally mistaken this should be pretty simple to fix(?), but I haven't figured how to :(

Oh, and just one more question, do I need to make this integration in only one file (like described above) or do I have to make tons of files to get everything integrated?

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sat, 2005-03-12 14:55

First declare the goal of your integration and i may explain you the steps necessary to do it.
1. Do you want to integrate G2 just visually in your existing website?
2. Do you want to integrate user managament and login (authentication)?

If your answer to 2. is No, then you just have to take a look at the folder templates.
If your answer to 2. is Yes, then you might want to take a look at the links at the bottom of http://gallery.menalto.com/index.php?name=PNphpBB2&file=viewtopic&t=23957 .
And use cvs to checkout the existing integration examples from the gallery repository on sourceforge.net.
A small code example can also be found in this topic and how to checkout the integration code from the cvs repository too.

 
Zlaxzzor

Joined: 2005-03-12
Posts: 7
Posted: Sat, 2005-03-12 15:00

Yes, I want to integrate G2 visually in my existing website, all albums, photos etc.

If question nr. two means the admin part of the site I don't really care about it, I just want everything that my normal users can see to be integrated in my site.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sat, 2005-03-12 15:10

What about users? Does your existing website have a login / user system? Do you use a Content Management System / Forum?
Perhaps a link to your website would explain some things...

 
Zlaxzzor

Joined: 2005-03-12
Posts: 7
Posted: Sat, 2005-03-12 15:34

Hehe, I'm just building it up, but you can see it at my local server if you go to http://83.219.199.245/art/ the site is built up with includes for header, menu, left, main, right, footer and so on.

If you press "bilder" in the menu there you'll come to G2 (no photos added at the moment though).

What I would like to do is to integrate G2 so it would look like something like http://83.219.199.245/art/hangman/ but of course with the albums and photos there instead of the hangman game.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sat, 2005-03-12 15:57

You still didn't answer my question whether you want to integrate G2 with an existing user system. I take this as a no.

What you have to do to integrate G2 visually in your website is...
see instructions in templates/global.tpl

create a subfolder templates/local/
copy global.tpl to local/global.tpl
and include there your header/footer.

you can use ordinary html.
if you need php, put it in {php}your php here{/php} tags in global.tpl.

 
Zlaxzzor

Joined: 2005-03-12
Posts: 7
Posted: Sat, 2005-03-12 18:49

Yes, you are correct, I'm not using any other user system that I need to integrate with G2.

I have been trying to make these changes i the global template all the day now but it looks very odd. If you could check it you'll see what needs to be fixed (http://83.219.199.145/art/gallery2):

1. The height and backgrounds of TD's and TR's are changing between the normal site and G2 of some strange reason, I have been looking for the solution but can't find it.

2. If you press the image for example (no, it's not me at the pic), you will notice how the menu in the upper right goes at the top of the rest of the site, I want it to stay inside the table.

3. Last, I would like to have the left menu to the left and not above the galleries as it is right now.

I would be very grateful if you could help me out with these problems, I really do love this product and the support also seems to be great.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sat, 2005-03-12 18:54

your website is currently unavailable.

are you using G2 beta 1, an older version or a version from the last few days?
mindless is making progress changing things in G2 so that the G2 css (style sheets) don't interfere with the rest of your site.
Please install the latest nightly snapshot (current.gallery2.tar.gz) from http://galleryupdates.jpmullan.com
and check if there are still these issues with changing heights etc.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sat, 2005-03-12 19:58

moved to customization forum.

 
Zlaxzzor

Joined: 2005-03-12
Posts: 7
Posted: Sat, 2005-03-12 20:43

Hmm, I tried downloading the current build but couldn't get the installation to work there (it failed at the core step I think), so I downloaded the build 2005-03-12-09-33-17.zip instead. Installation worked fine, but now it seems like this build doesn't read the global.tpl file in the templates/local folder. Have I missed something here or am I right that something is wrong here?

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sat, 2005-03-12 20:54

- delete your current global.tpl (make a backup for yourself to know what you changed)
- copy the new global.tpl to local/global.tpl, apply your changes
- maybe flush templates in yourgalleryurl/lib/tools/test/

 
Zlaxzzor

Joined: 2005-03-12
Posts: 7
Posted: Sun, 2005-03-13 00:48

Ahh, yes, that did it. Now I'm back exactly where I were with the beta1 release :)

I mistyped my IP in my earlier posts, the correct ip to the site is http://83.219.199.245/art/ , so please go there and you will definitely see what is wrong.

1. Daily image is placed in-between a <center> and </center>, but doesn't get centered at all, and date and views shouldn't be shown there either, only the name and not that big.

2. When you go to the gallery there are a couple of things that I also need to change. First of all, as I said earlier, some TD:s and TR:s are changing height and background-colours here, check the boxes to the left and the menu in the top to see what I mean. I'm using the same includes as I am using at the news site, so it's the correct css file and so on.

3. The left menu of the gallery shouldn't be above the galleries, I want it to be to the left of the galleries.

4. If you press the photo, you will notice a few strange things here, first of all, the top menu of the gallery goes out above the box I have to the right, I want the menu to stay inside the center table. Second, when you press the photo you will only see the left part of it and the right part disappears under the table. Is it possible to do so when you click at the image it will pop up in its full size in a new window?

Once again, thank you very much for your support.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sun, 2005-03-13 01:06

try adding your own css AFTER the css of G2, so move your include css statement right before </head>

 
Zlaxzzor

Joined: 2005-03-12
Posts: 7
Posted: Sun, 2005-03-13 01:12

Done, doesn't seem like there is any change though unfortunately.

Well, I'll go to bed now, but I'll return here first thing tomorrow looking for more advices ;)

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Mon, 2005-03-14 17:04

i can't access that IP either.. hm.

are you asking how to make these things happen, or asking why your CSS is not having the effect you think it should?