Error when posting comments

On my site (http://10days.bzzagent.com/gallery/index.php?album=Day1&image=DSC_6854.jpg#) when a user posts a comment he/she'll get:

Warning: Cannot modify header information - headers already sent by (output started at /home/bzzagent/www/10days/gallery/index.php:5) in /home/bzzagent/www/10days/gallery/zen/template-functions.php on line 67

Warning: Cannot modify header information - headers already sent by (output started at /home/bzzagent/www/10days/gallery/index.php:5) in /home/bzzagent/www/10days/gallery/zen/template-functions.php on line 75

Any idea on how to fix this ?

Erik

Comments

  • one quick way around it.. if you can.. it to turn off Display_errors in your php config file. the comment is still getting posted it is just displaying the warnings..

    Other than the theme.. what else have you done to your gallery.. any special mods.. normally you will see those errors when integrating zp into another site like wp where the headers are sent outside of zp
  • edasque Member
    The gallery is pretty much vanilla. I do use wp and zenpress but the gallery is not hosted within a wp theme, it's just there, outside it.
  • edasque Member
    so now with the comments off, it displays a blank page instead of a blank page with errors
  • trisweb Administrator
    Are you sure you never modified anything else? Even in the config file?

    If you put even one blank line in the config file, or one bit of HTML in any other file, it could cause that error.
  • I get 2 different cookies when I post on your site... and they are different compared to all my zp sites.. normally I am only gettting 1 cookie with a name.. zenphoto and my post information.. i am getting 2 different ones on yours with different information... any ideas what would of caused this on your side.
  • edasque Member
    for the cookies I am thinking you're hitting the wp app first and then zenphoto which both set a cookie ?

    As far as modifying anything, there is one thing, I added a line of HTML to return to the wordpress site at the top of each of the three main pages (index, album, detail). What could that do ?
  • as far as the cookies go.. those are wordpress cookies and not zp cookies, hence the reason you are getting the errors....

    That is most likely your problem. you might want to try this..(not sure how you have currently configured it) but my guess from what you said is with a php call you included/required a wordpress file into index/album/image.php is this correct.. ?

    you are receiving a conflict because both wp and zp are trying to output header information.

    include your wp file in the zp index.php before your require_once to template-functions.php

    Since I dont really know how exactally you integrated it then if that still doesnt work, on line 66 of image.php in the template that you are using, change "isset($error)" with ($FIXME). Let us know how that works for ya
  • edasque Member
    Except for the zenpress integration which I don't think is at play here, I didn't integrate WP in those three files, just put an href link that calls the page, nothing else. Maybe it's the blogbeat script ?
  • LOL, That is possible also, is there anything else that you have integrated into it..

    If all you did was create a link at the top.. that is not the problem.. i thougth you were pulling WP stuff into your install..

    it is probably the blogbeat which is causing the errors. How and where did you integrate that into your zp installation
  • edasque Member
    I just added the script tag for blogbeat after the zen script. You can see it on every page.
  • just for sake of determining weather or not blogbeat is the problem, remove the blogbeat from the template files and see if it still happens..
    if it is the problem I would try a similar method that I mentioned above but with the blogbeat script.. put it in the index.php in your zproot indead of your template files.. see if that helps
  • edasque Member
    Ok, so I tried a few thing. First I removed the blogbeat script. No dice. Then I remove the theme files and overwrote them with the default-dark vanilla file. No dice. So I decided to use the default theme. No dice.

    So I re-aplied the modified default-dark I had. Still no dice but it looks good :)
  • so even the, unmodified, default theme does not work? whatabout the testing theme?
  • edasque Member
    same thing
  • Maybe there was something wrong with your download????? I am all out of ideas..

    Try to download the latest version again and re-upload the index.php in the zproot and the zen directory.

    dont use the same config but rather put in your settings in the new config.php.

    honestly I am out of ideas. I have zp integrated into many sites left and right on multiple different webserver types and configurations.. and I have only had THAT problem when modding the files to do something other than default. Which is why I am suggesting to download a new package..

    anyone have any other better ideas.. ??????? I am about all out..
  • trisweb Administrator
    Please give us your gallery's URL so we can actually diagnose the problem. Thanks!
  • trisweb Administrator
    Can you please copy us the entire text contents of your [zproot]/index.php file? Thanks.
  • edasque Member
    <?php
    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");
    }

    ?>
  • edasque Member
    any idea ?
  • since zenphoto is my new hobby and I love working with it, I am actually playing around trying to recreate your problem... havent gotten too indepth but I had to work last night and I am going to the Pistons game tonight.. I wont get a chance to look into it further until tomorrow.

    You never specified weather or not you re-downloaded zenphoto and reuploaded your index.php and the zen directory and re entered the information in the config.php?

    In the mean time, what type of server is this..
    IIS/Apache
    mod-rewrite?

    I'll let you know what I find..
  • edasque Member
    Apache on Linux w/ mod_rewrite but turned off in zp

    http://10days.bzzagent.com/phpinfo.php
  • trisweb Administrator
    Well since we can't recreate this and it seems to be an isolated problem, the best way for you to fix it is probably to turn on Output Buffering in PHP if you can.... it would fix the problem entirely.

    With me, using Apache, PHP4 with Output Buffering turned off (the only way this problem can possibly appear), mod_rewrite off, etc etc. everything works perfectly.

    And Daniel, since you say "zenphoto is my new hobby", want to help us out and become a dev? ;-)
  • trisweb Administrator
    Okay, one more thing it could be... try deleting the cache/theme.txt file if there is one. If there isn't, try switching themes a couple times in the admin...

    Also try different permissions on that file, especially 777.
  • I appreciate the offer however I am not close to being good enough to work on this. I am still teaching myself php, and while I am getting better, I still have a ways to go. I am working on writing my own template functions, which I have a few, maybe ill take a look at some of the stuff in the bug tracker and see what I can do, hopefully submit a few and help you out.

    and yeah.. back on topic... I will also see still what I can find.. however I am not really feeling up to it now cause my Pistons lost tonight:-(
  • edasque Member
    Sorry about the Pistons :(

    Tried switching themes, deleting the file, changing the permissions. No go. Same results.
  • trisweb Administrator
    Turn output buffering on, that should fix it in any case -- it seems like you have a version of PHP with an obscure bug that we have no hope of finding...
Sign In or Register to comment.