help with integration and includes

Hello everyone, i'm running my own website with a blog using the Habari blogging-engine and Zenphoto to display my photogallery.

System configuraton

# Zenphoto version 1.2.5 [4022] (Official Build)
# PHP version: 5.2.10-pl1-gentoo
# Graphics support: PHP GD library bundled (2.0.34 compatible)
# PHP memory limit: 128M (Note: Your server might allocate less!)
# MySQL version: 5.0.70
# Server Software Apache
# Habari Version 0.6.2
# Habari API Version 3124
# Habari DB Version 3249

#PHP Extensions
date, libxml, openssl, pcre, zlib, bz2, calendar, ctype, curl, dba, dom, session, filter, gd, gettext, hash, iconv, standard, json, mbstring, mcrypt, mysql, SimpleXML, SPL, PDO, pdo_mysql, pdo_sqlite, posix, pspell, Reflection, imap, mysqli, snmp, sockets, SQLite, exif, sysvmsg, sysvsem, sysvshm, tokenizer, xml, apache2handler, pdf
PCRE Version 7.9 2009-04-11

Background-info for my questions

Right now i've successfully styled my Zenphoto and Habari installation to match each other, and in my Habari-theme i've used a Simplepie script to import my latest images from Zenphoto through RSS into my Habari-sidebar.

This works somewhat good but it is not a clean solution and it sometimes give me php errors.

What i really would like though is to show my latest(only one) album through a php include. I don't want every picture in the album, just the album-thumbnail linked to the zenphotopage with the images from that specific album, i want the name from the album, and the date when it was uploaded.

Now I'm not a very good coder but I know some html/css and just a little bit of php.

Questions I'm looking for answers to:

1. Do you think this is possible to accomplish?
2. If so, is there some kind of existing quide?
3. Is there someone who would like to try to explain for me how to do it?
4. Is there some alternative way except using RSS?
5. Have I forgotten to mention something?

I would really appreciate any answers i can get! Thanks...

Comments

  • Have you looked at http://www.zenphoto.org/2008/01/hacks/#zenphoto-as-plugin?

    You will need to do coding to use this, but you will need to do that anyway to use anything other than the RSS you are currently using.
  • big thanks for the link, i somehow didn't find that while searching the site. i have been expecting to do some coding from the beginning, it will definitely help me on the right track, but i might return with questions later. :)

    thanks again!
  • okey, i have now tried to add this code in the sidebar of my theme:

    `
    <?php define('ZENFOLDER', 'zp-core');
    define('WEBPATH', 'zenphoto');
    require_once(WEBPATH . "/" . ZENFOLDER . "/template-functions.php");

    $randomImage = getRandomImages();
    $randomImageURL = getURL($randomImage);
    echo "<div class=\"module-header\">

    Random Image

    ";
    echo "imagegetSizedImage(getOption('image_size')) . "'alt=\"random image\"\n" . $randomImage->getTitle() . '" />';
    ?>
    `
    With that code i got this error message:

    Zenphoto Error
    MySQL Error: Zenphoto could not connect to the database server.Check your zp-config.php file for the correct host, user name, and password.Note that you may need to change the host from localhost if your web server uses a separate MySQL server, which is common in large shared hosting environments like Dreamhost and GoDaddy.Also make sure the server is running, if you control it.

    anyone who want to help me to try and find a solution? I don't know much about databases and stuff.
  • acrylian Administrator, Developer
    You need to enter the database details when Zenphoto Setup asks for it. It should also complain about this.
  • No, zenphoto works properly when i go to `http://mysite.com/zenphoto`, i get the error when i tried to load that code in the sidebar on my main-site.

    Could it have something todo with my main site and zenphoto having different database table prefix?
  • I am not sure what might caust this. But maybe setting DEBUG_ERROR to true will give us some additional information that will help.
Sign In or Register to comment.