Example #1
0
<?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>