MyBB Community Forums

Full Version: Creating a list of recent threads that includes the "new posts" status?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I would like to change my index page to show something like the 30 last active discussions.

I know there is a Recent Threads plugin, unfortunately it bypasses the default templates I think, and thus it doesn't show the read / unread status (ie. bold text topics).

I would like my registered visitors to automatically see the updated topics in bold text like most of the forum's thread listings do.

edit:

Maybe a simple solution would be to have a copy of {$forumdisplay_threadlist} which does practically the same thing except removing the "where fid = {forum id}" criteria ? if you remove that criteria then you effectively have a "recent threads" list right?

Any idea how that can be done?
You can use code from the core, yes. Remember to check all forum/group permissions.
I'm sure I can adapt the code myself but I need help to find how I can include a threadlist in a page, and then how I could make a copy of the template perhaps that will call my modified thread list code?

I can figure more or less what the thread listing code does but I'm lost as to how it gets called, and how to make a template that calls it.
That helps a little bit with the template side.

Now the default MyBB code I think does not call thread list from a template, but the other way around: it says "I want to make a thread list, I have the data, now render with xyz template".

So eventually I might want to make a template to render a different thread list. And I understand that my "modified thread list" can be something I prepare in the plugin hook or somewhere along those lines.

What is still obscure to me, is what function in MyBB can be called to render a thread list ?

Is there actually a function that can be used to render a thread list, or is it somewhat "hardcoded" into forumdisplay.php ?

Should I copy much of the content of forumdisplay.php into another file to do my modified thread list ? And then can I even call that from the plugin? Won't the environment be different if it's included from within another function?
You can copy the code you need from forumdisplay.php. There's no simplier answer to your questions, except coding the whole plugin for you. Analyze which queries, loops etc. are needed and implement them into your plugin.

Or just use a more advanced plugin like ProStats: http://community.mybb.com/mods.php?action=view&pid=59 which basically does the same thing and has thread status icons (but no boldening). Or analyze the plugin to write something similar.
Alright thanks. I realized maybe another way to do it (because I only want this thread list on the index page), is to replace index.php with forumdisplay.php which I then modify for my needs... after all the forum doesn't need to go through index.php right, and forumdisplay also shows the header, the footer ...

Would there be any major gotchas to doing that? I think I'll lose some bitsl ike the board stats but it might be easier to figure the missing bits and add them back in from index.php, than it is to isolate the thread list code.

That plugin looks like a Boeing 747 dashboard...

I'm trying to do what many communities do today: recent discussions on the front page, so the visitor is into the content straightaway. And then pretend forums are "categories" or tags, and you pretty much have the same thing as https://laracasts.com/discuss or bbpress . Only when user wants to create a topic, they click through one of those "categories" (aka "forum"), and then post a topic.

The index page is completely outdated. I and most of my forum members do the same thing : click "recent posts" or something similar like "new posts", and never ever have a use for the index page with the forum list.

Have you considered doing something like that with MyBB 2.0? (all recent discussions on the front page)
(2015-10-10, 05:58 PM)ecirbaf Wrote: [ -> ]Alright thanks. I realized maybe another way to do it (because I only want this thread list on the index page), is to replace index.php with forumdisplay.php which I then modify for my needs... after all the forum doesn't need to go through index.php right, and forumdisplay also shows the header, the footer ...

Would there be any major gotchas to doing that? I think I'll lose some bitsl ike the board stats but it might be easier to figure the missing bits and add them back in from index.php, than it is to isolate the thread list code.

You can do that, yes.


(2015-10-10, 05:58 PM)ecirbaf Wrote: [ -> ]That plugin looks like a Boeing 747 dashboard...

Most options can be disabled if I'm not mistaken..

(2015-10-10, 05:58 PM)ecirbaf Wrote: [ -> ]Have you considered doing something like that with MyBB 2.0?  (all recent discussions on the front page)

Yes. I'm quite sure it was shown in at least one preview article/video.
That's great news. I didn't see all of the previews yet, will do that.

Would you have an archive somewhere of all the default theme's template files as separate text files? It would help a lot figure what the code is doing when I can do a text file search like grep in the codebase and also match the variables, html and css classes in the templates.
Pages: 1 2