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?
$randomImage = getRandomImages(); $randomImageURL = getURL($randomImage); echo "<a href='".$randomImageURL."' title='Random Picture...'> 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...
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 "<a href='".$randomImageURL."' title='Random Picture...'> 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?
Comments
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
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 "<a href='".$randomImageURL."' title='Random Picture...'>
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...
`
<?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 "<a href='".$randomImageURL."' title='Random Picture...'>
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?