Pages (3): 1 2 3   
Member
Member
spellmank   17-05-2006, 12:30
#1

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

Member
Member
Chilifrei64   17-05-2006, 16:21
#2

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");
}

  1. Tweak your zenphoto templates (not your wp templates) to fit your wp style. You can now use functions such as get_header and get_sidebar.
  2. Work around a conflict with comments by opening the ZP template image.php and replacing isset($error) with $FIXME.

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.

Member
Member
spellmank   17-05-2006, 20:03
#3

I didn't think you were being a jerk at all. Sorry that you thought I thought that. : -)

Thanks for the instructions above. I'll give them a try.

spellmank

Member
Member
spellmank   18-05-2006, 00:43
#4

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

Member
Member
Chilifrei64   18-05-2006, 03:24
#5

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.

Member
Member
spellmank   18-05-2006, 12:37
#6

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?

Member
Member
Chilifrei64   18-05-2006, 14:50
#7

Did you do this fix?

  1. Work around a conflict with comments by opening the ZP template image.php and replacing isset($error) with $FIXME.
Member
Member
spellmank   18-05-2006, 15:27
#8

I had already done that. I replaced iseet($error) which looked like this (isset($error)) with this ($FIXME).

Member
Member
Chilifrei64   18-05-2006, 15:43
#9

copy and paste your zproot/index.php into here so I can see..

also, do you have a link we can look at?

Developer
Developer
trisweb   18-05-2006, 20:53
#10

It's a conflict in the function name since I copied that function from WP ;-) Just rename it and its one use in Zenphoto and it should work. Sorry about that, how bout if I rename the function for the next release?

Member
Member
spellmank   19-05-2006, 01:15
#11

trisweb,

Ahhh, so I shoul rename isset($error) something like $Oops?
Sorry, don't quite follow you. I don't know enough about PHP yet.

spellmank

Member
Member
spellmank   19-05-2006, 01:19
#12

Quote:

Link: http://www.karaspellman.com/wordpress/zenphoto/

Member
Member
Chilifrei64   19-05-2006, 03:16
#13

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

``

Member
Member
spellmank   19-05-2006, 12:23
#14

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)?

 |  | 
Member
Member
spellmank   19-05-2006, 12:33
#15

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: Check Valid E-Mail Address


function is_valid_email($email) {
$regex = '/^[A-z0-9][\w.-]*@[A-z0-9][\w-.]+.[A-z0-9]{2,6}$/';
return (preg_match($regex, $email));
}

Developer
Developer
trisweb   20-05-2006, 22:08
#16

I told you above, you have to rename is_valid_email in zenphoto. It will not work without doing that. Just replace the string "is_valid_email" anywhere it's found in ZP code to "is_valid_email_zp"

It's changed in the latest SVN if you just want to use that...

Member
Member
spellmank   24-05-2006, 13:12
#17

Sorry, trisweb,

I'm new to PHP so I don't always follow what has been said above. When you said to rename a function I wasn't sure which one. I just needed more specifics.

Thanks again for your help!
spellmank

Junior Member
Junior Member
ruzee   12-06-2006, 21:20
#18

Here's another way of doing it (including a nice howto):
http://www.ruzee.com/blog/2006/06/integrating-zenphoto-into-wordpress/

Member
Member
webdev   13-07-2006, 06:17
#19

thnx ruzee !

Member
Member
ny888   20-07-2006, 21:10
#20

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 ??

Pages (3): 1 2 3   
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.