added some functionality required for fetching the char of a clanfight

main
hecht 13 years ago
parent 62a93ecf4c
commit 923baaf625

@ -10,17 +10,28 @@ include_once (ROOT_PATH . '/include/config.inc.php');
include_once (ROOT_PATH . '/include/char.inc.php');
include_once (ROOT_PATH . '/include/event.inc.php');
include_once (ROOT_PATH . '/include/parse.inc.php');
?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="design/FightStyle.css">
</head>
<body>
<?php
$char_id = validateUnsignedInteger($_GET['char_id'], null);
//function abholenChar(array $user, $event_id, $char_id) {
//function getEventIdsToFetch($charid) {
$ids = getEventIdsToFetch($char_id);
$event_ids = getEventIdsToFetch($char_id);
foreach ($ids as $id) {
// abholenChar(array $user, $event_id, $char_id)
foreach ($event_ids as $event_id) {
$fight_ids = getEventFightIdsByChar($event_id, $char_id);
foreach ($fight_ids as $event_fight_id) {
displayEventFight($event_id, $event_fight_id);
}
}
?>
?>
</body>
</html>

@ -5,6 +5,13 @@
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="design/FightStyle.css">
</head>
<body>
<?php
include_once('path.inc.php'); // get the path ;)
include_once(ROOT_PATH.'/include/config/db.inc.php');
@ -19,4 +26,6 @@ if($event_id !== NULL && $event_fight_id !== NULL) {
} else {
echo 'Man kann die Seite so nicht aufrufen!!<br>';
}
?>
?>
</body>
</html>

@ -365,6 +365,14 @@ function getHistoricalChallengeIDs($clanid, $limit = NULL) {
return $array;
}
function getClanLockedTime($clan_id) {
$sql = 'SELECT TIMESTAMPDIFF(SECOND, NOW(), locked_until) FROM clan_locked WHERE clanid = ' . $clan_id;
$row = mysql_fetch_row(mysql_query($sql));
if($row)
return $row[0];
return 0;
}
// Checks if the clan is locked, will lock it if required!
function isClanLocked($clanid) {
if(!is_numeric($clanid)) {
@ -804,6 +812,7 @@ function getCountLeaderAssignedChars($clan_id, $clan_fight_id) {
return $row[0];
}
/**
* This function checks if there is a char-rule that allows forcing the char for leader assignment!
* @param int $char_id

@ -164,4 +164,49 @@ function displayCount($value){
return number_format($value,0,'','.');
}
function generateTimerHtml($timerId, $timeInSeconds, $htmlOnExpire) {
?>
<div align='center' id='timer_<?php echo $timerId; ?>'>
<?php
if($timeInSeconds <= 0){
echo $htmlOnExpire;
} else{
?>
<script type='text/javascript'>
v=new Date();
var ht=document.getElementById('timer_<?php echo $timerId; ?>');
function t(){
n=new Date();
s=<?php echo $timeInSeconds; ?>-Math.round((n.getTime()-v.getTime())/1000.);
m=0;
h=0;
if(s<0){
ht.innerHTML="<?php echo $htmlOnExpire; ?>"
} else {
if(s>59){
m=Math.floor(s/60);s=s-m*60
}
if(m>59){
h=Math.floor(m/60);m=m-h*60
}
if(s<10){
s='0'+s
}
if(m<10){
m='0'+m
}
ht.innerHTML=h+':'+m+':'+s
}
window.setTimeout('t();',950);
}
window.onload=t;
</script>
<?php
}
?>
</div>
<?php
}
?>

@ -365,7 +365,7 @@ function displayEventFight($event_id, $event_fight_id) {
include_once(ROOT_PATH.'/include/event.inc.php'); // for the defines :)
// Erstmal die Seite starten
echo '<html><head><link rel="stylesheet" type="text/css" href="design/FightStyle.css"></head><body><table width="100%">';
echo '<table width="100%">';
// :D
// first readout the required event data
$sql = 'SELECT *, visible <= now() as passed FROM event_fights WHERE event_id = ' . $event_id . ' AND event_fight_id = ' . $event_fight_id . ' AND `starting` <= now()';
@ -427,7 +427,7 @@ function displayEventFight($event_id, $event_fight_id) {
echo '<tr height="5px"><td>&nbsp;</td></tr>';
echo '</table></body></html>';
echo '</table>';
return null;
}

Loading…
Cancel
Save