Hi,
What is the best method to integrate ZenPhoto within WordPress? I've looked into ZenPress (http://simbul.bzaar.net/zenpress/), but it appears that it only allows for linking to one's separate ZenPhoto site. I like the way A day in the life... site (http://www.chilifrei.net) has integrated ZenPhoto in such a way that it looks like the rest of the site. Any assistance would be greatly appreciated.
Thanks,
spellmank
Put the following information in your zproot/index.php
/ Start Wordpress /
define('WP_USE_THEMES', false);
require($_SERVER["DOCUMENT_ROOT"].'/journal/wp-blog-header.php');
/ Start zenphoto /
require_once("zen/template-functions.php");
$themepath = 'themes';
$theme = $_zp_gallery->getCurrentTheme();
$_zp_themeroot = WEBPATH . "/$themepath/$theme";
if (in_context(ZP_IMAGE)) {
include("$themepath/$theme/image.php");
} else if (in_context(ZP_ALBUM)) {
include("$themepath/$theme/album.php");
} else if (in_context(ZP_INDEX)) {
include("$themepath/$theme/index.php");
}
A couple of things to look for
if you are calling your wordpress
getheader();
or
getsidebar();
That can cause problems depending on where it is placed.
make sure your
require_once('zen/template-functions.php');
is before your getheader() or getsidebar() calls and right after your require(..wp-blog-header.php) call
The other thing that I did because of conflicting css styles was I removed the zenphoto css file from the templates and merged it into my wordpress theme css file. This made integrating much easier.
PS.. I wasnt trying to be a jerk on my board.. sorry if I came across that way, I thought you were asking questions about zenpress which I dont know much about other than I have it installed and it works for me.
I hate to appear dim, but I'm not finding require_once('zen/template-functions.php'); or require(..wp-blog-header.php) in any of my theme/default files or zen/ files for that matter. Not sure how to edit those theme/default files if I can't find the "calls" you mentioned above. I'm very new to PHP so some I am a bit lost.
However, I was able to edit the zproot/index.php and the image.php files successfully. I'm holding off on the css edits until I figure out how to edit the ZP templates.
spellmank
All files that you edit are going to be zenphoto files.
the require_once('zen/template-functions.php'); is located in your zenphoto root This is the file(really the only file) that you need to edit. NOT the index.php in your themes directory.
examplemy website) www.chilifrei.net/zp
is the url to my gallery. On my hard drive the path is d:\websites\chilifrei.net\zp
inside that zp folder is an index.php which is the file you need to edit.
I'm getting this fatal error:
Fatal error: Cannot redeclare is_valid_email() (previously declared in /var/www/vhosts/karaspellman.com/httpdocs/wordpress/zenphoto/zen/functions.php:88) in /var/www/vhosts/karaspellman.com/httpdocs/wordpress/wp-content/plugins/email/email.php on line 270
Any thoughts?
Did you do this fix?
copy and paste your zproot/index.php into here so I can see..
also, do you have a link we can look at?
Quote:
I am sorry, I made a grammitical error.. dont put the code above into your index.php.. replace the old code with the code above.
you should only have your second part.. it looks as if you have both the original code and the new code live and between php brackets? your zproot/index.php should look like this
``
Hi,
I'm still getting that email error after making the changes to the index.php file above. Here is my code for the image.php from the default theme. Again I had changed isset($error) to ($FIXME). Should it be just $FIXME instead of ($FIXME)?
| |
Here is that email error again:
Fatal error: Cannot redeclare is_valid_email() (previously declared in /var/www/vhosts/karaspellman.com/httpdocs/wordpress/wp-content/plugins/email/email.php:270) in /var/www/vhosts/karaspellman.com/httpdocs/wordpress/zenphoto/zen/functions.php on line 88
I took a look at line 88 in the ZenPhoto functions.php and it is this:
// Determines if the input is an e-mail address. Stolen from WordPress, then fixed.
function is_valid_email($inputemail) {
$chars = "/^([a-z0-9+]|\-|\.)+@(([a-z0-9_]|\-)+\.)+[a-z]{2,6}\$/i";
if(strstr($input_email, '@') && strstr($input_email, '.')) {
if (preg_match($chars, $input_email)) {
return true;
}
}
return false;
}
I also looked at line 270 from email.php in WordPress:
function is_valid_email($email) {
$regex = '/^[A-z0-9][\w.-]*@[A-z0-9][\w-.]+.[A-z0-9]{2,6}$/';
return (preg_match($regex, $email));
}
Here's another way of doing it (including a nice howto):
http://www.ruzee.com/blog/2006/06/integrating-zenphoto-into-wordpress/
I'm so close to getting this all to work I can taste it but need some clarification -
I've modified index.php so now it displays with my header, sidebar, and footer.
Only thing is that the zp content is not fitting inside of the blog alongside the sidebar. Instead, it's displaying below the sidebar and is taking up the width of the page.
I must be missing edits ??? in index.php, album.php and image.php ??