Ejemplo n.º 1
0
function Navigation_IE($p)
{
    global $SET;
    $navbar = "";
    if ($_SESSION['style']) {
        $navbar = "navbar-inverse";
    }
    HTML("<div id='nav' class='navbar {$navbar}'>");
    HTML("<div class='navbar-inner'>");
    HTML("<div class='container-fluid'>");
    HTML("<a href='" . 路径("index.php") . "' class='brand'>COGS</a>");
    HTML("<a class='btn btn-navbar' data-toggle='collapse' data-target='.nav-collapse'><span class='icon-bar'></span><span class='icon-bar'></span><span class='icon-bar'></span></a>");
    HTML("<div class='nav-collapse'>");
    HTML("<ul class='nav'>");
    if (strpos($SET['cur'], "comment")) {
        $active['comment'] = 'active';
    } else {
        if (strpos($SET['cur'], "contest")) {
            $active['contest'] = 'active';
        } else {
            if (strpos($SET['cur'], "problem")) {
                $active['problem'] = 'active';
            } else {
                if (strpos($SET['cur'], "submit")) {
                    $active['submit'] = 'active';
                } else {
                    if (strpos($SET['cur'], "page")) {
                        $active['page'] = 'active';
                    } else {
                        if (strpos($SET['cur'], "user")) {
                            $active['user'] = '******';
                        } else {
                            if (strpos($SET['cur'], "docs")) {
                                $active['docs'] = 'active';
                            } else {
                                if (strpos($SET['cur'], "admin")) {
                                    $active['admin'] = 'active';
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    HTML("<li class='{$active['problem']}'><a href='" . 路径("problem/index.php") . "'>题目</a></li>");
    HTML("<li class='{$active['submit']}'><a href='" . 路径("submit/index.php") . "'>记录</a></li>");
    $context = "比赛";
    $now = time();
    $cnt2 = $p->dosql("select ctid from comptime where starttime < {$now} and endtime > {$now}");
    if ($cnt2) {
        $context .= "<span class='doing'>({$cnt2})</span>";
    }
    $cnt1 = $p->dosql("select ctid from comptime where starttime > {$now} and endtime > {$now}");
    if ($cnt1) {
        $context .= "<span class='todo'>({$cnt1})</span>";
    }
    HTML("<li class='{$active['contest']}'><a href='" . 路径("contest/index.php") . "'>{$context}</a></li>");
    HTML("<li class='{$active['page']}'><a href='" . 路径("page/index.php") . "'>页面</a></li>");
    HTML("<li class='{$active['user']}'><a href='" . 路径("user/index.php") . "'>用户</a></li>");
    HTML("<li class='{$active['comment']}'><a href='" . 路径("problem/comments.php") . "'>评论</a></li>");
    HTML("</ul>");
    HTML("<ul class='nav pull-right'>");
    HTML("<li class='{$active['docs']}'><a href='" . 路径("docs/index.php") . "'>帮助</a></li>");
    if (有此权限('可以管理')) {
        HTML("<li class='{$active['admin']}'><a href='" . 路径("admin/index.php") . "'>管理</a></li>");
    }
    HTML("<li class='divider-vertical'></li>");
    HTML("<li class='dropdown'>");
    if ($uid = (int) $_SESSION['ID']) {
        $sql = "select * from userinfo where uid='{$uid}'";
        $p->dosql($sql);
        $d = $p->rtnrlt(0);
        $nickname = $d['nickname'];
        $cnt1 = $p->dosql("select mid from mail where readed = 0 and toid = {$uid}");
        if ($cnt1 > 0) {
            $mails .= "<span class='doing'>({$cnt1})</span>";
        }
        $cnt1 = $p->dosql("select mid from mail where readed = 0 and fromid = {$uid}");
        if ($cnt1 > 0) {
            $mails .= "<span class='todo'>({$cnt1})</span>";
        }
    } else {
        $nickname = "登录";
    }
    if ($uid = (int) $_SESSION['ID']) {
        HTML("<li class=''><a href='" . 路径("user/detail.php?uid={$uid}") . "'>{$nickname}{$mails}</a></li>");
        //HTML("<li class=''><a href='".路径("user/panel.php")."'>设置</a></li>");
        //HTML("<li class=''><a href='".路径("mail/index.php")."'>信件{$mails}</a></li>");
        HTML("<li class=''><a href='" . 路径("user/dologout.php") . "'>退出</a></li>");
    } else {
        HTML("<li class=''><a href='" . 路径("user/login.php") . "'>登录</a></li>");
        HTML("<li class=''><a href='" . 路径("user/register.php") . "'>注册</a></li>");
    }
    HTML("</ul>");
    HTML("</li>");
    HTML("</ul>");
    HTML("</div>");
    HTML("</div>");
    HTML("</div>");
    HTML("</div>");
}
Ejemplo n.º 2
0
<?php

$SH = 路径("include/");
$SS = 路径("style/");
?>
<script charset="utf-8" src="/kindeditor/kindeditor-min.js"></script>
<script charset="utf-8" src="/kindeditor/lang/zh_CN.js"></script>
<script>
var editor;
KindEditor.ready(function(K) {
    editor = K.create('#<?php 
echo $edname;
?>
', {
        cssPath: ['/Bootstrap/css/<?php 
echo $_SESSION['user_style'];
?>
.min.css', '<?php 
echo $SS;
?>
cogs.css', '/kindeditor/plugins/code/prettify.css'],
        bodyClass: 'problem',
        uploadJson: '<?php 
echo $SH;
?>
upload_json.inc.php',
        //fileManagerJson : '../php/file_manager_json.php',
        //allowFileManager : true,
        width: '100%',
        syncType: 'form',
        filterMode: false,
Ejemplo n.º 3
0
<tr>
<td valign='top' style="width: 14em;">
<a class="pull-left" href="<?php 
        echo 路径("user/detail.php?uid={$d['uid']}");
        ?>
">
<?php 
        echo gravatar::showImage($d['email'], 64);
        ?>
</a>
<div style="margin-left:72px;">
<?php 
        if ($_SESSION['ID']) {
            ?>
<a href="<?php 
            echo 路径("mail/index.php");
            ?>
?toid=<?php 
            echo $d['uid'];
            ?>
" title="给<?php 
            echo $d['nickname'];
            ?>
发送信件" class="pull-right"><span class="icon-envelope"></span></a>
<?php 
        }
        ?>
<a href="?uid=<?php 
        echo $d['uid'];
        ?>
"
Ejemplo n.º 4
0
function gethead($head, $check, $title, $userid = 0)
{
    global $SET, $cfg, $LIB;
    $user_style = $_SESSION['user_style'] ? $_SESSION['user_style'] : $SET["user_style"];
    if ($head > 0) {
        ?>
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<!--<meta name="author" content="CmYkRgB123, BYVoid; 王者自由, Kingfree" />
<meta name="description" content="CmYkRgB123 Online Grading System,简称 COGS ,又称 COJS。是一款 OI 在线评测系统,基于 LAMP 技术,文件输入输出,支持评测插件和提交答案。" />
<meta name="keywords" content="COGS, COJS, OJ, OI, NOI, ACM/ICPC" />
<meta name="generator" content="Vim" />
<meta name="revised" content="<?php 
        echo $cfg['Version'];
        ?>
" />
<meta name="others" content="" />-->

<link rel="Shortcut Icon" href="<?php 
        echo 路径("style/cogs.png");
        ?>
" />
<link rel=stylesheet type="text/css" href="/Bootstrap/css/<?php 
        echo $user_style;
        ?>
.min.css" />
<link rel=stylesheet href="<?php 
        echo 路径("style/{$SET['style_profile']}");
        ?>
" />
<?php 
        背景图片($userid ? $userid : $_SESSION['ID']);
        $LIB->tradsimp();
        ?>
<script type="text/javascript" src="/jQuery/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="<?php 
        echo 路径("include/sortTable.js");
        ?>
"></script>
<script type="text/javascript" src="/Bootstrap/js/bootstrap.min.js"></script>
<!--[if IE 6]>
<link href="/Bootstrap-IE6/ie6.min.css" type="text/css" rel="stylesheet">
<![endif]-->
<title><?php 
        echo $title . " - " . $SET['global_sitename'];
        ?>
</title>
</head>
<body>
<div id="alltext">
<?php 
        if ($check == "sess") {
            $check = "普通用户";
        } else {
            if ($check == "admin") {
                $check = "管理用户";
            } else {
                if ($check == "advadmin") {
                    $check = "超级用户";
                }
            }
        }
        if (!有此权限($check)) {
            异常("没有权限 {$check} !");
        }
        $pi = new DataAccess();
        require_once 路径("include/navigation.php");
        if ($head != 8) {
            if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') == false) {
                Navigation($pi);
            } else {
                Navigation_IE($pi);
            }
        }
        ?>

<div id="body" class='container-fluid'>
<?php 
    }
}
Ejemplo n.º 5
0
        ?>
<a href="<?php 
        echo 路径("mail/index.php");
        ?>
?toid=<?php 
        echo $d['uid'];
        ?>
" title="给<?php 
        echo $d['nickname'];
        ?>
发送信件" class="pull-right"><span class="icon-envelope"></span></a>
<?php 
    }
    ?>
<a href="<?php 
    echo 路径("user/detail.php?uid={$d['uid']}");
    ?>
"
<?php 
    if (有此权限("查看用户")) {
        echo "title='" . $d['realname'] . "'";
    }
    ?>
>
<b><?php 
    echo $d['nickname'];
    ?>
</b>
</a>
<br />
积分:<?php 
Ejemplo n.º 6
0
<?php

require_once "../include/header.php";
gethead(8, "普通用户", "");
$txt = "";
$path = 路径("images/gravatar") . '/';
$email = $_GET['email'];
for ($i = 0; $i <= 200; $i++) {
    $file = $path . $email . "s{$i}";
    if (file_exists($file)) {
        unlink($file);
        $txt .= "<p>清除 " . $file . " 中... </p>";
    }
}
提示($txt . "重建头像缓存完成!", 取路径("user/panel.php"));
Ejemplo n.º 7
0
function 是否通过($pid, $q)
{
    if ($_SESSION['ID']) {
        $sql = "SELECT * FROM submit WHERE pid ={$pid} AND uid ={$_SESSION['ID']} order by score desc limit 1";
        $ac = $q->dosql($sql);
        if ($ac) {
            $e = $q->rtnrlt(0);
            //echo "<a href='".路径("problem/code.php?id=").$e['sid']."' target='_blank'><span class=".
            echo "<a href='" . 路径("submit/code.php?id=") . $e['sid'] . "' target='_blank'><span class=icon-" . ($e['accepted'] ? "ok>" : "pause>") . "</span></a>";
            //} else echo "<span class='did'>-</span>";
        } else {
            echo "<span class='icon-minus'>-</span>";
        }
    }
}