Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. IT & Infrastructure
  4. Algorithm/SQL that Code Project uses to select forum messages

Algorithm/SQL that Code Project uses to select forum messages

Scheduled Pinned Locked Moved IT & Infrastructure
databasedesignalgorithmshelpquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    badgrs
    wrote on last edited by
    #1

    Hi there, I'm trying to design some forum software and I'd really like to use the conversation-style view that Code Project uses, rather than the more main stream thread style (I hesitate to use traditional here as I believe the conversation view came first?). I'm struggling with how you would pull out the messages to view on any given page without a whole load of unnecessary iteration and database queries. So you have thread topics, each represented by a message with child messages (presumably theres no need for a thread topic DB table, a message with no parent would signify this). You want to keep the order of threads according to the original post date, but how do you then select the right number of threads and messages to fill a page (say 30 messages max) without knowing exactly how many messages each thread will contain? Now I'm thinking about it I guess the easy answer is to keep a count! Surely there must be another solution that could be calculated on the fly, preferably inside some SQL statement. Well, I don't think I've really explained that very well but hopefully someone will get my gist! Basically I want to build a forum that works the same as these ones do, think about that for a minute and you should either understand my problem or realise theres no problem at all and you have the answer for me :D I seem to remember reading ages ago that the original source code for the Code Project forums was available some where, is that still the case? If so where? Cheers! -- Rory

    P 1 Reply Last reply
    0
    • B badgrs

      Hi there, I'm trying to design some forum software and I'd really like to use the conversation-style view that Code Project uses, rather than the more main stream thread style (I hesitate to use traditional here as I believe the conversation view came first?). I'm struggling with how you would pull out the messages to view on any given page without a whole load of unnecessary iteration and database queries. So you have thread topics, each represented by a message with child messages (presumably theres no need for a thread topic DB table, a message with no parent would signify this). You want to keep the order of threads according to the original post date, but how do you then select the right number of threads and messages to fill a page (say 30 messages max) without knowing exactly how many messages each thread will contain? Now I'm thinking about it I guess the easy answer is to keep a count! Surely there must be another solution that could be calculated on the fly, preferably inside some SQL statement. Well, I don't think I've really explained that very well but hopefully someone will get my gist! Basically I want to build a forum that works the same as these ones do, think about that for a minute and you should either understand my problem or realise theres no problem at all and you have the answer for me :D I seem to remember reading ages ago that the original source code for the Code Project forums was available some where, is that still the case? If so where? Cheers! -- Rory

      P Offline
      P Offline
      Paul Conrad
      wrote on last edited by
      #2

      I am sure it is proprietary and Chris's hamsters running the servers will not let you see it :laugh:

      "I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups