本文整理汇总了PHP中Items::getItem方法的典型用法代码示例。如果您正苦于以下问题:PHP Items::getItem方法的具体用法?PHP Items::getItem怎么用?PHP Items::getItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Items
的用法示例。
在下文中一共展示了Items::getItem方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Items
<?php
global $action;
global $model;
$IC = new Items();
$page_item = $IC->getItem(array("tags" => "page:signup-confirmed", "extend" => array("user" => true, "tags" => true, "mediae" => true)));
if ($page_item) {
$this->sharingMetaData($page_item);
}
$type = session()->value("signup_type");
$username = session()->value("signup_username");
session()->reset("signup_type");
session()->reset("signup_username");
?>
<div class="scene newsletter i:scene">
<? if($page_item && $page_item["status"]):
$media = $IC->sliceMedia($page_item); ?>
<div class="article i:article id:<?php
echo $page_item["item_id"];
?>
" itemscope itemtype="http://schema.org/Article">
<? if($media): ?>
<div class="image item_id:<?php
echo $page_item["item_id"];
?>
format:<?php
echo $media["format"];
?>
示例2: getQRCodePackageURL
public function getQRCodePackageURL($gameId)
{
$query = "SELECT * FROM qrcodes WHERE game_id = {$gameId}";
$rsResult = Module::query($query);
if (mysql_error()) {
return new returnData(3, NULL, "SQL Error");
}
//Set up a tmp directory
$relDir = "{$gameId}_qrcodes_" . date('Y_m_d_h_i_s');
$tmpDir = Config::gamedataFSPath . "/backups/{$relDir}";
$command = "mkdir {$tmpDir}";
exec($command, $output, $return);
if ($return) {
return new returnData(4, NULL, "cannot create backup dir, check file permissions");
}
//Get all the images
while ($qrCode = mysql_fetch_object($rsResult)) {
//Look up the item to get a good file name
$fileNameType = '';
$fileNameId = '';
$fileNameName = '';
switch ($qrCode->link_type) {
case 'Location':
$fileNameType = "Location";
$fileNameId = $qrCode->link_id;
$locationReturnData = Locations::getLocation($gameId, $qrCode->link_id);
$location = $locationReturnData->data;
switch ($location->type) {
case 'Npc':
$object = Npcs::getNpc($gameId, $location->type_id);
$fileNameName = $object->data->name;
break;
case 'Node':
$object = Nodes::getNode($gameId, $location->type_id);
$fileNameName = $object->data->title;
break;
case 'Item':
$object = Items::getItem($gameId, $location->type_id);
$fileNameName = $object->data->name;
break;
}
break;
default:
$returnResult = new returnData(5, NULL, "Invalid QR Code Found.");
}
$fileName = "{$fileNameType}{$fileNameId}-{$fileNameName}.jpg";
$command = "curl -s -o /{$tmpDir}/{$fileName} 'http://chart.apis.google.com/chart?chs=300x300&cht=qr&choe=UTF-8&chl={$qrCode->code}'";
exec($command, $output, $return);
if ($return) {
return new returnData(4, NULL, "cannot download and save qr code image, check file permissions and url in console");
}
}
//Zip up the whole directory
$zipFileName = "aris_qr_codes.tar";
$cwd = Config::gamedataFSPath . "/backups";
chdir($cwd);
$command = "tar -cf {$zipFileName} {$relDir}/";
exec($command, $output, $return);
if ($return) {
return new returnData(5, NULL, "cannot compress backup dir, check that tar command is availabe.");
}
//Delete the Temp
/*
$rmCommand = "rm -rf {$tmpDir}";
exec($rmCommand, $output, $return);
if ($return) return new returnData(5, NULL, "cannot delete backup dir, check file permissions");
*/
return new returnData(0, Config::gamedataWWWPath . "/backups/{$zipFileName}");
}
示例3: hydrateContent
private function hydrateContent($content, $gameId)
{
if ($content->content_type == 'Node') {
$contentDetails = Nodes::getNode($gameId, $content->content_id)->data;
$content->name = $contentDetails->title;
} else {
if ($content->content_type == 'Item') {
$contentDetails = Items::getItem($gameId, $content->content_id)->data;
$content->name = $contentDetails->name;
} else {
if ($content->content_type == 'Npc') {
$contentDetails = Npcs::getNpc($gameId, $content->content_id)->data;
$content->name = $contentDetails->name;
} else {
if ($content->content_type == 'WebPage') {
$contentDetails = WebPages::getWebPage($gameId, $content->content_id)->data;
$content->name = $contentDetails->name;
$content->media = NULL;
$content->media_id = NULL;
} else {
if ($content->content_type == 'AugBubble') {
$contentDetails = AugBubbles::getAugBubble($gameId, $content->content_id)->data;
$content->name = $contentDetails->name;
$content->media = NULL;
$content->media_id = NULL;
} else {
if ($content->content_type == 'CustomMap') {
$contentDetails = Overlays::getOverlay($gameId, $content->content_id)->data;
$content->name = $contentDetails->name;
} else {
if ($content->content_type == 'PlayerNote') {
$contentDetails = Notes::getNoteById($content->content_id)->data;
$content->name = $contentDetails->title;
$content->icon_media_id = 5;
$content->media = NULL;
$content->media_id = NULL;
}
}
}
}
}
}
}
//Get the Icon Media
$mediaHelper = new Media();
$mediaReturnObject = $mediaHelper->getMediaObject($gameId, $contentDetails->icon_media_id);
$media = $mediaReturnObject->data;
$content->icon_media = $media;
$content->icon_media_id = $contentDetails->icon_media_id;
$content->is_spawnable = Spawnables::hasActiveSpawnable($gameId, $content->content_type, $content->content_id);
if ($content->content_type != 'WebPage' && $content->content_type != 'PlayerNote' && $content->content_type != 'AugBubble' && $content->content_type != 'CustomMap') {
//Get the Media
$mediaHelper = new Media();
$mediaReturnObject = $mediaHelper->getMediaObject($gameId, $contentDetails->media_id);
$media = $mediaReturnObject->data;
$content->media = $media;
$content->media_id = $contentDetails->media_id;
}
/* Depricated
if ($content->content_type == 'AugBubble'){
//Get the Alignment Media
$mediaHelper = new Media;
$mediaReturnObject = $mediaHelper->getMediaObject($gameId, $contentDetails->alignment_media_id);
$alignmentMedia = $mediaReturnObject->data;
$content->alignment_media = $alignmentMedia;
$content->alignment_media_id = $alignmentMedia->media_id;
}
*/
return $content;
}
示例4: setItemCountForPlayer
protected function setItemCountForPlayer($gameId, $intItemId, $playerId, $qty)
{
$currentQty = Module::itemQtyInPlayerInventory($gameId, $playerId, $intItemId);
$item = Items::getItem($gameId, $intItemId)->data;
$maxQty = $item->max_qty_in_inventory;
if ($qty > $maxQty && $maxQty != -1) {
$qty = $maxQty;
}
if ($qty < 0) {
return 0;
} else {
$amountToAdjust = $qty - $currentQty;
Module::adjustQtyForPlayerItem($gameId, $intItemId, $playerId, $amountToAdjust);
return $qty;
}
}
示例5: Items
<?php
$IC = new Items();
$page_item = $IC->getItem(array("tags" => "page:front", "extend" => array("user" => true, "mediae" => true, "tags" => true)));
if ($page_item) {
$this->sharingMetaData($page_item);
}
$post_items = $IC->getItems(array("itemtype" => "post", "tags" => "on:frontpage", "status" => 1, "extend" => array("tags" => true, "readstate" => true, "user" => true, "mediae" => true)));
?>
<div class="scene front i:front">
<div class="intro">
<!--
// ny dansk tekst
jeg tror
vi har sovet længe nok
nu
er det på tide
at vågne og indse
at midlet
er blevet en tyran
og målet er glemt
i stakken af regninger
vi har så travlt
at stilstand er tryghed
og tryghed er en luksus
som koster os alt