Page 1 of 1

Problem Embedding in PHP page

Posted: Sun Mar 02, 2008 7:18 pm
by baph
Hi,

I followed the tutorial for embedding, and am having partial luck.

the blog is embedded into http://www.radiomagic.co.uk/newsser.php

I get an output of the correct page and it has the blog embedded - but, I cannot follow any of the links (archive, recent) at the side. When i do it comes out of the newsser.php page, and as there are no headers/template info it looks a mess without my navigation/images etc.

If for example I follow the link to my first story it goes to http://www.radiomagic.co.uk/serendipity ... Live!.html which does not keep embedded into the newsser.php page (with the navigation

Wrapper.php and newsser.php are both in the root. Serendipity is in a directory below root /serendipity/

My index file is still set as index.php (if changed it shows a blank page)

my wrapper page is

Code: Select all

<?php
  ob_start();
  chdir("./serendipity/");
  require("index.php");
  chdir("../");
  $serendipity_contents = ob_get_contents();
  ob_end_clean();
?>
My newsserv.php (page I want to embed into is

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>


<link href="css/radiomagic.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style1 {font-size: 12px}
-->
</style>
</head>
	<body>
		<div id="wrap">
			<div id="header">
				<div id="logo">
					<a href="index.html"><img src="images/RMlogo.png" alt="PaganDASH - I'm Pagan - Count me IN!"></a>				</div>
			  <div class="clearrow"></div>
			</div>
			<div class="clearrow"></div>
			<div id="nav">
				<p><strong>Navigation</strong><br />
			      <a href="index.html">Home</a><br />
			      <a href="news.php">News</a><br />
			    <a href="books.html">Books</a><br />
                <a href="audio.html">Audio</a><br />
                <a href="video.html">Video</a><br />
			      <a href="contact.php">Contact</a><br />
			      <a href="links.html">Links</a><br />
	          </p>
		  </div>
			<div id="content">
				<div id="title">
					Radio <span class="red">Magic</span> - Latest News.</div>
               <?php
echo $serendipity_contents; // Print the variable
?>
          </div>
                
          <div class="clearrow"></div>
			<div id="footer">
	      Radio Magic<span class="red" style="font-style: italic;"></span> - <a href="mailto:mail@jfortune.co.uk">mail@jfortune.co.uk</a><br />
				Site designed by <a href="mailto:editor@pentaclemagazine.org">Jon Randall</a>, Mar 2008<br />
		  </div>
			<div class="clearrow"></div>
		</div>
	</body>
</html>
Any help to keep it embedded would be great.

Jon

Posted: Sun Mar 02, 2008 10:50 pm
by baph
I am a dolt!

I just realised that I needed to change the indexfile to (not as it seems in the instructions) - but the newsser.php page I created.(it was the reference to index.php that confused me)

It is now solved!

Jon

Posted: Wed Mar 05, 2008 10:58 pm
by baph
I'm now having a different problem.

Everything is embedded... however, when I try to view the "older" articles, it shows just the last (howevermany set in admin) articles, rather than the one wanted.

the site is www.radiomagiclive.com and the link is news.

Any help would be appreciated.

Jon

Posted: Thu Mar 06, 2008 2:59 am
by judebert
The "Older..." link works fine for me. However, selecting any month brings me back to the news page.

That's usually an indication that the URL is incorrect, but yours seems exactly right to me: http://www.radiomagiclive.com/news.php? ... 08/01.html

Perhaps your path to the archives doesn't match this path? Or your .htaccess is otherwise incorrect? Check the archive path in your admin page, under configuration.

And now, a bit of personal opinion: since you put Serendipity on a separate page anyway, it would probably be a lot easier just to create a template that looks like your front page. It looks relatively simple (although I sometimes can't tell, with my low-contrast LCD monitor).

Posted: Fri Mar 07, 2008 11:14 am
by baph
My .htaccess is

Code: Select all

# BEGIN s9y
DirectoryIndex /serendipity/news.php
DirectoryIndex news.php index.php index.html index.htm

<Files *.tpl.php>
    deny from all
</Files>

<Files *.tpl>
    deny from all
</Files>

<Files *.sql>
    deny from all
</Files>

<Files *.inc.php>
    deny from all
</Files>

<Files *.db>
    deny from all
</Files>

# END s9y
and the link in the config is

archives/%id%-%title%.html

http://www.radiomagiclive.com/serendipity/

I cannot see any problem there.

Jon

Posted: Fri Mar 07, 2008 8:55 pm
by judebert
Actually, the .htaccess looks really sparse to me. I've got a bunch of RewriteRules before the <Files> directives.

I'd try changing a path, saving, then changing it back and saving again.

Unfortunately, I'm not sure that will help. I tried the substitution directly in the URL, and it still gave me the front page.

Unfortunately, I'm busy with charity and family events all weekend. Maybe someone else can take the time to check your site out. If we haven't got it fixed by Monday, I should be able to do some code diving then.

Make sure the .htaccess you posted is from Serendipity's directory. It would also be nice to know what version of s9y you're running, what version of PHP you use, and what webserver you're running (we assume Apache, with mod_rewrite enabled).

Posted: Tue Mar 11, 2008 5:53 pm
by baph
Hi Judebert,

I tried the change - no difference.

I'm using s9y 1.2.1

PHP Version 5.2.5

Apache/2.2.6 (Unix) mod_ssl/2.2.6 OpenSSL/0.9.7a mod_auth_passthrough/2.1 mod_bwlimited/1.4

Thanks for your time and suggestions.

Jon

Posted: Wed Mar 12, 2008 3:29 pm
by judebert
@baph: no change to the .htaccess, either? Are you using mod_rewrite?

@Everybody:

My youngest daughter broke her leg over the weekend. I'll try to keep posting and doing stuff, but my time just got gobbled up. (Mostly by sleep deprivation.)

Could someone else have a look at this? Serendipity is embedded at http://www.radiomagiclive.com/serendipity/. The "Older..." archives page works as expected, but all its links -- view full or view topics -- just take you back to the Serendipity front page. It's acting a lot like a 404.

Thanks.

Posted: Wed Mar 12, 2008 3:50 pm
by garvinhicking
Hi!

Seems to be a "archive" vs. "archives" problem, maybe someone messed with the permalink configuration? No permalink is allowed to live in the same path.

Does not work:
http://www.radiomagiclive.com/news.php? ... 08/03.html

works:
http://www.radiomagiclive.com/news.php? ... 08/03.html

HTH,
Garvin

Posted: Thu Mar 13, 2008 9:36 am
by baph
Hi Garvin,

The settings for the permalinks are as they were originally set automatically. nothing has been changed.

Jon

Posted: Thu Mar 13, 2008 10:09 am
by garvinhicking
Hi!

But then I wouldn't understand how the URLs above come to happen. Please post your full permalink configuration.

Regards,
Garvin

Posted: Fri Mar 14, 2008 12:28 am
by baph
The settings are as below.

Jon

Permalink Entry URL structure archives/%id%-%title%.html

Permalink Author URL structure authors/%id%-%realname%

Permalink Category URL structure categories/%id%-%name%

Permalink RSS-Feed Category URL structure feeds/categories/%id%-%name%.rss

Permalink RSS-Feed Author URL structure feeds/authors/%id%-%realname%.rss

Path to archives archives

Path to archive archive

Path to categories categories

Path to authors authors

Path to unsubscribe comments unsubscribe

Path to delete comments delete

Path to approve comments approve

Path to RSS Feeds feeds

Path to single plugin plugin

Path to admin admin

Path to search search

Path to comments comments

Posted: Fri Mar 14, 2008 12:41 am
by baph
judebert wrote:@baph: no change to the .htaccess, either? Are you using mod_rewrite?
when I turn mod_rewrite on it then causes problems with the embedding of the rest of the site - namely, it gets stuck in the serendipity directory, and will not show the proper pages.

I've turned it back on to show what happens.

Jon

Posted: Tue Mar 25, 2008 8:04 pm
by baph
As it was mucking up the site, I've turned it back off again.

It seems I'm doomed to have just the latest news show.

Thanks to all for their help.

Jon