mark as read and add as friend (help)

Started on the old forum in January 2011 · view the original in the archive · old links redirect here

6 replies · 409 views · started 15 years ago · 1 min read

5 participants
frostymarvelous Senior · 266 posts #1

I've been mulling over these two since I started coding. Anyway way I figure, I can only make these with a database heavy approach. I've come up with a serialized array in a blob field for friends and a cookie solution for mark as read, one I won't post so as not to influence ur responses to this thread.

My question is, how do you achieve this?

Perfection comes at a cost

I accept liberty!

frostymarvelous Senior · 266 posts #2

Come on guys. This can't be that hard.

Added after 29 minutes:

Ok, I think its only right to post my solution so far.

I'm greating aTable to store each friend pair in a row.

For the unread posts, I'm still at a loss for an effective method. My main problem is, I want to indicate by each forum which has unread posts.

I'm thinking of storing read posts ID as a serialized array in a cookie. I will then check for new posts within a given time period and compare the IDs.

I'm wondering if there is a more effective method especially for the unread posts.

Thanks.

Perfection comes at a cost

I accept liberty!

leadiztah Developer · 55 posts #3

you can use a checkbox input type of a form for that 🙂

are you already work with lavalair script?

pmbguy Senior · 344 posts #5

ok, here's my thoughts. An easy way but not the best would be to add a field on the users table that updates everytime one visits forumindx action. Then code a function for displaying the fcats that while getting topic count also checks count for topics with latest post greater than your last visit to the forumindx action page. Btw, update time after list cat function so that it doesnt cancel itself out. Something like that...

frostymarvelous Senior · 266 posts #6

Thanks adex, that was soooo helpful. sarcastic.

Pmbguy, I can achieve it with my own methods. Problem here is, I need to streamline it so it doesn't take too .uvh time to load. Its going to be in my completely rewritten site builder, and I can't have a forum index page which will be about the most loaded page creating a bottleneck for me.

I'm thinking in terms of database types etc. The works. I need to make it as fast and low resource hungry as possible.

Perfection comes at a cost

I accept liberty!

morse Senior · 364 posts #7

This is a classical problem of achieving a solution at the cost of server space and processing. If I was in your place, I would not be venturing into the territory of keeping a record of what is read and what is not read, for the following reasons.

  • If suppose you have 1000 topics in your forums and you have 1000 members online, you will need to keep a data record of whether each member has read a certain forum or not. This would mean that you have to record 1000x1000 entries, and this number will increase exponentially with an increase in topics and member list.
  • An easier and less resource hogging way would be to store the last activity timestamp of the user and compare it with the last post timestamp of every topic, you can then show up new posts / topics since a member was last active on your site.

tinyurl.com/earnbymobile Easy earning for Indians

Alternative mobile advertising network .. Minimum 100 USD pay / NET15 pay cycle, Good Brand, Best targeting for Android goo.gl/6vub3

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close