Archive problem when embedded

Having trouble installing serendipity?
Post Reply
Khantahr
Regular
Posts: 5
Joined: Thu Jul 21, 2005 6:36 pm
Location: Fresno, CA

Archive problem when embedded

Post by Khantahr »

I've got Serendipity embedded in my website using a wrapper. It all works fine as far as I can tell except when you view an individual entry (by clicking on the title). When you do that, it ignores the placement in my wrapper and just spits out the Serendipity stuff first, and the rest of my page last.

Here's a link so you can see what's happening:

http://www.flightinstructing.com/pilot_life/

Thanks for any ideas about how to fix this.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Archive problem when embedded

Post by garvinhicking »

Can you explain how you have your wrapper set up in detail? I suppose your buffering methods don't properly work with the Rewrite Methods from Serendipity.

Which URL Rewriting are you using? Check if the DirectoryIndex directive in .htacces leads to your wrapper file and NOT index.php. You can specify that file in s9y configuration, the indexFile option.

On top of that, in recent versions of Serendipity we suggest to use Smarty in the index.tpl templates to inject your surrounding page instead using the ugly output buffering method. :)

There are some threads here in the forum that deal with the new smarty method...

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Guest

Post by Guest »

Hi, thanks for your response.

My main site uses templates as well, each page is created from 4 different templates, header (which containes the html headers as well), footer (which closes the relevant html tags), menu, and content. So, my wrapper is a php file which fills out a template with the data from Serendipity.

The template looks like this (the whole thing):

Code: Select all

<div class="content">
    {BLOG_CONTENT}
</div>
The wrapper php file has this for the relevent section:

Code: Select all

// Let serendipity generate our content:
ob_start();
require 'index.php';
$blog_data = ob_get_contents();
ob_end_clean();

$template->assign_vars( array(
    'BLOG_CONTENT' => $blog_data ) );
    
include(  $site_root.'include/page_header.php' );
include(  $site_root.'include/menu.php' );

$template->set_filenames( array(
    'body' => 'pilot_life.tpl' ) );
$template->parse( 'body' );

include(  $site_root.'include/page_footer.php' );
I checked what you said in the .htaccess file and it's all ok there.

Would using Smarty work since the rest of my page is php generated too?
Khantahr
Regular
Posts: 5
Joined: Thu Jul 21, 2005 6:36 pm
Location: Fresno, CA

Post by Khantahr »

Oops, I didn't realize it let Guests post.

Guest=Me.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Okay, your wrapper basically looks okay. Is your indexFile s9y config directive properly set to "wrapper.php"? And which URL Rewriting do you use?

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Guest

Post by Guest »

My indexFile directive is set to "pilot_life.php" which is the name of the wrapper file. I'm using the apache mod_rewrite for URL rewriting.

As far as I can tell, the only time this problem crops up is when viewing an individual entry with comment. All of the other pages look fine.

Thanks.
Khantahr
Regular
Posts: 5
Joined: Thu Jul 21, 2005 6:36 pm
Location: Fresno, CA

Post by Khantahr »

Gah! I did it again. I didn't mean to say that a topic must have comments for it to display improperly. Just viewing the individual topic will cause it to display all of the blog contents at the top of the page, and everything else below it.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hm, this is really a strange thing. Does your .htaccess file then contain proper RewriteRules that point to your "pilot_life.php" file?

Which plugins did you install? Some plugins like the caching plugin may interfere...

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Khantahr
Regular
Posts: 5
Joined: Thu Jul 21, 2005 6:36 pm
Location: Fresno, CA

Post by Khantahr »

Yes! I logged in this time!

Sorry I took so long to respond, I was off on a trip.

My .htaccess:

Code: Select all

ErrorDocument 404 /pilot_life/pilot_life.php
DirectoryIndex /pilot_life/pilot_life.php
php_value session.use_trans_sid 0
php_value register_globals off

RewriteEngine On
RewriteBase /pilot_life/
RewriteRule ^archives([/A-Za-z0-9]+)\.html pilot_life.php?url=/archives/$1.html$
RewriteRule ^([0-9]+)[_\-][0-9a-z_\-]*\.html pilot_life.php?url=$1-article.html$
RewriteRule ^feeds/(.*) pilot_life.php?url=/feeds/$1 [L,QSA]
RewriteRule ^unsubscribe/(.*)/([0-9]+) pilot_life.php?url=/unsubscribe/$1/$2 [L$
RewriteRule ^approve/(.*)/(.*)/([0-9]+) pilot_life.php?url=approve/$1/$2/$3 [L,$
RewriteRule ^delete/(.*)/(.*)/([0-9]+) pilot_life.php?url=delete/$1/$2/$3 [L,QS$
RewriteRule ^(admin|entries)(/.+)? pilot_life.php?url=admin/ [L,QSA]
RewriteRule ^archive$ pilot_life.php?url=/archive [L,QSA]
RewriteRule ^categories/([0-9]+) pilot_life.php?url=/categories/$1 [L,QSA]
RewriteRule ^(index|atom|rss|b2rss|b2rdf).(rss|rdf|rss2|xml)$ rss.php?file=$1&e$
RewriteRule ^plugin/(.*) pilot_life.php?url=plugin/$1 [L,QSA]
RewriteRule ^search/(.*) pilot_life.php?url=/search/$1 [L,QSA]
RewriteRule ^(serendipity\.css|serendipity_admin\.css) pilot_life.php?url=/$1 [$
RewriteRule ^authors/([0-9]+) pilot_life.php?url=/authors/$1 [L,QSA]
RewriteRule ^index\.(html?|php.+) pilot_life.php?url=index.html [L,QSA]
RewriteRule ^htmlarea/(.*) htmlarea/$1 [L,QSA]
RewriteRule (.*\.html?) pilot_life.php?url=/$1 [L,QSA]
My plugins:
Calendar
Archives
Categories
Syndicate this Blog
Markup: NL2BR
Markup: Serendipity
Markup: Emoticate
Browser Compatibility
Spam Protector
Statistics
Announce entries
Fix common XHTML errors
e-Mail Entry
Google Sitemap Generator
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

No problem, hope your trip was well. :)

I think we're getting closer to the problem. Can you remove the "E-Mail entry" plugin temporarily? It might be that this one interferes. If it is the cause for that, I can look how to fix it, so for now just step by step. :)

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Khantahr
Regular
Posts: 5
Joined: Thu Jul 21, 2005 6:36 pm
Location: Fresno, CA

Post by Khantahr »

Hi again, sorry I was on another trip, and it's a pain to drag my laptop along.

I tried removing the email entry plugin and that fixed it. Thanks for the suggestion. I'll check back for updates to that plugin.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

I think I fixed the problem in version 1.12 of the plugin!

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply