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


PHP Canvas::openCanvas方法代码示例

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


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

示例1: shareCanvas

function shareCanvas()
{
    global $db;
    //$rst = array();
    $vid = $_REQUEST['vid'];
    $shareTo = $_REQUEST['shareTo'];
    $sql = "";
    if (substr_count($shareTo, "@") == 0) {
        $sql = "select user_id from colfusion_users where user_login ='" . $shareTo . "'";
    } else {
        $sql = "select user_id from colfusion_users where user_email ='" . $shareTo . "'";
    }
    $r = $db->get_row($sql);
    $user_id;
    if (is_null($r)) {
        $RST['status'] = 0;
        $RST['msg'] = "Can't find the user.";
    } else {
        $user_id = $r->user_id;
        $canvas;
        if ($_SESSION['Canvases'][$vid] != null) {
            $canvas = unserialize($_SESSION['Canvases'][$_REQUEST['vid']]);
            //$rst = $canvas->shareCanvas($user_id,$_REQUEST['authorization']);
        } else {
            $canvas = Canvas::openCanvas($_REQUEST['vid']);
        }
        if ($canvas == null) {
            $RST['status'] = '0';
            $RST['msg'] = 'No permit or no canvas exists.';
        } else {
            if (is_null($canvas->shareCanvas($user_id, $_REQUEST['authorization']))) {
                $RST['status'] = 0;
                $RST['msg'] = 'Unable to share this canvas to ' . $shareTo;
            } else {
                $RST['status'] = 1;
            }
        }
    }
    echo json_encode($RST);
    error_reporting(E_ALL);
}
开发者ID:Grprashanthkumar,项目名称:ColfusionWeb,代码行数:41,代码来源:control.php


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