SMF Support > SMF 2.0.x Support
How to show latest posts of a sub-forum?
(1/1)
subzero_mb:
Hi there,
I have done many modifications to my smf forum, I have join in one 20 smf forums (that was crazy but I did it) and I have touch the code in many places... but still I don´t know how to show the latest posts of subforum 21, 3 and 15 for example!
There is a function in SSI that it is recent_posts() that it looks like everything that I need, and in fact does what I want, I pass the Id's of the subforums and it shows the latests posts but.... just if these posts have been written recently (I have no idea what it is recently exactly for smf, I mean in time) so if messages have been written today these are showed but if the last messages are from 1 week ago for example, the function shows nothing...
So I have created a mysql query but problems are bigger because the results are text with bbcode, if I want to cut the message just for the 100 first words the bbcode could be broken...
And finally I am here asking how can do something that i really look so easy but in fact, at least for me it is not. Could does anyone help me? Many thanks!
subzero_mb:
C'mon no one knows how to do that?? I am sure that someone has a website or portal where he shows the last posts of a group of subforums... Please any help or advice
K@:
Give us a chance, mate!
When you posted, don't forget that some of us may well have been in bed! (Different timezones and all that)
Someone WILL get to you. But, please, be a bit patient.
subzero_mb:
Ok, sorry, i just thought that it was an easy questions who many people will know but I will be patient for the experts.
Anyway if nobody knows I am thinking in use some of the many bbcode to html functions that there are looking in google and then using a cutting function that doesn´t break the html code, and with this will be enough I think. But of course if there is a smf function that could do it I will prefer to use it.
emanuele:
--- Quote from: subzero_mb on July 09, 2012, 11:30:36 AM ---So I have created a mysql query but problems are bigger because the results are text with bbcode, if I want to cut the message just for the 100 first words the bbcode could be broken...
--- End quote ---
As long as you use the internal bbcode parser, the broken bbcode should not be a problem because parse_bbc usually tries to properly close tags or ignore them.
--- Quote from: subzero_mb on July 09, 2012, 11:30:36 AM ---There is a function in SSI that it is recent_posts() that it looks like everything that I need, and in fact does what I want, I pass the Id's of the subforums and it shows the latests posts but.... just if these posts have been written recently (I have no idea what it is recently exactly for smf, I mean in time) so if messages have been written today these are showed but if the last messages are from 1 week ago for example, the function shows nothing...
--- End quote ---
Looking at SSI code "recent" means the last "x" posts (default is 8).
--- Quote from: subzero_mb on July 09, 2012, 11:30:36 AM ---And finally I am here asking how can do something that i really look so easy but in fact, at least for me it is not. Could does anyone help me? Many thanks!
--- End quote ---
Honestly I'm not sure what your question is.
Maybe a bit of the code you wrote could help clarify what you are doing. ;)
Navigation
[0] Message Index
Go to full version