Zenphoto integration into html website - zp_load_gallery()

How to integrate zenphoto into website but with the gallery view, not the random image function like on
http://www.zenphoto.org/news/zenphoto-as-a-plug-in-using-zenphoto-functions-from-outside-zenphoto
how to use zp_load_gallery() function

Comments

  • The random function is just an example. The same technique works with whatever you want to display. But you CANNOT just load Zenphoto outside of Zenphoto as the environment is not correct. So what you have to do is decide what you want displayed and take the random images example as a starting point.

    BTW, why on earth would you want to load the whole gallery outside of the whole gallery. Why not just make Zenphoto the main site then? We must not be interpreting your request as you meant it because it really does not make any sense.
  • acrylian Administrator, Developer
    If you have already a site and just want to add a gallery using Zenphoto create a Zenphoto theme that looks like your site and just call that. No visitor will care.
  • My client want to use the same design on whole site and not to change the layout of the site even on gallery page but wants to have possibility to login and add pictures. I have no expirience with php and Zenphoto is the best gallery for me and it has all the functions that I need.
    I need to integrate it into my website, to load the albums of zenphoto into some page
    http://pop-portrait.com/biography.html is one of the pages and instead of that text in the middle I need to include gallery...
  • For a example i need to code how to integrate one album into my page, maybe by zp_load_album($folder) function
  • The short answer is you can't. Which is of course wrong. But you will have to become an expert on the Zenphoto object model and how Zenphoto works to do this. You will have to mimic the Zenphoto stand-alone environment as instantiated by index.php for your page and then replicate zenphoto theme's album.php script in your script.

    But since you say you have no experience with PHP (your lack of Zenphoto experience is moot in this case) you are not advised to take on this task.

    All this can be done, but is it really worth it? You would be better off discarding the current site and building it from Zenphoto tools. You can certainly create a WEBsite using entirely Zenphoto that looks like the site you linked to. But it will take some work, some knowledge of Zenphoto themeing (there is a tutorial), and, of course, some reasonable knowledge of PHP since this is not a straight CSS change from an existing theme.
  • acrylian Administrator, Developer
    I agree to my collegue that you should not do websites using CMS for clients without at least basic understanding of PHP. You can't btw include php function in a .html page, it must of course be a php page.

    My client want to use the same design on whole site and not to change the layout of the site even on gallery page
    Make a Zenphoto theme to look like the site if you don't want to rework everything... Or go the ugly really not recommended way using an iFrame. But no one really should do that as you should know...
  • You can do a lot by customizing a theme. For instance, I am currently customizing two different themes for galleries on two websites, and in each case, I'm not too far off.
    For instance, take a look at http://stjamestheapostle.ca
    and http://stjamestheapostle.ca/photos

    In a nutshell, the website itself is made with lots of included files. The site-wide menu, the left sidebar and the footer are in three files that are included in all pages, and almost all formatting is done with style sheets.

    As for the "photo" section, I worked exclusively with files in the /themes/myTheme folder (where myTheme is a copy of your theme). I have done minimal adaptation to the theme-related stylesheets, mostly to remove stuff that is conflicting. In each of the pages of the theme (album.php, footer.php...), I added links to my own style sheets at the top, and included the common parts of my site such as the site-wide menu and footer to the appropriate pages of the theme.

    Because I haven't coded anything in the program itself, I shouldn't have any problems when I upgrade to Zenphoto 1.4.2, or even to 1.5
  • acrylian Administrator, Developer
    Exactly that is the way to go if you don't run the whole site with Zenphoto.
  • Hi, I totally understand both points of view. Zenphoto people saying "do your own theme" and beginner web designers that want to "embed" zenphoto into some other already built website to make things easy.

    I'm surprised that no one is talking about <frameset...>. I did use it for the company I work for, all I needed was to maintain the company header. So I used <frameset...> NOT <iframe>!

    A few drawbacks...

    a) Whenever I refresh the page, it goes back to zenphoto index.php page (within my .html of course).

    b) I can't email a direct url to a client to a specific album/photo page unless I direct them DIRECTLY to zenphoto which defeats the purpose of using <frameset...>

    c) Because we wanted a black background for the entire gallery, when I am viewing a full size photo and I click "next", the entire page "flashes" because the background goes white for 1/10 of a second, so it appears like a very quick "flash" until the next photo loads, my boss hates that but he loves the back-end interface, it's saved the company thousand of dollars in saved hours of web work. This happens in Safari and Chrome on a Mac but Firefox works nice, no "flashing" in Firefox Mac (don't know about Windows though). This doesn't happen when in "slideshow" view and of course, it doesn't happen when I go to Zenphoto index.php directly instead of <frameset...>

    I know <frameset...> may not be a wonderful techy solution but hey, it worked for me! for this specific project.

    Here's the website where you can see how my <frameset...> works. http://www.refinedsight.com/portfolio.html

    I just loaded zenphoto into another website project, but my <frameset...> won't really work, so my "Gallery" button will go directly to zenphoto/index.php and that's it.
  • acrylian Administrator, Developer
    Sure it is the easy way but not really best practice and that is what we try to recommend..;) They were great 15 years ago. Except for the usability reasons you state there are:
    - Bloated code (you need several pages for just one display!)
    - Quite bad for search engines
    - Not allowed in strict (X)HTML variants
    - Not allowed at all in the - whenever - coming HTML5
Sign In or Register to comment.