1 sweda Feb 28, 2009 19:35
3 yabba 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 sweda 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 yabba 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 sweda Mar 01, 2009 22:45
I think it's probably cheating, but a stub in a frame works well!
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
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
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.