News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Is there a modification for SMF that displays topics on the board index

Started by CyanGaming, August 05, 2018, 06:28:57 PM

Previous topic - Next topic

CyanGaming

I couldn't find anywhere else to ask this question, basically, I found a mod that displays recent topics on the board index, however, it only displays up to 10 topics. Plus I was wondering if there is a mod that will display recent topics on the boardindex, but place each topic under it's board.

It seems like it wouldn't be difficult to do since it's just moving where you're displaying them.

Kindred

Actually, it is difficult and expensive, in terms of sever resources, to do that
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

CyanGaming

is there any difference between displaying them under their respective boards and not doing that? or are they the same?

Kindred

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

CyanGaming

In what way, I just assumed you could display a bunch of recent ones, then move them under the board

Kindred

That is not how the system is coded.

The list of boards includes only the most recent post in that board...

The entire list of recent posts is pulled separately and is not filtered by board.

Changing the  boardindex to pull, filter and sort as the board list is displayed would potentially be the most expensive resource intensive query the system could do and it is very different from what the system currently does.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

CyanGaming

but would it be feasible to pull the entire list of recent topics, then filter them by board after the request one by one into their proper boards?

also, you say that's not how the system is coded, but how does the system get a list of topics when you click into a board? could you not use that property?

Kindred

That's what I am saying...   it is not feasible from a resource standpoint.

So, yes... that's what the messageindex in the board does...  but now, multiple that query times the number of boards that you have... (say 10)...    so, not that boardindex query is the messageindex resource usage times 10, then also times the number of current connections viewing your boardindex.... and this includes search engines.

Easily 100 times the resource usage, quickly...


In other words... as I first said, that's not how the system is coded (for very good reasons) and doing that, while technically possible is seriously NOT recommended.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

CyanGaming

hmm what about this:

create a seperate database, have the columns be: board,0,1,2,3,4,5,6,7,8,9
then everytime someone makes a post, check which topic it's in, then check if that topic already exists in the database, if it does, remove it and add it again to 0 (also shift over the rest) Probably have to store the topic as it's html when displayed inside the board.

At that point you can just request the whole table when you want to display it, this table is already sorted for you, so you wont have to make multiple requests.

I imagine I made some mistakes in the explanation, but I think the idea is possible? or did I overlook something again

Kindred

So, now you are doubling the cost to make a post?

Basically, sure.. you can do what you are asking, either way... but what you are asking is a bad idea, either way .
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

CyanGaming

isn't doubling the cost of a post better than multiplying the cost of loading the forum by 100?

vii

If I'm reading this right, you just want to display all the topics on the board index page? Why not just make one board for the entire forum, then have the index page redirect to that board automatically? Otherwise, just displaying a few recent topics under each board sounds about as good as you can get SMF without doing some major overhauls.

I have to agree with Kindred here. This idea doesn't make sense with SMF. I think there are probably other forum software solutions out there that might fit your idea better, like Flarum.

CyanGaming

I don't want to display all of them, just recent ones. like newest 5-10 for each board.
also, having 1 board for the whole forum doesn't make sense, since you dont get any organization

vii

At best then, I think maybe you can do what SMF does for the 'Recent Posts' on the board index, and create a setting variable for $modSettings for each board, like, $modSettings['recent_posts_bid' . $boardID], and you can just store them that way. SMF will pre-load all the settings variables on each page load, so there shouldn't be too much overhead unless you have like 100+ boards. You'll have to save the post info every time someone creates a new topic on the board. You can do this from either createPost() in Subs-Post.php (?) or Post2() in Post.php

You'll also need some maintenance code for this, like for when you delete a board, or a person deletes a topic that is in the $modSettings board's recent posts variable, so you can remove any corresponding $modSettings stuff. The entire idea probably isn't the best design but I can't think of any other way to do this with less resources.

One last thing - if you display like 5-10 recent topics per board, and you have a lot of boards, the forum index page will probably get really messy / dense with text.

Arantor

The only problem with that is that you end up making many extra queries per post.

There is no good way to do this efficiently in SMF's design and it generally doesn't look great ether.

Pipke

"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

Kindred

Pipke - He already knows about that mod.

That's not what he wants.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: