WordPress 2 and 1.01 Beta

Alright, so I've been using that noscope code and all to get WordPress and ZenPhoto playing nicely and they basically do now...although I noticed when I post a comment I get some errors.

`Warning: Cannot modify header information - headers already sent by (output started at /home2/horseboy/public_html/wp-content/themes/k2/header.php:6) in /home2/horseboy/public_html/photos/zen/template-functions.php on line 67`

`Warning: Cannot modify header information - headers already sent by (output started at /home2/horseboy/public_html/wp-content/themes/k2/header.php:6) in /home2/horseboy/public_html/photos/zen/template-functions.php on line 75`

So I looked in my template-funtions.php on those lines and they have to do with re-setting the cookie. I can paste the code here if you would like...anyways...I know just about nothing for PHP...I am surprised I even got this far...so it seems that this is just one error that is making this WordPress/ZenPhoto integration harder...

Also to note, the comment does get posted :) It's just something to do with cookies that gets messed up. Thanks for any help!

Comments

  • 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. I to ran into the same problem

    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
    This was the problem that I encountered.

    Also make sure you have done the work around conflict with comments by opening the ZP template image.php and replacing isset($error) with $FIXME. as stated on noscope.com's instructions under number 4.
  • Actually I think it was your website that I was looking at, you have the one with the Windows XP wallpaper-ish header image?

    Anyways, in my index.php, this is exactly what I have:

    <?php

    /* Start Wordpress */
    define('WP_USE_THEMES', false);
    require($_SERVER["DOCUMENT_ROOT"].'/wp-blog-header.php');
    get_header();
    /* 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");
    }

    ?>

    For the $FIXME thing, I changed this file /themes/default/image.php and the line that I changed was:

    <?php if (isset($error)) { ?><tr><td><div class="error">There was an error submitting your comment. Name, a valid e-mail address, and a comment are required.</div></td></tr><?php } ?>

    to

    <?php if ($FIXME) { ?><tr><td><div class="error">There was an error submitting your comment. Name, a valid e-mail address, and a comment are required.</div></td></tr><?php } ?>

    Same error that I got before happens again.
  • Think you need to re-read what Chilifrei64 said?

    make sure your
    require_once(“zen/template-functions.php???);
    is before your getheader() or getsidebar() calls
  • Awesome. Yeah...now it works. Thanks guys! :)
  • After spending hours cracking my head, I just realized why my gallery isnt indexed by search engines and spider simulators are unable to properly crawl it. It's due to:
    require($_SERVER["DOCUMENT_ROOT"].'/wp-blog-header.php');
    returning 404 error, when it really is loading fine.

    So I added this after the above statement:
    header("HTTP/1.1 200 OK");
    to force the header back to 200. And spider simulators seem to do fine now.

    Will wait to see if search engines will index the gallery. But do add that line if you are using this method to integrate with WP. :)
  • Alright, for some background information first. I am now having this problem. I recently migrated to a new server. copied all files from old to new and took sql dumps from old to new. Everything is working as it should.... almost. the only thing not working is commenting on zenphoto pictures. If I turn on errors in php I see that it is giving me the headers are already sent on lines 67 and 75.
    The only things that are different are i went from php version 4.3.8 to 5.1.2 and mysql 4.0.1 to 5.0.20. The server is still iis6 and Server 2003 standard.
    I have verified that I am following the guidelines which I posted above and nothing was wrong there.
    The migration was a straight file copy and sql dump. I still have access to the old site(internal webserver) and it still works there but on the new server it doesnt.

    Now, to get it to post I put the require_once(template-functions.php) right underneath the get header() and get sidebar() calls and I am able to post, but it then spits out all sorts of WP errors on the gallery page.

    Basically this is a latest version of everything. WP2.0.2, ZP1.0.2, latest stable mysql and latest stable php on a brand new install of w2k3 server . The only thing different is the php and mysql versions. Can anybody come up with a good reason.. i have been playing with this for hours and havent gotten anywhere...anyone else out there running the latest version of WP and ZP with the latest php and mysql who's comments arent working?
  • Alright, well incase anybody is wondering.. After about spending a few hours on it I have found the problem. One thing that I failed to mention was that I was using seperate DB for zp and wp. Other than the versions of php and mysql that changed.. the other thing that changes was my mysql username and password setup. I was using the same mysql user to access both DB, so that single user had access to both db which is why it gave me "errors trying to locate zen.wp-posts" I really dont know the reasoning behind it all, I was just logically troubleshooting and not using any sorta programming/sql logic at all. But just incase anybody else has this same problem:
    seperate wp and zp db's
    should also mean
    seperate wp and zp mysql usernames
Sign In or Register to comment.