coppermine-gallery.com/forum

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Installation & Setup => Topic started by: Informator on February 27, 2005, 06:39:40 PM

Title: Using CPG as an included file
Post by: Informator on February 27, 2005, 06:39:40 PM
Hi everybody, I run CPGNuke very happily on another part of my site - but this is not about that. I want to have CPG run as an included file on my site. Unfortunately, if I just include index.php it gives an error because the master script is not in the CPG folder, so the paths get messed up. I don't want to risk hacking the script because I have a feeling there'll be too much for me to do. Can someone give me a way in which I could use CPG as an include?
Title: Re: Using CPG as an included file
Post by: Joachim Müller on February 28, 2005, 09:22:22 AM
you can't include coppermine using PHP's include/require command - it simply doesn't work that way. Instead, you have to create a theme that matches you're site's layout to make it blend into your site. You can however include some content from your site (stuff inside <body> tags) into coppermine, search the board for "custom header" for details on how to accomplish that. Please keep in mind that we don't support any nuke ports here, this board is dedicated to the standalone version of coppermine only. Posting a link to your site and some more details might help for a start (if you need a more detailed answer).

Joachim
Title: Re: Using CPG as an included file
Post by: snappy on June 09, 2005, 12:34:37 PM
So does that mean, that I have to use Frames if I want coppermine to be shown in the content-part of my website? :o
I think i should be possible to add this feature. I've found a guestbook (http://www.vipergb.de.vu/) that does exactly what I want coppermine to do: you simply put an include("/guestbook/index.php") in your code and it works better than in a frame :)
Title: Re: Using CPG as an included file
Post by: Nibbler on June 09, 2005, 12:48:02 PM
Coppermine is slightly more complicated than a guestbook :)
Title: Re: Using CPG as an included file
Post by: snappy on June 09, 2005, 01:12:57 PM
I'm sure about that  :)

But I think it's not depending on the funktionality how you can handle a gallery or a guestbook. I think including the code or putting it in a frame makes no big difference.
Title: Re: Using CPG as an included file
Post by: Nibbler on June 09, 2005, 01:25:45 PM
Great, then please post how to accomplish this so easily. :)
Title: Re: Using CPG as an included file
Post by: Tranz on June 09, 2005, 10:59:38 PM
Quote from: snappy on June 09, 2005, 12:34:37 PMI've found a guestbook (http://www.vipergb.de.vu/)
I made a skin for the guestbook so that it gets the theme info from the gallery: http://forum.coppermine-gallery.net/index.php?topic=18738.0 :)
Title: Re: Using CPG as an included file
Post by: snappy on June 11, 2005, 06:30:32 PM
Quote from: Nibbler on June 09, 2005, 12:48:02 PM
Coppermine is slightly more complicated than a guestbook :)

If I'd know how to do this, I wouldn't have postet here to find out, how to do it :)
Title: Re: Using CPG as an included file
Post by: kegobeer on June 11, 2005, 06:37:57 PM
Coppermine wasn't written to be included into another web page; rewriting the code would be a huge task and it's something the dev team won't do.  Your options are:  either an iframe or a theme to match your site.
Title: Re: Using CPG as an included file
Post by: snappy on June 15, 2005, 01:14:28 AM
short and clear answer :)

But nevertheless it seams to me, that this problem could be solved, if one would put a variable in front of each filecall in all the scripts...much work to do, I will have a look at it...
Title: Re: Using CPG as an included file
Post by: Joachim Müller on June 15, 2005, 09:26:02 AM
not that easy, as coppermine needs to modify the header, which can only be done when there hasn't been any output yet. As stated above: not that easy, and there are several good reasons why coppermine has been written the way it is. The ability to be included via PHP's include command would be nice for easy integration into an existing site, I agree. But then, coppermine would have to be less powerfull, as the script needs more control than a simple include file could have.