本文整理匯總了PHP中Contest::loadContest方法的典型用法代碼示例。如果您正苦於以下問題:PHP Contest::loadContest方法的具體用法?PHP Contest::loadContest怎麽用?PHP Contest::loadContest使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Contest
的用法示例。
在下文中一共展示了Contest::loadContest方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: shuffle
<?php
require_once "common.php";
require_once $NPADMIN_PATH . "API.php";
$contestId = $_GET['contest_id'];
$contest = Contest::loadContest($contestId);
if ($contest->status !== STATUS_FINISHED) {
npadmin_security($contest->getAllowedGroups(), false, _("You are not invited to this contest"), true);
$userId = npadmin_loginData()->getUser()->userId;
} else {
$userId = null;
}
if ($contest->status === STATUS_OPEN) {
$photos = $contest->photosOfUser($userId);
} else {
$photos = $contest->photosOfUser(null);
if ($contest->status === STATUS_VOTING) {
shuffle($photos);
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<style type="text/css" media="all">
@import url("static/style.css");
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>