Page 1 of 1

Castle Control

Posted: Sat Jul 11, 2009 10:13 am
by nimeni
Hi guys^^

db.php

Code: Select all

<?phpfunction db_connect(){		if (mysql_connect('localhost', 'user','password')){		if(mysql_select_db('db_name')){			return true;		} else {			return false;		}	} else {		return false;	}} ?>
castles.php

Code: Select all

 <?phpinclude_once('includes/db.php');include_once('header.php');echo ("<META HTTP-EQUIV=Refresh CONTENT='300; URL=castles.php'>");?>               <div id="page_content">                   <div class="spacer">	           		  <table align="center" id="tabel_continut">                        	<tr>                            	<td class="leftcol">                                <h1 align="center">Castle Control</h1><br><br>                                <p align="left">&nbsp;&nbsp;<font color="red">Updated every 5 minutes</font></p>                                <br/><br/>                                            <?php                                            $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");											//echo $rowdata; 											$img_castele = array(1 => "Gludio.bmp", 																 2 => "Dion.bmp", 																 3 => "Giran.bmp", 																 4 => "Oren.bmp", 																 5 => "Aden.gif",																 6 => "Innadril.gif", 																 7 => "Goddard.gif",																 8 => "Rune.gif",																 9 => "Schuttgart.gif");											//print_r ($img_castele); 											$i = 1;//set a variable to identify images											if(mysql_num_rows($rowdata) > 0 ) {												echo "<table id='castel_status' cellpadding='5'>";												while($row = mysql_fetch_array($rowdata)) {   														echo "<tr><td style='width:230px;'><img src='images/castle/".$img_castele[$row['idcastel']]."' /></td>";														echo "<td style='width:310px;'>";														echo "<h2 style='font-size:14px; color:#F63; margin:0; padding:0; font-weight:bold; margin-bottom:5px;'>".$row['name']." Castle</h2>";														echo "<strong>Next Siege : </strong>".date('D\ j M Y H\:i',$row['siegeDate']/1000)."<br />";														echo "<strong>Clan Owner : </strong>". $row['clan_name']."<br />";														echo "<strong>Clan Level : </strong>".$row['clan_level']."<br />";                                                                                                                echo "<strong>Leader : </strong>". $row['char_name']."<br />";														echo "<strong>Tax : </strong>".$row['taxPercent']."%<br />";														echo "<strong>Alliance : </strong>". $row['ally_name']."<br /></td></tr>";														$i++;												}												echo "</table>"; 											} else {												echo "<br />No records in the database.";											}?> </table></div></div> 
Updated.

Image

Re: Castle Control

Posted: Sat Jul 11, 2009 1:24 pm
by momo61
cool cool. Post more scripts if you feel like it. I like these things :)

Re: Castle Control

Posted: Sun Jan 03, 2010 9:27 am
by pOpArOb
what does this actually do

Re: Castle Control

Posted: Mon Jan 04, 2010 1:01 pm
by momo61
pOpArOb wrote:what does this actually do
You use it on your website to display which castles are currently possessed by which clans :)

Re: Castle Control

Posted: Thu Jan 14, 2010 10:19 pm
by MELERIX
and the pictures ?

Re: Castle Control

Posted: Fri Jan 15, 2010 8:04 am
by janiii
i would say, the castle control from daedalus is better: viewtopic.php?f=94&t=10730
at least, daedalus is active on forum and can give support.

Re: Castle Control

Posted: Tue Jan 26, 2010 6:27 pm
by janiii
thx for the screenshots, nice work nimeni ;)