Author Topic: set notification by admin  (Read 277 times)

Offline warhonowicz

  • Jr. Member
  • **
  • Posts: 120
  • Gender: Male
  • MMC Webmaster
    • Middlesex Mini Club
set notification by admin
« on: October 19, 2009, 06:02:39 AM »
We use SMF as the forum on our intranet site. Users cannot register themselves but have to be set up by and Admin.

Is it possible to at the same time set up a notification for a certain board? And also, is there a way to do this for all existing users?
Tell me and I will forget
Show me and I might remember
But involve me and I will understand

Middlesex Mini Club





Click here for great music

Offline LexArma

  • Senior Support Specialist
  • Simple Machines Hero
  • *
  • Posts: 7,849
  • Gender: Male
  • Polar bears ate my DSL line :P
Re: set notification by admin
« Reply #1 on: October 21, 2009, 04:04:13 AM »
Is it possible to at the same time set up a notification for a certain board? And also, is there a way to do this for all existing users?
1. No - not really. 2. No, not really.

The only way I see this possible, is either by editing SMF to default to notifications on certain boards,
or by messing around the database directly after each registration.
I'm from Finland. I live amongst all the polar bears and penguins, in an igloo, that I built with my own two hands in the middle of the vast emptiness of Helsinki.

= Using SMF since 2005 =
"You need to believe in things that aren't true. How else would they ever become?"

I do NOT offer hosting at all.
I do NOT offer PM support unless I specifically offer to do so.

Offline warhonowicz

  • Jr. Member
  • **
  • Posts: 120
  • Gender: Male
  • MMC Webmaster
    • Middlesex Mini Club
Re: set notification by admin
« Reply #2 on: October 21, 2009, 11:35:14 AM »
if I were to go with the second option, what table(s) would I have to look into and what setting would I have to change?
Tell me and I will forget
Show me and I might remember
But involve me and I will understand

Middlesex Mini Club





Click here for great music

Offline LexArma

  • Senior Support Specialist
  • Simple Machines Hero
  • *
  • Posts: 7,849
  • Gender: Male
  • Polar bears ate my DSL line :P
Re: set notification by admin
« Reply #3 on: October 21, 2009, 11:40:36 AM »
Sorry to say that your guess is as good as mine. I haven't an idea as to how exactly it could be accomplished.
I'm from Finland. I live amongst all the polar bears and penguins, in an igloo, that I built with my own two hands in the middle of the vast emptiness of Helsinki.

= Using SMF since 2005 =
"You need to believe in things that aren't true. How else would they ever become?"

I do NOT offer hosting at all.
I do NOT offer PM support unless I specifically offer to do so.

Offline warhonowicz

  • Jr. Member
  • **
  • Posts: 120
  • Gender: Male
  • MMC Webmaster
    • Middlesex Mini Club
Re: set notification by admin
« Reply #4 on: October 21, 2009, 11:58:45 AM »
Thanks ... does anyone else know?
Tell me and I will forget
Show me and I might remember
But involve me and I will understand

Middlesex Mini Club





Click here for great music

Offline Norv

  • Senior Support Specialist
  • Simple Machines Hero
  • *
  • Posts: 5,106
  • Software is not released, only allowed to escape.
Re: set notification by admin
« Reply #5 on: November 04, 2009, 03:30:11 PM »
Please check out in phpMyAdmin the table smf_log_notify (replace "smf_" with your actual database tables prefix): you will see there a way to map ID_MEMBER to an ID_BOARD and respectively to an ID_TOPIC.
I think the line you need to insert (to register the member for notification on a particular board) would be like:
Code: [Select]
INSERT INTO smf_log_notify (ID_MEMBER, ID_BOARD) VALUES (new_id_member, id_board);
where "smf_" should be your database tables prefix, new_id_member should be the ID_MEMBER of the last member in the smf_members table (that is, after the new member was registered), and id_board should be the id of the board you want the member to be notified about.

Alternative: since users are manually registered by an admin, you might be able to make it a little easier: typically in the case of your forum, I would suppose  each user is registered one by one so there are really little chances (if any) to have two users registered in the same minute.
If that is the case, you could count on the fact that the last registered member is still the same until you go and edit the database, so you could use MySQL to get itself the last ID inserted in the members table, and have it inserted directly:
Code: [Select]
INSERT INTO smf_log_notify (ID_MEMBER, ID_BOARD) VALUES ((SELECT max(ID_MEMBER) FROM smf_members), id_board);
You still need to replace manually id_board with the proper id of your board.
Note that in case another admin registers another member meanwhile, meaning after you (or anyone) register a member, but before you manage to execute this alternative code, then the notification will be set up only for the last member, you might miss the previous one.
File a security report  |  Bugtracker  |  Online Manual
Please note that I will not answer unsolicited PMs for support. Questions and answers should be publicly available.

Offline warhonowicz

  • Jr. Member
  • **
  • Posts: 120
  • Gender: Male
  • MMC Webmaster
    • Middlesex Mini Club
Re: set notification by admin
« Reply #6 on: November 08, 2009, 04:43:10 AM »
Thanks
Tell me and I will forget
Show me and I might remember
But involve me and I will understand

Middlesex Mini Club





Click here for great music