I'm trying to use the following function, which is stored in my zp-customfunctions.php file, in my Wordpress Footer.
`
function show_latest_image_links($number) {
$sql = "SELECT * FROM ". prefix("images") ." ORDER BY id DESC LIMIT $number";
$result = mysql_query($sql);
while($r = mysql_fetch_array($result)) {
$id=$r['albumid'];
$sql="SELECT * FROM ". prefix("albums") ." WHERE id = $id";
$album = mysql_query($sql);
$a = mysql_fetch_array($album);
echo '';
echo '
';
$title=$r['title'];
echo $title;
echo '';
echo '';
}
}
`
It works correctly, displaying text links to my latest photos, in my ZenPhoto footer. However, in Wordpress, I receive the following error.
Fatal error: Call to undefined function prefix() in /home/bryan/public_html/wp-content/themes/valid-light/zp-customfunctions.php on line 300
I have ZenPhoto pull in my Wordpress theme so that I can edit my ZenPhoto theme files from within Wordpress, etc. In my Wordpress header, I was able to successfully load zp-customfunctions.php using require_once. However, I haven't been able to use require_once to load my template-functions.php file from ZenPhoto. The following code:
`
define('ZENFOLDER', 'zp-core');
define('WEBPATH', 'gallery');
require_once(WEBPATH . "/" . ZENFOLDER . "/template-functions.php");
`
results in:
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.
My ZenPhoto installation is in the "gallery" folder in the root of my site.
"/" Wordpress is installed in the root
"/gallery" ZenPhotos is installed here
Is it possible to hard-code the path for template-functions.php, like this:
`require_once("
http://www.bryanbrazil.com/gallery/zp-core/template-functions.php");`
It doesn't seem to work like this.
Hopefully I've provided enough details...thanks in advance for any help you can provide.
Comments
Probably we should do what he suggests...
If I can test anything out, just let me know. Thanks!