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


PHP Api::queryRaid方法代码示例

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


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

示例1: Out

$Out = new Out();
$Out->pushValue("title", "Raidplaner RSS feed");
$Out->pushValue("link", $BaseURL . "index.php");
$Out->pushValue("description", "Upcoming raids for the next 2 weeks.");
$Out->pushValue("language", "en-en");
$Out->pushValue("copyright", "packedpixel");
$Out->pushValue("pubDate", date(DATE_RSS));
// Requires private token to be visible
$Token = isset($_REQUEST["token"]) ? $_REQUEST["token"] : null;
if (Api::testPrivateToken($Token)) {
    // Setting the correct timezones
    $Timezone = isset($_REQUEST["timezone"]) ? $_REQUEST["timezone"] : date_default_timezone_get();
    // Query API
    date_default_timezone_set("UTC");
    $Parameters = array("start" => time() - 24 * 60 * 60, "end" => time() + 14 * 24 * 60 * 60, "limit" => 0, "closed" => true, "canceled" => true);
    $Locations = Api::queryLocation(null);
    $Raids = Api::queryRaid($Parameters);
    $LocationName = array();
    foreach ($Locations as $Location) {
        $LocationName[$Location["Id"]] = $Location["Name"];
    }
    // Generate RSS content
    date_default_timezone_set($Timezone);
    foreach ($Raids as $Raid) {
        $Start = date("H:i", intval($Raid["Start"]));
        $End = date("H:i", intval($Raid["End"]));
        $Out->pushValue("item", array("title" => $LocationName[$Raid["LocationId"]] . " (" . $Raid["Size"] . ")", "description" => "Status: " . $Raid["Status"] . "\nFrom " . $Start . " to " . $End . "\n" . $Raid["Description"], "link" => $BaseURL . "index.php#raid," . $Raid["RaidId"], "author" => "Raidplaner", "guid" => $Raid["RaidId"], "pubDate" => date(DATE_RSS, intval($Raid["Start"]))));
    }
}
$Out->flushXML("channel");
echo '</rss>';
开发者ID:zatoshi,项目名称:raidplaner,代码行数:31,代码来源:feed.php

示例2: onRaidModify

 public function onRaidModify($aRaidId)
 {
     if ($this->authenticate()) {
         $Parameters = array('raid' => $aRaidId, 'canceled' => true, 'closed' => true);
         $RaidResult = Api::queryRaid($Parameters);
         if (count($RaidResult) > 0) {
             $Raid = $RaidResult[0];
             $LocationName = $this->mLocations[$Raid['LocationId']];
             $Timezone = date_default_timezone_get();
             try {
                 date_default_timezone_set('UTC');
                 $Start = new Google_Service_Calendar_EventDateTime();
                 $Start->setDateTime(date($this->mDateFormat, intval($Raid['Start'])));
                 $Start->setTimeZone('UTC');
                 $End = new Google_Service_Calendar_EventDateTime();
                 $End->setDateTime(date($this->mDateFormat, intval($Raid['End'])));
                 $End->setTimeZone('UTC');
                 $Events = $this->mCalService->events->listEvents(GOOGLE_CAL_ID, array('sharedExtendedProperty' => 'RaidId=' . $aRaidId));
                 // There should be only one event, but we're a bit
                 // paranoid here
                 foreach ($Events->getItems() as $Event) {
                     $Event->setLocation($LocationName);
                     $Event->setDescription($Raid['Description']);
                     if ($Raid['Status'] == 'canceled') {
                         $Event->setSummary('[canceled] ' . $LocationName . ' (' . $Raid['Size'] . ')');
                     } else {
                         $Event->setSummary($LocationName . ' (' . $Raid['Size'] . ')');
                     }
                     $Event->setStart($Start);
                     $Event->setEnd($End);
                     $this->mCalService->events->update(GOOGLE_CAL_ID, $Event->getid(), $Event);
                 }
             } catch (Exception $Ex) {
                 $Out = Out::getInstance();
                 $Out->pushError($Ex->getMessage());
             }
             date_default_timezone_set($Timezone);
         }
     }
 }
开发者ID:zatoshi,项目名称:raidplaner,代码行数:40,代码来源:gcal.php


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