Development > Feature Requests
Single Post
mforum:
Hi
what about the ability to add a single post as article ?
In that case only a Read More link is needed .... a write a comment link would be confusing. :)
AngelinaBelle:
I was thinking about this! I was thinking SMF needs a function to retrieve just the body of the post, perhaps with options to show or not show the author, profile info, avatar, etc.
The body of a recent post about a club event could be a perfect "Welcome" block.
As in http://rockhallsailingclub.org/smf/SPStandalone.php, where I copy/pasted the contents of a post into a custom HTML block.
I think it would be better/easier if I could have a block that was defined as a single post. Or the ability to embed the post contents in a custom HTML or BBC block.
I think this is a great idea. If the SimplePortal team rejects it, it might be a good mod.
AB
130860:
smf has an ssi funtion to fech a single post from db:
try this:
<?php $post = ssi_fetchPosts(1, NULL, NULL);
echo $post[0]['body'], '<br />'; ?>
where 1 es the ID of the post you want it to show.
more info:
http://www.simplemachines.org/community/index.php?action=search2;search=ssi_fetchPosts
greetings!
[SiNaN]:
For SMF 1.1:
http://custom.simplemachines.org/mods/index.php?mod=357
For SMF 2.0:
ssi_fetchPosts() would work as 130860 noted.
AngelinaBelle:
Doh! Thanks!
Navigation
[0] Message Index
[#] Next page
Go to full version