Jump to content


Photo

new/nonew icons (forums)


  • Please log in to reply
19 replies to this topic

#1 coolaid

coolaid

    P2L Jedi Master

  • Members
  • PipPipPipPip
  • 1,435 posts
  • Gender:Male
  • Interests:i wonder..

Posted 12 March 2006 - 03:41 PM

im creating a forums and i'm completely in the dark about one aspect of forums. what would be a typical way of creating those new / no new icons for each category?

any help would be great, an explanation of what i would need to do, a script, a tutorial would be better :D

#2 Av-

Av-

    I Feel Left Out

  • Members
  • PipPipPipPip
  • 1,972 posts
  • Gender:Male
  • Location:10 ft. below sea level

Posted 12 March 2006 - 06:54 PM

Dude, im having the exact same problem (yeah, im also creating a forum ^_^). Even after lookng at phpbb and woltlab bb's source and db im still clueless about how this should be done.

#3 austen

austen

    P2L Jedi

  • Members
  • PipPipPip
  • 910 posts
  • Location:Montana, US
  • Interests:Web design, snowboarding (lots of it), Computer science related.

Posted 12 March 2006 - 07:26 PM

Wouldn't you have some sort of time field in your topic table that updated with the last reply of a topic... and then you could like, do some clever comparisons of that to a time field in the members table? or or... you could use cookies somehow? I'd look into the cookies thing, I know a couple of my friends used to have a site where they used cookies to track recent posts they made... so that could work well though it would be complicated most likely.

-austen

PS: sorry for the slightly jumbled reply, I had several ideas on this... though I'd check out the use of cookies first.

EDIT: I know now that this is done with cookies... I changed computers and the topics that were "old" on my powerbook are "new" on my windows machine I just fixed sooo.... yeah, get good with cookies... though I'm not really sure how to go about it.

Edited by austen, 12 March 2006 - 07:57 PM.


#4 Mr. Matt

Mr. Matt

    Moderator

  • Validating
  • PipPipPipPip
  • 1,945 posts
  • Gender:Not Telling

Posted 13 March 2006 - 08:23 AM

like austen said you would use cookies, you would compare the time in the database for the last post and compare it against the last time you were on the board

well thats how i would do it

#5 austen

austen

    P2L Jedi

  • Members
  • PipPipPip
  • 910 posts
  • Location:Montana, US
  • Interests:Web design, snowboarding (lots of it), Computer science related.

Posted 13 March 2006 - 09:32 AM

like austen said you would use cookies, you would compare the time in the database for the last post and compare it against the last time you were on the board

well thats how i would do it


That's what I was thinking..

-austen

#6 Av-

Av-

    I Feel Left Out

  • Members
  • PipPipPipPip
  • 1,972 posts
  • Gender:Male
  • Location:10 ft. below sea level

Posted 13 March 2006 - 10:41 AM

Then you would need a cookie for every single topic?

#7 coolaid

coolaid

    P2L Jedi Master

  • Members
  • PipPipPipPip
  • 1,435 posts
  • Gender:Male
  • Interests:i wonder..

Posted 13 March 2006 - 04:20 PM

so far both ideas seem pretty insane...

using timestamps to compare last user log in to last post just wont work cause what if they log in, but dont see all topics and have to get off to do something... they wont know what they did and didn't see.

the cookies is a bit more viable i guess but still.. cookies for every topic seems like overkill, but i'm thinking of ways i could use cookies for this

#8 Av-

Av-

    I Feel Left Out

  • Members
  • PipPipPipPip
  • 1,972 posts
  • Gender:Male
  • Location:10 ft. below sea level

Posted 13 March 2006 - 04:38 PM

I think i read somewhere that IE doesnt allow you to put more than 20 cookies on a computer from a single domain.
Try n keep it under 20 topics :)

Myabe you could do something like an extra field in the forum's databse for every topic which holds all the names who have already read that topic...

#9 austen

austen

    P2L Jedi

  • Members
  • PipPipPip
  • 910 posts
  • Location:Montana, US
  • Interests:Web design, snowboarding (lots of it), Computer science related.

Posted 13 March 2006 - 04:42 PM

Yeah, I'm trying to think on this as well, it has been bugging me as I haven't been able to give you guys a definitive answer... I'll talk to someone I know that would know and see what he has to say.

-austen

Myabe you could do something like an extra field in the forum's databse for every topic which holds all the names who have already read that topic...


I believe that would make your database quite large and what would happen if you did that, and a new reply was posted, you'd clear that field? I guess that could hypothetically work... and you could show the user something based on if their name was in that topic's field.

-austen

#10 rc69

rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 13 March 2006 - 04:50 PM

I think i read somewhere that IE doesnt allow you to put more than 20 cookies on a computer from a single domain.
Try n keep it under 20 topics ;)

Myabe you could do something like an extra field in the forum's databse for every topic which holds all the names who have already read that topic...

Even i don't know how the whole new topic thing works as i've never looked into it. I also know that creating forums is not an easy task, which is another reason i've never looked into "marking posts as read" or anything like that.
But, in regards to the above quote, you could always use one cookie to store 20,000 topic ids (but that would just be all sorts of annoying). I've thought about the database thing as well, but like austen said, if you have a forum the size of p2l's, you'd rack up a 20 gig database in no time (and that's even less enjoyable then the cookie idea).

#11 austen

austen

    P2L Jedi

  • Members
  • PipPipPip
  • 910 posts
  • Location:Montana, US
  • Interests:Web design, snowboarding (lots of it), Computer science related.

Posted 13 March 2006 - 05:04 PM

Exactly... I'll see what my friends have to say tonight (ones that know a heck of a lot more than me) about this ordeal as I think they might have done it sometime in the past..

-austen

#12 coolaid

coolaid

    P2L Jedi Master

  • Members
  • PipPipPipPip
  • 1,435 posts
  • Gender:Male
  • Interests:i wonder..

Posted 13 March 2006 - 05:27 PM

i cant wait austen! ;) but i have too....

use one cookie to store 20,000 topic ids

thats what i was thinking of doing actually ;)

i actually looked at my cookies and looked at my forums (the actual ones that are in use not the in-production ones) and i saw the cookie 'topicsread' and it was loooongggggggg i actually think thats how big forums do it... oh well.. we'll see

#13 Av-

Av-

    I Feel Left Out

  • Members
  • PipPipPipPip
  • 1,972 posts
  • Gender:Male
  • Location:10 ft. below sea level

Posted 13 March 2006 - 06:22 PM

As far as i know, cookies can only hold 4 kb, you will reach that mark pretty quick if you have a busy board. Topic's will not be added to the cookies and the new post icon will still show up, even if they already read it.

A solution would be t clear the cookies every now and then or make user increase their cookiesize in the browser preferences

#14 tiki

tiki

    Young Padawan

  • Members
  • Pip
  • 259 posts
  • Gender:Male
  • Location:California

Posted 13 March 2006 - 06:53 PM

have a field that stores the userid with the topic id....

if they viewed that thread, insert there id and mark it as read. then remove id, but that wud set at back at unread right?

#15 Mr. Matt

Mr. Matt

    Moderator

  • Validating
  • PipPipPipPip
  • 1,945 posts
  • Gender:Not Telling

Posted 14 March 2006 - 09:10 AM

that again would make the database very large and take up a lot of un-needed processing time slowing the server down.

I have an idea, i will take a look later on and get back to it

#16 austen

austen

    P2L Jedi

  • Members
  • PipPipPip
  • 910 posts
  • Location:Montana, US
  • Interests:Web design, snowboarding (lots of it), Computer science related.

Posted 14 March 2006 - 09:19 AM

When I discussed this with my usually all-knowing php friend, he had the same thoughts as all of us on this, however, he is still thinking on the problem because like me, it bugs him that he doesn't know how it would work though the database method would get huge, it may possibly be only applicable to Logged In members... arrg, I'll be thinking on this all day - post more later.

-austen

#17 tiki

tiki

    Young Padawan

  • Members
  • Pip
  • 259 posts
  • Gender:Male
  • Location:California

Posted 15 March 2006 - 02:10 AM

me and my friend spooky were discussing this also. it wouldnt be cron jobs or db... we suspect cookies/sessions.... but how?-

#18 austen

austen

    P2L Jedi

  • Members
  • PipPipPip
  • 910 posts
  • Location:Montana, US
  • Interests:Web design, snowboarding (lots of it), Computer science related.

Posted 15 March 2006 - 09:25 AM

I opened a topic over at PHPFreaks.com - this is what they suggested.... the database route with a script that cleans the db periodically to prevent buildups.. go here:

http://www.phpfreaks...showtopic=88375

This seems like it'd work to me...

-austen

#19 MillerTime

MillerTime

    Young Padawan

  • Members
  • Pip
  • 69 posts

Posted 15 March 2006 - 11:21 PM

my friend at krpytek made a neat forum from scratch and has that feature working. You can ask him if ya like, http://www.kryptek.org

But his forums have a bit of a problem of keeping people logged in..somethings wrong there

But it is in very early stages..He's releasing it as a free open source forum software in the future..

#20 Nerdstyle

Nerdstyle

    Young Padawan

  • Members
  • Pip
  • 29 posts

Posted 16 March 2006 - 01:21 AM

Yeah I have thought about doing this with my forum on my site. I was a worried a little about the database way of doing it too because of the size. But now that I think of it its not that bad. The size is not that big per entry and mysql is really good at speed even with lots of entrys.

You would definately want to clean it up every once in a while though.

That krpytek site is pretty impressive BTW if he did it by scratch.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users