1
allnewtome
Notification-management module
  • 2006/9/20 20:54

  • allnewtome

  • Not too shy to talk

  • Posts: 175

  • Since: 2005/11/30


I would like to be able to manage users' notification options.

e.g. set everyone to receive notifications for event X

e.g. set set all users in group X to receive notification for event Y

This shouldn't be difficult - for those in the know!

Thanks!

2
fnog
Re: Notification-management module
  • 2006/11/25 14:18

  • fnog

  • Just popping in

  • Posts: 4

  • Since: 2002/8/2 2


Searching exactly the same thing, I wonder if there isn't a module for that functionality already... I haven't found it though

At this moment I'm looking for a way to send new forum posts (CBB) notifications for all my private site members (20 users +/-)

3
allnewtome
Re: Notification-management module
  • 2006/11/25 16:36

  • allnewtome

  • Not too shy to talk

  • Posts: 175

  • Since: 2005/11/30


As far as I can see it you have these options:

1. Tell your 20 members how to log in and change their own notification settings.

2. Log in using their usernames and do this if you know their passwords (this is what I did in the end as I also had 20 users to change!)

3. Change the notifications table in the database. As far as I see it's as simple as adding one row for each notification. I don't think it's cross-referenced anywhere else, so I don't think you can break anything by doing this. Recently I deleted a row from that table (it was causing a problem on the notifications.php page) and it didn't seem to have any knock-on effects.

I can try to explain option 3 if you feel it would be useful. If anyone knows that that option would break anything then please say so

4
irmtfan
Re: Notification-management module
  • 2006/11/26 10:25

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


it will be useful for me too
- delete notifications for users that don't login within X days.

i like it as a check box so i can tick it and press on Ok.

5
allnewtome
Re: Notification-management module
  • 2006/11/26 12:27

  • allnewtome

  • Not too shy to talk

  • Posts: 175

  • Since: 2005/11/30


OK here is what I know.

Here is how the notifications table is structured:

mysqlshow columns from prefix_xoopsnotifications;   
+--------------+-----------------------+------+-----+---------+----------------+
Field        Type                  Null Key | Default | Extra          |
+--------------+-----------------------+------+-----+---------+----------------+
not_id       mediumint(8unsigned |      | PRI NULL    auto_increment |
not_modid    smallint(5unsigned  |      | MUL 0       |                |
not_itemid   mediumint(8unsigned |      | MUL 0       |                |
not_category varchar(30)           |      | MUL |         |                |
not_event    varchar(30)           |      | MUL |         |                |
not_uid      mediumint(8unsigned |      | MUL 0       |                |
not_mode     tinyint(1)            |      |     | 0       |                |
+--------------+-----------------------+------+-----+---------+----------------+
7 rows in set (0.00 sec)


And here is an example if its content:

mysqlselect from prefix_xoopsnotifications;
+--------+-----------+------------+---------------+------------------+---------+----------+
not_id not_modid not_itemid not_category  not_event        not_uid not_mode |
+--------+-----------+------------+---------------+------------------+---------+----------+
|      
|         |          category_item bookmark         |       |        |
|      
|         |          global_item   published        |     150 |        |
|      
|         |          global_item   category_created |       |        |
|      
|         |          | global        | new_fullpost     |       |        |
|      
|         |          global_item   published        |       |        |
|      
|         |          forum         new_thread       |       |        |
|      
|         |          forum         new_post         |       |        |
|     
10 |         |          global_item   published        |     153 |        |
|     
11 |         |          | global        | new_post         |      12 |        |
|     
12 |         |          global_item   published        |      12 |        |
|     
13 |         |          global_item   published        |      11 |        |
|     
14 |         |          | global        | new_post         |      11 |        |
|     
15 |         |          global_item   published        |       |        |
|     
16 |         |          | global        | new_post         |       |        |
|     
17 |         |          global_item   published        |      13 |        |
|     
18 |         |          | global        | new_post         |      13 |        |
|     
19 |         |          global_item   published        |      14 |        |
|     
20 |         |          | global        | new_post         |      14 |        |
|     
21 |         |          global_item   published        |      16 |        |
|     
22 |         |          | global        | new_post         |      16 |        |
|     
23 |         |          global_item   published        |      17 |        |
|     
24 |         |          | global        | new_post         |      17 |        |
|     
25 |         |          global_item   published        |      18 |        |
|     
26 |         |          | global        | new_post         |      18 |        |
|     
27 |         |          global_item   published        |      19 |        |
|     
28 |         |          | global        | new_post         |      19 |        |
|     
29 |         |          global_item   published        |      20 |        |
|     
30 |         |          | global        | new_post         |      20 |        |
|     
31 |         |          global_item   published        |      21 |        |
|     
32 |         |          | global        | new_post         |      21 |        |
|     
33 |         |          global_item   published        |      22 |        |
|     
34 |         |          | global        | new_post         |      22 |        |
|     
35 |         |          global_item   published        |      23 |        |
|     
36 |         |          | global        | new_post         |      23 |        |
|     
37 |         |          global_item   published        |      24 |        |
|     
38 |         |          | global        | new_post         |      24 |        |
|     
39 |         |          global_item   published        |     218 |        |
|     
40 |         |          | global        | new_post         |     218 |        |
|     
41 |         |          global_item   published        |      25 |        |
|     
42 |         |          | global        | new_post         |      25 |        |
|     
43 |         |          global_item   published        |     173 |        |
|     
44 |         |          | global        | new_post         |     173 |        |
|     
45 |         |          global_item   published        |      68 |        |
|     
46 |         |          | global        | new_post         |      68 |        |
|     
48 |         |          global_item   published        |      27 |        |
|     
49 |         |          | global        | new_post         |      27 |        |
|     
50 |         |          global_item   published        |      39 |        |
|     
51 |         |          | global        | new_post         |      39 |        |
|     
54 |         |        113 thread        new_post         |       |        |
+--------+-----------+------------+---------------+------------------+---------+----------+
49 rows in set (0.00 sec)


not_id is the notification identity number. When a notification is cancelled, XOOPS deletes the relevant row (and doesn't change any of the other not_id row numbers). New notifications are given the next highest not_id number (auto_increment) rather than filling in any gaps.

not_modid identifies the relevant module. On my site 2 is smartsection and 4 is cbb.

not_itemid is module-specific and identifies the relevant item. Most here are 0 as they refer to the module generally, but note not_id 54 where the not_itemid is 113 (the thread number to be notified about).

not_category and not_event explain themselves and are module-specific again.

not_uid identifies the relevant user by his user number.

not_mode - well, I honestly don't know what it means, but stick with 0 and you can't go wrong!



For 20 users you could easily use MySQL commands to add 20 rows for 20 new notifications. For more users I suppose you could write a PHP script to do it automatically. If you do that then submit it here! It could make a good module.

To delete users who haven't logged in for a while you'd just need to delete (or not) the relevant prefix_xoopsnotifications rows depending the value of the last_login column of the prefix_users table. I haven't time now to think it through fully.

I don't think that the table is referred to elsewhere so don't think there would be any problems with adding to it via MySQL (back it all up first though!) I've deleted rows with no problems but haven't had to add any yet.

Good luck!

Login

Who's Online

211 user(s) are online (142 user(s) are browsing Support Forums)


Members: 0


Guests: 211


more...

Donat-O-Meter

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

Latest GitHub Commits