示例#1
0
    $objMsgM = new Keke_witkey_msg_class();
    if (strtoupper(CHARSET) == 'GBK') {
        $to_username = kekezu::utftogbk($to_username);
    }
    $arrSpaceInfo = kekezu::get_user_info($to_username, 1);
    if (!$arrSpaceInfo) {
        $tips['errors']['to_username'] = '******';
        kekezu::show_msg($tips, NULL, NULL, NULL, 'error');
    }
    if ($arrSpaceInfo['uid'] == $gUid) {
        $tips['errors']['to_username'] = '******';
        kekezu::show_msg($tips, NULL, NULL, NULL, 'error');
    }
    if (strtoupper(CHARSET) == 'GBK') {
        $title = kekezu::utftogbk($title);
        $content = kekezu::utftogbk($content);
    }
    $objMsgM->setUid($gUid);
    $objMsgM->setUsername($username);
    $objMsgM->setTo_uid($arrSpaceInfo['uid']);
    $objMsgM->setTo_username($arrSpaceInfo['username']);
    $objMsgM->setTitle(kekezu::str_filter(kekezu::escape($title)));
    $objMsgM->setContent(kekezu::str_filter(kekezu::escape($content)));
    $objMsgM->setOn_time(time());
    $objMsgM->setType(3);
    $objMsgM->create_keke_witkey_msg();
    unset($objMsgM);
    kekezu::show_msg('已发送', NULL, NULL, NULL, 'ok');
} else {
    $userArrData = keke_user_class::get_user_info($id);
}
示例#2
0
 public static function send_private_message($title, $tar_content, $to_uid, $to_username, $url = '', $output = 'normal')
 {
     global $uid, $username;
     global $_lang;
     if (CHARSET == 'gbk') {
         $title = kekezu::utftogbk($title);
         $tar_content = kekezu::utftogbk($tar_content);
         $to_username = kekezu::utftogbk($to_username);
     }
     $msg_obj = new Keke_witkey_msg_class();
     $msg_obj->_msg_id = null;
     $msg_obj->setUid($uid);
     $msg_obj->setUsername($username);
     $msg_obj->setTitle($title);
     $msg_obj->setTo_uid($to_uid);
     $msg_obj->setTo_username($to_username);
     $msg_obj->setContent($tar_content);
     $msg_obj->setOn_time(time());
     $msg_obj->setType(2);
     return $msg_obj->create_keke_witkey_msg();
 }