What's the best way to do this?

Discussion in 'PHP' started by bigrollerdave, Feb 23, 2007.

  1. #1
    Okay I have a custom made forum on one of my sites. What I'm trying to do is have the thread become bold when your on the view thread page example. Once the user enters the thread though I want that bold to go away untill there is another new post in the thread. I can think of a few ways to do this but they all seem very mysql hungry.
     
    bigrollerdave, Feb 23, 2007 IP
  2. bigrollerdave

    bigrollerdave Well-Known Member

    Messages:
    2,112
    Likes Received:
    52
    Best Answers:
    0
    Trophy Points:
    140
    #2
    Anyone have any idea?
     
    bigrollerdave, Feb 24, 2007 IP
  3. picouli

    picouli Peon

    Messages:
    760
    Likes Received:
    89
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Use cookies
     
    picouli, Feb 24, 2007 IP
  4. bigrollerdave

    bigrollerdave Well-Known Member

    Messages:
    2,112
    Likes Received:
    52
    Best Answers:
    0
    Trophy Points:
    140
    #4
    set a cookie for every thread the user looks at?
     
    bigrollerdave, Feb 24, 2007 IP
  5. tinkerbox

    tinkerbox Peon

    Messages:
    55
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    cookie will track your clicks, bold means, you havent click the link yet(in this case). Not just bold, you also can change it to other color, try use css.

    find some thing like this in ur css file:
    
    .xxx a {
     ....
    }
    .xxx a: hover {
     ... 
    }
    .xxx a:visited {
     ...
    }
    
    Code (markup):
    play around with that :)
     
    tinkerbox, Feb 24, 2007 IP
  6. picouli

    picouli Peon

    Messages:
    760
    Likes Received:
    89
    Best Answers:
    0
    Trophy Points:
    0
    #6
    That's right - set a cookie with name = thread title (formatted to be accepted) and value = date of the visit: then if there's a message newer than the date of last visit show in bold, otherwise in plain.

    :)
     
    picouli, Feb 24, 2007 IP
  7. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #7
    So you're gonna end up with 200 cookies? And I'd use the topic ID's if it's a forum...
     
    nico_swd, Feb 24, 2007 IP
  8. picouli

    picouli Peon

    Messages:
    760
    Likes Received:
    89
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Yeah, that's right - otherwise how can you mark threads as "read" for unregistered users?
     
    picouli, Feb 24, 2007 IP
  9. bigrollerdave

    bigrollerdave Well-Known Member

    Messages:
    2,112
    Likes Received:
    52
    Best Answers:
    0
    Trophy Points:
    140
    #9
    I'm not worried about unregistered users just the ones that have already signed up
     
    bigrollerdave, Feb 24, 2007 IP