Need help with embedding

Having trouble installing serendipity?
Post Reply
tonypiazza
Posts: 3
Joined: Thu Dec 07, 2006 4:28 am
Location: Austin, TX

Need help with embedding

Post by tonypiazza »

I am in the process of embedding Serendipity in static site. I have put my standard html into a PHP file and included the following snippet to generate the content of the blog:

Code: Select all

<?php
chdir('serendipity');
include 'serendipity_config.inc.php';
serendipity_smarty_init(); // Start Smarty templating framework
serendipity_printEntries(serendipity_fetchEntries(null, true, $serendipity['fetchLimit']));
$serendipity['smarty']->display(serendipity_getTemplateFile('content.tpl', 'serendipityPath'));
?>
The problem is that this doesn't generate the sidebar. So my question is - what additional code is needed to generate the sidebar on the right side of the page?

Thanks in advance for your help!

Tony
tonypiazza
Posts: 3
Joined: Thu Dec 07, 2006 4:28 am
Location: Austin, TX

RE: Need help with embedding

Post by tonypiazza »

So I've been hacking away trying to figure out how to make this work the way I want. I'm getting real close to what I want. You can view my blog here:

http://piazzatraining.com/blog.php

Here is the code I am using:

Code: Select all

<?php
   chdir('serendipity'); // Switch to Serendipity patch
   include 'index.php';
   serendipity_smarty_init(); // Start Smarty templating framework
?>
All that's left is to fix the following:

1) Turn off the border at the very top of the generated content. I think it's the result of a style somewhere...

2) Turn off the banner.

3) Change the formatting of dates on entries so that it uses a comma after the day of the month instead of a period.

That's it. I have to say that I am very impressed with Serendipity so far.

Let me know if you can help me resolve any of the issues listed above.

Thanks,

Tony
tonypiazza
Posts: 3
Joined: Thu Dec 07, 2006 4:28 am
Location: Austin, TX

RE: Need help with embedding

Post by tonypiazza »

I was able to resolve the first 2 issues. The first one was a simple change to the file style.css in the appropriate template folder. The second one required me to create an index.tpl file in that folder with the banner stuff removed. The last issue (3) still has me stumped though. I would appreciate any help you can give me on that one.

Thanks,

Tony
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: RE: Need help with embedding

Post by garvinhicking »

Hi!

The date timestamp format can be changed if you either edit your 'serendipity_lang_XX.inc.php' file in the 'lang' directory and change the "DATE_FORMAT" constant.

Alternatively you can edit the 'entries.tpl' template file of your theme and replace all occurences of "DATE_FORMAT" with your custom string like "%d.%m.%Y %H.%i".

HTH,.
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