Jump to content

Threaded forum algorithm


Rike

Recommended Posts

Hallo everybody!

I am looking for some information about creating PHP threaded forum (with MySQL). BB forum is easy - db table with forums, topics and posts, every post has foreign key to topic, topic to forum and it's done. But if I want something like Disqus, how to do this more efficiently? How to collect posts in db with minimum query needed to render any thread?

And what about post rating? How to prevent user from sending more then one rating?

Link to comment
https://forums.phpfreaks.com/topic/289894-threaded-forum-algorithm/
Share on other sites

Database: learn about adjacency list (requires a parent->child relationship) versus nested sets (requires... something more complex). They have complementary advantages and disadvantages - meaning one's strength is the other's weakness.

Post rating: require a login and track every user's rating so you'll know if they've voted before.

If you don't mind I'm moving this to the MySQL forum as you're asking more about database design than coding.

 

Yes, there will be a lot of rows, but databases are designed for this sort of thing. As long as you're using good normalization practices and proper indexes, everything will perform smoothly.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.