Page 1 of 1

trouble with embedding (another one...)

Posted: Thu Apr 24, 2008 6:39 pm
by moumousganou
Hi
First i'am sorry to bother you with a question that's already been asked, but i don't really manage to get serendipity to work as an embedded version.

So what I did :
I installed (in /serendipity ) serendipity with the embedded option turned on.
I made a sample webpage and a wrapper :

sample webpage (named blog.php ):

Code: Select all

<?php
require("wrapper.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

	<title>untitled</title>
	
</head>


<body>

<p>other things </p>

<?php
echo $serendipity_contents;
?>

</body>
</html>
the wrapper :

Code: Select all

<?php
  ob_start();
  chdir("serendipity/");
  require("index.php");
  chdir("../");
  $serendipity_contents = ob_get_contents();
  ob_end_clean();
?>
and i choose blog.php as my indexFile

So the blog is displaying when i load blog.php, but all the links are pointing to something like /serendipity/post-number... instead of "blog.php?......" and so all the "others things" won't be displayed. I tried to change relative path to / and add this option to my wrapper

Code: Select all

$_SERVER['REQUEST_URI'] = './serendipity/' . $_SERVER['REQUEST_URI'];
with that some of the links are working the way i want them "blog.php?/..." but some aren't (the admin one for example).
I don't know what i'am doing wrong (i don't even know if what i'am saying is clear).
So if someone can help me it would be great.
thank you.
ps : excuse my english mistakes

Posted: Thu Apr 24, 2008 8:52 pm
by judebert
I think you're clear enough for us to understand the problem. We've got an international community, so you don't need to worry about your English.

The admin link will always be {THE_S9Y_DIRECTORY}/serendipity_admin.php. It is a separate script and cannot be embedded, for security reasons.

However, your other links should have changed to blog.php when you changed the indexFile option. Perhaps it's a problem with rewriting. What is your rewriting option set to?

Posted: Thu Apr 24, 2008 9:42 pm
by moumousganou
Thank you for your answer. The Url rewriting option is set to off. Does it have to be on ?
Thank again

Posted: Thu Apr 24, 2008 11:32 pm
by judebert
Rewriting off is the best option.

To correctly answer your questions, we'll probably have to see the problem. What links besides the admin link are incorrect? Can you tell us the URL to the page that demonstrates the problem?

Posted: Fri Apr 25, 2008 2:36 pm
by moumousganou
Hi
I finally found a solution. I just put my blog.php page and my wrapper (without the chdir cmd ) into the serendipity directory, put the indexFile to blog.php and everything is working as i want.
If it's interesting for you that i give more explanation about the problem i had before i'll be glad to.
Thank for your help.
Matthieu

Posted: Fri Apr 25, 2008 5:26 pm
by judebert
Embedding problems can be complex and unique. I'm glad you got it to work, though!

If you're up for a bit of debugging, I would like to know if it works with blog.php in a different directory, but wrapper.php in the serendipity/ directory. And did you remove the REQUEST_URI modification?

Posted: Sat Apr 26, 2008 5:53 pm
by moumousganou
Hi
With blog.php in an another directory and wrapper.php in the serendipity one it's not working really well (but i actually never try to put "../blog.php" as indexFile i just put blog.php as my index file, that's maybee why it wasn't working). And yes i delete the $request line in my actual config.
I have another question that's not related to the previous one (maybee i should create a new post ?).
With the embedded option on, serendipity output that :

Code: Select all

<div class="serendipity_entry serendipity_entry_author_Matthieu  ">

       <div class='serendipity_entryFooter'>
					<a href="/serendipity/blog.php?/archives/1-Mon-premier-post.html">Mon premier post</a> Posté par <a href="http://localhost:8888/serendipity/blog.php?/authors/1-Matthieu">Matthieu</a>

                                                    à
                  14:24<br />
					                                                            <br /><a href="/serendipity/blog.php?/archives/1-Mon-premier-post.html#comments">Commentaire (1)</a>
                                    
                                                            <br /><a href="/serendipity/blog.php?/archives/1-Mon-premier-post.html#trackbacks">Rétroliens (0)</a><br />
                                    		
            </div>

	<h4 class="serendipity_title"><a href="/serendipity/blog.php?/archives/1-Mon-premier-post.html">Mon premier post</a></h4>
<div class="serendipity_entry_body">
	blah blah blah.<br />

<br />
Is there a way of making serendipity output the entry footer after the post so comments and links will be after the post, and is it also possible to remove the br/ between comments and backlinks ?

thank for your support.

matthieu

Posted: Sat Apr 26, 2008 10:55 pm
by Don Chambers
The entry footer is contained within the file entries.tpl. If your template does not have its own, it will use the version of this file from the /templates/default/ folder, and this version does position the entry footer at the bottom of an entry.

Based on the output you provided, I'm going to guess that you might be using the serendipity 3.0 template located in /templates/carl_contest/. If so, that template DOES have its own entries.tpl file.

You could relocate the <div class='serendipity_entryFooter'> (and everything within this div) so that it occurs after <div class="serendipity_entry_extended">, which is what contains the extended body of an entry for those entries that have it.

Keep in mind that if you relocate the entry footer, you will probably need to modify the stylesheet so that it looks good & functions correctly at its new location.

Posted: Sun Apr 27, 2008 9:58 pm
by moumousganou
Thank don. But as i use the embedded option i was thinking that no template (or just a really basic one) was usen. I changed the theme and it's working !!!
Thanks a lot