Recent Topics

1 Mar 08, 2008 19:08    

My b2evolution Version: Not Entered

hello.

i am trying to embed my blog into my home page.

i dont want to use iframes, as my blog's size varies based on the content, and iframes must be static.

i like the fact that when users click on the links on the blog, it reloads my web page with the new blog page embedded where it was originally.

thats what i like.

here is what i mean. try it out.

http://kaneprestenback.com/test.php

you notice that the blog is seamlessy embedded in the site. (the beginning is the post "longbloglongblog...", and ends with the archivelink.) i like that when u click the link for next page, it stays on my page, by adding numbers to the url.

what i dont like is that it has the following at the top of the blog.:

Warning: Cannot modify header information - headers already sent by (output started at /home/kanepres/public_html/test.php:4) in /home/kanepres/public_html/b2/inc/MODEL/sessions/_session.class.php on line 222

Warning: Cannot modify header information - headers already sent by (output started at /home/kanepres/public_html/test.php:4) in /home/kanepres/public_html/b2/inc/MODEL/skins/_skin.funcs.php on line 71

i cannot figure out how to get rid of that!

here is the code that exists on test.php to get the page embedded:

<?php 
require(dirname(__FILE__).'/b2/currentstub.php'); 
?>

now, i dont know why that works, cuz i dont know php. i found it by searching the forums, and paring down a bunch of surrounding code. it does what i want it to do... cept for the minor problem of that warning header.

how do i get rid of it?

i went into currentstub.php and deleted any blank lines. same is true for _main.php, and test.php has no blank lines either.

currenstub.php works fine when accessed by itself.
http://kaneprestenback.com/b2/currentstub.php

_session.class.php and _skin.funcs.php do not have blank lines at the end of the closing tag. so they seem to be funtional as well.

setcookie( $cookie_session, $this->ID.'_'.$this->key, time()+315360000, $cookie_path, $cookie_domain );

is at the line on _session.class

header( 'Content-type: '.$type.'; charset='.$io_charset );

appears at the line for _skins.funcs

playing with just the bit of code, placeing just the code, with no information at the top, works fine: http://kaneprestenback.com/test2.php
but placing any kind of information, in this case a simple line of text,causes the warning to appear:http://kaneprestenback.com/test3.php

so thereya go. i seem to have done everythin i could to figure out what is going on, and i am stumped. i dont really know php, so im prolly missing a very simple bit if code... how do i get this to work???!! how do i place the php in my html and have it come out without this warning?

please help!

KP

2 Mar 07, 2008 22:30

um... Hey welcome to the forums!

b2evolution can do just about anything you need, as you've started to figure out. The thing is though that once you take out any linkback to b2evolution you don't stand much of a chance of getting free help about free software in a free forum.

Sorry, but IMHO you're on your own.

3 Mar 07, 2008 23:00

I don't think it is a good idea to include the whole blog in your page.
The best way to get what you want is modify the skin. Just move everything above the blog in header and the rest in footer.

4 Mar 08, 2008 08:55

hey edB

thanks for the friendly hello.

not sure what u mean abt "linkback"...

the site i'm including on this forum is just a test site. not teh finished thing. once i've figured out how to do what im trying to do, by all means, ill go back and reconstruct the code to provide homage to whoever is to thank. the test site is by no means meant to be viewed by the public at this point... nowhere on my actual site is there a link to the test site... its purely there for to demonstrate what my problem is to u kind folks here on the site.

i get the feeling that u may have an idea to help me. if u do, then im sorry if i've caused any alarm, andi will certainly provide due credit for any assistance u may have. and a beer. i'll get u a beer.

thanks for the help!

kp

5 Mar 08, 2008 09:05

hey sam2kb

you do have a good idea... and its evidently what i shoulda done from the beginning and saved myself abt a day of work tryin to learn this php stuff. i thought abt it for a second... then thought "NO. how hard can it be to embed a page with php!!" and then spent the next day or so hacking at code to figure it out... that ultimately i spent so much time on that idea, that i just want it to work! rather than concede defeat yaknow?

problem is... i need this blog on my main page... and the b2evo install isnt in my main directory.

though i spose i could just use a redirect if it comes down to it, right?

would it then be possible to use two different blogs on the same page? cuz that was the original intention... though thats prolly an entirely different topic!

6 Mar 08, 2008 19:08

Okay, maybe I am just dumber than a bag of hammers, but I cannot figure out how to get my blog onto my website.

I have read that I can "use a stub" but I can't figure out how to get that to work.

Is there any way to get a block of code to imbed in my site?

Thanks,

Todd

7 Mar 08, 2008 19:29

Hi drtodd,

Welcome to the forums.
You're the 5000th registered member of the forum.
CONGRATULATIONS.

Back to your question.
It is very difficult to incorporate the blog into an existing site. What you want is to make a skin out of the website and use that for the blog. Once you have done that you can replace certain pages of your site with the new blog.

Basically you want an existing skin that somehow resembles the structure of your website, strip it from all styling and move your own style over to the skin. For a normal site you are looking for the header (images), the background (colours / images) and the fonts (styles).

If you provide us a link to your blogs we can give you some more specific advise.

Good luck

8 Mar 08, 2008 19:33

Hi Kane,

What you want is basically the same as this question: http://forums.b2evolution.net/viewtopic.php?t=14716
Therefore I will merge the two topics and move them over to the Templates, skins, XHTML and CSS forum.
I will see to it that you both will get the answers you need.

Good luck

9 Mar 08, 2008 22:34

To kanepres

Try to comment this string in the top of _main.php

skin_content_header();	// Sets charset!


Another way is disable PHP errors. But if you wanna make a good and valid site without css styles mess you must modify the skin.

10 Mar 08, 2008 23:40

well played sam2kb!

commenting that string managed to get rid of ONE of the warnings...

however one still remains.

they are like pesky little rodents!

Quote:
Warning: Cannot modify header information - headers already sent by (output started at /home/kanepres/public_html/test.php:4) in /home/kanepres/public_html/b2/inc/MODEL/sessions/_session.class.php on line 222

is still there.

i wonder if since the warning related to the skin was able to get rid of by commenting a string in the skins... if theres some other php file that just needs to have a line commented... hmm

11 Mar 09, 2008 03:11

¥åßßå suggests this. In your existing index.php at the very top put:

<?php
ob_start();
require_once dirname(__FILE__).'/path/to/evo/index.php';
$blogPage = ob_get_clean();
?>


and at the point where you want the blog to appear simply do:

<?
echo $blogPage;
?>


You must change "/path/to/evo/index.php" in the relative path from the file you are editing to the index,php file of the blog.

I am not sure if this works as advertised, but this looks promising.

Good luck

¥åßßå rocks. He said so himself.

12 Mar 09, 2008 07:36

afwas!! u sir are a ROCK STAR!!

totally works.!

check out

http://kaneprestenback.com/test5.php

i'm even able to use my currentstub.php!

so thanks all!

i'm gonna edit the official index.php in the morning. and no worries to edB... i promise i will include a link back to b2e! especially since u guys helped little me and figured out my little problem! heck, ill include a link back on the home page, and on my credits page!

yep. that yabba fella rocks indeed.


Form is loading...