1
samuels
Using notifications system on my module
  • 2003/11/26 9:36

  • samuels

  • Quite a regular

  • Posts: 249

  • Since: 2003/10/30


I'm creating a module and I have read the wakka section that explains how to use the notification system.
But I'm unable to make it run.

I have make the following changes to my module:

In xoops_version.php
//Notification
$modversion['hasNotification'] = 1;
$modversion['notification']['lookup_file'] = 'include/notification.inc.php';

$modversion['notification']['category'][1]['name'] = 'messages';
$modversion['notification']['category'][1]['title'] = _MI_FIRMAS_CATEGORY_NOTIFY;
$modversion['notification']['category'][1]['description'] = _MI_FIRMAS_CATEGORY_NOTIFYDSC;
$modversion['notification']['category'][1]['subscribe_from'] = 'index.php';
$modversion['notification']['category'][1]['item_name'] = 'owner_id';
$modversion['notification']['category'][1]['allow_bookmark'] = 1;

$modversion['notification']['event'][1]['name'] = 'new_message';
$modversion['notification']['event'][1]['category'] = 'global';
$modversion['notification']['event'][1]['admin_only'] = 0;
$modversion['notification']['event'][1]['title'] = _MI_FIRMAS_GLOBAL_NEW_MESSAGE_NOTIFY;
$modversion['notification']['event'][1]['caption'] = _MI_FIRMAS_GLOBAL_NEW_MESSAGE_NOTIFYCAP;
$modversion['notification']['event'][1]['description'] = _MI_FIRMAS_GLOBAL_NEW_MESSAGE_NOTIFYDSC;
$modversion['notification']['event'][1]['mail_template'] = 'global_newfile_notify';
$modversion['notification']['event'][1]['mail_subject'] = _MI_FIRMAS_GLOBAL_NEW_MESSAGE_NOTIFYSBJ;


In my post.php file

$notification_handler =& xoops_gethandler('notification');
    
$tags = array();
    
$tags['name'] = '';
    
$tags['url'] = '';
    
$notification_handler->triggerEvent('messages'$owner_id'new_message',$tags);


In my index template i have added:

<{include file:'db:system_notification_select.html'}>


When I go to the index y can see the notification block but it says Bookmark this item (no notification).

Why? Thank's for your time.

2
mvandam
Re: Using notifications system on my module
  • 2003/11/26 10:59

  • mvandam

  • Quite a regular

  • Posts: 253

  • Since: 2003/2/7 2


You may need to specific 'lookup_func' in addition to 'lookup_file'. (Or omit both for now)

Also, go to your module preferences and make sure you enable all notification events. Since you allowed bookmarking, that option seems to be showing up correctly. (No notification simply means that 'bookmarking' doesn't create notifications, just a link so someone can find a disucssion again later.)

Does you new event show up in the module preferences?

3
Mithrandir
Re: Using notifications system on my module

Did you copy the file notification.inc.php from e.g. news/include to yourmodule/include/notification.inc.php?

4
samuels
Re: Using notifications system on my module
  • 2003/11/26 20:24

  • samuels

  • Quite a regular

  • Posts: 249

  • Since: 2003/10/30


I have copied the file notification.inc.php to mymodule/include/ and the file notification_update.php to mymodule/

Perhaps it´s something related to the unique id that I must use, but I've tested it and never is null.

My module it's a modification of xtremmeguestbook module, and I'm using it to provide a presonalized guestbook for each user. It's like posting comments on user's accounts.
I very interested in notification system.

You can see in action here http://www.forjandoleyendas.com/userinfo.php?uid=1

The link "Ver o firmar en su libro de visitas"

Thank's for your time.

5
mvandam
Re: Using notifications system on my module
  • 2003/11/26 22:54

  • mvandam

  • Quite a regular

  • Posts: 253

  • Since: 2003/2/7 2


When I try the link, I think it says 'no permission'.

Can you describe in more detail what is *not* working...

- Does your event show up in the notification block?

- Is just *part* of your event show up? i.e. is some text missing?

- Try switching 'allow_bookmark' to false (or '0') and see if that clears up your problems

- Anything else you might think is helpful for us to know?

6
samuels
Re: Using notifications system on my module
  • 2003/11/27 7:23

  • samuels

  • Quite a regular

  • Posts: 249

  • Since: 2003/10/30


I forgot the permission, the link is ok now.

I can add the notification to my notification list, but I don't receive a new pm when somebody sends a message to the board.
I'll try with allow_bookmark disabled and i'll upload the module somewhere.

Thank's for all.

7
mvandam
Re: Using notifications system on my module
  • 2003/11/27 8:47

  • mvandam

  • Quite a regular

  • Posts: 253

  • Since: 2003/2/7 2


This is probably a stupid suggestion, but have you inserted the 'trigger' function call at the appropriate place in your module code? The event needs to be triggered (with the appropriate id number specified) for any notifications to be sent.

8
samuels
Re: Using notifications system on my module
  • 2003/11/28 13:32

  • samuels

  • Quite a regular

  • Posts: 249

  • Since: 2003/10/30


I've triggered it in my post.php file. When somebody sends a message it should add the notification, or not?

9
mvandam
Re: Using notifications system on my module
  • 2003/11/28 20:48

  • mvandam

  • Quite a regular

  • Posts: 253

  • Since: 2003/2/7 2


Hmmm, yes, it should.

I would suggest double checking the spelling of the 'category' and 'event' you are passing to the trigger function, as well as the id number.

Also, if you know your way around mysql, (e.g. with mysqladmin) I would suggest checking the notifications table after you 'subscribe' to the event to make sure your 'subscription' is properly recorded in the table. If this is not correct then the trigger would not find any people to notify.

10
ealltech
Re: Using notifications system on my module
  • 2017/1/14 9:12

  • ealltech

  • Just popping in

  • Posts: 3

  • Since: 2017/1/12


I'm creating a system on module and I have read the wakka section that explains how to use the notification system. But I'm unable to make it run. I have make the following changes to my module: In xoops_version.php

Login

Who's Online

171 user(s) are online (103 user(s) are browsing Support Forums)


Members: 0


Guests: 171


more...

Donat-O-Meter

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

Latest GitHub Commits