Example #1
0
function getNews()
{
    EasyRdf_Namespace::set('sd', 'http://symbolicdata.org/Data/Model#');
    EasyRdf_Namespace::set('sioc', 'http://rdfs.org/sioc/ns#');
    $query1 = '
PREFIX sd: <http://symbolicdata.org/Data/Model#>
construct { ?a ?b ?c . }
from <http://symbolicdata.org/Data/News/>
Where { ?a a sioc:BlogPost ; ?b ?c . }
';
    $query2 = '
PREFIX sd: <http://symbolicdata.org/Data/Model#>
construct { ?p foaf:name ?n . }
from <http://symbolicdata.org/Data/News/>
from <http://symbolicdata.org/Data/People/>
Where { ?a a sioc:BlogPost ; dc:publisher ?p . 
  ?p foaf:name ?n . }
';
    $sparql = new EasyRdf_Sparql_Client('http://symbolicdata.org:8890/sparql');
    $result = $sparql->query($query1);
    // a CONSTRUCT query returns an EasyRdf_Graph
    //echo $result->dump("turtle");
    $people = $sparql->query($query2);
    //echo $people->dump("turtle");
    /* generate data structure for output table */
    $s = array();
    foreach ($result->allOfType("sioc:BlogPost") as $v) {
        $a = $v->getUri();
        $label = $v->get('rdfs:label');
        $created = $v->get('dc:created');
        $subject = $v->join('dc:subject');
        $abstract = $v->get('dc:abstract');
        $publisher = $people->get($v->get('dc:publisher'), 'foaf:name');
        $link = $v->get('sioc:link');
        $linksTo = $v->get('sioc:links_to');
        $out = '<p><dl> <dt><strong><a href="' . $a . '">' . $label . '</a></strong></dt>
';
        $out .= addLine($created, "Created");
        $out .= addLine($subject, "Subject");
        $out .= addLine($abstract, "Abstract");
        $out .= addLine($publisher, "Publisher");
        $out .= addLink($link, "More");
        $out .= addLink($linksTo, "Links to");
        $out .= '</dl></p>';
        $s["{$created_}{$a}"] = $out;
    }
    krsort($s);
    return join($s, "\n");
}
Example #2
0
 * View all team affiliations
 *
 * Part of the DOMjudge Programming Contest Jury System and licenced
 * under the GNU GPL. See README and COPYING for details.
 */
require 'init.php';
$title = 'Affiliations';
require LIBWWWDIR . '/header.php';
echo "<h1>Affiliations</h1>\n\n";
$res = $DB->q('SELECT a.*, COUNT(teamid) AS cnt FROM team_affiliation a
               LEFT JOIN team USING (affilid)
               GROUP BY affilid ORDER BY name');
if ($res->count() == 0) {
    echo "<p class=\"nodata\">No affiliations defined</p>\n\n";
} else {
    echo "<table class=\"list sortable\">\n<thead>\n" . "<tr><th>ID</th>" . "<th>shortname</th>" . "<th>name</th>" . "<th>country</th>" . "<th>#teams</th>" . "<th></th></tr>\n</thead>\n<tbody>\n";
    while ($row = $res->next()) {
        $countryflag = "../images/countries/" . urlencode($row['country']) . ".png";
        $link = '<a href="team_affiliation.php?id=' . urlencode($row['affilid']) . '">';
        echo '<tr><td>' . $link . htmlspecialchars($row['affilid']) . '</a></td><td>' . $link . htmlspecialchars($row['shortname']) . '</a></td><td>' . $link . htmlspecialchars($row['name']) . '</a></td><td class="tdcenter">' . $link . htmlspecialchars($row['country']) . (is_readable($countryflag) ? ' <img src="' . $countryflag . '" alt="' . htmlspecialchars($row['country']) . '" />' : '&nbsp;') . '</a></td><td class="tdright">' . $link . (int) $row['cnt'] . '</a></td>';
        if (IS_ADMIN) {
            echo "<td class=\"editdel\">" . editLink('team_affiliation', $row['affilid']) . "&nbsp;" . delLink('team_affiliation', 'affilid', $row['affilid']) . "</td>";
        }
        echo "</tr>\n";
    }
    echo "</tbody>\n</table>\n\n";
}
if (IS_ADMIN) {
    echo "<p>" . addLink('team_affiliation') . "</p>\n\n";
}
require LIBWWWDIR . '/footer.php';
Example #3
0
     $rid = getRequestVar('rid');
     deleteRSS($rid);
     break;
 case "editLink":
     $lid = getRequestVar('lid');
     $editLink = getRequestVar('editLink');
     $editSite = getRequestVar('editSite');
     editLink($lid, $editLink, $editSite);
     break;
 case "editLinks":
     editLinks();
     break;
 case "addLink":
     $newLink = getRequestVar('newLink');
     $newSite = getRequestVar('newSite');
     addLink($newLink, $newSite);
     break;
 case "moveLink":
     $lid = getRequestVar('lid');
     $direction = getRequestVar('direction');
     moveLink($lid, $direction);
     break;
 case "deleteLink":
     $lid = getRequestVar('lid');
     deleteLink($lid);
     break;
 case "CreateUser":
     CreateUser();
     break;
 case "addUser":
     $newUser = getRequestVar('newUser');
Example #4
0
    }
    echo "<th scope=\"col\">process<br />balloons?</th>";
    echo "<th scope=\"col\">public?</th>";
    echo "<th scope=\"col\" class=\"sorttable_numeric\"># teams</th>";
    echo "<th scope=\"col\" class=\"sorttable_numeric\"># problems</th>";
    echo "<th scope=\"col\">name</th>" . (IS_ADMIN ? "<th scope=\"col\"></th>" : '') . "</tr>\n</thead>\n<tbody>\n";
    $iseven = false;
    foreach ($res as $row) {
        $link = '<a href="contest.php?id=' . urlencode($row['cid']) . '">';
        echo '<tr class="' . ($iseven ? 'roweven' : 'rowodd') . (!$row['enabled'] ? ' disabled' : '') . (in_array($row['cid'], $curcids) ? ' highlight' : '') . '">' . "<td class=\"tdright\">" . $link . "c" . (int) $row['cid'] . "</a></td>\n";
        echo "<td>" . $link . specialchars($row['shortname']) . "</a></td>\n";
        foreach ($times as $time) {
            echo "<td title=\"" . printtime(@$row[$time . 'time'], '%Y-%m-%d %H:%M:%S (%Z)') . "\">" . $link . (isset($row[$time . 'time']) ? printtime($row[$time . 'time']) : '-') . "</a></td>\n";
        }
        echo "<td>" . $link . ($row['process_balloons'] ? 'yes' : 'no') . "</a></td>\n";
        echo "<td>" . $link . ($row['public'] ? 'yes' : 'no') . "</a></td>\n";
        echo "<td>" . $link . ($row['public'] ? '<em>all</em>' : $row['numteams']) . "</a></td>\n";
        echo "<td>" . $link . $numprobs[$row['cid']] . "</a></td>\n";
        echo "<td>" . $link . specialchars($row['name']) . "</a></td>\n";
        $iseven = !$iseven;
        if (IS_ADMIN) {
            echo "<td class=\"editdel\">" . editLink('contest', $row['cid']) . "&nbsp;" . delLink('contest', 'cid', $row['cid']) . "</td>\n";
        }
        echo "</tr>\n";
    }
    echo "</tbody>\n</table>\n\n";
}
if (IS_ADMIN) {
    echo "<p>" . addLink('contest') . "</p>\n\n";
}
require LIBWWWDIR . '/footer.php';
Example #5
0
    loadPlayers($data);
}
if ($type == "loadUsers") {
    loadUsers();
}
if ($type == "addPlayer") {
    addPlayer($data);
}
if ($type == "loadChalleneges") {
    loadChalleneges();
}
if ($type == "loadChallengeText") {
    loadChallengeText();
}
if ($type == "addLink") {
    addLink($data);
}
if ($type == "loadLinks") {
    loadLinks($data);
}
if ($type == "getTeamRating") {
    getTeamRating($data);
}
if ($type == "getTeamRanking") {
    getTeamRanking($data);
}
if ($type == "getWinners") {
    getWinners($data);
}
if ($type == "getTodaysChallenge") {
    getTodaysChallenge($data);
    }
    $_POST['data'][0]['restrictions'] = json_encode($_POST['data'][0]['restrictions']);
    require_once 'edit.php';
    exit;
}
require 'init.php';
$title = 'Judgehost restrictions';
require LIBWWWDIR . '/header.php';
echo "<h1>Judgehost Restrictions</h1>\n\n";
$res = $DB->q('SELECT judgehost_restriction.*, COUNT(hostname) AS numjudgehosts
               FROM judgehost_restriction LEFT JOIN judgehost USING (restrictionid)
               GROUP BY judgehost_restriction.restrictionid ORDER BY restrictionid');
if ($res->count() == 0) {
    echo "<p class=\"nodata\">No judgehost restrictions defined</p>\n\n";
} else {
    echo "<table class=\"list sortable\">\n<thead>\n" . "<tr><th scope=\"col\">ID</th>" . "<th scope=\"col\">name</th><th scope=\"col\">#contests</th>\n" . "<th scope=\"col\">#problems</th><th scope=\"col\">#languages</th>\n" . "<th scope=\"col\">#linked judgehosts</th>\n" . "<th scope=\"col\"></th>\n" . "</thead>\n<tbody>\n";
    while ($row = $res->next()) {
        $restrictions = json_decode($row['restrictions'], true);
        $link = '<a href="judgehost_restriction.php?id=' . (int) $row['restrictionid'] . '">';
        echo '<tr><td>' . $link . (int) $row['restrictionid'] . '</a></td><td>' . $link . specialchars($row['name']) . '</a></td><td class="tdright">' . $link . count($restrictions['contest']) . '</a></td><td class="tdright">' . $link . count($restrictions['problem']) . '</a></td><td class="tdright">' . $link . count($restrictions['language']) . '</a></td><td class="tdright">' . $link . (int) $row['numjudgehosts'] . '</a></td>';
        if (IS_ADMIN) {
            echo "<td class=\"editdel\">" . editLink('judgehost_restriction', $row['restrictionid']) . "&nbsp;" . delLink('judgehost_restriction', 'restrictionid', $row['restrictionid']) . "</td>";
        }
        echo "</tr>\n";
    }
    echo "</tbody>\n</table>\n\n";
}
if (IS_ADMIN) {
    echo "<p>" . addLink('judgehost_restriction') . "</p>\n\n";
}
require LIBWWWDIR . '/footer.php';
Example #7
0
    $op = isset($_GET['op']) ? $_GET['op'] : 'main';
} else {
    $op = $_POST['op'];
}
switch ($op) {
    case "delNewLink":
        delNewLink();
        break;
    case "approve":
        approve();
        break;
    case "addCat":
        addCat();
        break;
    case "addLink":
        addLink();
        break;
    case "listBrokenLinks":
        listBrokenLinks();
        break;
    case "delBrokenLinks":
        delBrokenLinks();
        break;
    case "ignoreBrokenLinks":
        ignoreBrokenLinks();
        break;
    case "listModReq":
        listModReq();
        break;
    case "changeModReq":
        changeModReq();
Example #8
0
<?php

/// Copyright (c) 2004-2015, Needlworks  / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
$IV = array('POST' => array('name' => array('string'), 'rss' => array('string', 'default' => ''), 'url' => array('string'), 'category' => array('int', 'mandatory' => false), 'newCategory' => array('string', 'mandatory' => false)));
require ROOT . '/library/preprocessor.php';
importlib("model.blog.link");
requireStrictRoute();
if (strpos($_POST['rss'], 'http://') !== 0) {
    $_POST['rss'] = 'http://' . $_POST['rss'];
}
if (strpos($_POST['url'], 'http://') !== 0) {
    $_POST['url'] = 'http://' . $_POST['url'];
}
Respond::ResultPage(addLink($blogid, $_POST));
Example #9
0
require LIBWWWDIR . '/header.php';
echo "<h1>Users</h1>\n\n";
if ($users->count() == 0) {
    echo "<p class=\"nodata\">No users defined</p>\n\n";
} else {
    echo "<table class=\"list sortable\">\n<thead>\n" . "<tr><th scope=\"col\">username</th><th scope=\"col\">name</th>" . "<th scope=\"col\">email</th><th scope=\"col\">roles</th>" . "<th scope=\"col\">team</th>" . "<th class=\"thleft\" scope=\"col\">status</th><th></th>" . "</tr>\n</thead>\n<tbody>\n";
    while ($row = $users->next()) {
        $status = 0;
        if (isset($row['last_login'])) {
            $status = 1;
        }
        $link = '<a href="user.php?id=' . urlencode($row['userid']) . '">';
        echo "<tr class=\"" . ($row['enabled'] == 1 ? '' : 'sub_ignore') . "\">" . "<td class=\"username\">" . $link . specialchars($row['username']) . "</a></td>" . "<td>" . $link . specialchars($row['name']) . "</a></td>" . "<td>" . $link . (isset($row['email']) ? specialchars($row['email']) : '&nbsp;') . "</a></td>" . "<td>" . $link . specialchars($row['roles']) . "</a></td>" . "<td>" . $link . (isset($row['teamid']) ? "t" . specialchars($row['teamid']) : '&nbsp;') . "</a></td>";
        echo "<td sorttable_customkey=\"" . $status . "\" class=\"";
        if ($status == 1) {
            echo 'team-ok" title="logged in: ' . printtime($row['last_login']) . '"';
        } else {
            echo 'team-nocon" title="no connections made"';
        }
        echo ">{$link}" . CIRCLE_SYM . "</a></td>";
        if (IS_ADMIN) {
            echo "<td class=\"editdel\">" . editLink('user', $row['userid']) . "&nbsp;" . delLink('user', 'userid', $row['userid'], $row['name']) . "</td>";
        }
        echo "</tr>\n";
    }
    echo "</tbody>\n</table>\n\n";
}
if (IS_ADMIN) {
    echo "<p>" . addLink('user') . "</p>\n";
}
require LIBWWWDIR . '/footer.php';
Example #10
0
            echo "\">" . $link . "-";
        }
        echo "</a></td><td>" . $link . ($row['room'] ? htmlspecialchars($row['room']) : '&nbsp;') . "</a></td>";
        echo "<td class=\"";
        switch ($status) {
            case 0:
                echo 'team-nocon" title="no connections made"';
                break;
            case 1:
                echo 'team-nosub" title="teampage viewed, no submissions"';
                break;
            case 2:
                echo 'team-nocor" title="submitted, none correct"';
                break;
            case 3:
                echo 'team-ok" title="correct submission(s)"';
                break;
        }
        echo ">{$link}" . CIRCLE_SYM . "</a></td>";
        echo "<td class=\"teamstat\" title=\"{$numcor} correct / {$numsub} submitted\">{$link}{$numcor} / {$numsub}</a></td>";
        if (IS_ADMIN) {
            echo "<td class=\"editdel\">" . editLink('team', $row['teamid']) . " " . delLink('team', 'teamid', $row['teamid']) . "</td>";
        }
        echo "</tr>\n";
    }
    echo "</tbody>\n</table>\n\n";
}
if (IS_ADMIN) {
    echo "<p>" . addLink('team') . "</p>\n";
}
require LIBWWWDIR . '/footer.php';
Example #11
0
function addWeeks($max)
{
    global $LANG_TXT_WEEKS, $LANG_TXT_DAYS;
    echo '<center>';
    addText($LANG_TXT_WEEKS);
    addSpace(5);
    $idx = 0;
    $from = strtotime('last monday', time());
    for ($i = 0; $i < $max; $i++) {
        addLink('from', gmdate("m/d", $from), 3);
        $idx += 1;
        if ($idx == 10) {
            echo '<br>';
            $idx = 0;
        }
        $from = strtotime('last monday', $from);
    }
    echo '</center>';
    echo '<center>';
    addText($LANG_TXT_DAYS . ":");
    addSpace(5);
    $from = strtotime('last monday', time());
    $idx = 0;
    for ($i = 0; $i < 7; $i++) {
        addLink('fromday', gmdate("d", $from), 3);
        $idx += 1;
        if ($idx == 10) {
            echo '<br>';
            $idx = 0;
        }
        $from = strtotime('tomorrow', $from);
    }
    echo '</center>';
}
Example #12
0
            function addLink($string)
            {
                $pattern = '/((ftp|http|https):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!\\-\\/]))?)/i';
                $replacement = '<a class="tweet_url" href="$1">$1</a>';
                $string = preg_replace($pattern, $replacement, $string);
                return $string;
            }
        } else {
            function addLink($string)
            {
                return $string;
            }
        }
        echo '<div id="twitter-feed">';
        echo '<div class="twitter-username"><img src="' . base_url('media/modules/tweet/twitter_bird.png') . '" width="45" height="30" alt="Follow us on Twitter">
			Follow <a href="http://twitter.com/' . $content->username . '" target="_blank">' . $content->username . '</a> on Twitter</div>';
        if (is_array($string) && empty($string['errors'])) {
            foreach ($string as $items) {
                echo '<div class="twitter-article">';
                if (isset($content->show_picture) && $content->show_picture == 'show') {
                    echo '<div class="twitter-pic"><a href="https://twitter.com/' . $items['user']['screen_name'] . '" ><img src="' . $items['user']['profile_image_url_https'] . '" width="42" height="42" alt="twitter avatar" /></a></div>';
                }
                echo '<div class="twitter-text"><p><span class="tweetprofilelink"><strong><a href="https://twitter.com/' . $items['user']['screen_name'] . '" >' . $items['user']['name'] . '</a></strong> <a href="https://twitter.com/' . $items['user']['screen_name'] . '" >@' . $items['user']['screen_name'] . '</a></span><span class="tweet-time"><a href="https://twitter.com/' . $items['user']['screen_name'] . '/status/' . $items['id_str'] . '"></a></span><br/>' . addLink($items['text']) . '</p></div>';
                echo '</div>';
            }
        }
        echo '</div>';
    }
} else {
    echo 'Data not found';
}
Example #13
0
     $link_from_object = $sel_object;
     $link_from_sid = $sys_id;
 }
 if ($post_action == 'post_add_link_to') {
     $link_from_object = $par['a3_link_from_object'];
     $link_from_sid = $par['a3_link_from_sid'];
     // 	$link_to_object   = $par['a3_link_to_object'];
     // 	$link_to_sid      = $par['a3_link_to_sid'];
     $link_to_object = $sel_object;
     $link_to_sid = $sys_id;
     //echo("from_sid=	$link_from_sid to_sid= $link_to_sid <br>");
     $from_struct = $a3pr[$link_from_sid]['a3_db'];
     // 	$to_struct   = $a3pr[$link_to_sid]['a3_db'];
     $to_struct = $sel_db;
     //echo("addLink($from_struct,$link_from_object,$to_struct,$link_to_object)");
     addLink($from_struct, $link_from_object, $to_struct, $link_to_object);
     //$par['a3_link_to_object']   = $sel_object;
     // Clear from destination
     $par['a3_link_from_object'] = 0;
     $par['a3_link_from_sid'] = 0;
     $par['a3_link_to_object'] = 0;
     $par['a3_link_to_sid'] = 0;
 }
 if ($post_action == 'post_add_link_cancel') {
     $par['a3_link_from_object'] = 0;
     $par['a3_link_from_sid'] = 0;
     $link_from_object = 0;
     $link_from_sid = 0;
 }
 if ($post_action == 'post_set_image') {
     if ($sel_db && $sel_object) {
Example #14
0
<?php

/**
 * View the languages
 *
 * Part of the DOMjudge Programming Contest Jury System and licenced
 * under the GNU GPL. See README and COPYING for details.
 */
require 'init.php';
$title = 'Languages';
require LIBWWWDIR . '/header.php';
echo "<h1>Languages</h1>\n\n";
$res = $DB->q('SELECT * FROM language ORDER BY name');
if ($res->count() == 0) {
    echo "<p class=\"nodata\">No languages defined</p>\n\n";
} else {
    echo "<table class=\"list sortable\">\n<thead>\n" . "<tr><th scope=\"col\">ID/ext</th><th scope=\"col\">name</th>" . "<th scope=\"col\">allow<br />submit</th>" . "<th scope=\"col\">allow<br />judge</th><th scope=\"col\">timefactor</th>" . "<th scope=\"col\">extensions</th><th scope=\"col\"></th>" . "</tr>\n</thead>\n<tbody>\n";
    while ($row = $res->next()) {
        $link = '<a href="language.php?id=' . urlencode($row['langid']) . '">';
        echo "<tr" . ($row['allow_submit'] ? '' : ' class="disabled"') . "><td>" . $link . specialchars($row['langid']) . "</a>" . "</td><td>" . $link . specialchars($row['name']) . "</a>" . "</td><td>" . $link . printyn($row['allow_submit']) . "</a>" . "</td><td>" . $link . printyn($row['allow_judge']) . "</a>" . "</td><td>" . $link . specialchars($row['time_factor']) . "</a>" . "</td><td>" . $link . specialchars(implode(', ', json_decode($row['extensions']))) . "</a>";
        if (IS_ADMIN) {
            echo "</td><td class=\"editdel\">" . editLink('language', $row['langid']) . "&nbsp;" . delLink('language', 'langid', $row['langid']);
        }
        echo "</td></tr>\n";
    }
    echo "</tbody>\n</table>\n\n";
}
if (IS_ADMIN) {
    echo "<p>" . addLink('language') . "</p>\n\n";
}
require LIBWWWDIR . '/footer.php';
Example #15
0
     $response = deleteTag($_REQUEST['url'], $_REQUEST['url_parameter'], $_REQUEST['tag']);
     break;
 case "get_pages_with_tag":
     $response = getPagesWithTag($_REQUEST['tag']);
     break;
 case "follow_contact":
     $response = followContact($_REQUEST['username']);
     break;
 case "unfollow_contact":
     $response = unfollowContact($_REQUEST['username']);
     break;
 case "get_contact_list":
     $response = getContactList();
     break;
 case "add_link":
     $response = addLink($_REQUEST['from_url'], $_REQUEST['from_url_param'], $_REQUEST['to_url'], $_REQUEST['to_url_param'], $_REQUEST['note']);
     break;
 case "delete_link":
     $response = deleteLink($_REQUEST['from_url'], $_REQUEST['from_url_param'], $_REQUEST['to_url'], $_REQUEST['to_url_param']);
     break;
 case "get_links":
     $response = getLinks($_REQUEST['url'], $_REQUEST['url_param']);
     break;
 case "rate_link":
     $response = rateLink($_REQUEST['from_url'], $_REQUEST['from_url_param'], $_REQUEST['to_url'], $_REQUEST['to_url_param'], $_REQUEST['up']);
     break;
 case "get_link_comment":
     $response = getLinkComment($_REQUEST['from_url'], $_REQUEST['from_url_param'], $_REQUEST['to_url'], $_REQUEST['to_url_param']);
     break;
 case "verify_user":
     $response = verifyUser($_REQUEST['confirm_code']);
Example #16
0
 * under the GNU GPL. See README and COPYING for details.
 */
require 'init.php';
$title = 'Executables';
require LIBWWWDIR . '/header.php';
echo "<h1>Executables</h1>\n\n";
// Select all data, sort problems from the current contest on top.
$res = $DB->q('SELECT execid, description, md5sum, type, OCTET_LENGTH(zipfile) AS size
               FROM executable ORDER BY execid');
if ($res->count() == 0) {
    echo "<p class=\"nodata\">No executables defined</p>\n\n";
} else {
    echo "<table class=\"list sortable\">\n<thead>\n" . "<tr><th scope=\"col\">ID</th><th scope=\"col\">type</th>" . "<th scope=\"col\">description</th>" . "<th scope=\"col\">size</th><th scope=\"col\">md5</th>" . "<th></th><th></th></tr></thead>\n<tbody>\n";
    $lastcid = -1;
    while ($row = $res->next()) {
        $link = '<a href="executable.php?id=' . urlencode($row['execid']) . '">';
        echo "<tr><td class=\"execid\">" . $link . htmlspecialchars($row['execid']) . "</a>" . "</td><td>" . $link . htmlspecialchars($row['type']) . "</a>" . "</td><td>" . $link . htmlspecialchars(str_cut($row['description'], 40)) . "</a>" . "</td><td class=\"size\">" . $link . printsize($row['size']) . "</a>" . "</td><td class=\"md5\">" . $link . htmlspecialchars($row['md5sum']) . "</a>" . "</td>";
        if (IS_ADMIN) {
            echo '<td title="export executable as zip-file"><a href="executable.php?fetch&amp;id=' . urlencode($row['execid']) . '"><img src="../images/b_save.png" alt="export" /></a></td>' . "<td class=\"editdel\">" . editLink('executable', $row['execid']) . "&nbsp;" . delLink('executable', 'execid', $row['execid']) . "</td>";
        }
        echo "</tr>\n";
    }
    echo "</tbody>\n</table>\n\n";
}
if (IS_ADMIN) {
    echo "<p>" . addLink('executable') . "</p>\n\n";
    if (class_exists("ZipArchive")) {
        echo "\n" . addForm('executable.php', 'post', null, 'multipart/form-data') . 'Executable archive(s): ' . addSelect('type', $executable_types) . addFileField('executable_archive[]', null, ' required multiple accept="application/zip"') . addSubmit('Upload', 'upload') . addEndForm() . "\n";
    }
}
require LIBWWWDIR . '/footer.php';
Example #17
0
     break;
 case 'uppProfile':
     //FROM PROFILE API
     echo updateProfile($conn);
     // -->
     break;
 case 'addAccounts':
     //FROM ACCOUNTS API
     echo addToGcash_Accounts($conn);
     break;
 case 'updAccounts':
     //FROM ACCOUNTS API
     echo updateToGcash_Accounts($conn);
     break;
 case 'addLink':
     echo addLink($conn);
     break;
 case 'updLink':
     echo updLink($conn);
     break;
 case 'validate_coop':
     echo validate_coopORsubs($conn);
     // -->
     break;
 case 'withdraw_logs':
     echo withdraw_logs($conn);
     // -->
     break;
 case 'deposit_logs':
     echo deposit_logs($conn);
     // -->
Example #18
0
        $classes = array();
        if (!isset($activecontests[$row['probid']])) {
            $classes[] = 'disabled';
        }
        $link = '<a href="problem.php?id=' . urlencode($row['probid']) . '">';
        echo "<tr class=\"" . implode(' ', $classes) . "\"><td>" . $link . "p" . specialchars($row['probid']) . "</a>" . "</td><td>" . $link . specialchars($row['name']) . "</a>" . "</td><td>" . $link . specialchars(isset($activecontests[$row['probid']]) ? $activecontests[$row['probid']] : 0) . "</a>" . "</td><td>" . $link . (int) $row['timelimit'] . "</a>" . "</td><td>" . $link . (isset($row['memlimit']) ? (int) $row['memlimit'] : 'default') . "</a>" . "</td><td>" . $link . (isset($row['outputlimit']) ? (int) $row['outputlimit'] : 'default') . "</a>" . "</td><td><a href=\"testcase.php?probid=" . $row['probid'] . "\">" . $row['testcases'] . "</a></td>";
        if (!empty($row['problemtext_type'])) {
            echo '<td title="view problem description">' . '<a href="problem.php?id=' . urlencode($row['probid']) . '&amp;cmd=viewtext"><img src="../images/' . urlencode($row['problemtext_type']) . '.png" alt="problem text" /></a></td>';
        } else {
            echo '<td></td>';
        }
        if (IS_ADMIN) {
            echo '<td title="export problem as zip-file">' . exportLink($row['probid']) . '</td>' . "<td class=\"editdel\">" . editLink('problem', $row['probid']) . "&nbsp;" . delLink('problem', 'probid', $row['probid']) . "</td>";
        }
        echo "</tr>\n";
    }
    echo "</tbody>\n</table>\n\n";
}
if (IS_ADMIN) {
    echo "<p>" . addLink('problem') . "</p>\n\n";
    if (class_exists("ZipArchive")) {
        $selected_cid = $cid === null ? -1 : $cid;
        $contests = $DB->q("KEYVALUETABLE SELECT cid,\n\t\t                    CONCAT('c', cid, ': ', shortname, ' - ', name) FROM contest");
        $values = array(-1 => 'Do not link to a contest');
        foreach ($contests as $cid => $contest) {
            $values[$cid] = $contest;
        }
        echo "\n" . addForm('problem.php', 'post', null, 'multipart/form-data') . 'Contest: ' . addSelect('contest', $values, $selected_cid, true) . 'Problem archive(s): ' . addFileField('problem_archive[]', null, ' required multiple accept="application/zip"') . addSubmit('Upload', 'upload') . addEndForm() . "\n";
    }
}
require LIBWWWDIR . '/footer.php';
Example #19
0
function updateLinks()
{
    global $logger;
    $logger->info('UPDATE LINKS');
    $resPirate = array();
    //parallel RollingCurl
    RollingCurl::$rc = new RollingCurl("main_callback");
    // the window size determines how many simultaneous requests to allow.
    RollingCurl::$rc->window_size = 5;
    //List of tracker loaders
    $loaders = array();
    $rutorMain = RUTORROOT;
    $loaders[] = new RutorLoader("{$rutorMain}/browse/0/1/0/2/");
    //foreign movies
    $loaders[] = new RutorLoader("{$rutorMain}/browse/1/1/0/2/");
    $loaders[] = new RutorLoader("{$rutorMain}/browse/2/1/0/2/");
    $loaders[] = new RutorLoader("{$rutorMain}/browse/3/1/0/2/");
    $loaders[] = new RutorLoader("{$rutorMain}/browse/4/1/0/2/");
    $loaders[] = new RutorLoader("{$rutorMain}/browse/5/1/0/2/");
    $loaders[] = new RutorLoader("{$rutorMain}/browse/6/1/0/2/");
    $loaders[] = new RutorLoader("{$rutorMain}/browse/7/1/0/2/");
    $loaders[] = new RutorLoader("{$rutorMain}/browse/8/1/0/2/");
    $loaders[] = new RutorLoader("{$rutorMain}/browse/9/1/0/2/");
    $loaders[] = new RutorLoader("{$rutorMain}/browse/10/1/0/2/");
    $loaders[] = new RutorLoader("{$rutorMain}/browse/11/1/0/2/");
    $loaders[] = new RutorLoader("{$rutorMain}/browse/12/1/0/2/");
    $loaders[] = new RutorLoader("{$rutorMain}/browse/13/1/0/2/");
    $loaders[] = new RutorLoader("{$rutorMain}/browse/0/7/0/2/");
    //multiplication
    $loaders[] = new RutorLoader("{$rutorMain}/browse/0/5/0/2");
    //russian movies
    $loaders[] = new RutorLoader("{$rutorMain}/browse/1/5/0/2");
    $NNMData = array("prev_sd" => 0, "prev_a" => 0, "prev_my" => 0, "prev_n" => 0, "prev_shc" => 0, "prev_shf" => 1, "prev_sha" => 1, "prev_shs" => 0, "prev_shr" => 0, "prev_sht" => 0, "f[0]" => 270, "o" => 10, "s" => 2, "tm" => -1, "ta" => -1, "sns" => -1, "sds" => -1, "nm" => "", "pn" => "");
    $loaders[] = new NNMLoader("http://nnm-club.me/forum/tracker.php", $NNMData);
    $NNMData["f[0]"] = 218;
    $loaders[] = new NNMLoader("http://nnm-club.me/forum/tracker.php", $NNMData);
    $NNMData["f[0]"] = 217;
    $NNMData["f[1]"] = 954;
    $loaders[] = new NNMLoader("http://nnm-club.me/forum/tracker.php", $NNMData);
    $pirateMain = PIRATEROOT;
    $loaders[] = new PirateLoader("{$pirateMain}/browse/201/0/7/0");
    /*
    $resPirate1 = new Pirate;
    $resPirate1->getPirateBay("https://pirateproxy.sx/browse/207/0/7");
    $resPirate2 = new Pirate;
    $resPirate2->getPirateBay("https://pirateproxy.sx/browse/207/1/7");
    $resPirate3 = new Pirate;
    $resPirate3->getPirateBay("https://pirateproxy.sx/browse/201/0/7");
    $resPirate = array_merge($resPirate1->result, $resPirate2->result, $resPirate3->result, $resRutor, $resSeedoff);
    flush();
    */
    foreach ($loaders as $loader) {
        $loader->setLogger($logger);
        $loader->load();
    }
    RollingCurl::$rc->execute();
    //result array with torrent infos
    $result = array();
    foreach ($loaders as $loader) {
        $result = array_merge($result, $loader->getResult());
    }
    $resSeedoff = array();
    $resSeedoff = seedoff\getSeedoff();
    $resSeedoff = array_merge($resSeedoff, seedoff\getSeedoff("http://www.seedoff.net/index.php?page=ajax&active=0&options=0&recommend=0&sticky=0&period=0&category=14&options=0&order=5&by=2&pages=2"));
    $resSeedoff = array_merge($resSeedoff, seedoff\getSeedoff("http://www.seedoff.net/index.php?page=ajax&active=0&options=0&recommend=0&sticky=0&period=0&category=14&options=0&order=5&by=2&pages=3"));
    $resSeedoff = array_merge($resSeedoff, seedoff\getSeedoff("http://www.seedoff.net/index.php?page=ajax&active=0&options=0&recommend=0&sticky=0&period=0&category=64&options=0&order=5&by=2&pages=1"));
    $result = array_merge($result, $resSeedoff);
    foreach ($result as $cur) {
        if (trySkip($cur)) {
            continue;
        }
        getIds($cur['title_approx'], $cur);
        $logger->info("add link: " . $cur['title_approx'] . "::" . $cur['description'] . "::" . $cur['link']);
        $res = addLink($cur);
        if ($res !== 0) {
            $logger->warning("link was not added: {$res}");
        }
        usleep(100 * 1000);
    }
    $logger->info(count($result) . " links updated");
}
Example #20
0
            } else {
                if ($reltime < dbconfig_get('judgehost_critical', 120)) {
                    echo "judgehost-warn";
                } else {
                    echo "judgehost-crit";
                }
            }
            echo "\" title =\"last checked in {$reltime} seconds ago\">";
        }
        echo $link . CIRCLE_SYM . "</a></td>";
        echo "<td>" . $link . (is_null($row['name']) ? '<i>none</i>' : $row['name']) . '</a></td>';
        echo "<td title=\"load during the last 2 and 10 minutes and the whole contest\">" . $link . sprintf('%.2f&nbsp;%.2f&nbsp;%.2f', @$work2min[$row['hostname']] / (2 * 60), @$work10min[$row['hostname']] / (10 * 60), @$workcontest[$row['hostname']] / $clen) . "</a></td>";
        if (IS_ADMIN) {
            if ($row['active']) {
                $activepicto = "pause";
                $activecmd = "deactivate";
            } else {
                $activepicto = "play";
                $activecmd = "activate";
            }
            echo "<td><a href=\"judgehost.php?id=" . $row['hostname'] . "&amp;cmd=" . $activecmd . "\"><img class=\"picto\" alt=\"" . $activecmd . "\" title=\"" . $activecmd . " judgehost\" " . "src=\"../images/" . $activepicto . ".png\" /></a></td>";
            echo "<td>" . delLink('judgehost', 'hostname', $row['hostname']) . "</td>";
        }
        echo "</tr>\n";
    }
    echo "</tbody>\n</table>\n\n";
}
if (IS_ADMIN) {
    echo addForm($pagename) . "<p>" . addSubmit('Start all judgehosts', 'cmd-activate') . addSubmit('Stop all judgehosts', 'cmd-deactivate') . "<br /><br />\n\n" . addLink('judgehosts', true) . "\n" . editLink('judgehosts', null, true) . "</p>\n" . addEndForm();
}
require LIBWWWDIR . '/footer.php';
Example #21
0
/**
 * View the categories
 *
 * Part of the DOMjudge Programming Contest Jury System and licenced
 * under the GNU GPL. See README and COPYING for details.
 */
require 'init.php';
$title = 'Categories';
require LIBWWWDIR . '/header.php';
echo "<h1>Categories</h1>\n\n";
$res = $DB->q('SELECT team_category.*, COUNT(teamid) AS numteams
               FROM team_category LEFT JOIN team USING (categoryid)
               GROUP BY team_category.categoryid ORDER BY sortorder, categoryid');
if ($res->count() == 0) {
    echo "<p class=\"nodata\">No categories defined</p>\n\n";
} else {
    echo "<table class=\"list sortable\">\n<thead>\n" . "<tr><th scope=\"col\">ID</th><th scope=\"col\">sort</th>" . "<th scope=\"col\">name</th><th scope=\"col\">#teams</th>" . "<th scope=\"col\">visible</th><th scope=\"col\"></th></tr>\n" . "</thead>\n<tbody>\n";
    while ($row = $res->next()) {
        $link = '<a href="team_category.php?id=' . (int) $row['categoryid'] . '">';
        echo '<tr' . (isset($row['color']) ? ' style="background: ' . $row['color'] . ';"' : '') . '><td>' . $link . (int) $row['categoryid'] . '</a></td><td>' . $link . (int) $row['sortorder'] . '</a></td><td>' . $link . htmlspecialchars($row['name']) . '</a></td><td class="tdright">' . $link . (int) $row['numteams'] . '</a></td><td class="tdcenter">' . $link . printyn($row['visible']) . '</a></td>';
        if (IS_ADMIN) {
            echo "<td class=\"editdel\">" . editLink('team_category', $row['categoryid']) . " " . delLink('team_category', 'categoryid', $row['categoryid']) . "</td>";
        }
        echo "</tr>\n";
    }
    echo "</tbody>\n</table>\n\n";
}
if (IS_ADMIN) {
    echo "<p>" . addLink('team_category') . "</p>\n\n";
}
require LIBWWWDIR . '/footer.php';
Example #22
0
 // From this point, an UI is required.
 $message = NULL;
 $messageType = NULL;
 $statsShortURL = str_replace('+', '', $query);
 // Form protection
 if (isset($_SESSION['form_protection'])) {
     if ($_POST['form_protection'] != $_SESSION['form_protection']) {
         $_POST = array();
     }
 }
 $_SESSION['form_protection'] = hash('sha256', mt_rand());
 $shortURL = NULL;
 if (isset($_POST['url'])) {
     $url = $_POST['url'];
     $link = isset($_POST['link']) ? $_POST['link'] : NULL;
     $shortURL = addLink($data, $url, $link);
     if ($shortURL === false) {
         $message = 'An error occurred. The link is probably invalid.';
         $messageType = MESSAGE_FAIL;
     } else {
         $message = 'Your link has been saved. The link is: <br />';
         $message .= '<a href="' . generateURL($shortURL) . '+" class="notifLink">' . generateURL($shortURL) . '</a>';
         $messageType = MESSAGE_SUCCESS;
         $_POST['url'] = NULL;
         $_POST['link'] = NULL;
     }
 }
 if ($page == PAGE_DELETE) {
     $link = $_GET['link'];
     // First: is the user allowed to delete the link?
     if (isLinkFree($data, $link)) {
Example #23
0
        addLink('', $_GET['dashboard'], true, $LANG_TEXT_BACK_TO_DASHBOARD);
        addLink('type', 'line2', true, $LANG_TXT_AVERAGE_BY_PLAN);
        addLink('type', 'linehour', true, $LANG_TXT_AVEGARE_BY_HOUR);
    }
    if ($_GET['type'] == 'lineSonda') {
        echo '<div id="item1"></div>';
        $chart1 = new Highchart();
        $chart1 = GraphSonda($chart1, "item1", $_GET['idplan'], $_GET['iditem'], $_GET['from'], $_GET['avg'], $_GET['tag']);
        renderChart($chart1, "item1");
        addFromLink();
        addAverageLink();
        addTagLink('None');
        addQoE(true);
        addFilterLink(array('None', 'P5', 'P95', 'Peak Hour', 'Off Peak Hour', '> 0', '< 1.5x', '< 2.0x', '< 3.0x'));
        addSpace(5);
        addLink('type', 'line2', true, $LANG_TEXT_BACK_TO_AVERAGE_BY_PLAN);
        //if ($_GET['dashboard'] == 'Video' || $_GET['dashboard'] == 'Ping' || $_GET['dashboard'] == 'File' || $_GET['dashboard'] == 'YouTube') addLink('type','group',false,'Group of Similar Test for Plan ' . $_GET['plan']);
    }
} else {
    resetParameter('from');
    addTagLink('None', true, $_GET['tag']);
    addFilterLink(array('None', 'P5', 'P95', '> 0', '< 1.5x', '< 2.0x', '< 3.0x'));
    Dashboard($_GET['dashboard'], $_GET['plan'], $_GET['tag'], $_POST['move']);
}
echo '<br><small>';
if ($_SESSION['cacheFull']) {
    echo '<center>' . $LANG_TXT_DATA_FROM_CACHE . '</center>';
} elseif ($_SESSION['cachePartial']) {
    echo '<center>' . $LANG_TXT_SOME_DATA_FROM_CACHE . '</center>';
} else {
    echo '<center>' . $LANG_TXT_DATA_FROM_DB . '</center>';