Page 2 of 2

Re: Trying to Embed

Posted: Tue Dec 20, 2011 6:39 pm
by Kevinized
How To Embed Serendipity Into Your Website.

Step 1

Create a page named blog_wrapper.php and apply your site's Templates. Save it in the <serendipity> Directory.

Step 2.

Find the location in blog_wrapper you wish to have your blog appear and insert this code;

Code: Select all

<?php
  ob_start();
require 'index.php';
$blog_data = ob_get_contents();
ob_end_clean();

echo $blog_data;
if ($serendipity['view'] == 'css' || $serendipity['view'] == 'plugins') {
  ;
  exit;
}
?>
Step 3

Log into Serendipity, go to your admin page and change the configuration. Find the setting for "Is Serendipity embedded?" and change it to "Yes".

Step 4

In your site's menu, create a link to blog_wrapper.php

That's it! Your site's formatting will now remain intact while using Serendipity

______________________________________

Again Garvin,

I hope you accept my apologies for accusing you of not being helpful and I appreciate your continued support.
I hope you change the instructions in your embedding documentation.

After figuring out how this works on one site, Ive used it in 4 other sites and have 5 very happy customers. If you accept donations, send me instructions on how to donate and I will pass the info on to those customers.

Re: Trying to Embed

Posted: Wed Dec 21, 2011 9:35 am
by garvinhicking
Hi!

Thanks for the introduction! I'll try to read through it carefully and try to work it into our embedding documentation once I'm up to my feet again. :)
I hope you accept my apologies for accusing you of not being helpful and I appreciate your continued support.
Sure, since you seem to have accepted my apologies as well. :)

We do not really have a central donation site for Serendipity, since maintaining such an account is always quite bureaucratic and at least in germany also has some legal challenges. So some of our developers have their own donation accounts or wishlists. If you want to donate to the project, the best is actually to simply talk about it, help in the documentation (like you already did). Thanks!

Regards,
Garvin

Re: Trying to Embed

Posted: Sat Dec 24, 2011 7:25 pm
by Kevinized
One problem I've encountered with this embed is that when you try to click on the "Open Login Screen" from the embedded page, nothing loads In my template.

I've created a link in my menu "Admin" that points to ../Blog/serendipity_admin.php (Blog being the directory where s9y resides) and My users can still use the Administration.

Is there a way to make login happen from within the embedded s9y?

Kevin
Happy holidays

Re: Trying to Embed

Posted: Mon Dec 26, 2011 1:30 pm
by garvinhicking
Hi!

I think usually the /Blog/admin hook should be caught the mod_rewrite or the Apache Errorhandling to redirect to serendipity_admin.php.

It might not be possible to do that if the embedded way of Blog.php calls the blog's index.php after the first HTTP headers are sent - is your Blog.php beginning with the require index.php command, or do you have some other output there already?

The HTML output of your /Blog/admin page ends abruptely, so I would guess that some PHP error or the likes is happening, which might be supressed if your php.ini has display_erorrs is set to false, you could check that.

HTH,
Garvin

Re: Trying to Embed

Posted: Thu Dec 29, 2011 5:16 pm
by Kevinized
Is the php.ini file controlled by my ISP?

Re: Trying to Embed

Posted: Thu Dec 29, 2011 8:24 pm
by garvinhicking
Kevinized wrote:Is the php.ini file controlled by my ISP?
Not necessarily, this depends on ISPs. Some allow you to overwrite the local value with a .htaccess file ("php_value display_errors On"), some with a custom php.ini in your directory, some with customized frontends, and some don't allow it at all...

Regards,
Garvin

Re: Trying to Embed

Posted: Wed Jan 04, 2012 5:12 pm
by Kevinized
It was the ISP's error

Now I get the first page of blog results but when I use the 'next page' link to

http://acefilipini.com/Blog/archives/P2.html,

I get
The requested URL /Blog/archives/P2.html was not found on this server.

and when I checked the archives directory, there no files in there.

What might have caused this to stop working?

Re: Trying to Embed

Posted: Thu Jan 05, 2012 10:49 am
by garvinhicking
Hi!

"Virtual" URLs like /Blog/archives/P2.html are formed by the s9y config option "URL Rewriting". You probably have/had this turned on, but it seems changes on your server or the .htaccess now prevent this from working. URL rewriting can either be done through mod_rewrite or apache's errorhandling (which can be chosen in the config).

If both don't work you can turn URL rewriting off, then the URLs will look like /Blog/index.php?/archives/P2.html.

HTH,
Garvin

Re: Trying to Embed

Posted: Fri Jan 06, 2012 10:26 pm
by Kevinized
Yes it was changes on the server that caused the problems and I reconfigured the settings and I can load the page.

It seems the changes have altered other things too because when I link to Page2.html, I lose menu formatting.

I believe a .css link got lost, what can I do to fix this or do I need to contact the ISP again?

Re: Trying to Embed

Posted: Sat Jan 07, 2012 11:02 am
by garvinhicking
Hi!

Hm, I do see that the HTML seems a bit messy on your page. However, how was it before? Since you use the embed mode, the CSS would've been emitted by your embedded HTML header part, so I think CSS links can only get lost if you modified your own HTML framework?

Regards,
Garvin