1
chromehand
Group object help
  • 2004/7/27 14:06

  • chromehand

  • Just popping in

  • Posts: 11

  • Since: 2004/6/25


Is there anyway to get an array of uid's from a group object?
The API is very sparse.....or I'm just overlooking the snake that's going to bite me



2
chromehand
Re: triggerEvent() returns false no matter what
  • 2004/7/20 18:57

  • chromehand

  • Just popping in

  • Posts: 11

  • Since: 2004/6/25


Good news - I managed to get it working through the email -
Somewhere I must have a setting hosed for PM'ing through the notification system.
Either way - Thanks much for all of your help!

After I add all of the file/folder notifications to the module , I'll release it.
Any suggestions as to how I should go about giving it a new version? All of the original GPL stuff is still in there....
I've never 'officially' released anything so any pointers are welcome



3
chromehand
Re: triggerEvent() returns false no matter what
  • 2004/7/20 18:09

  • chromehand

  • Just popping in

  • Posts: 11

  • Since: 2004/6/25


Thanks again for all the help.
I've tried with differen't users to no avail.
The notification system seems very good, but alas the module I'm trying to add it to (DMS 0.91) wasn't created to be extended easily. Great idea, but difficult to work on.


I've managed to find the notification object that should be doing something in the code block in notifications.php

foreach ($notifications as $notification) {
if (empty($omit_user_id) || $notification->getVar('not_uid') != $omit_user_id) {

// user-specific tags
//$tags['X_UNSUBSCRIBE_URL'] = 'TODO';
// TODO: don't show unsubscribe link if it is 'one-time' ??
$tags['X_UNSUBSCRIBE_URL'] = XOOPS_URL . '/notifications.php';
$tags = array_merge ($tags, $extra_tags);
$notification->notifyUser($template_dir, $template, $subject, $tags);

var_dump($notification);
}
}



//From the var dump above
object(xoopsnotification)(6) {
["vars"]=>
array(7) {
["not_id"]=>
array(6) {
["value"]=>
string(2) "29"
["required"]=>
bool(false)
["data_type"]=>
int(3)
["maxlength"]=>
NULL
["changed"]=>
bool(false)
["options"]=>
string(0) ""
}
["not_modid"]=>
array(6) {
["value"]=>
string(2) "20"
["required"]=>
bool(false)
["data_type"]=>
int(3)
["maxlength"]=>
NULL
["changed"]=>
bool(false)
["options"]=>
string(0) ""
}
["not_category"]=>
array(6) {
["value"]=>
string(5) "event"
["required"]=>
bool(false)
["data_type"]=>
int(1)
["maxlength"]=>
int(30)
["changed"]=>
bool(false)
["options"]=>
string(0) ""
}
["not_itemid"]=>
array(6) {
["value"]=>
string(3) "188"
["required"]=>
bool(false)
["data_type"]=>
int(3)
["maxlength"]=>
NULL
["changed"]=>
bool(false)
["options"]=>
string(0) ""
}
["not_event"]=>
array(6) {
["value"]=>
string(13) "dms_file_view"
["required"]=>
bool(false)
["data_type"]=>
int(1)
["maxlength"]=>
int(30)
["changed"]=>
bool(false)
["options"]=>
string(0) ""
}
["not_uid"]=>
array(6) {
["value"]=>
string(1) "1"
["required"]=>
bool(true)
["data_type"]=>
int(3)
["maxlength"]=>
NULL
["changed"]=>
bool(false)
["options"]=>
string(0) ""
}
["not_mode"]=>
array(6) {
["value"]=>
string(1) "0"
["required"]=>
bool(false)
["data_type"]=>
int(3)
["maxlength"]=>
NULL
["changed"]=>
bool(false)
["options"]=>
string(0) ""
}
}
["cleanVars"]=>
array(0) {
}
["_isNew"]=>
bool(false)
["_isDirty"]=>
bool(false)
["_errors"]=>
array(0) {
}
["_filters"]=>
array(0) {
}
}

Now - I have found that the method of that object

$notification->notifyUser($template_dir, $template, $subject, $tags);

is returning bool(true) and according to the comments in that functions header, it returns true if the $xoopsMailer() was successful. I should get a notification message right?
Not happening with any user - Where else can I possibly look? I'm on a rope looking at a short drop and a quick stop......
FYI:
This isn't a 'post' or 'new_thread' type of triggerEvent -
It's called when a script named file_view.php is accessed
so subscribed users are notified when someone views the selected file in the document manager system. There are no errors being generated anywhere and I have debug mode for PHP on.
I think I'll give up on the DMS after today........



4
chromehand
Re: triggerEvent() returns false no matter what
  • 2004/7/20 13:33

  • chromehand

  • Just popping in

  • Posts: 11

  • Since: 2004/6/25


Well I now have the notification preferences showing up in my module, and the one 'event' category notice.
One thing I have not found in the XoopsWiki about the notification system, is whether or not you can randomly make up the category and event names ......
Is there a specific set of category / event names that are allowed or is it free-form?

Anyone?

The event seems to be firing properly now, yet alas I still recieve no notice in my PM box............................onward I struggle.......



5
chromehand
Re: triggerEvent() returns false no matter what
  • 2004/7/19 19:51

  • chromehand

  • Just popping in

  • Posts: 11

  • Since: 2004/6/25


string(24) "triggerEvent, mod_config"
array(2) {
["notification_enabled"]=>
int(3)
["notification_events"]=>
array(0) {
}
}

I updated the module. (Now I really feel like a goober)
Above is what pops up when I dump inside triggerEvent.
I am making some progress. I'll keep diggin and post the clues

Thanks much for the help




6
chromehand
Re: One last chance before moving to PHPNuke
  • 2004/7/19 19:23

  • chromehand

  • Just popping in

  • Posts: 11

  • Since: 2004/6/25


One thing that seems to work for me when I have directory permission issues on WinXP Pro:

I use my FTP client to log into my site and change the permissions. It usually works for me.



7
chromehand
Re: triggerEvent() returns false no matter what
  • 2004/7/19 18:43

  • chromehand

  • Just popping in

  • Posts: 11

  • Since: 2004/6/25



Thanks for the reply.
No, the notices are not being sent because the method is returning false before message generation.
FYI: I'm adding notification to the DMS 0.91 module.

// Check if event is enabled
$config_handler =& xoops_gethandler('config');
$mod_config=&$config_handler->getConfigsByCat(0,$module->getVar('mid'));
if (empty($mod_config['notification_enabled'])) {
return false;

}

Wild guess:
The method returning false at this point stops the execution of the method because it can't find the configuration for the module?


I have returned $mod_config before the method could return false and $mod_config is empty.


WHere should I look to make sure the xoops_version.php is being parsed for the particular module?

I am absolutely lost....

Thanks again





8
chromehand
triggerEvent() returns false no matter what
  • 2004/7/19 17:20

  • chromehand

  • Just popping in

  • Posts: 11

  • Since: 2004/6/25


I've been trying to trigger and event using

//grab the handler for notification
$nh =& xoops_gethandler('notification');

//trigger the event
$nh->triggerEvent("file",$obj_id,"file_view",$tags)

It keeps returning false.
All of the params going to the method are fine.
I traced my problem inside the method to the lines below:

$config_handler =& xoops_gethandler('config');
$mod_config=&$config_handler->getConfigsByCat(0,$module->getVar('mid'));
if (empty($mod_config['notification_enabled'])) {
return false;
}

I have the line

$modversion['hasNotification']=1;

in the xoops_version.php
along with:

$modversion['notification']['category'][1]['name'] = "file";
$modversion['notification']['category'][1]['title'] = "File";
$modversion['notification']['category'][1]['description'] = "File Notifications";
$modversion['notification']['category'][1]['subscribe_from'] = "file_options.php";
$modversion['notification']['category'][1]['item_name'] = "obj_id";
$modversion['notification']['category'][1]['allow_bookmark'] = 0;

//ADDED: File events
$modversion['notification']['event'][1]['name'] = "file_view" ;
$modversion['notification']['event'][1]['category'] = "file";
$modversion['notification']['event'][1]['title'] = "File Viewed Notification";
$modversion['notification']['event'][1]['caption'] = "Notify me when this file is viewed";
$modversion['notification']['event'][1]['description'] = "No Description";
$modversion['notification']['event'][1]['mail_template'] = "file_viewed";
$modversion['notification']['event'][1]['mail_subject'] = "DMS Notice - File Deleted";


Users are able to subscribe/unsibscribe just fine, yet the event trigger keeps returning false no matter what I do to it.

Any ideas? I'm clue free......



THanks!!!!!!!



9
chromehand
Re: DMS Version 0.91 Module - Redux
  • 2004/7/6 14:30

  • chromehand

  • Just popping in

  • Posts: 11

  • Since: 2004/6/25


Looks like no one else out there has a clue.....

Well, I figured it out after some tribulation.


IE needs a PRAGMA header with no argument or it pukes out the script the file is being tunneled through.
The file_open and file_view scripts in that module are getting some serious overhaul.



10
chromehand
DMS Version 0.91 Module - Redux
  • 2004/7/1 18:21

  • chromehand

  • Just popping in

  • Posts: 11

  • Since: 2004/6/25



I'm testing out the DMS module I found in the downloads section. I'm having some issues using the check-out and view features.

IE 6.0 doesn't seem to be getting the headers it needs to download / view a file. It keeps trying to download the PHP script that should be sending the headers and generating an
'Internet Explorer was not able to open this internet site' error.

Can anyone shed some light on this possibly?

Many thanks




TopTop
(1) 2 »



Login

Who's Online

201 user(s) are online (163 user(s) are browsing Support Forums)


Members: 0


Guests: 201


more...

Donat-O-Meter

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

Latest GitHub Commits