Smarty call from php file

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
Don Chambers
Regular
Posts: 3657
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Smarty call from php file

Post by Don Chambers »

I'm trying to help someone make a minor modification to an s9y install that is embedded. The install does not use index.tpl, but rather a blog.php file that contains a bunch of php as well as all the html, such as <head>, etc.

I need to get {serendipity_hookPlugin hook="frontend_header"} into this file. How do I do that since it is not a smarty tpl file?
=Don=
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

That's a very old version of s9y, I think.

What you need is the PHP equivalent:

Code: Select all

serendipity_plugin_api::hook_event('frontend_header', &$serendipity);
Untested, of course. And you may need to...

Code: Select all

global $serendipity;
...or even:

Code: Select all

@include $serendipity[baseDir] . 'include/plugin_api.inc.php';
before it works.
Judebert
---
Website | Wishlist | PayPal
Don Chambers
Regular
Posts: 3657
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers »

Its not an old s9y install - just a very unusual one. In this instance, embedding was seen as necessary because the blog is only a small component of an existing website.
=Don=
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

Ah. I'm confusing the old theme system, which used some-or-other .php file, with the embedding. Sorry. Did the direct PHP call help?
Judebert
---
Website | Wishlist | PayPal
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Smarty call from php file

Post by garvinhicking »

Hi Don!

The blog.php file should be from within s9y, right?

In fact, even when s9y is embedded it should use a template's index.tpl file and render it. Thus, you shouldn't need to use any PHP.

However, it might help if you can post the blog.php here or somewhere else to look at.

Judeberts suggestion should work, but it would require a PHP coder to really understand the process of the blog.php...

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/
Don Chambers
Regular
Posts: 3657
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers »

Thanks Jude & Garvin. Jude's suggestion worked. Only need the global $serendipity & the php version of the hook. The @include gave me the white screen of death, but did not turn out to be necessary.
=Don=
Post Reply