TinyPortal

Development => Block Codes => Topic started by: pgc_boss on March 03, 2006, 07:19:29 AM

Title: View last post from News board.
Post by: pgc_boss on March 03, 2006, 07:19:29 AM
We have the ability through TP, to show the posts from a particular board on the frontpage. SMF also provides ssi_boardNews() which I believe serves a similar purpose.

My suggestion (or request if you prefer) is as follows:

If you take a look at the frontpage of my site (http://dev.phoenixgamesclub.org.uk/), you'll see that I have a static HTML block with some introductory text, with a newsblock above it. (It's been done this way, using frontpage blocks only because we don't want the static block to show up whenever you click Forums or Articles.)

The newsblock is a pretty decent way of giving out the most recent announcements but it randomly selects a news item, not the most recent one. Thus I have to delete all previous items and I've got no history.

Is it possible to use a PHP block to extract the information from the news forum (as done by TP) but to only display the most recent item???
Title: Re: View last post from News board.
Post by: pgc_boss on March 03, 2006, 07:40:04 AM
Okay ... scratch this ... I just found out how to do it.

Set up a Frontpage phpbox block.

Type the following code:
Code: [Select]
ssi_boardNews(n,1);where n is the boardID for your news.