Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: skb on January 09, 2021, 11:38:41 PM

Title: Question on displaying an old post
Post by: skb on January 09, 2021, 11:38:41 PM
My question is somewhat unusual and I think that it cannot be done, yet I thought of asking the expert opinion of this forum.

Is there a way to display an old post, not as a link and not as a screenshot image but as the post itself? 
Title: Re: Question on displaying an old post
Post by: Kindred on January 10, 2021, 12:22:19 AM
Sure. Use one of the ssi functions
Title: Re: Question on displaying an old post
Post by: Kindred on January 11, 2021, 10:16:48 AM
specifically:

// Fetch a post with a particular ID. By default will only show if you have permission to the see the board in question - this can be overriden.
function ssi_fetchPosts($post_ids = array(), $override_permissions = false, $output_method = 'echo')
Title: Re: Question on displaying an old post
Post by: skb on January 11, 2021, 10:18:48 PM
Thanks Kindred. Let me explain in more detail.

One of our founder member expired in December. We want to start a memorial thread for her, where we don't want the posts to contain the links to her memorable posts, but display the posts themselves. With the ssi function that you have given, I suppose we could display her posts in one of Tiny Portal's blocks, if not in a thread.
Title: Re: Question on displaying an old post
Post by: Aleksi "Lex" Kilpinen on January 12, 2021, 12:43:53 AM
Thanks Kindred. Let me explain in more detail.

One of our founder member expired in December. We want to start a memorial thread for her, where we don't want the posts to contain the links to her memorable posts, but display the posts themselves. With the ssi function that you have given, I suppose we could display her posts in one of Tiny Portal's blocks, if not in a thread.

Quote from: skb
Thanks Kindred. Let me explain in more detail.

One of our founder member expired in December. We want to start a memorial thread for her, where we don't want the posts to contain the links to her memorable posts, but display the posts themselves. With the ssi function that you have given, I suppose we could display her posts in one of Tiny Portal's blocks, if not in a thread.

Doing it this way would basically mean manually copying the posts, and removing the linking part of the code though.
Title: Re: Question on displaying an old post
Post by: shadav on January 12, 2021, 02:06:11 AM
I mean you could always just quote the posts, though yes it'd be one by one
Code: [Select]
[quote=users name goes here]copy of what the post said goes here[/quote]so this would show that they posted it but not link to that post
so it'd be like this
Quote from: shadav
see I made myself quote myself

[edit] hahaha sorry just saw that's what lex was saying...oh well I showed how to do it so  :P  :laugh:
Title: Re: Question on displaying an old post
Post by: skb on January 12, 2021, 02:14:23 AM
That's not what we had in mind, but thanks anyway.
Title: Re: Question on displaying an old post
Post by: skb on January 14, 2021, 01:13:12 AM
Ultimately we had to rely on the 'Quote' method. Marking this solved.
Title: Re: Question on displaying an old post
Post by: Kindred on January 14, 2021, 06:38:01 AM
Hmmmm..... I mean, since ssi_fetchPosts gets a specific post, it should be fairly straight forward to extend it to get the post and all replies...

ssi_fetchTopic

(base it on fetchPosts -- but use the queries in Display.php and output code in Display.template.php to fetch the initial post and the replies and display it as a topic)

I don't have time to code it right now --- but it shouldn't take more than an hour or so for someone competent with code to hack it in place.   Maybe request it as  mod?