31 lines
858 B
PHP
31 lines
858 B
PHP
<?php
|
|
|
|
header("Content-type: text/html; charset=utf-8");
|
|
|
|
$li=[];
|
|
|
|
//example list
|
|
$li[0]="team_name";
|
|
$li[1]="team_id";
|
|
$li[2]="<a target=\"_blank\" href=\"./api.php?action=attachment-dl,cid_0&game=test-1&ttoken=\">misc::hash-test</a>\n";
|
|
|
|
$team_info=get_team_info($game, $team_id);
|
|
$cid_list=get_challenge_list($game);
|
|
|
|
$li[0]=$team_info["name"];
|
|
$li[1]=$team_info["id"];
|
|
|
|
$li[2]="";
|
|
for($a=0; $a<count($cid_list); $a++) {
|
|
$li[2].="<a target=\"_blank\" href=";
|
|
$li[2].=json_encode("./api.php?action=attachment-dl,".rawurlencode($cid_list[$a]["cid"])."&game=".rawurlencode($game)."&ttoken=".rawurlencode($team_token));
|
|
$li[2].=">".htmlspecialchars($cid_list[$a]["name"])."</a>";
|
|
$li[2].="<br>\n";
|
|
}
|
|
unset($a);
|
|
|
|
$str=file_get_contents_with_lock(__DIR__."/assets/user_index_template.html");
|
|
$str=template_replace_anchor($str, $li);
|
|
|
|
echo $str;
|