1
magowiz
cbb 3.0.8 : enable by default notifications of new posts in a thread if a user post in this thread
  • 2009/10/17 14:33

  • magowiz

  • Just popping in

  • Posts: 18

  • Since: 2009/9/11


Hi,
is there a way to enable by default notifications of new posts in a thread for a user if that user post in that thread ?
I think is one of most used feature/behaviour in much forums , how can I do this ?

2
magowiz
Re: cbb 3.0.8 : enable by default notifications of new posts in a thread if a user post in this thread
  • 2009/10/17 15:42

  • magowiz

  • Just popping in

  • Posts: 18

  • Since: 2009/9/11


I found a way to do this, I modified file modules/newbb/include/forumform.inc.php like this :

(about line 169) :

else {         
                  
// Otherwise, check previous subscribed status...
                 
$notification_handler =& xoops_gethandler('notification');
    
        
//if (!empty($topic_id) && $notification_handler->isSubscribed('thread', $topic_id, 'new_post', $xoopsModule->getVar('mid'), $xoopsUser->getVar('uid')))
    //{             
              
$notify 1;         
       
/*}         
      else {             
              $notify = 0;         
       }*/
}


In this way the notification on new post is enabled by default if a user replies to a discussion or creates a new one.

I know it is kind of dirty hack and to do right things I should have add an option to user profile about notification behaviour but this is the quickest solution I found.

3
ghia
Re: cbb 3.0.8 : enable by default notifications of new posts in a thread if a user post in this thread
  • 2009/10/17 17:15

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


I think that in that way you have everytime switch it off again, if you don't want it.

Where it is set as zero, there should come a test to check if the user did already post in the thread. If not set the notification on.

(Be warned that many users have notification by PM and this may pile up in your database.)

4
magowiz
Re: cbb 3.0.8 : enable by default notifications of new posts in a thread if a user post in this thread
  • 2009/10/17 17:25

  • magowiz

  • Just popping in

  • Posts: 18

  • Since: 2009/9/11


You are right. Is there a way to set the default notification method to "email" on user registration ?

EDIT: I found it in Profile Admin ->Fields

5
xgarb
Re: cbb 3.0.8 : enable by default notifications of new posts in a thread if a user post in this thread
  • 2010/6/1 19:05

  • xgarb

  • Not too shy to talk

  • Posts: 154

  • Since: 2003/3/30


I did this..

else {
        
// Otherwise, check previous subscribed status...
        
$notification_handler =& xoops_gethandler('notification');
        if (!empty(
$topic_id) && !$notification_handler->isSubscribed('thread'$topic_id'new_post'$xoopsModule->getVar('mid'), $xoopsUser->getVar('uid'))) {
            
$notify 0;
        }
        else {
            
$notify 1;
        }
    }


note the ! in front of the second part of the if statement and changed the 1 and 0 which switches the logic around so 'Notify me of new posts in this thread' is now the default but it remembers when it's switched off.

Login

Who's Online

210 user(s) are online (61 user(s) are browsing Support Forums)


Members: 0


Guests: 210


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits