Skip to content

Commit 7b1ab91

Browse files
authored
Merge pull request #21 from daizeyao/master
fix: 修复错误超过10次不显示视频的bug
2 parents d26be40 + 551b969 commit 7b1ab91

File tree

3 files changed

+33
-34
lines changed

3 files changed

+33
-34
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v2.7.4
1+
v2.7.5

web/OJ/problem.php

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@
2323

2424
if (isset($OJ_LANG)) require_once("./lang/$OJ_LANG.php");
2525

26+
if(isset($_SESSION['user_id'])){
27+
$uid = $mysqli->real_escape_string($_SESSION['user_id']);
28+
}
2629
/* 获取我的标签 start */
2730
// $my_tag;
28-
// if(isset($_SESSION['user_id'])){
29-
// $uid = $mysqli->real_escape_string($_SESSION['user_id']);
30-
// }
3131
// if (isset($_SESSION['user_id']) && isset($_GET['id'])) {
3232
// $id=intval($_GET['id']);
3333
// $sql = "SELECT tag FROM tag WHERE user_id='$uid' AND problem_id='$id'";
@@ -70,15 +70,15 @@
7070
$sql = "SELECT * FROM `problem` WHERE `problem_id`=$id";
7171
} else
7272
$sql = <<<SQL
73-
SELECT
74-
*
75-
FROM
73+
SELECT
74+
*
75+
FROM
7676
problem
77-
WHERE
78-
defunct='N'
77+
WHERE
78+
defunct='N'
7979
AND problem_id=$id
8080
AND problem_id
81-
NOT IN (
81+
NOT IN (
8282
SELECT DISTINCT
8383
contest_problem.problem_id
8484
FROM
@@ -236,7 +236,7 @@
236236
//get try times and determine if he can see the video END
237237

238238

239-
//get the gptCode STRAT
239+
//get the gptCode STRAT
240240
$isHaveGPTCode = false;
241241
$GPTCode = NULL;
242242
$sql = "SELECT code FROM gpt_code WHERE problem_id='$real_id'";
@@ -286,4 +286,3 @@
286286
if (file_exists('./include/cache_end.php'))
287287
require_once('./include/cache_end.php');
288288
?>
289-

web/OJ/template/hznu/problem.php

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
<?php
1818

19-
if (isset($_GET['cid'])) require_once("contest_header.php");
19+
if (isset($_GET['cid'])) require_once("contest_header.php");
2020
else require_once("header.php");
2121

2222
//比赛期间暂时关闭
@@ -346,10 +346,10 @@ function sss($str){
346346
}
347347
?>
348348

349-
<?php
350-
if (isset($_GET['cid'])) {
351-
$can_see_video = 0;
352-
}
349+
<?php
350+
// if (isset($_GET['cid'])) {
351+
// $can_see_video = 0;
352+
// }
353353
?>
354354

355355
<?php if ($can_see_video || HAS_PRI("watch_solution_video")): ?>
@@ -359,27 +359,27 @@ function sss($str){
359359
<input type="hidden" name="pid" value="<?php echo $real_id ?>" placeholder="">
360360
<button class="am-btn am-btn-success am-btn-lg">Click To Watch The Video</button>
361361
</form>
362-
<?php else: ?>
363-
<button disabled="1" class="am-btn am-btn-default am-btn-lg">No Solution Video</button>
364-
<?php endif ?>
365-
<div style="display: block; color: grey; padding-bottom: 20px;">
366-
*if you see this button, it means you've submited more than <?php echo $VIDEO_SUBMIT_TIME ?> times.
367-
</div>
362+
<?php else: ?>
363+
<button disabled="1" class="am-btn am-btn-default am-btn-lg">No Solution Video</button>
368364
<?php endif ?>
365+
<div style="display: block; color: grey; padding-bottom: 20px;">
366+
*if you see this button, it means you've submited more than <?php echo $VIDEO_SUBMIT_TIME ?> times.
367+
</div>
368+
<?php endif ?>
369369

370-
<!-- gptcode start -->
371-
<?php if ($isHaveGPTCode && !isset($_GET['cid'])) : ?>
372-
<?php
373-
echo <<<HTML
374-
<h2>GPT Hint</h2>
375-
<pre><code>$GPTCode</code></pre>
370+
<!-- gptcode start -->
371+
<?php if ($isHaveGPTCode && !isset($_GET['cid'])) : ?>
372+
<?php
373+
echo <<<HTML
374+
<h2>GPT Hint</h2>
375+
<pre><code>$GPTCode</code></pre>
376376
HTML;
377-
?>
378-
<?php endif ?>
377+
?>
378+
<?php endif ?>
379379

380-
<!-- 添加一个具有一定高度的空白 div -->
381-
<div style="height: 20px;"></div>
382-
<!-- gptcode end -->
380+
<!-- 添加一个具有一定高度的空白 div -->
381+
<div style="height: 20px;"></div>
382+
<!-- gptcode end -->
383383

384384

385385
<!-- 提交等按钮 start -->

0 commit comments

Comments
 (0)