Page 1 of 1

Embedding in HTML page

Posted: Tue Jan 23, 2007 12:08 am
by peaceteacher
I know, another post about embedding... but anyway, I've taught myself enough html and css to begin putting together a site. I'm using static html pages and styling with css and divs. I would like to embed serendipity into a div. I've been reading the docs and the forum for hours and can't figure out why it's not working...

According to what i've found on this site I created a php file called wrapper.php which contains the following:

<?php
ob_start();
chdir("<../serendipity>");
require("index.php");
chdir("<../>";
$serendipity_contents = ob_get_contents();
ob_end_clean();
?>

I then added this as the first line in my blogtest.html file:

<?php
require("wrapper.php");
?>

Then I inserted this into the blogtest.html page to call the serendipity content:

<?php
echo $serendipity_contents;
?>

I then used admin to set the indexfile to wrapper.php My page loads normally, but serendipity does not show up.

Any help at all would be greatly appreciated!! my test page is at bobcrawfordonline.com/blogtest.html

Re: Embedding in HTML page

Posted: Tue Jan 23, 2007 10:11 am
by garvinhicking
Hi!

I take it that with <../serendpity> you mean you inserted the full path there without the <> characters, right?

One thing that will make trouble is that you pointed your s9y indexFile to 'wrapper.php', but your wrapper.php code does not contain a call to your blogtest.html file. So basically you would want to make the indexFile point to blogtest.html instead of wrapper.php. But that is stuff for things to do later.

First we should focus why you get no content when calling blogtest.html.

I suppose it simply does not work because PHP code contained in .html files will not get parsed. *g*

Rename the file to 'blogtest.php' and try that again. Then you should see some output!

Best regards,
Garvin

Re: Embedding in HTML page

Posted: Tue Jan 23, 2007 6:15 pm
by derflection
garvinhicking wrote:Hi!

I take it that with <../serendpity> you mean you inserted the full path there without the <> characters, right?

One thing that will make trouble is that you pointed your s9y indexFile to 'wrapper.php', but your wrapper.php code does not contain a call to your blogtest.html file. So basically you would want to make the indexFile point to blogtest.html instead of wrapper.php. But that is stuff for things to do later.

First we should focus why you get no content when calling blogtest.html.

I suppose it simply does not work because PHP code contained in .html files will not get parsed. *g*

Rename the file to 'blogtest.php' and try that again. Then you should see some output!

Best regards,
Garvin
Hi Garvin,
I too am having similar diffuclty. I get this error now when my newsblog.php page loads
Parse error: parse error, unexpected ';' in C:\Program Files\Apache Group\Apache2\htdocs\driveable\wrapper.php on line 5
I have tried putting a few things in the chdir("<../>"; on line 5 of my wrapper.php and none of them seem to work.
What am I missing?
The website is http://www.driveable.com/newsblog.php

Posted: Wed Jan 24, 2007 4:44 am
by peaceteacher
Hi Garvin,

Thanks for the quick reply! I followed your suggestions and received an error message identical to the one derflection mentions above... the unexpected ";" was because of a closing parenthesis that I missed. Once I fixed that the Serendipity content showed up! I think all I have left are some css issues to get Serendipity's content to flow around my pre-existing left sidebar.

One other problem has arisen though... the open admin link at the bottom of the serendipity sidebar links to "/admin", but i only seem to be able to open the admin panel manually by using ".../serendipity/serendipity_admin.php" is there any way to change this link... or alternatively to remove the admin panel from the sidebar?

Thanks again for your prompt assistance yesterday! Serendipity looks like a great package and I look forward to using it. Thanks for all your hard work!

Bob

(This is where the site is at... hopefully I'll have gotten it to float correctly by the time you look... lol)
http://www.bobcrawfordonline.com/serend ... ogtest.php

Re: Embedding in HTML page

Posted: Wed Jan 24, 2007 10:50 am
by garvinhicking
Hi derflection!

Please paste the code of your wrapper.php, you have an error in that file at line 5. :-)

Regards,
Garvin

Posted: Wed Jan 24, 2007 10:53 am
by garvinhicking
Hi peaceteacher!
Thanks for the quick reply! I followed your suggestions and received an error message identical to the one derflection mentions above... the unexpected ";" was because of a closing parenthesis that I missed.
Great you got that! :)
One other problem has arisen though... the open admin link at the bottom of the serendipity sidebar links to "/admin", but i only seem to be able to open the admin panel manually by using ".../serendipity/serendipity_admin.php" is there any way to change this link... or alternatively to remove the admin panel from the sidebar?
This is the URL rewriting that takes place - serendipity will use these links if in your s9y configuration you set for "URL Rewriting". It will most liekely currently be 'apache errorhandling' or 'mod_rewrite'. If you switch it to "None" you will get "unpretty URLs" that will contain the proper link. :)
Thanks again for your prompt assistance yesterday! Serendipity looks like a great package and I look forward to using it. Thanks for all your hard work!
You're kindly welcome! Have fun with SErendipity :)

Best regards,
Garvin

Posted: Wed Jan 24, 2007 6:05 pm
by peaceteacher
Thanks Garvin! That did the trick!