I am building a site for a friend who is a model, they want a open access part to the site with the usual features, bio, blog, links etc and then a secure side with all of there photography on.
I have done this before, using ZP in the secure section to handle the gallery needs, but this time this person wants the most recent say 3-5 galleries to appear on the home page of the open side of the site, is there a way to do this easily or is it a lot of php coding involved?
I was hoping there'd be an easy way that when they update the galleries with new content it could automatically keep the open home page updated if you understand what i mean.
Comments
Gallery = ZEnphoto site, you mean albums. Just to avoid misunderstandings.
If that home page is outside Zenphoto you have to do some coding following this way:
http://www.zenphoto.org/news/zenphoto-as-a-plug-in-using-zenphoto-functions-from-outside-zenphoto
As noted it might not work if the other part of the site is also run by a CMS (Wordpress an possibly others as well). For Wordpress there are some 3rd party tool available.
But Zenphoto could manage the full site requirements actually using the Zenpage CMS plugin, btw.
The site I'm building isnt wordpress, just a standard html site, but the gallery side of the site is ZP yes, its just the way its worked out best for me.
my site is built in the root directory /public_html/ and the ZP install is in /public_html/members/ if I put the following in
<?php define('SERVERPATH',str_replace('\\','/',dirname(__FILE__)).'/members'); define('WEBPATH','/'.basename(dirname(__FILE__)).'/members'); require_once(SERVERPATH.'/zp-core/template-functions.php'); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"">
<head>
</head>
<body>
<p> This example will show a pre-defined image. Really, almost any theme related actions could be done here. </p>
<?php $albumName = 'albums/mandy1'; $imageName = 'mandy1.jpg'; $image = newImage(NULL, array('folder'=>$albumName,'filename'=>$imageName)); makeImageCurrent($image); printCustomSizedImage(getImageTitle(), 500); ?> <!-- provide a link to the Zenphoto gallery --> <p>
">Visit the actual gallery from which this image was extracted. </p> </body> </html>
this is in a file called tester.php saved in the root folder, it does nothing, it doesn't show the theme, and the gallery link takes me to www.mywebaddress/public_html/members not www.mywebaddress/members/albums/mandy1
if i move the same file into the members folder and alter the first line to
<?php define('SERVERPATH',str_replace('\\','/',dirname(__FILE__)).'/'); define('WEBPATH','/'.basename(dirname(__FILE__)).'/'); require_once(SERVERPATH.'/zp-core/template-functions.php'); ?>
the link works but still no theme and no picture, plus this doesn't help as its a level to high??
Any help appreciated
So the caution is:
1. Escape all "code" type text.
2. Do not post something that looks like an URL unless needed--specially "dummy" ones as URLs are one thing that the spam filter is quite strict about.
BTW, if the filter does "catch" you you are automatically marked as "blocked" and will not be able to post until a moderator discovers and un-blocks you.
so anyone with any advice appreciated. will admit php isn't my strong point.
"define('SERVERPATH',str_replace('\\','/',dirname(__FILE__)).'/members');"
like I said, not getting any errors, but it won't find the picture or the theme?
"define('WEBPATH','/'.basename(dirname(__FILE__)).'/zenphoto');"
has been replaced with
"define('WEBPATH','/zenphoto');"
thing is that still doesn't work.
what next.
Then put some debugging statements into your script. For instance echo out the SERVER PATH and WEB PATH to be sure they are correct.
Try calling some simple functions, for instance `exposeZenPhotoInformations()` and see what you get.
now for my next question, is there a way of displaying the latest say 3 galleries in boxes rather than just a single image as in the tutorial? this way I wouldn't need to manually update the homepage it would be automated whenever I uplaod new galleries so new visitors can see there is new content?
A thumb for each album? Try including the image_album_statistics plugin additionally. Or use the object model directly: http://www.zenphoto.org/news/zenphotos-object-model-framework