本文整理汇总了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);
}