Member
Member
nordx   2008-12-08, 21:30
#1
I have a small CMS-Script where i can include php-scripts. I installed the zen-script in a dir "gallery"... now i want "include" the galleryscript in my main-site. Is it this possible?

greets,
nordx
Administrator
Administrator
acrylian   2008-12-09, 09:53
#2
No, Zenphoto is actually a gallery specialised CMS of its own. You can't directly include it. There are two main options;

1. http://www.zenphoto.org/2008/01/hacks/#zenphoto-as-plugin (please perform also a forum search on that topic)
2. Make your Zenphoto theme look like your site
Member
Member
nordx   2008-12-10, 15:47
#3
i tried the first one...
result:
CMS-Gallery-Page

i tried the "standard"-code for a test... here it is:

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

$randomImage = getRandomImages();
$randomImageURL = getURL($randomImage);
echo "
<img src='". $randomImage->getSizedImage(getOption('image_size')) . "'
alt=\"random image\"\n" . $randomImage->getTitle() . '" />';
?>
`
but the gallery for its own works perfectly as you can see here:
Gallery

i searched in the forum for solutions, but failed...
Member
Member
nordx   2008-12-11, 13:21
#4
ok i forgot some code,... but it still doesnt work:
`
<?php
define('ZENFOLDER', 'zp-core');
define('WEBPATH', 'gallery');
require_once(WEBPATH . "/" . ZENFOLDER . "/template-functions.php");
//load extensions
$_zp_plugin_scripts = array();
$_zp_flash_player = NULL;
$curdir = getcwd();
chdir(SERVERPATH . "/" . ZENFOLDER . PLUGIN_FOLDER);
$filelist = safe_glob('*'.'php');
chdir($curdir);
foreach ($filelist as $extension) {
$opt = 'zp_plugin_'.substr($extension, 0, strlen($extension)-4);
if (getOption($opt)) {
require_once(SERVERPATH . "/" . ZENFOLDER . PLUGIN_FOLDER . $extension);
}
}
$randomImage = getRandomImages();
$randomImageURL = getURL($randomImage);
echo "
<img src='". $randomImage->getSizedImage(getOption('image_size')) . "'
alt=\"random image\"\n" . $randomImage->getTitle() . '" />';
?>
`
and i get this error:
`
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 has an idea?
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.