当前位置: 首页>>代码示例>>PHP>>正文


PHP SocialManager::sendWallMessage方法代码示例

本文整理汇总了PHP中SocialManager::sendWallMessage方法的典型用法代码示例。如果您正苦于以下问题:PHP SocialManager::sendWallMessage方法的具体用法?PHP SocialManager::sendWallMessage怎么用?PHP SocialManager::sendWallMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SocialManager的用法示例。


在下文中一共展示了SocialManager::sendWallMessage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: api_get_path

    if (!empty($_POST['url_content'])) {
        $messageContent = $_POST['social_wall_new_msg_main'] . '<br><br>' . $_POST['url_content'];
    }
    $idMessage = SocialManager::sendWallMessage(api_get_user_id(), $friendId, $messageContent, $messageId, MESSAGE_STATUS_WALL_POST);
    if (!empty($_FILES['picture']['tmp_name']) && $idMessage > 0) {
        $error = SocialManager::sendWallMessageAttachmentFile(api_get_user_id(), $_FILES['picture'], $idMessage, $fileComment = '');
    }
    $url = api_get_path(WEB_CODE_PATH) . 'social/profile.php';
    $url .= empty($_SERVER['QUERY_STRING']) ? '' : '?' . Security::remove_XSS($_SERVER['QUERY_STRING']);
    header('Location: ' . $url);
    exit;
} else {
    if (!empty($_POST['social_wall_new_msg']) && !empty($_POST['messageId'])) {
        $messageId = intval($_POST['messageId']);
        $messageContent = $_POST['social_wall_new_msg'];
        $res = SocialManager::sendWallMessage(api_get_user_id(), $friendId, $messageContent, $messageId, MESSAGE_STATUS_WALL);
        $url = api_get_path(WEB_CODE_PATH) . 'social/profile.php';
        $url .= empty($_SERVER['QUERY_STRING']) ? '' : '?' . Security::remove_XSS($_SERVER['QUERY_STRING']);
        header('Location: ' . $url);
        exit;
    } else {
        if (isset($_GET['messageId'])) {
            $messageId = Security::remove_XSS($_GET['messageId']);
            $status = SocialManager::deleteMessage($messageId);
            header('Location: ' . api_get_path(WEB_CODE_PATH) . 'social/profile.php');
            exit;
        } else {
            if (isset($_GET['u'])) {
                //I'm your friend? I can see your profile?
                $user_id = intval($_GET['u']);
                if (api_is_anonymous($user_id, true)) {
开发者ID:KRCM13,项目名称:chamilo-lms,代码行数:31,代码来源:profile.php

示例2: api_get_path

if (!empty($_POST['social_wall_new_msg_main']) || !empty($_FILES['picture']['tmp_name'])) {
    $messageId = 0;
    $idMessage = SocialManager::sendWallMessage(api_get_user_id(), $friendId, $_POST['social_wall_new_msg_main'], $messageId, MESSAGE_STATUS_WALL_POST);
    if (!empty($_FILES['picture']['tmp_name']) && $idMessage > 0) {
        $error = SocialManager::sendWallMessageAttachmentFile(api_get_user_id(), $_FILES['picture'], $idMessage, $fileComment = '');
    }

    $url = api_get_path(WEB_CODE_PATH) . 'social/profile.php';
    $url .= empty($_SERVER['QUERY_STRING']) ? '' : '?'.Security::remove_XSS($_SERVER['QUERY_STRING']);
    header('Location: ' . $url);
    exit;

} else if (!empty($_POST['social_wall_new_msg'])  && !empty($_POST['messageId'])) {
    $messageId = intval($_POST['messageId']);
    $res = SocialManager::sendWallMessage(api_get_user_id(), $friendId, $_POST['social_wall_new_msg'], $messageId , MESSAGE_STATUS_WALL);
    $url = api_get_path(WEB_CODE_PATH) . 'social/profile.php';
    $url .= empty($_SERVER['QUERY_STRING']) ? '' : '?'.Security::remove_XSS($_SERVER['QUERY_STRING']);
    header('Location: ' . $url);
    exit;

} else if (isset($_GET['messageId'])) {
    $messageId = Security::remove_XSS($_GET['messageId']);
    $status = SocialManager::deleteMessage($messageId);
    header('Location: ' . api_get_path(WEB_CODE_PATH) . 'social/profile.php');
    exit;

} else if (isset($_GET['u'])) { //I'm your friend? I can see your profile?
    $user_id = intval($_GET['u']);
    if (api_is_anonymous($user_id, true)) {
        api_not_allowed(true);
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:30,代码来源:profile.php


注:本文中的SocialManager::sendWallMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。