21
Dave_L
Re: How does the notify function works?
  • 2005/6/28 16:25

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


When I first implemented notifications in a module I was writing, I foudn it useful to insert debug statements (i.e. echo and/or var_dump) into the core code that handles notifications.

For example:

kernel/notification.php

function triggerEvent ($category$item_id$event$extra_tags=array(), $user_list=array(), $module_id=null$omit_user_id=null)
    {
[
color=ff0000]var_dump('triggerEvent/start''category'$category'item_id'$item_id'event'$event'extra_tags'$extra_tags'user_list'$user_list'module_id'$module_id'omit_user_id'$omit_user_id);[/color]


function notifyUser($template_dir$template$subject$tags)
    {
[
color=ff0000]var_dump('notifyUser/start''template_dir'$template_dir'template'$template'subject'$subject'tags'$tags);[/color]


Those are only examples. You may need to add additional statements to isolate the problem.

22
suico
Re: How does the notify function works?
  • 2005/6/28 16:43

  • suico

  • Friend of XOOPS

  • Posts: 374

  • Since: 2003/7/24


Dave thanks for the help.

I added the lines you suggested to the methodes of the notify and also changed my line to:

$notification_handler -> triggerEvent('espera'$cod_lista'reserva'$tags) or exit("Error on trigger");


The result on my screen is:

string(18"triggerEvent/start" string(8"category" string(6"espera" string(7"item_id" string(2"27" string(5"event" string(7"reserva" string(10"extra_tags" array(2) { ["A_NAME"]=> string(1"1" ["A_URL"]=> string(1"2" string(9"user_list" array(0) { } string(9"module_id" NULL string(12"omit_user_id" NULL Error on trigger

If I understand well it is receiving the parameters correctly but is not beeing able to finish the trigger, right?
What can it be?
Yogurt Social Network Service
Visit: http://www.marcellobrandao.eti.br/

23
Dave_L
Re: How does the notify function works?
  • 2005/6/28 17:19

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


That shows that notifyUser is not being called. The next step is to trace through triggerEvent (add more debug output) to find out why.

24
suico
Re: How does the notify function works?
  • 2005/6/28 19:23

  • suico

  • Friend of XOOPS

  • Posts: 374

  • Since: 2003/7/24


Thanks on not giving up.
It has not call the notifyUser on the previous post because it was myself trying to trigger a notification for me (the omit thing).

I did it now with one member subscribing and another launching the trigger and the script seems to call the notifyUser and give me this output:

string(18"triggerEvent/start" string(8"category" string(6"espera" string(7"item_id" string(2"37" string(5"event" string(7"reserva" string(10"extra_tags" array(2) { ["A_NAME"]=> string(1"1" ["A_URL"]=> string(1"2" string(9"user_list" array(0) { } string(9"module_id" NULL string(12"omit_user_id" NULL 

string
(16"notifyUser/start" string(12"template_dir" string(98"c:/arquivos de programas/easyphp1-8/www/modules/carros/language/portugues.do.brasil/mail_template/" string(8"template" string(17"reserva_email.tpl" string(7"subject" string(26"Voce conseguiu uma reserva" string(4"tags" array(10) { ["X_ITEM_NAME"]=> string(19"Reserva de umespera" ["X_ITEM_URL"]=> string(63"http://intranet2/modules/carros/detalhe_espera.php?lista_cod=37" ["X_ITEM_TYPE"]=> string(15"Lista de espera" ["X_MODULE"]=> string(6"Carros" ["X_MODULE_URL"]=> string(32"http://intranet2/modules/carros/" ["X_NOTIFY_CATEGORY"]=> string(6"espera" ["X_NOTIFY_EVENT"]=> string(7"reserva" ["X_UNSUBSCRIBE_URL"]=> string(34"http://intranet2/notifications.php" ["A_NAME"]=> string(1"1" ["A_URL"]=> string(1"2" 

usa pm <-- this is an echo usa pm inside the if using pm condition

1  
<-- this is an echo $sucess;

Error on trigger  <-- this is the line i added on the previous post


It has called the notifyuser this time right?
It seems everything is ok this time hein?
Does anyone have an idea on what i am messing up?
Yogurt Social Network Service
Visit: http://www.marcellobrandao.eti.br/

25
phppp
Re: How does the notify function works?
  • 2005/6/28 21:36

  • phppp

  • XOOPS Contributor

  • Posts: 2857

  • Since: 2004/1/25


suico, I just did not get time to check it.
Leave message here to show I do not forget the topic :)

26
suico
Re: How does the notify function works?
  • 2005/6/29 17:00

  • suico

  • Friend of XOOPS

  • Posts: 374

  • Since: 2003/7/24


Thanks phppp when you have take take a look , i will update the file tonight for a new version more complete, the module is starting to look good for my needs , thought i am still having problems with this notification thing :(
Yogurt Social Network Service
Visit: http://www.marcellobrandao.eti.br/

27
suico
Re: How does the notify function works?
  • 2005/7/7 20:27

  • suico

  • Friend of XOOPS

  • Posts: 374

  • Since: 2003/7/24


HUmm anyone has an idea?
Yogurt Social Network Service
Visit: http://www.marcellobrandao.eti.br/

Login

Who's Online

399 user(s) are online (282 user(s) are browsing Support Forums)


Members: 0


Guests: 399


more...

Donat-O-Meter

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

Latest GitHub Commits