Skip to content

[Share]Castle Control (For Site)

Featured Replies

db.php

   1. <?php
   2. function db_connect()
   3. {
   4. if (mysql_connect('localhost', 'user','password'))
   5. {
   6. if(mysql_select_db('db_name')){
   7. return true;
   8. } else {
   9. return false;
  10. }
  11. } else {
  12. return false;
  13. }
  14. }
  15.  
  16. ?>

castles.php

    1.  
   2. <?php
   3. include_once('includes/db.php');
   4. include_once('header.php');
   5. echo ("<META HTTP-EQUIV=Refresh CONTENT='300; URL=castles.php'>");
   6. ?>
   7. <div id="page_content">
   8. <div class="spacer">
   9. <table align="center" id="tabel_continut">
  10. <tr>
  11. <td class="leftcol">
  12. <h1 align="center">Castle Control</h1><br><br>
  13. <p align="left">  <font color="red">Updated every 5 minutes</font></p>
  14. <br/><br/>
  15. <?php
  16. $rowdata = mysql_query("select a.clan_name, a.clan_level, a.clan_id, a.ally_name, a.leader_id, b.char_name, b.accesslevel, c.siegeDate, c.taxPercent, c.id as idcastel, c.name FROM clan_data as a, characters as b, castle as c WHERE ((a.clan_id = b.clanId) AND (b.accesslevel = 0) AND (c.id = a.hasCastle)) ORDER BY name ASC");
  17. //echo $rowdata;
  18.  
  19. $img_castele = array(1 => "Gludio.bmp",
  20. 2 => "Dion.bmp",
  21. 3 => "Giran.bmp",
  22. 4 => "Oren.bmp",
  23. 5 => "Aden.gif",
  24. 6 => "Innadril.gif",
  25. 7 => "Goddard.gif",
  26. 8 => "Rune.gif",
  27. 9 => "Schuttgart.gif");
  28. //print_r ($img_castele);
  29.  
  30. $i = 1;//set a variable to identify images
  31. if(mysql_num_rows($rowdata) > 0 ) {
  32. echo "<table id='castel_status' cellpadding='5'>";
  33. while($row = mysql_fetch_array($rowdata)) {
  34.  
  35.  
  36. echo "<tr><td style='width:230px;'><img src='images/castle/".$img_castele[$row['idcastel']]."' /></td>";
  37. echo "<td style='width:310px;'>";
  38. echo "<h2 style='font-size:14px; color:#F63; margin:0; padding:0; font-weight:bold; margin-bottom:5px;'>".$row['name']." Castle</h2>";
  39. echo "<strong>Next Siege : </strong>".date('D\ j M Y H\:i',$row['siegeDate']/1000)."<br />";
  40. echo "<strong>Clan Owner : </strong>". $row['clan_name']."<br />";
  41. echo "<strong>Clan Level : </strong>".$row['clan_level']."<br />";
  42. echo "<strong>Leader : </strong>". $row['char_name']."<br />";
  43. echo "<strong>Tax : </strong>".$row['taxPercent']."%<br />";
  44. echo "<strong>Alliance : </strong>". $row['ally_name']."<br /></td></tr>";
  45. $i++;
  46. }
  47. echo "</table>";
  48.  
  49. } else {
  50. echo "<br />No records in the database.";
  51. }
  52. ?>
  53. </table>
  54. </div>
  55. </div>
  56.  

Original Poster: nimeni from l2jforum

Elpizw na mn exei ksanaginei Share

  • 1 month later...

arning: include_once(includes/db.php) [function.include-once]: failed to open stream: No such file or directory in W:\www\castle\castles.php on line 2

 

Warning: include_once() [function.include]: Failed opening 'includes/db.php' for inclusion (include_path='.;/usr/local/PHP/includes;/usr/local/PHP/pear') in W:\www\castle\castles.php on line 2

 

Warning: include_once(header.php) [function.include-once]: failed to open stream: No such file or directory in W:\www\castle\castles.php on line 3

 

Warning: include_once() [function.include]: Failed opening 'header.php' for inclusion (include_path='.;/usr/local/PHP/includes;/usr/local/PHP/pear') in W:\www\castle\castles.php on line 3

Castle Control

 

 

 

  Updated every 5 minutes

 

 

 

 

Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in W:\www\castle\castles.php on line 15

 

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in W:\www\castle\castles.php on line 15

 

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in W:\www\castle\castles.php on line 30

 

No records in the database.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.