Topic Subscription question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
kaisellgren
DevNet Resident
Posts: 1675
Joined: Sat Jan 07, 2006 5:52 am
Location: Lahti, Finland.

Topic Subscription question

Post by kaisellgren »

Hi,

I am not asking how topic subscription works here. I am asking how to make one. I have written a nice looking forum system and I would like to create topic subscription function also. I know couple of methods to do this but they sound too 'heavy'.

What do you suggest? How do these IPB's, PHPBB's and other forums' subscription work?

Thank you for your time,
Kai
Flamie
Forum Contributor
Posts: 166
Joined: Mon Mar 01, 2004 3:19 pm

Post by Flamie »

simple, make a table called
users_subscriptions
with the following fields:
user_id, topic_id

when someone posts in a topic:
SELECT user_id FROM users_subscriptions WHERE topic_id=$thistopic
Loop thru the result, and mail() everyone :)

Oh and, when someone subscribes to a topic, just insert a row with the topic id and his id in that table ;p
Post Reply