Siemka, mam 2 pliczki. jeden to szablon z inputboxem z nickiem a 2 to miejsce w ktorym się sprawdza ranking.
Mój szablon jest skonstruowany na zasaadzie zmiennych. $gra to zmienna w której jest wyświetlany text w tym oknie po prawej(lol)
I mam problem.
Pierwszy plik to
http://kanciasci.pl/postac.php<?php
require_once('inc/system.php');
$gra ='
<form action="postac.php" method="post">
<center>
Nick osoby szukanej:
<input type="text" name="nick" value="'.$oUser["login"].'"/>
</form><input type="submit"></form>
';
$gra .= include 'get_member_details.php';
require_once('inc/szablon.php');
?>
A drugi to
http://kanciasci.pl/get_member_details.php którego ja nie napisałem ico za tym idzie nie potrafie ogarnąc.
<?
require_once('connector.php');
//require_once('postac.php');
//----------------------------------------------------------------------------------------------
function details_member($name) {
$return[] = $tmp;
}
return $return;
}
function details_attacker($name) {
$result = @mysql_query("SELECT * FROM sc_kills WHERE attacker = '".$name."'ORDER BY kill_id DESC LIMIT 10") or
die(mysql_error()); $return[] = $tmp;
}
return $return;
}
function details_victim($name) {
$result = @mysql_query("SELECT * FROM sc_kills WHERE victim = '".$name."'ORDER BY kill_id DESC LIMIT 10") or
die(mysql_error()); $return[] = $tmp;
}
return $return;
}
function attacker_test($name) {
foreach (details_member($name) as $player) {
if ( $player['civilian_kills'] >= 1 OR $player['rival_kills'] >= 1 OR $player['neutral_kills'] >= 1 ) {
return true;
}
}
}
function victim_test($name) {
foreach (details_member($name) as $player) {
if ( $player['deaths'] == 0 ) {
return true;
}
}
}
//-----------------------------------------------------------------------------------------------
?>
<table width='800px'>
<tr>
<td>
<table align='center' width='270px' border='0'>
<? if(attacker_test($name) == true): ?>
<tr><th align='left' colspan='3'>10 Recent Kills</th></tr>
<tr><th align='left'>Victim</th><th align='left'>Clan Tag</th><th align='left'>Typ</th></tr>
<? foreach(details_attacker($name) as $player ): ?>
<tr>
<td width='150px'>
<?=substr($player['victim'], 0
, 12
);?></td>
<td width='80px'>
<?=strtoupper($player['victim_tag'])?><?if($player['victim_tag'] == '')echo'------';?></td>
<td width='60px'>
<?switch($player['kill_type']){case 'c': echo'Civil';break
;case
'n':echo'Neutral';break
;case
'r':echo'Rival';break
;}?></td>
</tr>
<? endforeach; ?>
<? else: ?>
Dieser Spieler hat noch niemanden getötet.
<? endif; ?>
</table>
</td>
<td>
<table width='220px' align='center'>
<tr>
<td align='center'><b>
<?=substr($name, 0, 20)?></b><br/></td>
</tr>
<tr>
<td align='center'>
<? if ( $dynmap !== '####' ) {echo"<img src='http://$dynmap/tiles/faces/body/$name.png' height='100px' /></td>";} else {echo"<img src='img/standard_body.png' height='100px' /></td>";} ?> </tr>
<tr>
<td align='center'>
<table width='220px' border='0'>
<tr>
<td align='left'><b>Join Clan</b></td>
<td align='right'><b>Last Join</b></td>
</tr>
<tr>
<td align='left'>
<?foreach (details_member($name) as $member ): ?>
<? $join_clan = $member['join_date'];
$seconds = $join_clan / 1000;
<? endforeach; ?>
</td>
<td align='right'>
<?foreach (details_member($name) as $member ): ?>
<? $last_on = $member['last_seen'];
$seconds= $last_on / 1000;
<? endforeach; ?>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td>
<table align='right' width='270px' border='0'>
<? if(victim_test($name) == false): ?>
<tr><th align='right' colspan='3'>10 Recent Deaths</th></tr>
<tr><th align='left'>Attacker</th><th align='left'>Clan Tag</th><th align='left'>Typ</th></tr>
<? foreach(details_victim($name) as $player ): ?>
<tr><td width='150px' align='left'>
<?=substr($player['attacker'], 0
, 12
);?></td>
<td width='80px' align='left'>
<?=strtoupper($player['attacker_tag'])?><?if($player['attacker_tag'] == '')echo'------';?></td>
<td width='40px' align='left'>
<?switch($player['kill_type']){case 'c': echo'Civil';break
;case
'n':echo'Neutral';break
;case
'r':echo'Rival';break
;}?></td></tr>
<? endforeach; ?>
<? else: ?>
Dieser Spieler ist noch nicht gestorben.
<? endif; ?>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
Co chcciałbym osiagnąc? to wszystko co wyswietla get_member wrzucic do zmiennej $gra. Czyli żeby wyswietlało sie pod inputboxem