1
Hy,
I writing a little module for XOOPs 2.2.5 and I would like to send a PM on an special event.
I´m trying to use the XOOPS class XoopsPrivmessage so I declare the class and use it. But somehow I die on the event of writing the message to the database.
That’s the way I call the class and create a PM:
...
$pm_handler =& xoops_gethandler ( 'privmessage');
$pm =& $pm_handler->create();
$pm->setVar("subject", "testsubject");
$pm->setVar("msg_text", "text in message");
$pm->setVar("to_userid", 12);
$pm->setVar("from_userid", 44);
$pm->setVar("from_delete", 0);
if (!$pm_handler->insert($pm)) {echo "error sending pm";die;}
...
I die on this step of the XoopsPrivmessage class in kernel\privatemessage.php:
…
$this->db->query($sql)
if (!$result = $this->db->query($sql)) {
return false;
…
It looks like I need to load a further class so I can write the message to the db. But I think I got the database class loaded.
These are my classes loaded in the moment I get the error.
[0] => stdClass [1] => __PHP_Incomplete_Class [2] => Directory [3] => swfshape [4] => swffill [5] => swfgradient [6] => swfbitmap [7] => swftext [8] => swftextfield [9] => swffont [10] => swfdisplayitem [11] => swfmovie [12] => swfbutton [13] => swfaction [14] => swfmorph [15] => swfsprite [16] => domnode [17] => domdocument [18] => domparser [19] => domdocumenttype [20] => dtd [21] => domelement [22] => domattribute [23] => domcdata [24] => domtext [25] => domcomment [26] => domprocessinginstruction [27] => domnotation [28] => domentity [29] => domentityreference [30] => domnamespace [31] => XPathContext [32] => XPathObject [33] => XsltStylesheet [34] => protector [35] => xoopssecurity [36] => xoopserrorhandler [37] => xoopslogger [38] => xoopsobject [39] => xoopsobjecthandler [40] => xoopspersistableobjecthandler [41] => criteriaelement [42] => criteriacompo [43] => criteria [44] => mytextsanitizer [45] => xoopsdatabasefactory [46] => database [47] => xoopsdatabase [48] => xoopsmysqldatabase [49] => xoopsmysqldatabasesafe [50] => xoopsmysqldatabaseproxy [51] => xoopsconfighandler [52] => xoopsconfigoption [53] => xoopsconfigoptionhandler [54] => xoopsconfigitem [55] => xoopsconfigitemhandler [56] => xoopslocal [57] => xoopsmemberhandler [58] => xoopsuser [59] => xoopsguestuser [60] => xoopsuserhandler [61] => xoopsgroup [62] => xoopsgrouphandler [63] => xoopsmembership [64] => xoopsmembershiphandler [65] => xoopsprofile [66] => xoopsprofilehandler [67] => xoopsprofilefield [68] => xoopsprofilefieldhandler [69] => xoopssessionhandler [70] => xoopsmodule [71] => xoopsmodulehandler [72] => xoopsgroupperm [73] => xoopsgrouppermhandler [74] => xtheme [75] => smarty [76] => xoopstpl [77] => xoopsblock [78] => xoopsblockhandler [79] => xoopsblockinstance [80] => xoopsblockinstancehandler [81] => xoopsprivmessage [82] => xoopsprivmessagehandler
Would be very nice if someone could give me a hand on this.
Kindly Regards,
José