本文整理汇总了PHP中Status::setStatus方法的典型用法代码示例。如果您正苦于以下问题:PHP Status::setStatus方法的具体用法?PHP Status::setStatus怎么用?PHP Status::setStatus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Status
的用法示例。
在下文中一共展示了Status::setStatus方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getFromJSON
public static function getFromJSON($json)
{
$o = json_decode($json);
$diagnostic = new Diagnostic();
if ($o->requested_version) {
$version = new Version();
$version->setVersion($o->requested_version->version);
$version->setReleaseNotes($o->requested_version->notes);
$version->setReleaseNotesURL($o->requested_version->notes_url);
$diagnostic->setRequestedVersion($version);
}
if ($o->marketplace_item_status) {
foreach ($o->marketplace_item_status as $status) {
$s = new MarketplaceItemStatus();
$s->setMarketplaceItemHandle($status->mpHandle);
$s->setMarketplaceItemID($status->mpID);
$s->setSafety($status->safety);
$s->setStatus($status->status);
$diagnostic->addMarketplaceItemStatusObject($s);
}
}
if ($o->notices) {
foreach ($o->notices as $status) {
$s = new Status();
$s->setSafety($status->safety);
$s->setStatus($status->status);
$diagnostic->addNoticeStatusObject($s);
}
}
if ($o->status) {
$s = new Status();
$s->setSafety($o->status->safety);
$s->setStatus($o->status->status);
$diagnostic->setUpdateStatusObject($s);
}
return $diagnostic;
}
示例2: addStatus
public function addStatus($user)
{
$loggedInUser = $this->registry->getObject('authenticate')->getUser()->getUserID();
if ($loggedInUser == $user) {
require_once 'status.php';
if (isset($_POST['status_type']) && $_POST['status_type'] != 'update') {
if ($_POST['status_type'] == 'image') {
require_once 'imagestatus.php';
$status = new Imagestatus($this->registry, 0, $this->username);
$status->processImage('image_file');
} elseif ($_POST['status_type'] == 'video') {
require_once 'videostatus.php';
$status = new Videostatus($this->registry, 0, $this->username);
$status->setVideoIdFromURL($_POST['video_url']);
} elseif ($_POST['status_type'] == 'link') {
require_once 'linkstatus.php';
$status = new Linkstatus($this->registry, 0);
$status->setURL($this->registry->getObject('db')->sanitizeData($_POST['link_url']));
$status->setDescription($this->registry->getObject('db')->sanitizeData($_POST['link_description']));
}
} else {
$status = new Status($this->registry, 0);
}
$status->setProfile($user);
$status->setPoster($loggedInUser);
if (isset($_POST['status'])) {
$status->setStatus($this->registry->getObject('db')->sanitizeData($_POST['status']));
}
$status->generateType();
$status->save();
// success message display
$this->registry->getObject('template')->addTemplateBit('status_update_message', 'profile_status_update_confirm.php');
} else {
require_once 'relation.php';
$relationships = new RelationsGet($this->registry);
$connections = $relationships->getNetwork($user, false);
if (in_array($loggedInUser, $connections)) {
require_once 'status.php';
if (isset($_POST['status_type']) && $_POST['status_type'] != 'update') {
if ($_POST['status_type'] == 'image') {
require_once 'imagestatus.php';
$status = new Imagestatus($this->registry, 0, $this->username);
$status->processImage('image_file');
} elseif ($_POST['status_type'] == 'video') {
require_once 'videostatus.php';
$status = new Videostatus($this->registry, 0, $this->username);
$status->setVideoIdFromURL($_POST['video_url']);
} elseif ($_POST['status_type'] == 'link') {
require_once 'linkstatus.php';
$status = new Linkstatus($this->registry, 0);
$status->setURL($this->registry->getObject('db')->sanitizeData($_POST['link_url']));
$status->setDescription($this->registry->getObject('db')->sanitizeData($_POST['link_description']));
}
} else {
$status = new Status($this->registry, 0);
}
$status->setProfile($user);
$status->setPoster($loggedInUser);
$status->setStatus($this->registry->getObject('db')->sanitizeData($_POST['status']));
$status->generateType();
$status->save();
// success message display
$this->registry->getObject('template')->addTemplateBit('status_update_message', 'profile_status_post_confirm.php');
} else {
// error message display
$this->registry->getObject('template')->addTemplateBit('status_update_message', 'profile_status_error.php');
}
}
}
示例3: getUploadStatus
/**
* Get upload status
*
* @param uploadurl - required -
* The upload url.
* @return The Status object containing the number of bytes uploaded successfully
* or the error code and message thrown by the server.
* */
public function getUploadStatus($uploadurl)
{
$parameters = array('uploadUrl' => $uploadurl);
$urld = 'dpi/v1/item/status';
$this->response = $this->_restTransportInstance->sendRequest($urld, $parameters, 'GET', $this->_authToken);
$responseBody = simplexml_load_string($this->response);
$returnObject = new Status();
if ($responseBody === false) {
$errorCode = 'N/A';
$errorMessage = 'The server has encountered an error, please try again.';
$errorObject = new ErrorStatus($errorCode, $errorMessage);
$returnObject->setErrorStatus($errorObject);
} else {
if (empty($responseBody->errorStatus)) {
$bytesReceived = (string) $responseBody->bytesReceived;
$returnObject->setBytesReceived($bytesReceived);
$status = (string) $responseBody->status;
$returnObject->setStatus($status);
} else {
$errorCode = (string) $responseBody->errorStatus->code;
$errorMessage = (string) $responseBody->errorStatus->message;
$errorObject = new ErrorStatus($errorCode, $errorMessage);
$returnObject->setErrorStatus($errorObject);
}
}
return $returnObject;
}
示例4: addStatus
private function addStatus($array, $user)
{
$loggedIn = $this->registry->getObject('authenticate')->isLoggedIn();
if ($loggedIn == true) {
require_once 'status.php';
if (isset($_POST['status_type']) && $_POST['status_type'] != 'update') {
if ($_POST['status_type'] == 'image') {
require_once 'imagestatus.php';
$status = new Imagestatus($this->registry, 0, $user);
$status->processImage('image_file');
} elseif ($_POST['status_type'] == 'video') {
require_once 'videostatus.php';
$status = new Videostatus($this->registry, 0, $user);
$status->setVideoIdFromURL($_POST['video_url']);
} elseif ($_POST['status_type'] == 'link') {
require_once 'linkstatus.php';
$status = new Linkstatus($this->registry, 0);
$status->setURL($this->registry->getObject('db')->sanitizeData($_POST['link_url']));
$status->setDescription($this->registry->getObject('db')->sanitizeData($_POST['link_description']));
}
} else {
$status = new Status($this->registry, 0);
}
$status->setProfile($user);
$status->setPoster($user);
if (isset($_POST['status'])) {
$status->setStatus($this->registry->getObject('db')->sanitizeData($_POST['status']));
}
$status->generateType();
$status->save();
$newAddID = $status->getID();
//Status Wierdness Start
$this->registry->getObject('template')->getPage()->addTag('referer', isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '');
require_once 'stream.php';
$stream = new Stream($this->registry);
$status = $stream->getStatusByID($newAddID);
$statusTypes = $stream->getStatusType();
if (!$stream->isEmpty()) {
$this->registry->getObject('template')->buildFromTemplate('stream_more.php');
}
$streamdata = $stream->getStream();
$IDs = $stream->getIDs();
$cacheableIDs = array();
foreach ($IDs as $id) {
$i = array();
$i['status_id'] = $id;
$cacheableIDs[] = $i;
}
$cache = $this->registry->getObject('db')->cacheData($cacheableIDs);
$this->registry->getObject('template')->getPage()->addTag('stream', array('DATA', $cache));
//var_dump($cacheableIDs);
foreach ($streamdata as $data) {
$datatags = array();
foreach ($data as $tag => $value) {
$datatags['status' . $tag] = $value;
}
//var_dump($datatags);
// your own status updates
if ($data['profile'] == 0) {
// network updates
$this->addBit('stream-' . $data['ID'], 'updates/' . $data['type_reference'] . '-general.php', $datatags);
} elseif ($data['profile'] == $this->registry->getObject('authenticate')->getUser()->getUserID() && $data['poster'] == $this->registry->getObject('authenticate')->getUser()->getUserID()) {
$this->registry->getObject('template')->addTemplateBit('stream-' . $data['ID'], 'updates/' . $data['type_reference'] . '-self.php', $datatags);
} elseif ($data['profile'] == $this->registry->getObject('authenticate')->getUser()->getUserID()) {
// updates to you
$this->addBit('stream-' . $data['ID'], 'updates/' . $data['type_reference'] . '-toSelf.php', $datatags);
} elseif ($data['poster'] == $this->registry->getObject('authenticate')->getUser()->getUserID()) {
// updates by you
$this->addBit('stream-' . $data['ID'], 'updates/' . $data['type_reference'] . '-fromSelf.php', $datatags);
} elseif ($data['poster'] == $data['profile']) {
$this->addBit('stream-' . $data['ID'], 'updates/' . $data['type_reference'] . '-user.php', $datatags);
} else {
// network updates
$this->addBit('stream-' . $data['ID'], 'updates/' . $data['type_reference'] . '.php', $datatags);
}
}
// stream comments, likes and dislikes
$status_ids = implode(',', $IDs);
$start = array();
foreach ($IDs as $id) {
$start[$id] = array();
}
// comments
$this->generateComments($start, $status_ids);
//rates
$this->getRates('status', $IDs);
//$this->getRates('comments', $IDs);
$this->registry->getObject('template')->getPage()->addTag('offset', 20);
//$offset +
$this->registry->getObject('template')->parseOutput();
$this->registry->ajaxReply(array('content' => $this->registry->getObject('template')->getPage()->getContentToPrint(), 'status' => 'Status Added'));
//$this->registry->ajaxReply(array('content' => '<script>$(document).ready(function(){window.location.reload();})</script>', 'status' => 'Status Added'));
//Status Wierdness End
// success message display
//$this->registry->ajaxReply( array('status'=>'Status Added', 'content'=>'') );
//$this->registry->getObject('template')->addTemplateBit( 'status_update_message', 'profile_status_update_confirm.php' );
} else {
//$this->registry->ajaxReply( array('status'=>'Access Denied', 'content'=>'') );
$this->registry->errorPage('Access Denied', 'Login to continue');
}
//.........这里部分代码省略.........