Parse errors
| Pagina 2
46 antwoorden
Gesponsorde links
gamesty - 30/07/2005 10:24
Onbekend
Inderdaad,Dat staat in de config.Iemand?
DaOxx - 30/07/2005 11:17
PHP beginner
Heb je wel de juiste regel gepost, post eens 5 regels erboven en 5 regels beneden ook.
gamesty - 30/07/2005 11:26
Onbekend
Ik heb al heel de code gepost.Nu krijg ik al wat ik wil.Behalve dan dat ik 2 keer de nickname krijg.'login'
<?php /* ------------------------- */
include("_include-config.php");
if(! check_login()) {
header("Location: login.php");
exit;
}
mysql_query("UPDATE `[users]` SET `online`=NOW() WHERE `login`='{$data->login}'");
/* ------------------------- */ ?>
<html>
<head>
<title>[( Farwest )]</title>
</head>
<head>
<title> [(Farwest)] </title>
<link rel="stylesheet" type="text/css" href="<?php echo ($_COOKIE['v'] == 2) ? "css-v2.css" : "css-v1.css"; ?>">
</head>
<body style="background: #DDDDDD; margin: 0px;">
<table width=100%>
<tr><td align="center">
<form action="list.php" method="get">
Voorbeeld: "<b>a*</b>" zal een lijst geven van namen die beginnen met een A<br>
<input type="hidden" name="s" value="search"><input type="text" name="q" value="<?php echo $_REQUEST['q']; ?>"> <input type="submit" value="Zoek!">
</form>
</td></tr>
</table>
<table width=100%>
<tr><td align="center" class="subTitle" style="letter-spacing: normal;" width=15><b>#</b></td>
<td class="subTitle" style="letter-spacing: normal;" align="center"><a href="list.php?s=login"><b><font color=white>Nickname</a></b></td>
<td class="subTitle" style="letter-spacing: normal;" align="center"><b>Type</b></td>
<td class="subTitle" style="letter-spacing: normal;" align="center" width=150><a href="list.php?s=health"><b><font color=white>health</b></a></td>
<td class="subTitle" style="letter-spacing: normal;" align="center" width=100><a href="list.php?s=money"><b><font color=white>Geld</b></a></td>
<td class="subTitle" style="letter-spacing: normal;" align="center" width=75><a href="list.php?s=power"><font color="#FFFFFF"><b>Power</b></font></a></td></tr>
<?php /* ------------------------- */
echo mysql_error();
$begin = ($_GET['p'] >= 0) ? $_GET['p']*30 : 0;
if($_GET['s'] == "login")
$dbres = mysql_query("SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`health` FROM `[users]` WHERE `activated`=1 ORDER BY `login` LIMIT $begin,30");
else if($_GET['s'] == "money")
$dbres = mysql_query("SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`health` FROM `[users]` WHERE `activated`=1 ORDER BY `cash`+`bank` DESC,`login` ASC LIMIT $begin,30");
else if($_GET['s'] == "type")
$dbres = mysql_query("SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`health` FROM `[users]` WHERE `activated`=1 ORDER BY `type`,`login` LIMIT $begin,30");
else if($_GET['s'] == "health")
$dbres = mysql_query("SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`health` FROM `[users]` WHERE `activated`=1 ORDER BY `health`,`login` LIMIT $begin,30");
else if($_GET['s'] == "clicks")
$dbres = mysql_query("SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`health` FROM `[users]` WHERE `activated`=1 ORDER BY `clicks` DESC,`login` ASC LIMIT $begin,30");
else if($_GET['s'] == "clan")
$dbres = mysql_query("SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`health` FROM `[users]` WHERE `activated`=1 ORDER BY `clan` DESC,`login` ASC LIMIT $begin,30");
else if($_GET['s'] == "contant")
$dbres = mysql_query("SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`health` FROM `[users]` WHERE `activated`=1 ORDER BY `cash` DESC,`login` ASC LIMIT $begin,30");
else if($_GET['s'] == "online")
$dbres = mysql_query("SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`showonline`,`clan`,`health` FROM `[users]` WHERE `activated`=1 AND UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 ORDER BY `login` LIMIT $begin,30");
else if($_GET['s'] == "admin")
$dbres = mysql_query("SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`health` FROM `[users]` WHERE `level` & 0x80 AND UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 ORDER BY `login` LIMIT $begin,30");
else if($_GET['s'] == "search")
{
$_GET['q'] = preg_replace('/*/','%',$_GET['q']);
$dbres = mysql_query("SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`health` FROM `[users]` WHERE `activated`=1 AND `login` LIKE '{$_GET['q']}' ORDER BY `login` LIMIT $begin,30");
}
else
$dbres = "SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`health` FROM `[users]` WHERE `activated`=1 ORDER BY `login` LIMIT $begin,30";
$result = mysql_query($dbres) or die("FOUT: " . mysql_error());
$user = $_SESSION['login'];
for($j=$begin+1; $info = mysql_fetch_object($result); $j++)
{
// ????
$login = ($info->showonline == 0 && $data->level == 0x80 && $_GET['s'] == "online") ? "{$info->login} *" : $info->login;
// onthoud admins dikgedrukt en met *, als betreffende user dat is
$login = ($info->level & 0x80) ? "<b><font color=red>$login* </b>" : $login;
$login = ($info->level == 5) ? "<b><font color=#Green>$login* </b>" : $login;
$login = ($info->level == 100) ? "<b><font color=#000000>$login*</b>" : $login;$leven = $info->leven;
$contant = $info->cash+$info->contant;
$clan = $info->clan;
$clicks = $info->clicks;
// maak een array met typen
$type = Array("","Cowboy","Indiaan","Sherriff");
// onthoud betreffende type
$type = $type[$info->type];
// rond berekening van power af op gehele waarde en onthoud deze van de betreffende typen
$power = round(($info->attack+$info->defence)/2+$info->clicks*5);
// money is bank+cash waarde van betreffende coureur
$money = $info->cash+$info->bank;
if ($power <= 100) {
$rank = "Zwerver";
} elseif ($power > 100 AND $power <= 300) {
$rank = "Bedelaar";
} elseif ($power > 300 AND $power <= 700) {
$rank = "Crimineel";
} elseif ($power > 700 AND $power <= 1900) {
$rank = "Zakkenroller";
} elseif ($power > 1300 AND $power <= 2800) {
$rank = "Tuig";
} elseif ($power > 2000 AND $power <= 3900) {
$rank = "Geweldadig";
} elseif ($power > 2800 AND $power <= 4750) {
$rank = "Autodief";
} elseif ($power > 3700 AND $power <= 6700) {
$rank = "Drugsdealer";
} elseif ($power > 4700 AND $power <= 7800) {
$rank = "Gangster";
} elseif ($power > 5800 AND $power <= 9000) {
$rank = "Overvaller";
} elseif ($power > 6000 AND $power <= 1500) {
$rank = "Bendeleider";
} elseif ($power > 7300 AND $power <= 18200) {
$rank = "Huurmoordenaar";
} elseif ($power > 25200) {
$rank = "God";
}
// toon een rij met de kolommen: nummer, loginnaam, type, money en power van de user met nummer $j
?>
<tr><td align="center" class=\"mainTxt\" width="20"><?=$j;?></td>
<td class=\"mainTxt\"><a href="profile.php?x={$info->login}"><?=$login;?></a></td>
<td align="center" class=\"mainTxt\" width="150"><?=$type;?></td>
<td align="center" class=\"mainTxt\" width="150"><?=$health;?>%</td>
<td align="center" class=\"mainTxt\" width="100"><?=$money;?></td>
<td align="center" class=\"mainTxt\" width="100"><?=$power;?></td>
<?php
// DEBUG COMMENT: hier gaat SESSION de mist in
// DEBUG CODE:
echo "<td align=\"center\" class=\"mainTxt\" width=100>".$_SESSION['login']."</td>";
// als type niet is: HaCkEr OF (type is HaCkEr EN
if(($data->type != 3 || ($data->type == 3 && $info->type != 3)) && round($data->signup/3600-time()/3600) + 12 <= 0 && round($info->signup/3600-time()/3600) + 12 <= 0 && ($info->clan != $data->clan || $info->clan == ""))
print " <td align=\"center\" class=\"mainTxt\"><a href=\"attack.php?x={$info->login}\">Attack</a></td></tr>\n\n";
else
print " </tr>\n\n";
}
// als type niet is: HaCkEr OF (type is HaCkEr EN
if(($data->type != 3 || ($data->type == 3 && $info->type != 3)) && round($data->signup/3600-time()/3600) + 12 <= 0 && round($info->signup/3600-time()/3600) + 12 <= 0 && ($info->clan != $data->clan || $info->clan == ""))
print " <td align=\"center\" class=\"mainTxt\"><a href=\"attack.php?x={$info->login}\">Attack</a></td></tr>\n\n";
else
print " </tr>\n";
if($_GET['s'] == "online")
$dbres = mysql_query("SELECT `id` FROM `[users]` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300");
else if($_GET['s'] == "online")
$dbres = mysql_query("SELECT `id` FROM `[users]` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 AND `showonline`=1");
else if($_GET['s'] == "admin")
$dbres = mysql_query("SELECT `id` FROM `[users]` WHERE `level` & 0x80 AND UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 ORDER BY `login` LIMIT $begin,30");
else if($_GET['s'] == "search")
{
$dbres = mysql_query("SELECT `id` FROM `[users]` WHERE `activated`=1 AND `login` LIKE '{$_GET['q']}' ORDER BY `login`");
$_GET['q'] = preg_replace('/%/','*',$_GET['q']);
}
else
$dbres = mysql_query("SELECT id FROM `[users]` WHERE `activated`=1");
print "</table>\n\n<table width=100%>\n <tr><td class=\"mainTxt\" align=\"center\">";
if(mysql_num_rows($dbres) <= 30)
print "< 1 ></td></tr></table>\n";
else
{
if($begin/30 == 0)
print "<< ";
else
print ("<a href=\"list.php?s={$_GET['s']}&q={$_GET['q']}&p=\""
.($begin/30-1)."\"><<</a> ");
for($i=0; $i<mysql_num_rows($dbres)/30; $i++)
{
print ("<a href=\"list.php?s={$_GET['s']}&q={$_GET['q']}&p=$i\">". ($i+1) ."</a> ");
}
if($begin+30 >= mysql_num_rows($dbres))
print ">> ";
else
print ("<a href=\"list.php?s={$_GET['s']}&q={$_GET['q']}&p=". ($begin/30+1) ."\">>></a>");
}
$dbres = mysql_query("SELECT `id` FROM `[users]` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300");
$online = mysql_num_rows($dbres);
$dbres = mysql_query("SELECT `id` FROM `[users]` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 AND `showonline`=0");
$anonymous = mysql_num_rows($dbres);
$dbres = mysql_query("SELECT `id` FROM `[users]` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 AND `level`=255");
$admins = mysql_num_rows($dbres);
/* ------------------------- */ ?>
</table>
<table width=100%>
<tr><td align="center"><a href="list.php?s=online"><b><?php print $online; ?> leden online</b></a></td></tr>
<tr><td align="center"><a href="list.php?s=admin"><b><?php print $admins; ?> beheerder(s) online</b></a></td></tr>
<tr><td align="center"><font color=darkblue><b>Admins worden aangegeven als:</b><font color=red><b>Loginnaam<img src="images/diamant.gif" width=10 height=10 border=0 alt="diamant"></b></font></td></tr>
<tr><td align="center"><font color=darkblue><b>Betaalde Accounts als:</b><font color=#4DFF00<b>Loginnaam<img src="images/ster2.gif" width=10 height=10 border=0 alt="/images/ster2.gif"></b></font></td></tr>
</table>
<?php
$login = $user;
// DEBUG CODE:
// echo $_SESSION["login"];
?>
</body>
</html>
<span Style="display: none">
<?php /* ------------------------- */
include ( "_include-config.php" ) ;
if ( ! check_login( ) ) {
header ( "Location: login.php" ) ; }
mysql_query ( "UPDATE `[users]` SET `online`=NOW() WHERE `login`='{$data->login} '" ) ;
/* ------------------------- */ ?>
<html>
<head>
<title>[( Farwest )]</title>
</head>
<head>
<title> [(Farwest)] </title>
<link rel="stylesheet" type="text/css" href="
<?php echo ( $_COOKIE [ 'v' ] == 2 ) ?
"css-v2.css" : "css-v1.css" ; ?> ">
</head>
<body style="background: #DDDDDD; margin: 0px;">
<table width=100%>
<tr><td align="center">
<form action="list.php" method="get">
Voorbeeld: "<b>a*</b>" zal een lijst geven van namen die beginnen met een A<br>
<input type="hidden" name="s" value="search"><input type="text" name="q" value="
<?php echo $_REQUEST [ 'q' ] ; ?> "> <input type="submit" value="Zoek!">
</form>
</td></tr>
</table>
<table width=100%>
<tr><td align="center" class="subTitle" style="letter-spacing: normal;" width=15><b>#</b></td>
<td class="subTitle" style="letter-spacing: normal;" align="center"><a href="list.php?s=login"><b><font color=white>Nickname</a></b></td>
<td class="subTitle" style="letter-spacing: normal;" align="center"><b>Type</b></td>
<td class="subTitle" style="letter-spacing: normal;" align="center" width=150><a href="list.php?s=health"><b><font color=white>health</b></a></td>
<td class="subTitle" style="letter-spacing: normal;" align="center" width=100><a href="list.php?s=money"><b><font color=white>Geld</b></a></td>
<td class="subTitle" style="letter-spacing: normal;" align="center" width=75><a href="list.php?s=power"><font color="#FFFFFF"><b>Power</b></font></a></td></tr>
<?php /* ------------------------- */
$begin = ( $_GET [ 'p' ] >= 0 ) ? $_GET [ 'p' ] * 30 : 0 ;
if ( $_GET [ 's' ] == "login" )
$dbres = mysql_query ( "SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`health` FROM `[users]` WHERE `activated`=1 ORDER BY `login` LIMIT $begin ,30" ) ;
else if ( $_GET [ 's' ] == "money" )
$dbres = mysql_query ( "SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`health` FROM `[users]` WHERE `activated`=1 ORDER BY `cash`+`bank` DESC,`login` ASC LIMIT $begin ,30" ) ;
else if ( $_GET [ 's' ] == "type" )
$dbres = mysql_query ( "SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`health` FROM `[users]` WHERE `activated`=1 ORDER BY `type`,`login` LIMIT $begin ,30" ) ;
else if ( $_GET [ 's' ] == "health" )
$dbres = mysql_query ( "SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`health` FROM `[users]` WHERE `activated`=1 ORDER BY `health`,`login` LIMIT $begin ,30" ) ;
else if ( $_GET [ 's' ] == "clicks" )
$dbres = mysql_query ( "SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`health` FROM `[users]` WHERE `activated`=1 ORDER BY `clicks` DESC,`login` ASC LIMIT $begin ,30" ) ;
else if ( $_GET [ 's' ] == "clan" )
$dbres = mysql_query ( "SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`health` FROM `[users]` WHERE `activated`=1 ORDER BY `clan` DESC,`login` ASC LIMIT $begin ,30" ) ; else if ( $_GET [ 's' ] == "contant" )
$dbres = mysql_query ( "SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`health` FROM `[users]` WHERE `activated`=1 ORDER BY `cash` DESC,`login` ASC LIMIT $begin ,30" ) ;
else if ( $_GET [ 's' ] == "online" )
$dbres = mysql_query ( "SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`showonline`,`clan`,`health` FROM `[users]` WHERE `activated`=1 AND UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 ORDER BY `login` LIMIT $begin ,30" ) ;
else if ( $_GET [ 's' ] == "admin" )
$dbres = mysql_query ( "SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`health` FROM `[users]` WHERE `level` & 0x80 AND UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 ORDER BY `login` LIMIT $begin ,30" ) ;
else if ( $_GET [ 's' ] == "search" )
{
$dbres = mysql_query ( "SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`health` FROM `[users]` WHERE `activated`=1 AND `login` LIKE '{$_GET['q']} ' ORDER BY `login` LIMIT $begin ,30" ) ; }
else
$dbres = "SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`health` FROM `[users]` WHERE `activated`=1 ORDER BY `login` LIMIT $begin ,30" ;
$user = $_SESSION [ 'login' ] ;
{
// ????
$login = ( $info -> showonline == 0 && $data -> level == 0x80 && $_GET [ 's' ] == "online" ) ? "{$info->login} *" : $info -> login ;
// onthoud admins dikgedrukt en met *, als betreffende user dat is
$login = ( $info -> level & 0x80 ) ? "<b><font color=red>$login * </b>" : $login ;
$login = ( $info -> level == 5 ) ? "<b><font color=#Green>$login * </b>" : $login ;
$login = ( $info -> level == 100 ) ? "<b><font color=#000000>$login *</b>" : $login ; $leven = $info -> leven ;
$contant = $info -> cash + $info -> contant ;
$clan = $info -> clan ;
$clicks = $info -> clicks ;
// maak een array met typen
$type = Array ( "" , "Cowboy" , "Indiaan" , "Sherriff" ) ;
// onthoud betreffende type
$type = $type [ $info -> type ] ;
// rond berekening van power af op gehele waarde en onthoud deze van de betreffende typen
$power = round ( ( $info -> attack + $info -> defence ) / 2 + $info -> clicks * 5 ) ;
// money is bank+cash waarde van betreffende coureur
$money = $info -> cash + $info -> bank ;
if ( $power <= 100 ) {
$rank = "Zwerver" ;
} elseif ( $power > 100 AND $power <= 300 ) {
$rank = "Bedelaar" ;
} elseif ( $power > 300 AND $power <= 700 ) {
$rank = "Crimineel" ;
} elseif ( $power > 700 AND $power <= 1900 ) {
$rank = "Zakkenroller" ;
} elseif ( $power > 1300 AND $power <= 2800 ) {
$rank = "Tuig" ;
} elseif ( $power > 2000 AND $power <= 3900 ) {
$rank = "Geweldadig" ;
} elseif ( $power > 2800 AND $power <= 4750 ) {
$rank = "Autodief" ;
} elseif ( $power > 3700 AND $power <= 6700 ) {
$rank = "Drugsdealer" ;
} elseif ( $power > 4700 AND $power <= 7800 ) {
$rank = "Gangster" ;
} elseif ( $power > 5800 AND $power <= 9000 ) {
$rank = "Overvaller" ;
} elseif ( $power > 6000 AND $power <= 1500 ) {
$rank = "Bendeleider" ;
} elseif ( $power > 7300 AND $power <= 18200 ) {
$rank = "Huurmoordenaar" ;
} elseif ( $power > 25200 ) {
$rank = "God" ;
}
// toon een rij met de kolommen: nummer, loginnaam, type, money en power van de user met nummer $j
?>
<tr><td align="center" class=\"mainTxt\" width="20"><?= $j ; ?> </td>
<td class=\"mainTxt\"><a href="profile.php?x={$info->login}"><?= $login ; ?> </a></td>
<td align="center" class=\"mainTxt\" width="150"><?= $type ; ?> </td>
<td align="center" class=\"mainTxt\" width="150"><?= $health ; ?> %</td>
<td align="center" class=\"mainTxt\" width="100"><?= $money ; ?> </td>
<td align="center" class=\"mainTxt\" width="100"><?= $power ; ?> </td>
<?php
// DEBUG COMMENT: hier gaat SESSION de mist in
// DEBUG CODE:
echo "<td align=\" center\" class=\" mainTxt\" width=100>" . $_SESSION [ 'login' ] . "</td>" ;
// als type niet is: HaCkEr OF (type is HaCkEr EN
if ( ( $data -> type != 3 || ( $data -> type == 3 && $info -> type != 3 ) ) && round ( $data -> signup / 3600 - time ( ) / 3600 ) + 12 <= 0 && round ( $info -> signup / 3600 - time ( ) / 3600 ) + 12 <= 0 && ( $info -> clan != $data -> clan || $info -> clan == "" ) ) print " <td align=\" center\" class=\" mainTxt\" ><a href=\" attack.php?x={$info->login} \" >Attack</a></td></tr>\n \n " ; else
}
// als type niet is: HaCkEr OF (type is HaCkEr EN
if ( ( $data -> type != 3 || ( $data -> type == 3 && $info -> type != 3 ) ) && round ( $data -> signup / 3600 - time ( ) / 3600 ) + 12 <= 0 && round ( $info -> signup / 3600 - time ( ) / 3600 ) + 12 <= 0 && ( $info -> clan != $data -> clan || $info -> clan == "" ) ) print " <td align=\" center\" class=\" mainTxt\" ><a href=\" attack.php?x={$info->login} \" >Attack</a></td></tr>\n \n " ; else
if ( $_GET [ 's' ] == "online" )
$dbres = mysql_query ( "SELECT `id` FROM `[users]` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300" ) ;
else if ( $_GET [ 's' ] == "online" )
$dbres = mysql_query ( "SELECT `id` FROM `[users]` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 AND `showonline`=1" ) ;
else if ( $_GET [ 's' ] == "admin" )
$dbres = mysql_query ( "SELECT `id` FROM `[users]` WHERE `level` & 0x80 AND UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 ORDER BY `login` LIMIT $begin ,30" ) ;
else if ( $_GET [ 's' ] == "search" )
{
$dbres = mysql_query ( "SELECT `id` FROM `[users]` WHERE `activated`=1 AND `login` LIKE '{$_GET['q']} ' ORDER BY `login`" ) ;
}
else
$dbres = mysql_query ( "SELECT id FROM `[users]` WHERE `activated`=1" ) ; print "</table>\n \n <table width=100%>\n <tr><td class=\" mainTxt\" align=\" center\" >" ;
print "< 1 ></td></tr></table>\n " ;
else
{
if ( $begin / 30 == 0 )
else
print ( "<a href=\" list.php?s={$_GET['s']} &q={$_GET['q']} &p=\" " . ( $begin / 30 - 1 ) . "\" ><<</a> " ) ;
for ( $i = 0 ; $i < mysql_num_rows( $dbres ) / 30 ; $i ++ )
{
print ( "<a href=\" list.php?s={$_GET['s']} &q={$_GET['q']} &p=$i \" >" . ( $i + 1 ) . "</a> " ) ; }
else
print ( "<a href=\" list.php?s={$_GET['s']} &q={$_GET['q']} &p=" . ( $begin / 30 + 1 ) . "\" >>></a>" ) ; }
$dbres = mysql_query ( "SELECT `id` FROM `[users]` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300" ) ; $dbres = mysql_query ( "SELECT `id` FROM `[users]` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 AND `showonline`=0" ) ; $dbres = mysql_query ( "SELECT `id` FROM `[users]` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 AND `level`=255" ) ;
/* ------------------------- */ ?>
</table>
<table width=100%>
<tr><td align="center"><a href="list.php?s=online"><b>
<?php print $online ; ?> leden online</b></a></td></tr>
<tr><td align="center"><a href="list.php?s=admin"><b>
<?php print $admins ; ?> beheerder(s) online</b></a></td></tr>
<tr><td align="center"><font color=darkblue><b>Admins worden aangegeven als:</b><font color=red><b>Loginnaam<img src="images/diamant.gif" width=10 height=10 border=0 alt="diamant"></b></font></td></tr>
<tr><td align="center"><font color=darkblue><b>Betaalde Accounts als:</b><font color=#4DFF00<b>Loginnaam<img src="images/ster2.gif" width=10 height=10 border=0 alt="/images/ster2.gif"></b></font></td></tr>
</table>
<?php
$login = $user ;
// DEBUG CODE:
// echo $_SESSION["login"];
?>
</body>
</html>
<span Style="display: none">
Iemand hiervoor een oplossing?
gamesty - 30/07/2005 13:18 (laatste wijziging 30/07/2005 16:23)
Onbekend
Ik denk dat jullie mij niet verstaan.Drom heb ik eventjes het logingedeelte eruit gehaald.
Dit is wat ik krijg: http://thefarwest.wyger.nl/listtest.php
Ik wil dus dat die tweede keer usernames weg gaat.
gamesty - 30/07/2005 17:07
Onbekend
Kijk naar het voorbeeld.Ik krijg 2x de username.1x in het begin en dan achteraan.
gamesty - 30/07/2005 21:45 (laatste wijziging 31/07/2005 21:01)
Onbekend
Ja,Nu heb ik dat ook.Maar je krijgt nu een tabel voor attack.Die moet nog weg.
Kan iemand mij helpen?Please??
haytjes - 31/07/2005 21:07 (laatste wijziging 31/07/2005 21:23)
JS gevorderde
<?
// als type niet is: HaCkEr OF (type is HaCkEr EN
if(($data->type != 3 || ($data->type == 3 && $info->type != 3)) && round($data->signup/3600-time()/3600) + 12 <= 0 && round($info->signup/3600-time()/3600) + 12 <= 0 && ($info->clan != $data->clan || $info->clan == ""))
print " <td align=\"center\" class=\"mainTxt\"><a href=\"attack.php?x={$info->login}\">Attack</a></td></tr>\n\n";
else
print " </tr>\n\n";
}
// als type niet is: HaCkEr OF (type is HaCkEr EN
if(($data->type != 3 || ($data->type == 3 && $info->type != 3)) && round($data->signup/3600-time()/3600) + 12 <= 0 && round($info->signup/3600-time()/3600) + 12 <= 0 && ($info->clan != $data->clan || $info->clan == ""))
print " <td align=\"center\" class=\"mainTxt\"><a href=\"attack.php?x={$info->login}\">Attack</a></td></tr>\n\n";
else
print " </tr>\n";
?>
<?
// als type niet is: HaCkEr OF (type is HaCkEr EN
if ( ( $data -> type != 3 || ( $data -> type == 3 && $info -> type != 3 ) ) && round ( $data -> signup / 3600 - time ( ) / 3600 ) + 12 <= 0 && round ( $info -> signup / 3600 - time ( ) / 3600 ) + 12 <= 0 && ( $info -> clan != $data -> clan || $info -> clan == "" ) ) print " <td align=\" center\" class=\" mainTxt\" ><a href=\" attack.php?x={$info->login} \" >Attack</a></td></tr>\n \n " ; else
}
// als type niet is: HaCkEr OF (type is HaCkEr EN
if ( ( $data -> type != 3 || ( $data -> type == 3 && $info -> type != 3 ) ) && round ( $data -> signup / 3600 - time ( ) / 3600 ) + 12 <= 0 && round ( $info -> signup / 3600 - time ( ) / 3600 ) + 12 <= 0 && ( $info -> clan != $data -> clan || $info -> clan == "" ) ) print " <td align=\" center\" class=\" mainTxt\" ><a href=\" attack.php?x={$info->login} \" >Attack</a></td></tr>\n \n " ; else
?>
bedoel je dat dit weg moet ???
resultaat:
code weggedaan, is opgelost en oplossing staat hieronder
code weggedaan, is opgelost en oplossing staat hieronder
gamesty - 31/07/2005 21:18
Onbekend
Parse error: parse error, unexpected $ in /vhost/usr/thefarwest/listtest2.php on line 226
Er moet ergens een } tekort zijn.Maar waar.Ik vind hem niet.
haytjes - 31/07/2005 21:21 (laatste wijziging 31/07/2005 21:22)
JS gevorderde
<?php /* ------------------------- */
include("_include-config.php");
if(! check_login()) {
header("Location: login.php");
exit;
}
mysql_query("UPDATE `[users]` SET `online`=NOW() WHERE `login`='{$data->login}'");
/* ------------------------- */ ?>
<html>
<head>
<title>[( Farwest )]</title>
</head>
<head>
<title> [(Farwest)] </title>
<link rel="stylesheet" type="text/css" href="<?php echo ($_COOKIE['v'] == 2) ? "css-v2.css" : "css-v1.css"; ?>">
</head>
<body style="background: #DDDDDD; margin: 0px;">
<table width=100%>
<tr><td align="center">
<form action="list.php" method="get">
Voorbeeld: "<b>a*</b>" zal een lijst geven van namen die beginnen met een A<br>
<input type="hidden" name="s" value="search"><input type="text" name="q" value="<?php echo $_REQUEST['q']; ?>"> <input type="submit" value="Zoek!">
</form>
</td></tr>
</table>
<table width=100%>
<tr><td align="center" class="subTitle" style="letter-spacing: normal;" width=15><b>#</b></td>
<td class="subTitle" style="letter-spacing: normal;" align="center"><a href="list.php?s=login"><b><font color=white>Nickname</a></b></td>
<td class="subTitle" style="letter-spacing: normal;" align="center"><b>Type</b></td>
<td class="subTitle" style="letter-spacing: normal;" align="center" width=150><a href="list.php?s=health"><b><font color=white>health</b></a></td>
<td class="subTitle" style="letter-spacing: normal;" align="center" width=100><a href="list.php?s=money"><b><font color=white>Geld</b></a></td>
<td class="subTitle" style="letter-spacing: normal;" align="center" width=75><a href="list.php?s=power"><font color="#FFFFFF"><b>Power</b></font></a></td></tr>
<?php /* ------------------------- */
echo mysql_error();
$begin = ($_GET['p'] >= 0) ? $_GET['p']*30 : 0;
if($_GET['s'] == "login")
$dbres = mysql_query("SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`health` FROM `[users]` WHERE `activated`=1 ORDER BY `login` LIMIT $begin,30");
else if($_GET['s'] == "money")
$dbres = mysql_query("SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`health` FROM `[users]` WHERE `activated`=1 ORDER BY `cash`+`bank` DESC,`login` ASC LIMIT $begin,30");
else if($_GET['s'] == "type")
$dbres = mysql_query("SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`health` FROM `[users]` WHERE `activated`=1 ORDER BY `type`,`login` LIMIT $begin,30");
else if($_GET['s'] == "health")
$dbres = mysql_query("SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`health` FROM `[users]` WHERE `activated`=1 ORDER BY `health`,`login` LIMIT $begin,30");
else if($_GET['s'] == "clicks")
$dbres = mysql_query("SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`health` FROM `[users]` WHERE `activated`=1 ORDER BY `clicks` DESC,`login` ASC LIMIT $begin,30");
else if($_GET['s'] == "clan")
$dbres = mysql_query("SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`health` FROM `[users]` WHERE `activated`=1 ORDER BY `clan` DESC,`login` ASC LIMIT $begin,30");
else if($_GET['s'] == "contant")
$dbres = mysql_query("SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`health` FROM `[users]` WHERE `activated`=1 ORDER BY `cash` DESC,`login` ASC LIMIT $begin,30");
else if($_GET['s'] == "online")
$dbres = mysql_query("SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`showonline`,`clan`,`health` FROM `[users]` WHERE `activated`=1 AND UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 ORDER BY `login` LIMIT $begin,30");
else if($_GET['s'] == "admin")
$dbres = mysql_query("SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`health` FROM `[users]` WHERE `level` & 0x80 AND UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 ORDER BY `login` LIMIT $begin,30");
else if($_GET['s'] == "search")
{
$_GET['q'] = preg_replace('/*/','%',$_GET['q']);
$dbres = mysql_query("SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`health` FROM `[users]` WHERE `activated`=1 AND `login` LIKE '{$_GET['q']}' ORDER BY `login` LIMIT $begin,30");
}
else
$dbres = "SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`health` FROM `[users]` WHERE `activated`=1 ORDER BY `login` LIMIT $begin,30";
$result = mysql_query($dbres) or die("FOUT: " . mysql_error());
$user = $_SESSION['login'];
for($j=$begin+1; $info = mysql_fetch_object($result); $j++)
{
// ????
$login = ($info->showonline == 0 && $data->level == 0x80 && $_GET['s'] == "online") ? "{$info->login} *" : $info->login;
// onthoud admins dikgedrukt en met *, als betreffende user dat is
$login = ($info->level & 0x80) ? "<b><font color=red>$login* </b>" : $login;
$login = ($info->level == 5) ? "<b><font color=#Green>$login* </b>" : $login;
$login = ($info->level == 100) ? "<b><font color=#000000>$login*</b>" : $login;$leven = $info->leven;
$contant = $info->cash+$info->contant;
$clan = $info->clan;
$clicks = $info->clicks;
// maak een array met typen
$type = Array("","Cowboy","Indiaan","Sherriff");
// onthoud betreffende type
$type = $type[$info->type];
// rond berekening van power af op gehele waarde en onthoud deze van de betreffende typen
$power = round(($info->attack+$info->defence)/2+$info->clicks*5);
// money is bank+cash waarde van betreffende coureur
$money = $info->cash+$info->bank;
if ($power <= 100) {
$rank = "Zwerver";
} elseif ($power > 100 AND $power <= 300) {
$rank = "Bedelaar";
} elseif ($power > 300 AND $power <= 700) {
$rank = "Crimineel";
} elseif ($power > 700 AND $power <= 1900) {
$rank = "Zakkenroller";
} elseif ($power > 1300 AND $power <= 2800) {
$rank = "Tuig";
} elseif ($power > 2000 AND $power <= 3900) {
$rank = "Geweldadig";
} elseif ($power > 2800 AND $power <= 4750) {
$rank = "Autodief";
} elseif ($power > 3700 AND $power <= 6700) {
$rank = "Drugsdealer";
} elseif ($power > 4700 AND $power <= 7800) {
$rank = "Gangster";
} elseif ($power > 5800 AND $power <= 9000) {
$rank = "Overvaller";
} elseif ($power > 6000 AND $power <= 1500) {
$rank = "Bendeleider";
} elseif ($power > 7300 AND $power <= 18200) {
$rank = "Huurmoordenaar";
} elseif ($power > 25200) {
$rank = "God";
}
// toon een rij met de kolommen: nummer, loginnaam, type, money en power van de user met nummer $j
?>
<tr><td align="center" class=\"mainTxt\" width="20"><?=$j;?></td>
<td class=\"mainTxt\"><a href="profile.php?x={$info->login}"><?=$login;?></a></td>
<td align="center" class=\"mainTxt\" width="150"><?=$type;?></td>
<td align="center" class=\"mainTxt\" width="150"><?=$health;?>%</td>
<td align="center" class=\"mainTxt\" width="100"><?=$money;?></td>
<td align="center" class=\"mainTxt\" width="100"><?=$power;?></td>
<?php
// DEBUG COMMENT: hier gaat SESSION de mist in
// DEBUG CODE:
echo "<td align=\"center\" class=\"mainTxt\" width=100>".$_SESSION['login']."</td>";
}
if($_GET['s'] == "online")
$dbres = mysql_query("SELECT `id` FROM `[users]` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300");
else if($_GET['s'] == "online")
$dbres = mysql_query("SELECT `id` FROM `[users]` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 AND `showonline`=1");
else if($_GET['s'] == "admin")
$dbres = mysql_query("SELECT `id` FROM `[users]` WHERE `level` & 0x80 AND UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 ORDER BY `login` LIMIT $begin,30");
else if($_GET['s'] == "search")
{
$dbres = mysql_query("SELECT `id` FROM `[users]` WHERE `activated`=1 AND `login` LIKE '{$_GET['q']}' ORDER BY `login`");
$_GET['q'] = preg_replace('/%/','*',$_GET['q']);
}
else
$dbres = mysql_query("SELECT id FROM `[users]` WHERE `activated`=1");
print "</table>\n\n<table width=100%>\n <tr><td class=\"mainTxt\" align=\"center\">";
if(mysql_num_rows($dbres) <= 30)
print "< 1 ></td></tr></table>\n";
else
{
if($begin/30 == 0)
print "<< ";
else
print ("<a href=\"list.php?s={$_GET['s']}&q={$_GET['q']}&p=\""
.($begin/30-1)."\"><<</a> ");
for($i=0; $i<mysql_num_rows($dbres)/30; $i++)
{
print ("<a href=\"list.php?s={$_GET['s']}&q={$_GET['q']}&p=$i\">". ($i+1) ."</a> ");
}
if($begin+30 >= mysql_num_rows($dbres))
print ">> ";
else
print ("<a href=\"list.php?s={$_GET['s']}&q={$_GET['q']}&p=". ($begin/30+1) ."\">>></a>");
}
$dbres = mysql_query("SELECT `id` FROM `[users]` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300");
$online = mysql_num_rows($dbres);
$dbres = mysql_query("SELECT `id` FROM `[users]` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 AND `showonline`=0");
$anonymous = mysql_num_rows($dbres);
$dbres = mysql_query("SELECT `id` FROM `[users]` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 AND `level`=255");
$admins = mysql_num_rows($dbres);
/* ------------------------- */ ?>
</table>
<table width=100%>
<tr><td align="center"><a href="list.php?s=online"><b><?php print $online; ?> leden online</b></a></td></tr>
<tr><td align="center"><a href="list.php?s=admin"><b><?php print $admins; ?> beheerder(s) online</b></a></td></tr>
<tr><td align="center"><font color=darkblue><b>Admins worden aangegeven als:</b><font color=red><b>Loginnaam<img src="http://www.alasal.be/sitemasters/images/diamant.gif" width=10 height=10 border=0 alt="diamant"></b></font></td></tr>
<tr><td align="center"><font color=darkblue><b>Betaalde Accounts als:</b><font color=#4DFF00<b>Loginnaam<img src="http://www.alasal.be/sitemasters/images/ster2.gif" width=10 height=10 border=0 alt="/images/ster2.gif"></b></font></td></tr>
</table>
<?php
$login = $user;
// DEBUG CODE:
// echo $_SESSION["login"];
?>
</body>
</html>
<span Style="display: none">
<?php /* ------------------------- */
include ( "_include-config.php" ) ;
if ( ! check_login( ) ) {
header ( "Location: login.php" ) ; }
mysql_query ( "UPDATE `[users]` SET `online`=NOW() WHERE `login`='{$data->login} '" ) ;
/* ------------------------- */ ?>
<html>
<head>
<title>[( Farwest )]</title>
</head>
<head>
<title> [(Farwest)] </title>
<link rel="stylesheet" type="text/css" href="
<?php echo ( $_COOKIE [ 'v' ] == 2 ) ?
"css-v2.css" : "css-v1.css" ; ?> ">
</head>
<body style="background: #DDDDDD; margin: 0px;">
<table width=100%>
<tr><td align="center">
<form action="list.php" method="get">
Voorbeeld: "<b>a*</b>" zal een lijst geven van namen die beginnen met een A<br>
<input type="hidden" name="s" value="search"><input type="text" name="q" value="
<?php echo $_REQUEST [ 'q' ] ; ?> "> <input type="submit" value="Zoek!">
</form>
</td></tr>
</table>
<table width=100%>
<tr><td align="center" class="subTitle" style="letter-spacing: normal;" width=15><b>#</b></td>
<td class="subTitle" style="letter-spacing: normal;" align="center"><a href="list.php?s=login"><b><font color=white>Nickname</a></b></td>
<td class="subTitle" style="letter-spacing: normal;" align="center"><b>Type</b></td>
<td class="subTitle" style="letter-spacing: normal;" align="center" width=150><a href="list.php?s=health"><b><font color=white>health</b></a></td>
<td class="subTitle" style="letter-spacing: normal;" align="center" width=100><a href="list.php?s=money"><b><font color=white>Geld</b></a></td>
<td class="subTitle" style="letter-spacing: normal;" align="center" width=75><a href="list.php?s=power"><font color="#FFFFFF"><b>Power</b></font></a></td></tr>
<?php /* ------------------------- */
$begin = ( $_GET [ 'p' ] >= 0 ) ? $_GET [ 'p' ] * 30 : 0 ;
if ( $_GET [ 's' ] == "login" )
$dbres = mysql_query ( "SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`health` FROM `[users]` WHERE `activated`=1 ORDER BY `login` LIMIT $begin ,30" ) ;
else if ( $_GET [ 's' ] == "money" )
$dbres = mysql_query ( "SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`health` FROM `[users]` WHERE `activated`=1 ORDER BY `cash`+`bank` DESC,`login` ASC LIMIT $begin ,30" ) ;
else if ( $_GET [ 's' ] == "type" )
$dbres = mysql_query ( "SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`health` FROM `[users]` WHERE `activated`=1 ORDER BY `type`,`login` LIMIT $begin ,30" ) ;
else if ( $_GET [ 's' ] == "health" )
$dbres = mysql_query ( "SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`health` FROM `[users]` WHERE `activated`=1 ORDER BY `health`,`login` LIMIT $begin ,30" ) ;
else if ( $_GET [ 's' ] == "clicks" )
$dbres = mysql_query ( "SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`health` FROM `[users]` WHERE `activated`=1 ORDER BY `clicks` DESC,`login` ASC LIMIT $begin ,30" ) ;
else if ( $_GET [ 's' ] == "clan" )
$dbres = mysql_query ( "SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`health` FROM `[users]` WHERE `activated`=1 ORDER BY `clan` DESC,`login` ASC LIMIT $begin ,30" ) ; else if ( $_GET [ 's' ] == "contant" )
$dbres = mysql_query ( "SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`health` FROM `[users]` WHERE `activated`=1 ORDER BY `cash` DESC,`login` ASC LIMIT $begin ,30" ) ;
else if ( $_GET [ 's' ] == "online" )
$dbres = mysql_query ( "SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`showonline`,`clan`,`health` FROM `[users]` WHERE `activated`=1 AND UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 ORDER BY `login` LIMIT $begin ,30" ) ;
else if ( $_GET [ 's' ] == "admin" )
$dbres = mysql_query ( "SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`health` FROM `[users]` WHERE `level` & 0x80 AND UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 ORDER BY `login` LIMIT $begin ,30" ) ;
else if ( $_GET [ 's' ] == "search" )
{
$dbres = mysql_query ( "SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`health` FROM `[users]` WHERE `activated`=1 AND `login` LIKE '{$_GET['q']} ' ORDER BY `login` LIMIT $begin ,30" ) ; }
else
$dbres = "SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`health` FROM `[users]` WHERE `activated`=1 ORDER BY `login` LIMIT $begin ,30" ;
$user = $_SESSION [ 'login' ] ;
{
// ????
$login = ( $info -> showonline == 0 && $data -> level == 0x80 && $_GET [ 's' ] == "online" ) ? "{$info->login} *" : $info -> login ;
// onthoud admins dikgedrukt en met *, als betreffende user dat is
$login = ( $info -> level & 0x80 ) ? "<b><font color=red>$login * </b>" : $login ;
$login = ( $info -> level == 5 ) ? "<b><font color=#Green>$login * </b>" : $login ;
$login = ( $info -> level == 100 ) ? "<b><font color=#000000>$login *</b>" : $login ; $leven = $info -> leven ;
$contant = $info -> cash + $info -> contant ;
$clan = $info -> clan ;
$clicks = $info -> clicks ;
// maak een array met typen
$type = Array ( "" , "Cowboy" , "Indiaan" , "Sherriff" ) ;
// onthoud betreffende type
$type = $type [ $info -> type ] ;
// rond berekening van power af op gehele waarde en onthoud deze van de betreffende typen
$power = round ( ( $info -> attack + $info -> defence ) / 2 + $info -> clicks * 5 ) ;
// money is bank+cash waarde van betreffende coureur
$money = $info -> cash + $info -> bank ;
if ( $power <= 100 ) {
$rank = "Zwerver" ;
} elseif ( $power > 100 AND $power <= 300 ) {
$rank = "Bedelaar" ;
} elseif ( $power > 300 AND $power <= 700 ) {
$rank = "Crimineel" ;
} elseif ( $power > 700 AND $power <= 1900 ) {
$rank = "Zakkenroller" ;
} elseif ( $power > 1300 AND $power <= 2800 ) {
$rank = "Tuig" ;
} elseif ( $power > 2000 AND $power <= 3900 ) {
$rank = "Geweldadig" ;
} elseif ( $power > 2800 AND $power <= 4750 ) {
$rank = "Autodief" ;
} elseif ( $power > 3700 AND $power <= 6700 ) {
$rank = "Drugsdealer" ;
} elseif ( $power > 4700 AND $power <= 7800 ) {
$rank = "Gangster" ;
} elseif ( $power > 5800 AND $power <= 9000 ) {
$rank = "Overvaller" ;
} elseif ( $power > 6000 AND $power <= 1500 ) {
$rank = "Bendeleider" ;
} elseif ( $power > 7300 AND $power <= 18200 ) {
$rank = "Huurmoordenaar" ;
} elseif ( $power > 25200 ) {
$rank = "God" ;
}
// toon een rij met de kolommen: nummer, loginnaam, type, money en power van de user met nummer $j
?>
<tr><td align="center" class=\"mainTxt\" width="20"><?= $j ; ?> </td>
<td class=\"mainTxt\"><a href="profile.php?x={$info->login}"><?= $login ; ?> </a></td>
<td align="center" class=\"mainTxt\" width="150"><?= $type ; ?> </td>
<td align="center" class=\"mainTxt\" width="150"><?= $health ; ?> %</td>
<td align="center" class=\"mainTxt\" width="100"><?= $money ; ?> </td>
<td align="center" class=\"mainTxt\" width="100"><?= $power ; ?> </td>
<?php
// DEBUG COMMENT: hier gaat SESSION de mist in
// DEBUG CODE:
echo "<td align=\" center\" class=\" mainTxt\" width=100>" . $_SESSION [ 'login' ] . "</td>" ;
}
if ( $_GET [ 's' ] == "online" )
$dbres = mysql_query ( "SELECT `id` FROM `[users]` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300" ) ;
else if ( $_GET [ 's' ] == "online" )
$dbres = mysql_query ( "SELECT `id` FROM `[users]` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 AND `showonline`=1" ) ;
else if ( $_GET [ 's' ] == "admin" )
$dbres = mysql_query ( "SELECT `id` FROM `[users]` WHERE `level` & 0x80 AND UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 ORDER BY `login` LIMIT $begin ,30" ) ;
else if ( $_GET [ 's' ] == "search" )
{
$dbres = mysql_query ( "SELECT `id` FROM `[users]` WHERE `activated`=1 AND `login` LIKE '{$_GET['q']} ' ORDER BY `login`" ) ;
}
else
$dbres = mysql_query ( "SELECT id FROM `[users]` WHERE `activated`=1" ) ; print "</table>\n \n <table width=100%>\n <tr><td class=\" mainTxt\" align=\" center\" >" ;
print "< 1 ></td></tr></table>\n " ;
else
{
if ( $begin / 30 == 0 )
else
print ( "<a href=\" list.php?s={$_GET['s']} &q={$_GET['q']} &p=\" " . ( $begin / 30 - 1 ) . "\" ><<</a> " ) ;
for ( $i = 0 ; $i < mysql_num_rows( $dbres ) / 30 ; $i ++ )
{
print ( "<a href=\" list.php?s={$_GET['s']} &q={$_GET['q']} &p=$i \" >" . ( $i + 1 ) . "</a> " ) ; }
else
print ( "<a href=\" list.php?s={$_GET['s']} &q={$_GET['q']} &p=" . ( $begin / 30 + 1 ) . "\" >>></a>" ) ; }
$dbres = mysql_query ( "SELECT `id` FROM `[users]` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300" ) ; $dbres = mysql_query ( "SELECT `id` FROM `[users]` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 AND `showonline`=0" ) ; $dbres = mysql_query ( "SELECT `id` FROM `[users]` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 AND `level`=255" ) ;
/* ------------------------- */ ?>
</table>
<table width=100%>
<tr><td align="center"><a href="list.php?s=online"><b>
<?php print $online ; ?> leden online</b></a></td></tr>
<tr><td align="center"><a href="list.php?s=admin"><b>
<?php print $admins ; ?> beheerder(s) online</b></a></td></tr>
<tr><td align="center"><font color=darkblue><b>Admins worden aangegeven als:</b><font color=red><b>Loginnaam<img src="http://www.alasal.be/sitemasters/images/diamant.gif" width=10 height=10 border=0 alt="diamant"></b></font></td></tr>
<tr><td align="center"><font color=darkblue><b>Betaalde Accounts als:</b><font color=#4DFF00<b>Loginnaam<img src="http://www.alasal.be/sitemasters/images/ster2.gif" width=10 height=10 border=0 alt="/images/ster2.gif"></b></font></td></tr>
</table>
<?php
$login = $user ;
// DEBUG CODE:
// echo $_SESSION["login"];
?>
</body>
</html>
<span Style="display: none">
Ibrahim - 31/07/2005 21:23 (laatste wijziging 31/07/2005 21:24)
PHP expert
hier is die
<?php
else {
$dbres = "SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`health` FROM `[users]` WHERE `activated`=1 ORDER BY `login` LIMIT $begin,30";
$result = mysql_query($dbres) or die("FOUT: " . mysql_error());
$user = $_SESSION['login'];
}
?>
<?php
else {
$dbres = "SELECT `login`,UNIX_TIMESTAMP(`signup`) AS `signup`,`attack`,`defence`,`clicks`,`cash`,`bank`,`type`,`level`,`clan`,`health` FROM `[users]` WHERE `activated`=1 ORDER BY `login` LIMIT $begin ,30" ;
$user = $_SESSION [ 'login' ] ;
}
?>
3 verschillende actie dus met accolades scriptregel hierboven: 78 t/m 81
Gesponsorde links
Dit onderwerp is gesloten .