Calling up the Recent Entries PHP

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
MyPersianBay
Regular
Posts: 13
Joined: Fri Jan 12, 2007 6:19 pm

Calling up the Recent Entries PHP

Post by MyPersianBay »

Hello,

How can I call it up so I can embed it somewhere in my website?

Here is my website:
http://www.mypersianbay.com/serendipity1/articles.php

I like to move the recent articles to the left side in the empty spot.

Thanks a lot.

Sorry for a dumb question! my php knowledge is limited.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Calling up the Recent Entries PHP

Post by garvinhicking »

# 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/
MyPersianBay
Regular
Posts: 13
Joined: Fri Jan 12, 2007 6:19 pm

Post by MyPersianBay »

Thanks Garvin.

I think this helps a lot http://www.s9y.org/206.html . However, how can I get it to print only the titles?

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

Post by garvinhicking »

Hi!

You can simply copy the 'entries.tpl' to something like "myentires.tpl" and then change the $serendipity['smarty']->display() call to use that template.

Inside this template file you can make changes so that only titles are displayed!

Best 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/
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

I'm gratified to see that the Expert's solution actually helped someone! The last bit of customization, where you change step 6 to call a specific template, is the one you'll have to use along with Garvin's recommendation.

As for the template editing itself, just remove all the stuff that gets printed except for the template titles and URLs from 'myentires.tpl' (or whatever you decided to call it; I'd go with 'entry_titles_only.tpl' myself). And you'll want to put it in your templates/default/ directory, so it'll still be findable no matter what template you use.
Judebert
---
Website | Wishlist | PayPal
MyPersianBay
Regular
Posts: 13
Joined: Fri Jan 12, 2007 6:19 pm

Post by MyPersianBay »

Many Thanks to both of you. I think I found a clue what to do. :)

I'll keep you posted.
MyPersianBay
Regular
Posts: 13
Joined: Fri Jan 12, 2007 6:19 pm

Post by MyPersianBay »

I finally figured that out, here it is: http://www.mypersianbay.com/serendipity1/latest.php

I also made a template of my own here:
http://www.mypersianbay.com/serendipity1/articles.php

But the thing I can't figure out is that how I can define a style sheet in the latest.php file.
abdussamad
Regular
Posts: 117
Joined: Fri Apr 21, 2006 10:11 pm
Location: Karachi, Pakistan
Contact:

Post by abdussamad »

If you want to use the same style sheet as the template then you echo $serendipity['smarty_vars']['head_link_stylesheet']:

Code: Select all

  <link rel="stylesheet" type="text/css" href="<?=$serendipity['smarty_vars']['head_link_stylesheet']?>" />
Check out functions_smarty.inc.php in the include dir to lookup php equivalents of some of the smarty s9y functions.

BTW you have a very nice header design on your main site :) .

Edit: you'l probably have to do the includes and smarty init stuff before the inserting the above code.
Post Reply