SSI load latest message (title and body) from given board

Started by spiros, March 09, 2008, 03:57:05 PM

Previous topic - Next topic

spiros

I want to load the latest message from a given board and apply different formating to title and body. Is this possible?

jerm


spiros


fwitt

yep use ssi_boardNews($board = null, $limit = null, $start = null, $length = null, $output_method = 'echo')

set $board to the number of the board you want the post to be from, $limit to 1 so it only picks out the first post and $output_method to 'array' will give you an array containing the data rather than echoing it straight to screen for you.

so using this boards number


$data = ssi_boardNews($board = 60, $limit = 1, $start = null, $length = null, $output_method = 'array')


although i have just noticed that the function seems to have changed since i last used it, if this doesnt work i may have to compare the changes with those from an old version.

spiros

Thanks!

I want to include the title so that it appears like the title of a poem here
http://www.translatum.gr/

(scroll down to "Poem of the week")

And the content below, with the same formatting as it appears on the page.
Is this possible?

Bloodsurfer

While reading this I got an idea - is it somehow possible to get all postings of one specified user in one specified thread with SSI?

fwitt

Quote from: spiros on March 10, 2008, 02:29:50 PM<br />Thanks!<br /><br />I want to include the title so that it appears like the title of a poem here <br /><a href="http://www.translatum.gr/" class="bbc_link new_win" target="_blank">http://www.translatum.gr/</a><br /><br />(scroll down to "Poem of the week")<br /><br />And the content below, with the same formatting as it appears on the page.<br />Is this possible?<br />

with the array option on the ssi function you get an array containing the data, subject, body, poster etc... which you can use in any order and with any formatting you wish, so yes it is possible, doing a print_r on the array $data returned by the function in my post above should give you a good idea of what data you have to play with.


Quote from: Bloodsurfer on March 10, 2008, 03:25:26 PM<br />While reading this I got an idea - is it somehow possible to get all postings of one specified user in one specified thread with SSI?<br />

It would be possible to do, it might require a custom version of a SSI function to do as i don't think any of the existing ones filter out an individuals posts or for that matter posts by thread but i dont think it would that hard to write one that does this.

forumnoob

Quote from: Bloodsurfer on March 10, 2008, 03:25:26 PM
While reading this I got an idea - is it somehow possible to get all postings of one specified user in one specified thread with SSI?

well, you could just retrieve ALL posts then only list posts for a particular user
(in the poster array thats attached to each returned post from Board_news() )

there is also a specific query from Unknown that allows you pull all the posts from a particular user (regardless of board)

Advertisement: