mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2024-12-23 11:31:52 +00:00
fix: problem uploader
This commit is contained in:
parent
09e5234e5f
commit
5dd5934e8c
@ -14,6 +14,8 @@
|
||||
if (isSuperUser($myUser) || isProblemManager($myUser) || isProblemUploader($myUser)) {
|
||||
$new_problem_form = new UOJForm('new_problem');
|
||||
$new_problem_form->handle = function() {
|
||||
global $myUser;
|
||||
|
||||
DB::query("insert into problems (title, uploader, is_hidden, submission_requirement) values ('New Problem', '{$myUser['username']}', 1, '{}')");
|
||||
$id = DB::insert_id();
|
||||
DB::query("insert into problems_contents (id, statement, statement_md) values ($id, '', '')");
|
||||
@ -113,29 +115,9 @@ EOD;
|
||||
'url' => "/problems/template"
|
||||
)
|
||||
);
|
||||
|
||||
/*
|
||||
<?php
|
||||
echoLongTable(array('*'),
|
||||
"problems left join best_ac_submissions on best_ac_submissions.submitter = '{$myUser['username']}' and problems.id = best_ac_submissions.problem_id", $cond, 'order by id asc',
|
||||
$header,
|
||||
'echoProblem',
|
||||
array('page_len' => 3,
|
||||
'table_classes' => array('table', 'table-bordered', 'table-hover', 'table-striped'),
|
||||
'print_after_table' => function() {
|
||||
global $myUser;
|
||||
if (isSuperUser($myUser)) {
|
||||
global $new_problem_form;
|
||||
$new_problem_form->printHTML();
|
||||
}
|
||||
},
|
||||
'head_pagination' => true
|
||||
)
|
||||
);
|
||||
?>*/
|
||||
|
||||
$pag_config = array('page_len' => 40);
|
||||
$pag_config['col_names'] = array('*');
|
||||
$pag_config['col_names'] = array('best_ac_submissions.submission_id as submission_id', 'problems.id as id', 'problems.is_hidden as is_hidden', 'problems.title as title', 'problems.submit_num as submit_num', 'problems.ac_num as ac_num', 'problems.zan as zan', 'problems.extra_config as extra_config', 'problems.uploader as uploader');
|
||||
$pag_config['table_name'] = "problems left join best_ac_submissions on best_ac_submissions.submitter = '{$myUser['username']}' and problems.id = best_ac_submissions.problem_id";
|
||||
$pag_config['cond'] = $cond;
|
||||
$pag_config['tail'] = "order by id asc";
|
||||
|
Loading…
Reference in New Issue
Block a user