Castle Control

Have you created a useful tool? or Do you want to get help building one? This is the right place!
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
nimeni
Posts: 19
Joined: Fri Jun 15, 2007 7:43 pm

Castle Control

Post 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
You do not have the required permissions to view the files attached to this post.
Last edited by nimeni on Tue Jan 26, 2010 9:49 pm, edited 5 times in total.
User avatar
momo61
Posts: 1648
Joined: Fri Jun 06, 2008 2:05 pm
Location: Europe

Re: Castle Control

Post by momo61 »

cool cool. Post more scripts if you feel like it. I like these things :)
pOpArOb
Posts: 6
Joined: Fri Nov 06, 2009 1:39 am

Re: Castle Control

Post by pOpArOb »

what does this actually do
User avatar
momo61
Posts: 1648
Joined: Fri Jun 06, 2008 2:05 pm
Location: Europe

Re: Castle Control

Post 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 :)
User avatar
MELERIX
L2j Veteran
L2j Veteran
Posts: 6667
Joined: Sat Sep 23, 2006 11:31 pm
Location: Chile
Contact:

Re: Castle Control

Post by MELERIX »

and the pictures ?
User avatar
janiii
L2j Veteran
L2j Veteran
Posts: 4269
Joined: Wed May 28, 2008 3:15 pm
Location: Slovakia

Re: Castle Control

Post 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.
DO NOT EVEN TRY TO MESS WITH ME!
forum flOOder dancing dEVILoper
I don't give private support - PM will be ignored!
User avatar
janiii
L2j Veteran
L2j Veteran
Posts: 4269
Joined: Wed May 28, 2008 3:15 pm
Location: Slovakia

Re: Castle Control

Post by janiii »

thx for the screenshots, nice work nimeni ;)
DO NOT EVEN TRY TO MESS WITH ME!
forum flOOder dancing dEVILoper
I don't give private support - PM will be ignored!
Post Reply