Recent Topics

1 Feb 28, 2009 19:35    

My b2evolution Version: Not Entered

My b2evolution Version: Not Entered

I'm not exactly web/css or php savy, I've designed and manage a small, static website for a local charity and have rather been dropped in it by being asked to provide a page for a charity event with a blog.

I've installed b2evolution (having used the old b2 in the past) and worked out that you access a given blog via the appropriate stub file (I've even edited the stub file so it all works).

Now I'd like to add some HTML (links and images) to customise the blog and rather thought that I could just paste the PHP from the stub file into a webpage and at the extra (using Dreamweaver MX primarily in WYSIWYG mode). However, if I do this I get two errors stating:-

Warning: Cannot modify header information - headers already sent by (output started at /home/swedauk/public_html/ellen.htm:4) in /home/swedauk/public_html/b2_blog/inc/sessions/model/_session.class.php on line 219

Warning: Cannot modify header information - headers already sent by (output started at /home/swedauk/public_html/ellen.htm:4) in /home/swedauk/public_html/b2_blog/inc/skins/_skin.funcs.php on line 379

If I load a working stub file into Dreamweaver and then add content the result is the same.

I suspect that I'm being very dense and haven't quite got my head around skins yet but I was wondering whether I can easily incorporate a stub file into an existing webpage.

2 Feb 28, 2009 20:48

Hi sweda. Welcome to the forums!

So basically b2evolution is designed to make web pages - not be a part of one. It can be done, but I'm not sure if a stub is or isn't part of doing it that way. BTW by "part of a web page" I'm thinking like a box inside an existing page as opposed to additional pages in an existing web. Right?

Anyway the stub file thing only exists to (a) give a specific name to the blog in the URL and (b) to set up certain parameters the blog must follow. See at the end of a stub file where it says

/**
 * That's it, now let b2evolution do the rest! :)
 * Note: if you put this file in a subdirectory, you will need to adjust the path below, for example:
 * require_once dirname(__FILE__).'/../conf/_config.php';
 */
require_once dirname(__FILE__).'/conf/_config.php';

require $inc_path.'_blog_main.inc.php';


So you don't actually put any content into the stub file - just set up some parameters for the blog to follow, then let b2evolution do the rest.

Whether or not you use a stub file is up to you. Either way, a skin gives your blog a "look". It also decides which bits from the database get put where on the page. That's a brief overview eh? So a stub can be used or not, and you can have any skin you want, and either way you can embed a portion of your blog into an existing website. Somehow or other that gets done, but (sorry) I don't know how.

Anyway I THINK using something like

<?php require_once $inc_path.'_main.inc.php'; ?>

in your existing static web page will activate b2evolution without actually making it make a blog. At that point you would use php bits from b2evolution to grab bits of the blog that you want.

Much MUCH easier to simply put a link on your existing web page pointing to the "root level of your blog". Like install b2evolution in a folder called "blogs" then on domain_name.com/index.html have a link to domain_name.com/blogs/index.php and let b2evolution build all the pages it wants to after that.

3 Feb 28, 2009 23:00

Word of advice ... any time EdB types more lines of text than I can count ( even if I take my socks off ) is a good time to listen to him ;) ... even if he's bollocks wrong with "hey, using include will cure your header output line that occurs before the include line ..... yeah" advice ;)

¥

4 Mar 01, 2009 15:27

Thanks for the replies. Yes I'm trying to integrate the B2evolution blog into an existing webpage (I did this in the past with the old b2 system) but including the php code of the stub in the the page itself, I've also tried a PHP include statement to call the stub whilst leaving it as a seperate file, with the same errors occuring.

I suspect that I could achieve what I need to using skins and php code but that's beyond me a the moment, I may just need to leave the blog as a standalone page.

5 Mar 01, 2009 16:05

Your problem is that the page you're including it in has already spat some stuff out to the browser before evo gets a chance to set it's cookies.

The solution is to use obi_wan_start() and move the include to the top of your page ;)

your_page.php

<?php
ob_start();
include 'your_stub_file.php';
$obi_wan = ob_get_clean();
?>
<!-- your normal page here -->

<!-- place where you want blog to be -->
<?php
echo $obi_wan;
?>
<!-- carry on with the rest of your page -->

ish

¥

*edit*
Note : it'll totally invalidate the (x)html of your page though ;)

6 Mar 01, 2009 22:45

I think it's probably cheating, but a stub in a frame works well!


Form is loading...