DaVince This fool just HAD to have a custom rating
Registered 04/09/2004
Points 7998
12th March, 2007 at 16:57:28 -
For a while now, I have noticed that the 'new posts' icons are saved as a cookie (or something) rather than in the user's profile. There is, however, one problem with this, and that's the fact that the status of new posts are different on every PC I am on. This is pretty impractical, as I use up to four different PCs.
Any chance of this being stored in another way? Or would this take up too much database space (though it could be a simple matter of saving an array of unread post IDs)?
Ive taken this into concideration in the past, but it'd be quite a strain on the database, I'll have to think of a way to do it without having to have a seperate feild for each forum
Clubsoft:
Date/time of last login compared against time of the last post in a thread, with everything newer being bulb'd. Wouldn't work exactly the same as it does now, but that's how other forums do it.
- store a text file on the server using every user's id number from the database, as the file name.
- In that text file, store seperate lines of 2 integers. Each line could consist of firstly the id number of the forum thread, then followed by a comma and the number of replies a thread has (for example: "25823, 4").
- Then have a simple function that looks up the forum thread in the aforementioned text file for the user who is viewing the forum. If the amount of replies a thread has is -different- from the amount stored in the text file, it must mean that there are new replies.
This approach would make it universal. One thing i'm not aware of is read time. I assume it is faster for the server to read from a text file than it is to read from a database.
Not a bad way of doing it, though if I were Clubby I'd see about Radix' way.. after trying a similar idea using the cookies.
Edit: you could do a hint of both - but only test the first 15 topics? So retrieve the ID from the first 15, and in the cookie (ok, or text file) have the post ID and a logical indicator along with it. 1 being read and 0 unread. That could work pretty well..
Tim - the difference in cookies and the text file i suggested is that cookies are stored on clients, so it would be different on each computer you login from. The text file would be stored on the create-games.com server and thus things would be the same no matter where you logged in.
n/a
DaVince This fool just HAD to have a custom rating
Registered 04/09/2004
Points 7998
22nd March, 2007 at 13:40:23 -
Not sure if text files are such a good idea, after all databases were created for things like this.
If it's too much of a strain on the database, the date thing is an acceptable but not really failsafe method to use.
Ah yeah, sorry eviscerator/bodoron I wasn't thinking so laterally there I spose :\
We could use a combination of things above.. though its quite a tough thing to sort without having to add more fields to the database for each user and forum topic :| Though the text file thing would be fairly effective, it seems a bit flimsy to me really... but maybe its just that I don't like using text files to store db info, but doesn't seem too secure or ultimately beneficial to any mighty effect.
Some way to limit and read from the first 15 or so topics would be best.. I guess the cookie from a machine could store info in a users' field... like perhaps a number from 1-15 or 0-F or something, and that indicates that the first however many are unread. Though then the sorting of topics would have to alter and depend on ID's etc :\
Problem with text files is that for each user you'd need a file, and NTFS is limited to how many files can be in the same.. doubt i'd hit that (its in the 25,000 range), but I dont like limitations none the less.. I'll code it in to using the database at some point
another option is to have 1 field for each user that stores all forum info separated by commas. Then you could just read this text, parse it and put each entry into its own spot in an array, and then loop through the array.
well, a friend of mine made a tagwall for his site, and now it's full of ...things that have the word "viagra" in them
how about email confirmation in order to sign up then? i assume spam bots are not intelligent enough to both scan a site for the email field + locate the correct confirmation link in an email? and what if you just send the code in an email but without a link?