Ejemplo n.º 1
0
 function trigger_event($category, $item_id, $event, $extra_tags = array(), $user_list = array(), $omit_user_id = null)
 {
     $mydirname =& $this->mModule->get('dirname');
     require_once XOOPS_TRUST_PATH . '/libs/altsys/class/D3NotificationHandler.class.php';
     $not_handler =& D3NotificationHandler::getInstance();
     $not_handler->triggerEvent($mydirname, 'xcforum', $category, $item_id, $event, $extra_tags, $user_list, $omit_user_id);
 }
function pico_main_trigger_event($mydirname, $category, $item_id, $event, $extra_tags = array(), $user_list = array(), $omit_user_id = null)
{
    require_once XOOPS_TRUST_PATH . '/libs/altsys/class/D3NotificationHandler.class.php';
    $not_handler =& D3NotificationHandler::getInstance();
    $not_handler->triggerEvent($mydirname, 'pico', $category, $item_id, $event, $extra_tags, $user_list, $omit_user_id);
}
Ejemplo n.º 3
0
	function d3download_main_trigger_event( $mydirname , $category , $item_id, $event, $extra_tags=array(), $user_list=array(), $omit_user_id=null )
	{
		require_once XOOPS_TRUST_PATH.'/libs/altsys/class/D3NotificationHandler.class.php' ;
		$mytrustdirpath = dirname( dirname( __FILE__ ) );
		$mytrustdirname = basename( $mytrustdirpath );
		$not_handler =& D3NotificationHandler::getInstance() ;
		$not_handler->triggerEvent( $mydirname , $mytrustdirname , $category , $item_id , $event , $extra_tags , $user_list , $omit_user_id ) ;
	}
Ejemplo n.º 4
0
 function onUpdate($mode, $link_id, $forum_id, $topic_id, $post_id = 0)
 {
     global $xoopsDB, $xoopsConfig, $xoopsUser;
     if ($mode != "newtopic" && $mode != "reply") {
         return true;
     }
     // non-module integration returns false quickly
     if (!is_object($this->module)) {
         return false;
     }
     $not_module =& $this->module;
     $not_modid = $this->module->getVar('mid');
     $not_catinfo =& notificationCommentCategoryInfo($not_modid);
     // module without 'comment' notification
     if (empty($not_catinfo)) {
         return false;
     }
     $mydirname = $this->mydirname;
     //get uname
     if (is_object($xoopsUser)) {
         $uname = $xoopsUser->getVar('uname');
         $name = $xoopsUser->getVar('name');
     }
     $notif_name = $this->mod_config['use_name'] == 1 ? $name : $uname;
     $openarea_entry = 0;
     //default
     //get entry's title, bid, uid
     $sql = "SELECT d.uid, d.cid, d.title, d.bid, d.openarea AS openarea, d.vgids AS vgids, d.vpids AS vpids, \n\t\t\tc.cid, c.openarea AS openarea_cat, c.vgids AS vgids_cat, c.vpids AS vpids_cat \n\t\t\tFROM " . $xoopsDB->prefix($mydirname . '_diary') . " d \n\t\t\tLEFT JOIN " . $xoopsDB->prefix($mydirname . '_category') . " c \n\t\t\tON ((c.uid=d.uid or c.uid='0') and d.cid=c.cid) \n\t\t\tWHERE bid = '" . intval($link_id) . "'";
     //$sql = "SELECT * FROM " . $xoopsDB->prefix($mydirname.'_diary') . " WHERE bid = '".intval($link_id)."'";
     $result = $xoopsDB->query($sql);
     while ($dbdat = $xoopsDB->fetchArray($result)) {
         $title = $dbdat['title'];
         $bid = intval($dbdat['bid']);
         $uid = intval($dbdat['uid']);
         $cid = intval($dbdat['cid']);
         $openarea_entry = intval($dbdat['openarea']);
         $openarea_cat = intval($dbdat['openarea_cat']);
         $vgids = intval($dbdat['vgids']);
         $vpids = intval($dbdat['vpids']);
         $vgids_cat = intval($dbdat['vgids_cat']);
         $vpids_cat = intval($dbdat['vpids_cat']);
     }
     //$openarea_cat = $this->d3dConf->func->get_openarea_cat($uid,$cid);
     // Trigger Notification
     $users2notify = $this->mPerm->get_users_can_read_entry($openarea, $openarea_entry, $openarea_cat, $vgids, $vpids, $vgids_cat, $vpids_cat);
     $not_handler =& D3NotificationHandler::getInstance();
     $comment_tags = array('ENTRY_TITLE' => $title, 'ENTRY_BLOGGER' => $notif_name, 'ENTRY_URI' => XOOPS_URL . "/modules/" . $mydirname . "/index.php?page=detail&bid=" . $link_id . "&req_uid=" . $uid . "#comment");
     $not_handler->triggerEvent($this->mydirname, 'd3diary', 'blogger', $uid, 'new_comment', $comment_tags, $users2notify);
     $not_category = $not_catinfo['name'];
     $not_itemid = $link_id;
     $not_handler->triggerEvent($this->mydirname, 'd3diary', $not_category, $not_itemid, 'comment', $comment_tags, $users2notify);
     return true;
 }
Ejemplo n.º 5
0
 function processCommentNotifications($mode, $link_id, $forum_id, $topic_id, $post_id)
 {
     // non-module integration returns false quickly
     if (!is_object($this->module)) {
         return false;
     }
     $not_module =& $this->module;
     $not_modid = $this->module->getVar('mid');
     $not_catinfo =& notificationCommentCategoryInfo($not_modid);
     // module without 'comment' notification
     if (empty($not_catinfo)) {
         return false;
     }
     $not_category = $not_catinfo['name'];
     $not_itemid = $link_id;
     $not_event = 'comment';
     // 'comment_submit'?
     $comment_tags = array('X_COMMENT_URL' => XOOPS_URL . '/modules/' . $this->d3forum_dirname . '/index.php?post_id=' . intval($post_id));
     $users2notify = d3forum_get_users_can_read_forum($this->d3forum_dirname, $forum_id);
     if (empty($users2notify)) {
         $users2notify = array(0);
     }
     $not_handler =& D3NotificationHandler::getInstance();
     $not_handler->triggerEvent($this->mydirname, $this->mytrustdirname, $not_category, $not_itemid, $not_event, $comment_tags, $users2notify);
 }
Ejemplo n.º 6
0
			
			// Trigger Notification using "Altsys D3NotificationHandler"
			$openarea_entry = intval($func->getpost_param('openarea'))!=0 ? 
					intval($func->getpost_param('openarea')) : 0;
			$category->cid = (int)$diary->cid;
			$category->uid = $uid;
			$category->readdb($mydirname);
			$openarea_cat = intval($category->openarea)!=0 ? intval($category->openarea) : 0;
			$vgids_cat = !empty($category->vgids) ? $category->vgids : "";
			$vpids_cat = !empty($category->vpids) ? $category->vpids : "";

			// 1st parameter $openarea is byref
			$users2notify = $mPerm->get_users_can_read_entry( $openarea, $openarea_entry, $openarea_cat, 
						$diary->vgids, $diary->vpids, $vgids_cat, $vpids_cat );

			$not_handler =& D3NotificationHandler::getInstance() ;
			
			$comment_tags = array( 'ENTRY_TITLE' => $diary->title , 'ENTRY_URI' => XOOPS_URL.'/modules/'.$mydirname.'/index.php?page=detail&req_uid='.$req_uid.'&bid='.$diary->bid ) ;
			$not_handler->triggerEvent( $mydirname , 'd3diary' , 'global' , 0 , 'new_entry' , $comment_tags , $users2notify ) ;

			$comment_tags = array( 'ENTRY_TITLE' => $diary->title , 'ENTRY_BLOGGER' => $notif_name , 'ENTRY_URI' => XOOPS_URL.'/modules/'.$mydirname.'/index.php?page=detail&req_uid='.$req_uid.'&bid='.$diary->bid ) ;
			$not_handler->triggerEvent( $mydirname , 'd3diary' , 'blogger' , $req_uid , 'new_entry' , $comment_tags , $users2notify ) ;
		
		} else {
			$update_create_time = false;
		}
	} else {
		$update_create_time = false;
	}
	
	$diary->openarea=intval($func->getpost_param('openarea'));