simplest way to show weblog posts

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
Guest

simplest way to show weblog posts

Post by Guest »

What would be the simplest way to incoperate 5-10 of the latest weblog posts into my website? Should I strip the rss feed only to show the latest 5-10 posts or use php to pull them?

Thanks
wesley
Regular
Posts: 197
Joined: Sun Jul 10, 2005 11:15 am
Contact:

Post by wesley »

If you want to keep the blog page intact while your website's main page is
separate and standalone, the RSS feed sounds like a good idea...
I make s9y plugins, too.
My s9y blog depends on them. :)
Guest

Post by Guest »

can you recommend any good php scripts to do this?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

You could also use the s9y API to show your entries:

Code: Select all

<?php
chdir('/path/to/s9y');
include 'serendipity_config.inc.php';
$entries = serendipity_fetchEntries();
foreach($entries AS $entry) {
  echo $entry['title'] . "<br />";
  echo substr($entry['body'], 0, 255);
  echo "<hr />";
}
?>
You could look into include/functions_entries.inc.php and look at the function signature to see what you can do with that function :)

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