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


PHP Items::getItem方法代码示例

本文整理汇总了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"];
?>
开发者ID:kaestel,项目名称:stopknappen_dk,代码行数:31,代码来源:confirmed.php

示例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}");
 }
开发者ID:kimblemj,项目名称:server,代码行数:69,代码来源:qrcodes.php

示例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;
 }
开发者ID:spoymenov,项目名称:arisgames,代码行数:70,代码来源:editorFoldersAndContent.php

示例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;
     }
 }
开发者ID:kimblemj,项目名称:server,代码行数:16,代码来源:module.php

示例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
开发者ID:kaestel,项目名称:stopknappen_dk,代码行数:30,代码来源:front.php


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