ssi_boardNews

Description

Finds the first post from the most recent topics in the specified board (or the first board that guests can see if a board isn't specified) and either displays this information or returns it as an array depending on output_method.

Syntax

array ssi_boardNews ([int $board[, int $limit[, int $start[, int $length[, string $output_method]]]]])



Parameter $board

Expected type: Integer
Description: The ID of the board to pull the info from. If not specified, the first board that guests can see will be used.



Parameter $limit

Expected type: Integer
Description: The maximum number of items to find. If not specified, function will find all available items.



Parameter $start

Expected type: Integer
Description: The ID of a particular post to start with (otherwise the first result will be used)



Parameter $length

Expected type: Integer
Description: If specified, posts longer than this will be shortened and have "..." or a "Read More" link appended



Parameter $output_method

Expected type: String
Description: Standard SSI.php output_method variable. If 'echo', the results will be displayed in a pre-formatted style. Otherwise they will be returned in an array of arrays. Default is 'echo'.



Return value

Expected type: Array
Description: If output_method is 'echo', the function will display the information in a preformatted style. Otherwise an array of arrays will be returned. Each array is a separate news item and contains the following info

Array Elements
Key Optional Expected type Description
body no String The post (with bbcode and smileys already parsed). If length is specified, body is limited to the specified length and "..." is appended after the last space or linebreak
href no String URL to the topic
icon no String HTML string to display the message icon
id no Integer Topic ID
is_last no Boolean Whether or not this is the last item in the array (used to determine when to stop displaying seperators)
link no String A link to the topic displayed as how many "comments" (replies) it has (see ssi_examples.php)
new_comment no String A link to reply to the last post in the topic, displayed as "Write Comment" (see ssi_examples.php)
poster no Array The standard array of poster information - id (member ID or 0 for guests), name (display name or the name the guest entered), href (URL to poster's profile or an empty string for guests), link (link to the poster's profile or just the name if they were a guest)
replies no Integer How many replies the topic has
subject no String Topic's subject
time no String Formatted time/date string corresponding to when the topic was started
timestamp no Integer UNIX timestamp corresponding to when the topic was started (can be used to customize date/time info)


Notes

  • If you specify a board, guests must be able to see that board...
  • If no board is specified, pulls from the first board that guests can see
  • If guests can't see the specified board or can't see any boards, function dies with an error or returns an empty array depending on output_method
  • Doesn't check other board access - assumes if guests can see it than anyone can see it
  • Great for displaying the latest announcements on your website
  • Can be called directly via a URL (SSI.php?ssi_function=boardNews;board=x)
Advertisement: