login  Naam:   Wachtwoord: 
Registreer je!
 Forum

Parse errors | Pagina 2

46 antwoorden

Gesponsorde links
Offline gamesty - 30/07/2005 10:24
Avatar van gamesty Onbekend Inderdaad,Dat staat in de config.Iemand?
Offline DaOxx - 30/07/2005 11:17
Avatar van DaOxx PHP beginner Heb je wel de juiste regel gepost, post eens 5 regels erboven en 5 regels beneden ook.
Offline gamesty - 30/07/2005 11:26
Avatar van gamesty 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'

  1. <?php /* ------------------------- */
  2.  
  3. include("_include-config.php");
  4. if(! check_login()) {
  5. header("Location: login.php");
  6. exit;
  7. }
  8.  
  9. mysql_query("UPDATE `[users]` SET `online`=NOW() WHERE `login`='{$data->login}'");
  10.  
  11. /* ------------------------- */ ?>
  12. <html>
  13. <head>
  14. <title>[( Farwest )]</title>
  15.  
  16.  
  17. </head>
  18. <head>
  19. <title> [(Farwest)] </title>
  20. <link rel="stylesheet" type="text/css" href="<?php echo ($_COOKIE['v'] == 2) ? "css-v2.css" : "css-v1.css"; ?>">
  21.  
  22. </head>
  23.  
  24.  
  25. <body style="background: #DDDDDD; margin: 0px;">
  26. <table width=100%>
  27. <tr><td align="center">
  28. <form action="list.php" method="get">
  29. Voorbeeld: "<b>a*</b>" zal een lijst geven van namen die beginnen met een A<br>
  30. <input type="hidden" name="s" value="search"><input type="text" name="q" value="<?php echo $_REQUEST['q']; ?>"> <input type="submit" value="Zoek!">
  31. </form>
  32. </td></tr>
  33. </table>
  34. <table width=100%>
  35. <tr><td align="center" class="subTitle" style="letter-spacing: normal;" width=15><b>#</b></td>
  36. <td class="subTitle" style="letter-spacing: normal;" align="center"><a href="list.php?s=login"><b><font color=white>Nickname</a></b></td>
  37. <td class="subTitle" style="letter-spacing: normal;" align="center"><b>Type</b></td>
  38. <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>
  39. <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>
  40. <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>
  41. <?php /* ------------------------- */
  42. $begin = ($_GET['p'] >= 0) ? $_GET['p']*30 : 0;
  43.  
  44. if($_GET['s'] == "login")
  45. $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");
  46.  
  47.  
  48. else if($_GET['s'] == "money")
  49. $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");
  50.  
  51. else if($_GET['s'] == "type")
  52. $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");
  53.  
  54. else if($_GET['s'] == "health")
  55. $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");
  56.  
  57. else if($_GET['s'] == "clicks")
  58. $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");
  59.  
  60. else if($_GET['s'] == "clan")
  61. $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");
  62. else if($_GET['s'] == "contant")
  63. $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");
  64.  
  65. else if($_GET['s'] == "online")
  66. $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");
  67.  
  68. else if($_GET['s'] == "admin")
  69. $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");
  70.  
  71. else if($_GET['s'] == "search")
  72. {
  73. $_GET['q'] = preg_replace('/*/','%',$_GET['q']);
  74. $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");
  75. }
  76.  
  77. else
  78. $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";
  79. $result = mysql_query($dbres) or die("FOUT: " . mysql_error());
  80. $user = $_SESSION['login'];
  81.  
  82. for($j=$begin+1; $info = mysql_fetch_object($result); $j++)
  83. {
  84. // ????
  85. $login = ($info->showonline == 0 && $data->level == 0x80 && $_GET['s'] == "online") ? "{$info->login} *" : $info->login;
  86.  
  87. // onthoud admins dikgedrukt en met *, als betreffende user dat is
  88. $login = ($info->level & 0x80) ? "<b><font color=red>$login* </b>" : $login;
  89.  
  90. $login = ($info->level == 5) ? "<b><font color=#Green>$login* </b>" : $login;
  91.  
  92. $login = ($info->level == 100) ? "<b><font color=#000000>$login*</b>" : $login;$leven = $info->leven;
  93.  
  94.  
  95. $contant = $info->cash+$info->contant;
  96. $clan = $info->clan;
  97. $clicks = $info->clicks;
  98. // maak een array met typen
  99. $type = Array("","Cowboy","Indiaan","Sherriff");
  100.  
  101. // onthoud betreffende type
  102. $type = $type[$info->type];
  103.  
  104. // rond berekening van power af op gehele waarde en onthoud deze van de betreffende typen
  105. $power = round(($info->attack+$info->defence)/2+$info->clicks*5);
  106.  
  107. // money is bank+cash waarde van betreffende coureur
  108. $money = $info->cash+$info->bank;
  109.  
  110. if ($power <= 100) {
  111. $rank = "Zwerver";
  112. } elseif ($power > 100 AND $power <= 300) {
  113. $rank = "Bedelaar";
  114. } elseif ($power > 300 AND $power <= 700) {
  115. $rank = "Crimineel";
  116. } elseif ($power > 700 AND $power <= 1900) {
  117. $rank = "Zakkenroller";
  118. } elseif ($power > 1300 AND $power <= 2800) {
  119. $rank = "Tuig";
  120. } elseif ($power > 2000 AND $power <= 3900) {
  121. $rank = "Geweldadig";
  122. } elseif ($power > 2800 AND $power <= 4750) {
  123. $rank = "Autodief";
  124. } elseif ($power > 3700 AND $power <= 6700) {
  125. $rank = "Drugsdealer";
  126. } elseif ($power > 4700 AND $power <= 7800) {
  127. $rank = "Gangster";
  128. } elseif ($power > 5800 AND $power <= 9000) {
  129. $rank = "Overvaller";
  130. } elseif ($power > 6000 AND $power <= 1500) {
  131. $rank = "Bendeleider";
  132. } elseif ($power > 7300 AND $power <= 18200) {
  133. $rank = "Huurmoordenaar";
  134. } elseif ($power > 25200) {
  135. $rank = "God";
  136. }
  137.  
  138.  
  139. // toon een rij met de kolommen: nummer, loginnaam, type, money en power van de user met nummer $j
  140. ?>
  141. <tr><td align="center" class=\"mainTxt\" width="20"><?=$j;?></td>
  142. <td class=\"mainTxt\"><a href="profile.php?x={$info->login}"><?=$login;?></a></td>
  143. <td align="center" class=\"mainTxt\" width="150"><?=$type;?></td>
  144. <td align="center" class=\"mainTxt\" width="150"><?=$health;?>%</td>
  145. <td align="center" class=\"mainTxt\" width="100"><?=$money;?></td>
  146. <td align="center" class=\"mainTxt\" width="100"><?=$power;?></td>
  147. <?php
  148. // DEBUG COMMENT: hier gaat SESSION de mist in
  149. // DEBUG CODE:
  150. echo "<td align=\"center\" class=\"mainTxt\" width=100>".$_SESSION['login']."</td>";
  151.  
  152. // als type niet is: HaCkEr OF (type is HaCkEr EN
  153. 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 == ""))
  154. print " <td align=\"center\" class=\"mainTxt\"><a href=\"attack.php?x={$info->login}\">Attack</a></td></tr>\n\n";
  155. else
  156. print " </tr>\n\n";
  157. }
  158. // als type niet is: HaCkEr OF (type is HaCkEr EN
  159. 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 == ""))
  160. print " <td align=\"center\" class=\"mainTxt\"><a href=\"attack.php?x={$info->login}\">Attack</a></td></tr>\n\n";
  161. else
  162. print " </tr>\n";
  163.  
  164. if($_GET['s'] == "online")
  165. $dbres = mysql_query("SELECT `id` FROM `[users]` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300");
  166.  
  167. else if($_GET['s'] == "online")
  168. $dbres = mysql_query("SELECT `id` FROM `[users]` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 AND `showonline`=1");
  169.  
  170. else if($_GET['s'] == "admin")
  171. $dbres = mysql_query("SELECT `id` FROM `[users]` WHERE `level` & 0x80 AND UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 ORDER BY `login` LIMIT $begin,30");
  172.  
  173.  
  174. else if($_GET['s'] == "search")
  175. {
  176. $dbres = mysql_query("SELECT `id` FROM `[users]` WHERE `activated`=1 AND `login` LIKE '{$_GET['q']}' ORDER BY `login`");
  177.  
  178. $_GET['q'] = preg_replace('/%/','*',$_GET['q']);
  179. }
  180.  
  181. else
  182. $dbres = mysql_query("SELECT id FROM `[users]` WHERE `activated`=1");
  183. print "</table>\n\n<table width=100%>\n <tr><td class=\"mainTxt\" align=\"center\">";
  184.  
  185. if(mysql_num_rows($dbres) <= 30)
  186. print "&#60; 1 &#62;</td></tr></table>\n";
  187.  
  188. else
  189. {
  190. if($begin/30 == 0)
  191. print "&#60;&#60; ";
  192.  
  193. else
  194. print ("<a href=\"list.php?s={$_GET['s']}&q={$_GET['q']}&p=\""
  195. .($begin/30-1)."\">&#60;&#60;</a> ");
  196.  
  197. for($i=0; $i<mysql_num_rows($dbres)/30; $i++)
  198. {
  199. print ("<a href=\"list.php?s={$_GET['s']}&q={$_GET['q']}&p=$i\">". ($i+1) ."</a> ");
  200. }
  201.  
  202. if($begin+30 >= mysql_num_rows($dbres))
  203. print "&#62;&#62; ";
  204.  
  205. else
  206. print ("<a href=\"list.php?s={$_GET['s']}&q={$_GET['q']}&p=". ($begin/30+1) ."\">&#62;&#62;</a>");
  207. }
  208.  
  209. $dbres = mysql_query("SELECT `id` FROM `[users]` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300");
  210. $online = mysql_num_rows($dbres);
  211. $dbres = mysql_query("SELECT `id` FROM `[users]` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 AND `showonline`=0");
  212. $anonymous = mysql_num_rows($dbres);
  213. $dbres = mysql_query("SELECT `id` FROM `[users]` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 AND `level`=255");
  214. $admins = mysql_num_rows($dbres);
  215.  
  216. /* ------------------------- */ ?>
  217. </table>
  218. <table width=100%>
  219. <tr><td align="center"><a href="list.php?s=online"><b><?php print $online; ?> leden online</b></a></td></tr>
  220. <tr><td align="center"><a href="list.php?s=admin"><b><?php print $admins; ?> beheerder(s) online</b></a></td></tr>
  221. <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>
  222. <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>
  223. </table>
  224.  
  225. <?php
  226. $login = $user;
  227.  
  228. // DEBUG CODE:
  229. // echo $_SESSION["login"];
  230. ?>
  231.  
  232. </body>
  233.  
  234.  
  235. </html>
  236.  
  237. <span Style="display: none">


Iemand hiervoor een oplossing?
Offline Dolfje - 30/07/2005 12:26
Avatar van Dolfje Gouden medailleGouden medailleGouden medaille

PHP ver gevorderde
doe eens achter alle mysql_query een "or die(mysql_error)"
en zeg me dan wat er word uitgeprint 
Offline haytjes - 30/07/2005 12:27 (laatste wijziging 30/07/2005 13:11)
Avatar van haytjes Gouden medailleGouden medaille

JS gevorderde
@siliecom14 : het was maar om zker te weten hoor !!,

[edit]
dacht dat je nog altijd dezelfde fout had ...
Offline gamesty - 30/07/2005 13:18 (laatste wijziging 30/07/2005 16:23)
Avatar van gamesty 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.
Offline Dolfje - 30/07/2005 16:57
Avatar van Dolfje Gouden medailleGouden medailleGouden medaille

PHP ver gevorderde
je krijgt 2x nickname? k'snap et nie
Offline gamesty - 30/07/2005 17:07
Avatar van gamesty Onbekend Kijk naar het voorbeeld.Ik krijg 2x de username.1x in het begin en dan achteraan.
Offline haytjes - 30/07/2005 21:20
Avatar van haytjes Gouden medailleGouden medaille

JS gevorderde
still don't get it !!!!!
Offline Dolfje - 30/07/2005 21:34
Avatar van Dolfje Gouden medailleGouden medailleGouden medaille

PHP ver gevorderde
ik krijg maar 1 keer username hoor.

de velden die ik krijg: #, nickname, type, health, geld, power, attack
Offline gamesty - 30/07/2005 21:45 (laatste wijziging 31/07/2005 21:01)
Avatar van gamesty Onbekend Ja,Nu heb ik dat ook.Maar je krijgt nu een tabel voor attack.Die moet nog weg.

Kan iemand mij helpen?Please??
Offline haytjes - 31/07/2005 21:07 (laatste wijziging 31/07/2005 21:23)
Avatar van haytjes Gouden medailleGouden medaille

JS gevorderde
  1. <?
  2. // als type niet is: HaCkEr OF (type is HaCkEr EN
  3. 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 == ""))
  4. print " <td align=\"center\" class=\"mainTxt\"><a href=\"attack.php?x={$info->login}\">Attack</a></td></tr>\n\n";
  5. else
  6. print " </tr>\n\n";
  7. }
  8. // als type niet is: HaCkEr OF (type is HaCkEr EN
  9. 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 == ""))
  10. print " <td align=\"center\" class=\"mainTxt\"><a href=\"attack.php?x={$info->login}\">Attack</a></td></tr>\n\n";
  11. else
  12. print " </tr>\n";
  13. ?>


bedoel je dat dit weg moet ???

resultaat:
  1. code weggedaan, is opgelost en oplossing staat hieronder
Offline gamesty - 31/07/2005 21:18
Avatar van gamesty 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.
Offline haytjes - 31/07/2005 21:21 (laatste wijziging 31/07/2005 21:22)
Avatar van haytjes Gouden medailleGouden medaille

JS gevorderde
  1. <?php /* ------------------------- */
  2.  
  3. include("_include-config.php");
  4. if(! check_login()) {
  5. header("Location: login.php");
  6. }
  7.  
  8. mysql_query("UPDATE `[users]` SET `online`=NOW() WHERE `login`='{$data->login}'");
  9.  
  10. /* ------------------------- */ ?>
  11. <html>
  12. <head>
  13. <title>[( Farwest )]</title>
  14.  
  15.  
  16. </head>
  17. <head>
  18. <title> [(Farwest)] </title>
  19. <link rel="stylesheet" type="text/css" href="<?php echo ($_COOKIE['v'] == 2) ? "css-v2.css" : "css-v1.css"; ?>">
  20.  
  21. </head>
  22.  
  23.  
  24. <body style="background: #DDDDDD; margin: 0px;">
  25. <table width=100%>
  26. <tr><td align="center">
  27. <form action="list.php" method="get">
  28. Voorbeeld: "<b>a*</b>" zal een lijst geven van namen die beginnen met een A<br>
  29. <input type="hidden" name="s" value="search"><input type="text" name="q" value="<?php echo $_REQUEST['q']; ?>"> <input type="submit" value="Zoek!">
  30. </form>
  31. </td></tr>
  32. </table>
  33. <table width=100%>
  34. <tr><td align="center" class="subTitle" style="letter-spacing: normal;" width=15><b>#</b></td>
  35. <td class="subTitle" style="letter-spacing: normal;" align="center"><a href="list.php?s=login"><b><font color=white>Nickname</a></b></td>
  36. <td class="subTitle" style="letter-spacing: normal;" align="center"><b>Type</b></td>
  37. <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>
  38. <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>
  39. <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>
  40. <?php /* ------------------------- */
  41. $begin = ($_GET['p'] >= 0) ? $_GET['p']*30 : 0;
  42.  
  43. if($_GET['s'] == "login")
  44. $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");
  45.  
  46.  
  47. else if($_GET['s'] == "money")
  48. $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");
  49.  
  50. else if($_GET['s'] == "type")
  51. $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");
  52.  
  53. else if($_GET['s'] == "health")
  54. $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");
  55.  
  56. else if($_GET['s'] == "clicks")
  57. $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");
  58.  
  59. else if($_GET['s'] == "clan")
  60. $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");
  61. else if($_GET['s'] == "contant")
  62. $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");
  63.  
  64. else if($_GET['s'] == "online")
  65. $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");
  66.  
  67. else if($_GET['s'] == "admin")
  68. $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");
  69.  
  70. else if($_GET['s'] == "search")
  71. {
  72. $_GET['q'] = preg_replace('/*/','%',$_GET['q']);
  73. $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");
  74. }
  75.  
  76. else
  77. $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";
  78. $result = mysql_query($dbres) or die("FOUT: " . mysql_error());
  79. $user = $_SESSION['login'];
  80.  
  81. for($j=$begin+1; $info = mysql_fetch_object($result); $j++)
  82. {
  83. // ????
  84. $login = ($info->showonline == 0 && $data->level == 0x80 && $_GET['s'] == "online") ? "{$info->login} *" : $info->login;
  85.  
  86. // onthoud admins dikgedrukt en met *, als betreffende user dat is
  87. $login = ($info->level & 0x80) ? "<b><font color=red>$login* </b>" : $login;
  88.  
  89. $login = ($info->level == 5) ? "<b><font color=#Green>$login* </b>" : $login;
  90.  
  91. $login = ($info->level == 100) ? "<b><font color=#000000>$login*</b>" : $login;$leven = $info->leven;
  92.  
  93.  
  94. $contant = $info->cash+$info->contant;
  95. $clan = $info->clan;
  96. $clicks = $info->clicks;
  97. // maak een array met typen
  98. $type = Array("","Cowboy","Indiaan","Sherriff");
  99.  
  100. // onthoud betreffende type
  101. $type = $type[$info->type];
  102.  
  103. // rond berekening van power af op gehele waarde en onthoud deze van de betreffende typen
  104. $power = round(($info->attack+$info->defence)/2+$info->clicks*5);
  105.  
  106. // money is bank+cash waarde van betreffende coureur
  107. $money = $info->cash+$info->bank;
  108.  
  109. if ($power <= 100) {
  110. $rank = "Zwerver";
  111. } elseif ($power > 100 AND $power <= 300) {
  112. $rank = "Bedelaar";
  113. } elseif ($power > 300 AND $power <= 700) {
  114. $rank = "Crimineel";
  115. } elseif ($power > 700 AND $power <= 1900) {
  116. $rank = "Zakkenroller";
  117. } elseif ($power > 1300 AND $power <= 2800) {
  118. $rank = "Tuig";
  119. } elseif ($power > 2000 AND $power <= 3900) {
  120. $rank = "Geweldadig";
  121. } elseif ($power > 2800 AND $power <= 4750) {
  122. $rank = "Autodief";
  123. } elseif ($power > 3700 AND $power <= 6700) {
  124. $rank = "Drugsdealer";
  125. } elseif ($power > 4700 AND $power <= 7800) {
  126. $rank = "Gangster";
  127. } elseif ($power > 5800 AND $power <= 9000) {
  128. $rank = "Overvaller";
  129. } elseif ($power > 6000 AND $power <= 1500) {
  130. $rank = "Bendeleider";
  131. } elseif ($power > 7300 AND $power <= 18200) {
  132. $rank = "Huurmoordenaar";
  133. } elseif ($power > 25200) {
  134. $rank = "God";
  135. }
  136.  
  137.  
  138. // toon een rij met de kolommen: nummer, loginnaam, type, money en power van de user met nummer $j
  139. ?>
  140. <tr><td align="center" class=\"mainTxt\" width="20"><?=$j;?></td>
  141. <td class=\"mainTxt\"><a href="profile.php?x={$info->login}"><?=$login;?></a></td>
  142. <td align="center" class=\"mainTxt\" width="150"><?=$type;?></td>
  143. <td align="center" class=\"mainTxt\" width="150"><?=$health;?>%</td>
  144. <td align="center" class=\"mainTxt\" width="100"><?=$money;?></td>
  145. <td align="center" class=\"mainTxt\" width="100"><?=$power;?></td>
  146. <?php
  147. // DEBUG COMMENT: hier gaat SESSION de mist in
  148. // DEBUG CODE:
  149. echo "<td align=\"center\" class=\"mainTxt\" width=100>".$_SESSION['login']."</td>";
  150.  
  151. }
  152.  
  153. if($_GET['s'] == "online")
  154. $dbres = mysql_query("SELECT `id` FROM `[users]` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300");
  155.  
  156. else if($_GET['s'] == "online")
  157. $dbres = mysql_query("SELECT `id` FROM `[users]` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 AND `showonline`=1");
  158.  
  159. else if($_GET['s'] == "admin")
  160. $dbres = mysql_query("SELECT `id` FROM `[users]` WHERE `level` & 0x80 AND UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 ORDER BY `login` LIMIT $begin,30");
  161.  
  162.  
  163. else if($_GET['s'] == "search")
  164. {
  165. $dbres = mysql_query("SELECT `id` FROM `[users]` WHERE `activated`=1 AND `login` LIKE '{$_GET['q']}' ORDER BY `login`");
  166.  
  167. $_GET['q'] = preg_replace('/%/','*',$_GET['q']);
  168. }
  169.  
  170. else
  171. $dbres = mysql_query("SELECT id FROM `[users]` WHERE `activated`=1");
  172. print "</table>\n\n<table width=100%>\n <tr><td class=\"mainTxt\" align=\"center\">";
  173.  
  174. if(mysql_num_rows($dbres) <= 30)
  175. print "&#60; 1 &#62;</td></tr></table>\n";
  176.  
  177. else
  178. {
  179. if($begin/30 == 0)
  180. print "&#60;&#60; ";
  181.  
  182. else
  183. print ("<a href=\"list.php?s={$_GET['s']}&q={$_GET['q']}&p=\""
  184. .($begin/30-1)."\">&#60;&#60;</a> ");
  185.  
  186. for($i=0; $i<mysql_num_rows($dbres)/30; $i++)
  187. {
  188. print ("<a href=\"list.php?s={$_GET['s']}&q={$_GET['q']}&p=$i\">". ($i+1) ."</a> ");
  189. }
  190.  
  191. if($begin+30 >= mysql_num_rows($dbres))
  192. print "&#62;&#62; ";
  193.  
  194. else
  195. print ("<a href=\"list.php?s={$_GET['s']}&q={$_GET['q']}&p=". ($begin/30+1) ."\">&#62;&#62;</a>");
  196. }
  197.  
  198. $dbres = mysql_query("SELECT `id` FROM `[users]` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300");
  199. $online = mysql_num_rows($dbres);
  200. $dbres = mysql_query("SELECT `id` FROM `[users]` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 AND `showonline`=0");
  201. $anonymous = mysql_num_rows($dbres);
  202. $dbres = mysql_query("SELECT `id` FROM `[users]` WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(`online`) < 300 AND `level`=255");
  203. $admins = mysql_num_rows($dbres);
  204.  
  205. /* ------------------------- */ ?>
  206. </table>
  207. <table width=100%>
  208. <tr><td align="center"><a href="list.php?s=online"><b><?php print $online; ?> leden online</b></a></td></tr>
  209. <tr><td align="center"><a href="list.php?s=admin"><b><?php print $admins; ?> beheerder(s) online</b></a></td></tr>
  210. <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>
  211. <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>
  212. </table>
  213.  
  214. <?php
  215. $login = $user;
  216.  
  217. // DEBUG CODE:
  218. // echo $_SESSION["login"];
  219. ?>
  220.  
  221. </body>
  222.  
  223.  
  224. </html>
  225.  
  226. <span Style="display: none">
Offline Ibrahim - 31/07/2005 21:23 (laatste wijziging 31/07/2005 21:24)
Avatar van Ibrahim PHP expert hier is die

  1. <?php
  2. else {
  3. $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";
  4. $result = mysql_query($dbres) or die("FOUT: " . mysql_error());
  5. $user = $_SESSION['login'];
  6. }
  7. ?>

3 verschillende actie dus met accolades scriptregel hierboven: 78 t/m 81
Offline haytjes - 31/07/2005 21:25
Avatar van haytjes Gouden medailleGouden medaille

JS gevorderde
nep 't was daar ni,
in de code die ik verwijderde stond een },
die ik dan ook verwijderde.

Die else wordt later gesloten, maar je ziet dat niet daardat er niet wordt ingesprongen
Gesponsorde links
Dit onderwerp is gesloten.
Actieve forumberichten
© 2002-2024 Sitemasters.be - Regels - Laadtijd: 0.283s