After submitting comment, page turns blank

First off, great software. I love it. I've been looking for exactly this for some time. I've integrated it into my WordPress theme and am really excited about getting more photos up.

On to my issue...when I'm at a photo page and I plug in all my info, write my message and click submit, the page turns white...with nothing viewable.

However, if I go back to the thumbnail page and click on the photo again to look at the comments, the comment I just posted is there.

Also, when the page turns white and I hit refresh, the post will double (or triple or quadruple...depending on how many times I hit refresh).

I noticed the form action="#"... should that be something else? why is my page turning blank after posting a comment?

Thanks for any support.

Comments

  • you can test out what I'm experiencing here: http://www.mcclure411.com/photogallery_zp/

    pick a gallery, then pick the image. at the page where you can post a comment...try to post one. when you hit submit, the page goes white.
  • marc Member
    I'm having this same problem, too.
    Has anyone figured out what causes this or how to fix it? I've integrated my zen photo album into the K2reloaded theme for wordpress.

    http://vvroz.com/photos/
  • marc Member
    UPDATE: So I don't have this problem if I run zenphoto not embedded into wordpress just by itself. However if I turn off mod rewrite or get rid of the .htaccess file while zenphoto is embedded into wordpress it gives me this message:
    "OK
    The document has moved here.

    Apache/1.3.36 Server at vvroz.com Port 80"

    The link points to the same url for my image page and it just reloads it and my image page displays again with the comment added.

    Is there something wrong with mod rewrite on my host server or something wrong with my zenphoto setup?

    Any ideas would be very helpful.
    Thanks.
  • iross Member
    Apologies for cross posting this to two threads, but it seems relevant to both

    I was having this problem as well ...

    You probably have something like this in your index.php...

    `/* Start Wordpress */

    define('WP_USE_THEMES', false);

    require($_SERVER["DOCUMENT_ROOT"].'/blog/wp-blog-header.php');

    /* Start zenphoto */

    require_once("zen/template-functions.php");

    $themepath = 'themes';`

    Swap them around, i.e. start ZenPhoto first then WordPress.. This worked for me, I was having issues with the image page always displaying a comment error due to some conflict with the $error variable.

    This was resolved by replacing all instances of $error in the zen source with $zenerror.

    Works perfectly now.
  • marc Member
    So I tried switching them around and having ZenPhoto start before Wordpress. With the the following:
    `<?php<br />
    /* Start zenphoto */

    require_once("zen/template-functions.php");

    $themepath = 'themes';

    $theme = $_zp_gallery->getCurrentTheme();

    $_zp_themeroot = WEBPATH . "/$themepath/$theme";

    /* Start Wordpress */

    define('WP_USE_THEMES', false);

    require('../wp-blog-header.php');

    //Get Wordpress Header */

    get_header();

    echo "

    ";

    echo "
    ";

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

    }

    echo "
    ";

    //Get Wordpress Footer

    get_footer();

    ?>`
    But then I get this MySQL error: "MySQL Query ( SELECT *, (date + 0) AS date FROM zenalbums WHERE `folder`='test-album' LIMIT 1; ) Failed. Error: Table 'vvrozcom_wrdp1.zenalbums' doesn't exist"

    If I move image.php, album.php up before starting wordpress, the album works correctly and so do the comments like you said, however then my ZenPhoto album isn't embbedded in the wordpress theme its above it.
    `<?php<br />
    /* Start zenphoto */

    require_once("zen/template-functions.php");

    $themepath = 'themes';

    $theme = $_zp_gallery->getCurrentTheme();

    $_zp_themeroot = WEBPATH . "/$themepath/$theme";

    echo "
    ";

    echo "
    ";

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

    }

    echo "
    ";

    /* Start Wordpress */

    define('WP_USE_THEMES', false);

    require('../wp-blog-header.php');

    //Get Wordpress Header */

    get_header();

    //Get Wordpress Footer

    get_footer();

    ?>`

    What am I doing wrong? Thanks for any help.
  • trisweb Administrator
    Sounds like there are two WP compatibility problems: the $error variable, and one or more of the database variables.

    Someone want to submit a bug? Thanks.
  • marc Member
    Submitted bug.
  • Has this bug been looked into or fixed?
  • Found a fix for this after doing several Google searches. Open your Zenphoto index.php file. You will see these lines of code around the top of the page:

    if (!defined('ZENFOLDER')) { define('ZENFOLDER', 'zp-core'); }
    if (!file_exists(dirname(__FILE__) . '/' . ZENFOLDER . "/zp-config.php")) {
    $location = "http://". $_SERVER['HTTP_HOST'].dirname($_SERVER['SCRIPT_NAME']) . "/" . ZENFOLDER . "/setup.php";
    header("Location: $location" );
    }
    require_once(ZENFOLDER . "/template-functions.php");

    Take these lines and move them to the very top of the page. Then define your Wordpress theme and header:

    define('WP_USE_THEMES', false);
    require($_SERVER["DOCUMENT_ROOT"].'/wp-blog-header.php');

    Then put the rest of your Zenphoto code below that.

    I'm not saying this will fix everyone's issue, but it fixed mine. I hope it helps at least another couple of frustrated people.
Sign In or Register to comment.