Advertisement:

Author Topic: SSI load latest message (title and body) from given board  (Read 4550 times)

Offline spiros

  • Language Moderator
  • SMF Hero
  • *
  • Posts: 1,884
  • Gender: Male
  • A different point of view
    • spiros.doikas on Facebook
    • doikas on LinkedIn
    • @greektranslator on Twitter
    • Greek Translation
SSI load latest message (title and body) from given board
« on: March 09, 2008, 03:57:05 PM »
I want to load the latest message from a given board and apply different formating to title and body. Is this possible?
« Last Edit: March 09, 2008, 07:42:45 PM by spiros »

Offline jerm

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 7,250
Re: SSI load latest message (title and body) from given board
« Reply #1 on: March 09, 2008, 05:54:49 PM »
Are we to assume this post is linked to this one? http://www.simplemachines.org/community/index.php?topic=227336

So this one is actually "solved"?

Offline spiros

  • Language Moderator
  • SMF Hero
  • *
  • Posts: 1,884
  • Gender: Male
  • A different point of view
    • spiros.doikas on Facebook
    • doikas on LinkedIn
    • @greektranslator on Twitter
    • Greek Translation
Re: SSI load latest message (title and body) from given board
« Reply #2 on: March 09, 2008, 07:43:02 PM »
No, this is completely different topic :)

Offline fwitt

  • Full Member
  • ***
  • Posts: 479
  • Gender: Male
Re: SSI load latest message (title and body) from given board
« Reply #3 on: March 10, 2008, 09:28:46 AM »
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

Code: [Select]
$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.

Offline spiros

  • Language Moderator
  • SMF Hero
  • *
  • Posts: 1,884
  • Gender: Male
  • A different point of view
    • spiros.doikas on Facebook
    • doikas on LinkedIn
    • @greektranslator on Twitter
    • Greek Translation
Re: SSI load latest message (title and body) from given board
« Reply #4 on: March 10, 2008, 02:29:50 PM »
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?

Offline Bloodsurfer

  • Semi-Newbie
  • *
  • Posts: 45
Re: SSI load latest message (title and body) from given board
« Reply #5 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?

Offline fwitt

  • Full Member
  • ***
  • Posts: 479
  • Gender: Male
Re: SSI load latest message (title and body) from given board
« Reply #6 on: March 10, 2008, 04:22:47 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.


<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.

Offline forumnoob

  • Jr. Member
  • **
  • Posts: 114
Re: SSI load latest message (title and body) from given board
« Reply #7 on: March 11, 2008, 11:48:24 AM »
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)