function install($data = '')
 {
     parent::install();
     subscribeToEvent($this->name, 'SAY');
     addClass('IRCBots');
     addClassProperty('IRCBots', 'message', 5);
     addClassProperty('IRCBots', 'pushMessage');
     //addClassProperty('IRCBots', 'alive');
     addClassProperty('IRCBots', 'updated');
     addClassProperty('IRCBots', 'updatedTime');
     addClassMethod('IRCBots', 'onNewMessage', '$this->setProperty("updated", time());' . "\n" . '$this->setProperty("updatedTime", date("H:i"));' . "\n" . '$this->setProperty("message", $params["message"]);');
     addClassObject('IRCBots', 'IRCBot1');
 }
    /**
    * Install
    *
    * Module installation routine
    *
    * @access private
    */
    function install()
    {
        subscribeToEvent($this->name, 'HOURLY');
        $className = 'ya_traffic';
        $objectName = array('yt_settings', 'yt_info');
        $objDescription = array('Настройки', 'Информация о пробках');
        /*$updCode = ;*/
        $rec = SQLSelectOne("SELECT ID FROM classes WHERE TITLE LIKE '" . DBSafe($className) . "'");
        if (!$rec['ID']) {
            $rec = array();
            $rec['TITLE'] = $className;
            $rec['DESCRIPTION'] = 'Пробки от Яндекс';
            $rec['ID'] = SQLInsert('classes', $rec);
        }
        for ($i = 0; $i < count($objectName); $i++) {
            $obj_rec = SQLSelectOne("SELECT ID FROM objects WHERE CLASS_ID='" . $rec['ID'] . "' AND TITLE LIKE '" . DBSafe($objectName[$i]) . "'");
            if (!$obj_rec['ID']) {
                $obj_rec = array();
                $obj_rec['CLASS_ID'] = $rec['ID'];
                $obj_rec['TITLE'] = $objectName[$i];
                $obj_rec['DESCRIPTION'] = $objDescription[$i];
                $obj_rec['ID'] = SQLInsert('objects', $obj_rec);
            }
        }
        addClassMethod('ya_traffic', 'update', 'include_once(DIR_MODULES."app_yatraffic/app_yatraffic.class.php");
$app_yatraffic=new app_yatraffic();
$app_yatraffic->get_traffic(gg("yt_settings.reg_id"));');
        $data_file = 'https://export.yandex.ru/bar/reginfo.xml';
        $xml = simplexml_load_file($data_file);
        sg('yt_settings.reg_id', $xml->region['id']);
        parent::install();
    }
 /**
  * Install
  *
  * Module installation routine
  *
  * @access private
  */
 function install($data = '')
 {
     subscribeToEvent($this->name, 'SAY', '', 10);
     subscribeToEvent($this->name, 'SAYTO', '', 10);
     subscribeToEvent($this->name, 'SAYREPLY', '', 10);
     parent::install();
 }
Example #4
0
 /**
 * Install
 *
 * Module installation routine
 *
 * @access private
 */
 function install($data = '')
 {
     subscribeToEvent($this->name, 'SAY');
     parent::install();
 }