new posting notification for any user (General)

by Littob, Friday, February 13, 2009, 04:56 (5550 days ago)

If somebody needs the new-posting-notification-function for any user, here is the way to get it.

To allow sending mails to ordinary users
- open the functions.inc.php and delete "user_type > 0 AND" in line 1072

To add the new-posting-notification-function to any new user:
- open the admin.inc.php and add in line 940 "new_posting_notification" under INSERT INTO and the number '1' under VALUE.

The whole line should look like this:
mysql_query("INSERT INTO ".$db_settings['userdata_table']." (user_type,
user_name, user_real_name, user_pw, user_email, user_hp, user_location,
email_contact, last_login, last_logout, user_ip, registered, user_view,
fold_threads, signature, profile, auto_login_code, pwf_code, activate_code,
new_posting_notification
) VALUES (0,'".mysql_real_escape_string($ar_username)."', '',
'".mysql_real_escape_string($pw_hash)."' ,'".mysql_real_escape_string($ar_email)."',
'', '', ".$settings['default_email_contact'].", NOW(),
NOW(), '".$_SERVER["REMOTE_ADDR"]."',NOW() ,".intval($settings['default_view']).","
.intval($settings['fold_threads']).",'','','','','','1')", $connid) or
die(mysql_error()); //raise_error('database_error',mysql_error());

additions

by Littob, Thursday, July 23, 2009, 17:21 (5390 days ago) @ Littob

To keep the new-posting-notification-function active even if the admin change some user-details in the usermanagement-panel, you have to change a few more lines.


Again includes/admin.inc.php on line 138, change the "0" info a "1". The line finally should look like this:

if(isset($_POST['new_posting_notification'])) $new_posting_notification = trim($_POST['new_posting_notification']); else $new_posting_notification = 1;

To avoid the new-posting-notification is set to "0" when a user edit his profile, you have to change the file includes/unser.inc.php at line 472. You have to change again the "0" into a "1". The line finally should look like this:

if(isset($_POST['new_posting_notification']) && $_SESSION[$settings['session_prefix'].'user_type']>0) $new_posting_notification = intval($_POST['new_posting_notification']);
else $new_posting_notification = 1;


and i moreover change the line 481 (don't know it is really necessary). It finaly look like this:

$new_posting_notification = 1;


Good luck :-)

Still searching for new posting notification for any user

by gmw, Wednesday, July 06, 2011, 23:07 (4677 days ago) @ Littob

Hello and thanks for your tips!

I have installed version 2.2.8 some days ago and would like to give the notification for any user, since the group of users has asked for this option.

I changed the settings in »admin.inc.php«, but unfortunately it doesn’t work. The line numbers differ (since I am using version 2.2.8?), and the additional settings in »user.inc.php« do not exist in the described way.

Can anybody please help to get the notificaton function work?

Thanks in advance! :) G. M.

RSS Feed of thread