I've read through the documentation and searched forums regarding embedding, and I've made it partway and am stuck. I know my html, but any scripting I can vaguely understand working code after the fact, but am finding it impossible to write or modify it when I'm not even sure what my goal is.
My Serendipity blog is in the /blog folder, relative to the web home folder. The installation is specifically in the subdomain blog.mysite.com, which actually is www.mysite.com/blog/.
My understanding (and I may be wrong) is that for my lower level of skill, I should just try to make an index.php file my website's default home page. Within this, I should have a section that echos a variable (for example $theblog) that I've defined in a separate file, wrapper.php, which also resides in the website's default home directory.
Thus far, I successfully have gotten my blog to appear within the page, however all relative links are broken. These include broken images, which want to erroneously be called from www.mysite.com/uploads/, whereas they acutally are in blog.mysite.com/uploads (aka www.mysite.com/blog/uploads).
I've tried a couple iterations, but for starters, here is one version of what I have tried:
My test file is test.php:
Code: Select all
<?php
require("wrapper.php"); // stores S9Y in a variable
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
Your non-Serendipity content goes here.
<?php
echo $blog_data; // Print the variable
?>
More non-Serendipity content here.
</body>
</html> Code: Select all
<?php
chdir('/home/content/myaccountname/html/blog/');
$_REQUEST['page'] = 'blog';
ob_start();
require('./index.php');
$blog_data = ob_get_contents();
chdir('/home/content/myaccountname/html/');
ob_end_clean();
?>
Also, once the relative links are "fixed", I'm still unclear on whether clicking on a blog entry would result in another embedded page, or a standalone page.
Thank you in advance!