Problems integrating wordpress and zenphoto - Cannot modify header information..

I recently upgraded zenphoto from 1.0.6 to the nightly 1.2.5 from last night - 7.25.2009.
I had zenphoto working fine integrated into my wordpress site with the K2reloaded theme. However now reworking the upgraded zenphoto back into wordpress I get a bunch of warnings (see below).

I'm stuck. Any ideas? I read through all the posts on a similar topic and followed the guide to integrate zenphoto into wordpress.

This is what my index.php file looks like...
require_once(dirname(__FILE__).'/zp-core/folder-definitions.php');
...
require_once(ZENFOLDER . "/template-functions.php");
...

/* Start Wordpress */
define('WP_USE_THEMES', false);
require('../wp-blog-header.php');
get_header();

require_once(dirname(__FILE__). "/".ZENFOLDER.'/controller.php');

header ('Content-Type: text/html; charset=' . getOption('charset'));
$obj = '';
...
rest of the guts of main zenphoto index.php stuff
....
get_footer();

WARNINGS:
Warning: Cannot modify header information - headers already sent by (output started at /home4/vvrozcom/public_html/wp-content/themes/K2reloaded/header.php:6) in /home4/vvrozcom/public_html/photos/index.php on line 46

Warning: Cannot modify header information - headers already sent by (output started at /home4/vvrozcom/public_html/wp-content/themes/K2reloaded/header.php:6) in /home4/vvrozcom/public_html/photos/zp-core/functions.php on line 1796

Warning: Cannot modify header information - headers already sent by (output started at /home4/vvrozcom/public_html/wp-content/themes/K2reloaded/header.php:6) in /home4/vvrozcom/public_html/photos/index.php on line 156

Warning: Cannot modify header information - headers already sent by (output started at /home4/vvrozcom/public_html/wp-content/themes/K2reloaded/header.php:6) in /home4/vvrozcom/public_html/photos/index.php on line 157

Warning: Cannot modify header information - headers already sent by (output started at /home4/vvrozcom/public_html/wp-content/themes/K2reloaded/header.php:6) in /home4/vvrozcom/public_html/photos/index.php on line 158

Comments

  • marc Member
    I ended up moving the wordpress get_header(); call into my theme's index,album,image.php files instead of having it called from the main zenphoto index.php file, and that seemed to help. Not sure if there is a more straight forward way so that you don't have to reproduce the wordpress call for each theme file.

    If anyone has a better solution, I'd love to hear it.
  • acrylian Administrator, Developer
    That is bascially what we do on Zenphoto.org, too except that we use a additional header.php file (called before anything else) that looks like this:
    `
    <?php require('../wp-blog-header.php'); ?>

    <?php get_header(); ?>

    <?php zenJavascript(); ?>
    /css/zen.css" type="text/css" />
    `
  • Hi,

    I know this isn't supported, but if someone out there could provide me with an a bit more detailed step-by-step guide on how to fix this I'd be quite thankful :).

    I'd used to have it running using Ruzee's old guide, creating a separate theme in ZenPhoto press, and then modifying index.php/album.php/image.php within that theme subfolder.

    I get a heap of errors on my gallery page, since upgrading to 1.2.x before the actual gallery is being displayed: http://www.confession-box.org/gallery/

    Thanks in advance,
    -Mnemon
  • acrylian Administrator, Developer
    The "Function ereg() is deprecated" is fixed in the nighty build (and its not really an error), about the other ones I don't know right now as we don't know what exactly you are doing for inclusion. Mabye post some code.
  • Hi,

    thanks for the quick reply :) Will wait for next stable release. Regarding the rest, my index/album/image.php in theme folder all look like this:

    <?php if (!defined('WEBPATH')) die(); $themeResult = getTheme($zenCSS, $themeColor, 'light'); $firstPageImages = normalizeColumns('2', '6');?>
    <?php require($_SERVER['DOCUMENT_ROOT'].'/wp-blog-header.php'); ?>
    <?php function addcss() {
    global $_zp_themeroot;
    echo '<link rel="stylesheet" href="'.$_zp_themeroot.'/styles/light.css" type="text/css" />';
    }
    add_action('wp_head', 'addcss');
    ?>
    <?php get_header() ?>
    <?php db_connect(); // reconnect to zenphoto db ?>

    [zenphoto stuff here - i.e. everything included in div="main"]

    <?php if (function_exists('printLanguageSelector')) { printLanguageSelector(); } ?>
    <?php if (function_exists('printAdminToolbox')) printAdminToolbox(); ?>
    <?php $wpdb->select(confession_box_); // reconnect wordpress db ?>
    <?php get_footer() ?>

    Cheers,
    -Mnemon
  • acrylian Administrator, Developer
    Here is the head section (excluded in a header.php file actually) of our Zenphoto theme on zenphoto.org that we haven't changed since 2007:
    `
    <?php require('../wp-blog-header.php'); ?>
    <?php get_header(); ?>
    <?php zenJavascript(); ?>
    /css/zen.css" type="text/css" />
    Zenphoto theme stuff follows here
    <?php get_footer(); ?>
    `
Sign In or Register to comment.