Page 1 of 1

Embedded /archives Link Args Ignored

Posted: Thu Aug 16, 2007 10:29 pm
by queej
I have successfully embedded Serendipity in our web site, except for archives links. The dates seem to be ignored. I am using the wrapper code shown in the documentation, and all other links work fine.

The URL blog.php/?archive works, but the URL blog.php?/archives/2007/08/15.html does not.

I have the most recent Beta copy (Aug 8th).

Thanks in advance for any help you can provide.

Re: Embedded /archives Link Args Ignored

Posted: Fri Aug 17, 2007 11:00 am
by garvinhicking
Hi!

So you did configure the s9y "indexFile" option to 'blog.php', yes? How does your blog.php look? Does it mangle with the $_SERVER['REQUEST_URI']?

Regards,
Garvin

Posted: Fri Aug 17, 2007 12:33 pm
by queej
Thank you. I am using "../blog.php" for my indexFile. My main site has a subdirectory "blogs", which is the serendipity installation.

This is my blog.php:

Code: Select all

<?php
if ( !strstr( $_SERVER["REQUEST_URI"], "blog" ) ) {
	$_SERVER["REQUEST_URI"] = GR_BASE_URL."blogs/index.php?/categories/1-Featured-Graphs";
 }
ob_start();
chdir( "./blogs" );
if ( !strstr( $_SERVER["REQUEST_URI"], "/feeds/" ) ) { // do not include styles for RSS feeds and other XML pages
	echo '<style>';
	include_once( 'serendipity.css.php' );
	echo '</style>';
 }
require_once( "index.php" );
chdir( ".." );
$blog_contents = ob_get_contents();
ob_end_clean();
?>
I am also using require_once('blog_wrapper.php') in my main index.page. Here is my blog_wrapper.php:

Code: Select all

<?php
if ( strstr( $_SERVER["REQUEST_URI"], "/feeds/" ) ) { // handle RSS feeds
	require_once( "blog_wrapper.php" );
	echo $blog_contents;
 }
 else {	 // all "normal" pages
	include( 'includes.php' );
	require_once( "blog_wrapper.php" );
	include( 'header.php' );
	echo $blog_contents;
	require_once( './footer.php' );
 }
?

Posted: Fri Aug 17, 2007 1:00 pm
by garvinhicking
Hi!

That won't work. Your blog.php needs to be in the same directory.

Regards,
Garvin

Thanks! That did it.

Posted: Fri Aug 17, 2007 2:05 pm
by queej
Thanks very much. I moved my blog.php and blog_wrapper.php into my ./blogs directory, then did a conditional chdir if I am not already in that directory, and everything seems to work well.