comment notification mod comment notification mod
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

comment notification mod

Started by bitcloud, April 13, 2007, 01:16:07 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

bitcloud

Hey Stramm...

No one else seems to be talking about it, but i'm looking for a way to display a "New Unread Comments" and "New Private Messages" in the header.

I'm trying to mod a copy of "subcribtion_manage.php" to display only subscribed posts which contain unread comments. First I've gotta get it displaying the number of comments on each post, and somehow have it store this information for the user (I haven't even thought of how to do this yet. I'm not looking forward to the task :)

Every other mod i've seen relating to this issue is about email notifications. Do you have any plan or inclination to try and implement such a comment notification mod? Can you offer any pointers on this?

Cheers
Lachlan

bitcloud

Sorry, obviously the "New Private Message" bit is already covered by your mod pack, so it's really the "new comments" i'm looking to include

Stramm

To display the (total) number of comments on a specific pic would mean you need to edit the actual query and join the comments table. Then that's two joins (pictures, notify and comments table). I'd say that can put a lot of heat on your server if you have a lot of comments and users using that feature.

To display the number of comments after the user subscribed to some pic (and or the last time he visited it after subscribing) you'll need to save the comment id to the notify table (create that new entry in the db first). That would mean a lot of editing put it's possible

To just show the pics with unread comments in the subscription manager is simple. You add to the query that you do want to show only pics with mail_sent = 1. Every time a user adds a comment, subscribed users will get an email once, the mentioned fiels got set to 1. If he visits the pic, mail_sent gets set to 0

-> change
" FROM {$CONFIG['TABLE_PICTURES']} AS p INNER JOIN {$CONFIG['TABLE_NOTIFY']} AS u ON pid=u.picture_id WHERE  u.user_id=".(USER_ID).
to
" FROM {$CONFIG['TABLE_PICTURES']} AS p INNER JOIN {$CONFIG['TABLE_NOTIFY']} AS u ON pid=u.picture_id WHERE u.mail_sent=1 AND u.user_id=".(USER_ID).

and to make the counts fit
$result = cpg_db_query("SELECT count(*) FROM  {$CONFIG['TABLE_NOTIFY']} WHERE user_id=".(USER_ID));
to
$result = cpg_db_query("SELECT count(*) FROM  {$CONFIG['TABLE_NOTIFY']} WHERE mail_sent=1 AND user_id=".(USER_ID));

bitcloud

jees! really?
thats brilliant.

I guess the only other thing to resolve now is to somehow not display files that a user has uploaded themselves (until they have been commented on)
As it is, it displays new commented threads perfectly (!) but also displays uncommented user-owned uploads... (so a user wouldn't know if a self published image had been commented on as they appear to begin with)

thanks heaps for the help so far... if there are any clues as to how to achieve this you could offer that would pretty much solve this one for me...

Stramm

That's a setting in the user profile... 'auto subscribe to pictures you uploaded' (or something like that I named it I think)

bitcloud

I was hoping i could do some kind of:

if ($number_of_comments > 0) {
if ($commenter_uid != $currentuser_uid) {
displaythumbnail;
}
}


That sort of check so that nothing will show until there's atleast 1 comment posted (by someone other than the current user) - that way it won't affect email notifications. Can i pull comment numbers or comment owner uid's out from within subcribtion_manage.php?

bitcloud

Actually, I don't know what I was doing before, but it seems to work now without any additional modifications (maybe some old subscriptions were entered into the database differently or something)

anyway thanks so much stramm... you've been so much help. I'll try and outline my full comment notification mod here sometime in the near future (after I do some bug testing etc)

Stramm

k, looking forward to your contribution ;)

PS: maybe it's cause you didn't work with the 'fixed' subscribtion manage