ssi_recentPosts

Description

Gets a list of recent posts and either displays them or returns an array of info depending on output_method.

Syntax

array ssi_recentPosts ([int $numRecent[, array $boards_to_exclude[, string $output_method]]])



Parameter $numRecent

Expected type: Integer
Description: How many recent posts to display. Default is 8



Parameter $boards_to_exclude

Expected type: Array of Integers
Description: An array of board IDs. If specified, recent posts from these boards will not be included in the results.



Parameter $output_method

Expected type: String
Description: Standard output_method - if not specified, the function will output a nice formatted list, otherwise it will return the array of information. If there are no recent posts, an empty array is returned.



Return value

Expected type: Array
Description: Returns nothing if output_method is echo; otherwise returns an array of arrays with the following keys

Array Elements
Key Optional Expected type Description
board no Array An array of information about the board - id (board ID), name (board name), href (URL to the board) and link (HTML link to the board)
href no String URL to the post
link no String HTML link to the post
new no Boolean Whether or not this is a new post
newTime no String Used to determine which posts within the topic to mark read
poster no Array An array of information about the poster - id (member ID or 0 if they're a guest), name (poster's name), href (URL to the poster's profile, if applicable), link (HTML link to the poster's profile, or the name if they're a guest)
short_subject no String The first 22 characters of the subject with "..." appended, or the entire subject if it's less than 26 characters long
subject no String The subject of this post
time no String The formatted time/date string indicating when the post was made
timestamp no Integer The raw timestamp indicating when the post was made
topic no Integer The topic ID


Notes

  • If output_method is echo, will display a pre-formatted list
  • Does not care if all the recent posts are from the same board...
Advertisement: