Results 1 to 5 of 5

Thread: Php caching? or database end?

  1. #1
    Join Date
    Jan 2012
    Beans
    55

    Php caching? or database end?

    I have a site that would pretty much looked like a forum and the topic threads are in bold.
    So what i want is when a specific user visit's that thread, the next time he will see its title it will be unbold unless a new user replied to that thread. like in this forums. any suggestions on how to do it? or algorithms? I would appreciate if you have so. I'm new to web developing. thanks.

  2. #2
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    12,640
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: Php caching? or database end?

    If you have little or no experience with web development, I think you would be much better off using existing forum software. While vBulletin, which is used here, isn't free, it would be my first choice. Among free alternatives you should look at Simple Machine Forum or phpBB.

    That said, if you are committed to reinventing the wheel, then you would manage this task in an SQL database. If you look at how this forum is organized, each thread has a identification number (for this one it is 2155023), as does each posting. (Your posting above has ID 12694228. Place your cursor over the "#1" on the right-hand side of your post's header line and look at the link to which it points.) In the database you would have a table that consists of three fields, the user's ID, the thread's ID, and the ID number of the last posting read. Each time a user reads a post you would update the table. When the user logs in next time, you can determine if there are unread posts in the thread and proceed accordingly.
    Last edited by SeijiSensei; June 17th, 2013 at 04:02 AM.
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  3. #3
    Join Date
    Jan 2012
    Beans
    55

    Re: Php caching? or database end?

    Quote Originally Posted by SeijiSensei View Post
    If you have little or no experience with web development, I think you would be much better off using existing forum software. While vBulletin, which is used here, isn't free, it would be my first choice. Among free alternatives you should look at Simple Machine Forum or phpBB.

    That said, if you are committed to reinventing the wheel, then you would manage this task in an SQL database. If you look at how this forum is organized, each thread has a identification number (for this one it is 2155023), as does each posting. (Your posting above has ID 12694228. Place your cursor over the "#1" on the right-hand side of your post's header line and look at the link to which it points.) In the database you would have a table that consists of three fields, the user's ID, the thread's ID, and the ID number of the last posting read. Each time a user reads a post you would update the table. When the user logs in next time, you can determine if there are unread posts in the thread and proceed accordingly.
    i kinda get your concept sir. gonna update soon. thank you.

  4. #4
    Join Date
    Jun 2007
    Location
    Porirua, New Zealand
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Php caching? or database end?

    Another php-based example of forum software that has enjoyed some popularity here is MyBB.
    Forum DOs and DON'Ts
    Please use CODE tags - Including your email address in a post is not recommended
    Never assume that the information provided by Dr Google is up-to-date or relevant.

  5. #5
    Join Date
    Jan 2012
    Beans
    55

    Re: Php caching? or database end?

    Quote Originally Posted by lisati View Post
    Another php-based example of forum software that has enjoyed some popularity here is MyBB.
    no sir. i want to make my own for a school project.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •