ZenphotoCMS Forum
Using ZenPhoto as a plugin - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: Using ZenPhoto as a plugin (/thread-4558.html)



Using ZenPhoto as a plugin - Matthew - 2009-01-29

Hi,

I know this has been discussed before, but I can't get this working...

I would like to use ZenPhoto 1.2.2 as a plugin, I have created a php file with this code:

When I open this php file on my server I get this error message:
Warning: Cannot modify header information - headers already sent by (output started at /www/htdocs/w006b63d/v2/test.php:9) in /www/htdocs/w006b63d/v2/zenphoto/zp-core/functions.php on line 1894

What does it mean?




Using ZenPhoto as a plugin - Matthew - 2009-01-29

I have read now, I have to change nearly all of the variables, the code in my new php file looks like this:

or replace zenphoto with the name of the folder in albums?
require_once(WEBPATH . "/" . zenphoto . "/template-functions.php");
?>
doesn't work, too

I still get the same error.
Zenphoto is installed in zenphoto.




Using ZenPhoto as a plugin - sbillard - 2009-01-29

Zenphoto is attempting to store a cookie, which is not allowed if headers have already been sent. So the most likely cause is that the code you inserted was not placed before the headers for your page. It should be pretty much the first thing in your script.




Using ZenPhoto as a plugin - Matthew - 2009-01-29

Thank you very much, sbillard, it works now.

The randon image function is nice, but how do I display the albums from the gallery instead?
Would you be so nice, to post the code here?




Using ZenPhoto as a plugin - sbillard - 2009-01-29

There are any number of functions that might be appropriate depending on what you really want. You should check the functions guide on the web site. In particular see the print_album_menu plugin.




Using ZenPhoto as a plugin - Matthew - 2009-01-29

Sorry, I still don't get it

my code looks like this:

Unbenanntes Dokument

I get this error:
Fatal error: Call to undefined function rewrite_path() in /www/htdocs/w006b63d/v2/zenphoto/zp-core/plugins/print_album_menu.php on line 163




Using ZenPhoto as a plugin - sbillard - 2009-01-29

What happened to the code of your first post?




Using ZenPhoto as a plugin - Matthew - 2009-01-30

it's gone.

Maybe, you can just tell me, what the correct code is?

To use the print-album plugin, I thought I have to enable the plugin in the admin panel/plugins + write down the "require_once" part at the beginning of my php file.
I link to the print_album_menu.php, not not the template-functions.php like it's written in the first post, is this correct or not?

The way how to link to the php file with
"zenphoto/zp-core/plugins/print_album_menu.php"
or
"define('ZENFOLDER', 'zp-core'); ... and so on"
is the same I guess, or not?




Using ZenPhoto as a plugin - sbillard - 2009-01-30

The code in the example is the basic recipe for using zenphoto from outside the album. It establishes the zenphoto environment. In addition to establishing the environment you need to load any plugins you wish to use.

See http://www.zenphoto.org/2008/01/hacks/#zenphoto-as-plugin




Using ZenPhoto as a plugin - Matthew - 2009-01-30

Sorry, but this doesn't help me... maybe you can see in one of my previous posts, that I already know this link (zenphoto-as-plugin).

I have seen now, someone else has the same problem, at this point excuse me, for opening another thread - I have used the search, but I didn't noticed this thread:
http://www.zenphoto.org/support/topic.php?id=4742#post-28064

For me it's the same, I'm not using thickbox, but Highslide JS, which has the same typical lightbox overlay background effect, which looks stupid inside an iframe.

The other thread from Jahan77 didn't come up with a real solution, it ended up with to look in a album.php from a theme, but this can't be the answer to his second last post.

How can I contact/send pm's to other members, like Jahan77?
I have found now function in the forum for it...




Using ZenPhoto as a plugin - sbillard - 2009-01-30

Click on the member link below their name. If they have registered an e-mail address it will show there.




Using ZenPhoto as a plugin - Matthew - 2009-01-30

No, it's not, maybe just for the admins.
I just can see:
Member since + Occupation and the last posts.

But anyway, can you help me to integrate zenphoto in my site as a plugin to show the albums with thumbs?




Using ZenPhoto as a plugin - acrylian - 2009-01-30

In any case you need to include the template-functions.php file first and then the plugin you want to use. Naturally plugins are depended on the main template-functions.php. That is why you get the error above.




Using ZenPhoto as a plugin - Matthew - 2009-01-31

thanx acrylian, works.

With the print_album_menue plugin I can just display links (as a list or drop down menu) to the gallery/gallery albums, but I can't display the gallery like a "mirror" of the zenphoto index.php (with the current theme, thumbs and so on)?




Using ZenPhoto as a plugin - sbillard - 2009-01-31

At this point you should really have a good thought about what you want to accomplish. If you want your page to look like zenphoto, why not just use zenphoto?




Using ZenPhoto as a plugin - Matthew - 2009-01-31

I want to use zenphoto, but not on an extra page. I want to integrate the gallery in my existing website, in a div (id="content").
I don't use Wordpress (not yet), for Wordpress there are several plugins to integrate zenphoto in an existing website/blog, for static html pages there are no plugins.
I've read "include" for zenphoto doesn't work, to use Ajax for this should have pro and cons, so... I think I need to use iFrames, which seems to be outdated and what you read is, not to use frames for websites, but I don't see any other solution.




Using ZenPhoto as a plugin - acrylian - 2009-01-31

Why don't you just make your theme look like your site. Your visitors will not notice the difference..

There is a plugin called Zenpage to run a complete site with Zenphoto: http://zenpage.maltem.de