added the "interfaces" for the clan fights

main
hecht 13 years ago
parent bc99599f64
commit f30196b6cb

@ -297,7 +297,7 @@ function getAttacksforChar($charid, $mode = 0) {
// $sql = 'select a.name, a.id, a.level, if(find_in_set(\'0\', req_atk) = 0, a.req_atk, substr(a.req_atk, 1, locate(\',0\', a.req_atk) - 1)) as req_atk , geld, ifnull((select l.benutzt from lernen l where l.besitzer = '.$char['id'].' and at_id = a.id),0) as benutzt, a.id not in (select l.at_id from lernen l where l.besitzer = '.$char['id'].') as unknown from attacken a where find_in_set('.$char_race.', a.rassen) order by level';
$sql_append = '';
if($char['frucht'] !== NULL) {
$sql_append1 = ' OR (frucht = (Select id from wochen_markt where item = \''.$char['frucht'].'\')) ';
$sql_append2 = ' AND (frucht <> (Select id from wochen_markt where item = \''.$char['frucht'].'\')) ';
@ -310,7 +310,7 @@ function getAttacksforChar($charid, $mode = 0) {
// make a union out of both (TODO: maybe an outer join would result into the same result)
$sql = '('.$sql.') union distinct ('.$sql2.') order by level';
$qry = mysql_query($sql);
if($qry === FALSE) // print sql on error
echo '<br>'.$sql.'<br>';
@ -380,5 +380,14 @@ function getAttacksforChar($charid, $mode = 0) {
return $overview;
}
/**
* This function reads out the attack set of the char
* @param string $name
* @param int $char_id
*/
function getAttackenSet($name, $char_id) {
// TODO: Further implementation
return NULL;
}
?>

@ -78,4 +78,33 @@ function inviteUser(array $user, $userid, array $clan = NULL){
}
}
function challengeClan(array $user, array $charids, $clanid, $validTime = 24) {
if($clan === NULL) {
$qry = mysql_query('Select * from clan where id = ' . $user['clan']);
$clan = mysql_fetch_assoc($qry);
}
if($clan['leader'] != $user['id'] && $clan['co_leader'] != $user['id']){
return 'Nur der Leader, bzw. der Co-Leader kann andere Clans herausfordern!!';
}
// TODO: Further implementation
return NULL;
}
function acceptChallenge(array $user, array $charids) {
if($clan === NULL) {
$qry = mysql_query('Select * from clan where id = ' . $user['clan']);
$clan = mysql_fetch_assoc($qry);
}
if($clan['leader'] != $user['id'] && $clan['co_leader'] != $user['id']){
return 'Nur der Leader, bzw. der Co-Leader kann herausforderungen anderer Clans annehmen!!';
}
// TODO: Further implementation
return NULL;
}
?>
Loading…
Cancel
Save