Compare commits

...

2 Commits

Author SHA1 Message Date
0ab54aac78
fix: 6926a6f912
All checks were successful
continuous-integration/drone/push Build is passing
2022-09-20 18:25:48 +08:00
02ef72b035
fix: user info style 2022-09-20 18:23:18 +08:00
2 changed files with 13 additions and 11 deletions

View File

@ -127,16 +127,17 @@
$ac_problems = DB::selectAll("select a.problem_id as problem_id, b.title as title from best_ac_submissions a inner join problems b on a.problem_id = b.id where submitter = '{$user['username']}';"); $ac_problems = DB::selectAll("select a.problem_id as problem_id, b.title as title from best_ac_submissions a inner join problems b on a.problem_id = b.id where submitter = '{$user['username']}';");
?> ?>
<h4 class="list-group-item-heading"><?= UOJLocale::get('accepted problems').''.UOJLocale::get('n problems in total', count($ac_problems))?> </h4> <h4 class="list-group-item-heading"><?= UOJLocale::get('accepted problems').''.UOJLocale::get('n problems in total', count($ac_problems))?> </h4>
<div class="list-group-item-text"> <ul class="list-group-item-text nav">
<?php <?php
foreach ($ac_problems as $problem) { foreach ($ac_problems as $problem) {
echo '<a href="/problem/', $problem['problem_id'], '" role="button" class="btn btn-light mr-1">#', $problem['problem_id'], '. ', $problem['title'], '</a>'; echo '<li><a href="/problem/', $problem['problem_id'], '" role="button" class="btn btn-light mr-1 mb-1" style="width: 12rem;">#', $problem['problem_id'], '. ', $problem['title'], '</a></li>';
} }
if (empty($ac_problems)) {
echo UOJLocale::get('none'); if (empty($ac_problems)) {
} echo UOJLocale::get('none');
}
?> ?>
</div> </ul>
</div> </div>
</div> </div>
</div> </div>

View File

@ -16,10 +16,11 @@ class Paginator {
$this->cur_start = 0; $this->cur_start = 0;
$this->table = $config['data']; $this->table = $config['data'];
} elseif (!isset($config['echo_full'])) { } elseif (!isset($config['echo_full'])) {
if (!isset($config['pagination_table'])) { $table = $config['table_name'];
$config['pagination_table'] = $config['table']; if (isset($config['pagination_table'])) {
$table = $config['pagination_table'];
} }
$this->n_rows = DB::selectCount("select count(*) from {$config['pagination_table']} where {$config['cond']}"); $this->n_rows = DB::selectCount("select count(*) from {$table} where {$config['cond']}");
$this->page_len = isset($config['page_len']) ? $config['page_len'] : 10; $this->page_len = isset($config['page_len']) ? $config['page_len'] : 10;