本文整理汇总了PHP中UserManager::getFromBlid方法的典型用法代码示例。如果您正苦于以下问题:PHP UserManager::getFromBlid方法的具体用法?PHP UserManager::getFromBlid怎么用?PHP UserManager::getFromBlid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserManager
的用法示例。
在下文中一共展示了UserManager::getFromBlid方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getSiteAccount
public function getSiteAccount()
{
return UserManager::getFromBlid($this->blid);
}
示例2: stdClass
$addonIds = AddonManager::getFromBoardID($boardObject->getID(), ($page - 1) * 10, 10);
$ret = new stdClass();
$ret->addons = array();
foreach ($addonIds as $aid) {
$addon = AddonManager::getFromID($aid);
if ($addon->getRating() == null) {
$rating = 0;
} else {
$rating = $addon->getRating();
}
$retboard = new stdClass();
$retboard->id = $addon->getId();
$retboard->name = $addon->getName();
$user = UserLog::getCurrentUsername($addon->getManagerBLID());
if ($user == false) {
$uo = UserManager::getFromBlid($addon->getManagerBLID());
if ($uo !== false) {
$user = $uo->getUsername();
} else {
$user = "Blockhead";
}
} else {
$user = utf8_encode($user);
}
$retboard->author = $user;
$retboard->rating = $rating;
$retboard->downloads = $addon->getDownloads("web") + $addon->getDownloads("ingame");
$ret->addons[] = $retboard;
}
$ret->status = "success";
$ret->board_id = $boardObject->getId();
示例3: foreach
<tbody>
<?php
$reclaims = RTBAddonManager::getPendingReclaims();
foreach ($reclaims as $rec) {
$addon = AddonManager::getFromId($rec->glass_id);
echo "<tr>";
echo "<td>";
echo '<a href="/addons/rtb/view.php?id=' . $rec->id . '">';
echo $rec->title;
echo "</a></td>";
echo "<td>";
echo '<a href="/addons/addon.php?id=' . $addon->getId() . '">';
echo $addon->getName();
echo "</a></td>";
echo "<td>";
echo UserManager::getFromBlid($addon->getManagerBLID())->getUsername();
echo "</td>";
echo "<td>";
echo "<form target=\"\" method=\"post\">";
echo "<input type=\"hidden\" name=\"id\" value=\"" . $rec->id . "\" />";
echo "<input name=\"action\" value=\"accept\" type=\"image\" src=\"/img/icons16/accept_button.png\" /> ";
echo "<input name=\"action\" value=\"reject\" type=\"image\" src=\"/img/icons16/delete.png\" />";
echo "</form>";
echo "</td>";
echo "</tr>";
}
if (sizeof($reclaims) == 0) {
echo "<tr><td colspan=\"3\" style=\"text-align:center\">Nothing to review!</td></tr>";
}
?>
</tbody>
示例4: array
$ret->downloads = $addonObject->getDownloads("web") + $addonObject->getDownloads("ingame");
$ret->rating = $addonObject->getRating();
$ret->screenshots = array();
$screens = ScreenshotManager::getScreenshotsFromAddon($aid);
foreach ($screens as $sid) {
$ss = ScreenshotManager::getFromId($sid);
$screenshot = new stdClass();
$screenshot->id = $ss->getId();
$screenshot->url = $ss->getUrl();
$screenshot->thumbnail = $ss->getThumbUrl();
$screenshot->extent = $ss->getX() . " " . $ss->getY();
$ret->screenshots[] = $screenshot;
}
$author = new stdClass();
$user = UserLog::getCurrentUsername($addonObject->getManagerBLID());
if ($user == false) {
$user = UserManager::getFromBlid($addonObject->getManagerBLID())->getUsername();
} else {
$user = utf8_encode($user);
}
$author->blid = $addonObject->getManagerBLID();
$author->name = $user;
$ret->authors = array($author);
$channelId[1] = "stable";
$channelId[2] = "beta";
$channel = new stdClass();
$channel->id = 1;
$channel->name = "stable";
$channel->version = $addonObject->getVersion();
$ret->branches[] = $channel;
echo json_encode($ret, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);