Jump to content
  • 0

Php Script


Question

Posted

ok guys i have a problem with my website, i added the php script, it works perfect but i can only see the 3 castles, check the image:

 

keyash.jpg

 

i cant see the other castles, they are hidden or smt... anyone can help?

7 answers to this question

Recommended Posts

  • 0
Posted

<?php

//---------------
// Made by GloBaL 
//---------------

$db_serv = 'ip';			//the address of the database goes here

$db_user = 'username';				//your sql username goes here
$db_pass = 'pass';					//your sql password goes here

$db_name = 'dataname';				//your database name goes here

$filename = './helios.js';		//generated javascript file you need to put attribute 777 in your folder

//-----------------------------------------------------------------------------------------------

@mysql_connect ( $db_serv, $db_user, $db_pass ) or die ('Coudn\'t connect to host');
@mysql_select_db( $db_name ) or die ('Couldn\'t select database');

$sql = @mysql_query('SELECT id,name,taxPercent,siegeDate,siegeHourOfDay FROM `castle`') or die('Query failed!');

$gen = "\n";

while ($castle = @mysql_fetch_array($sql))
{
$gen .= "\n".strtolower($castle['name']) . 'info = \'<div class="castleWrapper">';
$gen .= '<div class="castlePic" id="' . ucfirst(strtolower($castle['name'])) . 'Pic"></div>';
$gen .= '<div class="castleInfo">';
$gen .= '<div class="castleName"><strong>' . ucfirst(strtolower($castle['name'])) . ' Castle</strong></div>';

$clan = @mysql_fetch_array(mysql_query('SELECT clan_name,hasCastle FROM `clan_data` WHERE hasCastle = ' . $castle['id']));
$clan_name = (isset($clan['clan_name'])) ? htmlspecialchars($clan['clan_name'], ENT_QUOTES) : 'UNCLAIMED';

$gen .= '<div><strong>Controlled by:</strong> ' . $clan_name . '</div>';

if (isset($clan['clan_name'])) $gen .= '<div><strong>Tax Rate:</strong> ' . $castle['taxPercent'] . '%</div>';

$gen .= '<div><strong>Next Siege:</strong> ' . date('M d Y ',$castle['siegeDate']/1000) . $castle['siegeHourOfDay'] . date(':00 T') . '</div>';
$gen .= '</div></div>\';'."\n\n";
}

$handle = @fopen($filename, 'w+');
@fwrite($handle, $gen);
@fclose($handle);

?>

 

 

 

and this one i hope will hellp you

 

 

<?php require 'generator.php'; ?>
<html>
<head>
<title>Castle Control</title>
<style type="text/css">
body {margin: 5px; font: 11px Verdana, Arial, Helvetica, sans-serif; background-color: #FFFFFF;}
.castleWrapper{width:405px; margin:20px; padding:10px; border:1px solid #000000; color: #000000; overflow: auto; text-align: left;}
.castlePic{width:149px; height:99px; border:1px solid #000; float:left; margin-right:10px;}
.castleInfo div{width:400px;}
.castleName{width:450px; background: #000000; color: #FFFFFF; margin-bottom:5px; padding:2px;}
#AdenPic{background:url(./castle_control_image/aden.jpg) no-repeat;}
#DionPic{background:url(./castle_control_image/dion.jpg) no-repeat;}
#GiranPic{background:url(./castle_control_image/giran.jpg) no-repeat;}
#GludioPic{background:url(./castle_control_image/gludio.jpg) no-repeat;}
#GoddardPic{background:url(./castle_control_image/goddard.jpg) no-repeat;}
#InnadrilPic{background:url(./castle_control_image/innadril.jpg) no-repeat;}
#OrenPic{background:url(./castle_control_image/oren.jpg) no-repeat;}
#RunePic{background:url(./castle_control_image/rune.jpg) no-repeat;}
#SchuttgartPic{background:url(./castle_control_image/schuttgart.jpg) no-repeat;}
</style>
<script language="javascript" type="text/javascript" src="./helios.js"></script>
</head>
<body> 
<center> 
  <script language="javascript">
document.write(gludioinfo);
document.write(dioninfo);
document.write(giraninfo);
document.write(oreninfo);
document.write(adeninfo);
document.write(innadrilinfo);
document.write(goddardinfo);
document.write(runeinfo);
document.write(schuttgartinfo);
</script> 
</center> 
</body>
</html>

 

 

 

If you need something Ready that already have done let me know M8

  • 0
Posted
  On 2/10/2010 at 8:10 PM, DāЯқŜiĐє said:

<?php

//---------------
// Made by GloBaL 
//---------------

$db_serv = 'ip';			//the address of the database goes here

$db_user = 'username';				//your sql username goes here
$db_pass = 'pass';					//your sql password goes here

$db_name = 'dataname';				//your database name goes here

$filename = './helios.js';		//generated javascript file you need to put attribute 777 in your folder

//-----------------------------------------------------------------------------------------------

@mysql_connect ( $db_serv, $db_user, $db_pass ) or die ('Coudn\'t connect to host');
@mysql_select_db( $db_name ) or die ('Couldn\'t select database');

$sql = @mysql_query('SELECT id,name,taxPercent,siegeDate,siegeHourOfDay FROM `castle`') or die('Query failed!');

$gen = "\n";

while ($castle = @mysql_fetch_array($sql))
{
$gen .= "\n".strtolower($castle['name']) . 'info = \'<div class="castleWrapper">';
$gen .= '<div class="castlePic" id="' . ucfirst(strtolower($castle['name'])) . 'Pic"></div>';
$gen .= '<div class="castleInfo">';
$gen .= '<div class="castleName"><strong>' . ucfirst(strtolower($castle['name'])) . ' Castle</strong></div>';

$clan = @mysql_fetch_array(mysql_query('SELECT clan_name,hasCastle FROM `clan_data` WHERE hasCastle = ' . $castle['id']));
$clan_name = (isset($clan['clan_name'])) ? htmlspecialchars($clan['clan_name'], ENT_QUOTES) : 'UNCLAIMED';

$gen .= '<div><strong>Controlled by:</strong> ' . $clan_name . '</div>';

if (isset($clan['clan_name'])) $gen .= '<div><strong>Tax Rate:</strong> ' . $castle['taxPercent'] . '%</div>';

$gen .= '<div><strong>Next Siege:</strong> ' . date('M d Y ',$castle['siegeDate']/1000) . $castle['siegeHourOfDay'] . date(':00 T') . '</div>';
$gen .= '</div></div>\';'."\n\n";
}

$handle = @fopen($filename, 'w+');
@fwrite($handle, $gen);
@fclose($handle);

?>

 

 

 

and this one i hope will hellp you

 

 

<?php require 'generator.php'; ?>
<html>
<head>
<title>Castle Control</title>
<style type="text/css">
body {margin: 5px; font: 11px Verdana, Arial, Helvetica, sans-serif; background-color: #FFFFFF;}
.castleWrapper{width:405px; margin:20px; padding:10px; border:1px solid #000000; color: #000000; overflow: auto; text-align: left;}
.castlePic{width:149px; height:99px; border:1px solid #000; float:left; margin-right:10px;}
.castleInfo div{width:400px;}
.castleName{width:450px; background: #000000; color: #FFFFFF; margin-bottom:5px; padding:2px;}
#AdenPic{background:url(./castle_control_image/aden.jpg) no-repeat;}
#DionPic{background:url(./castle_control_image/dion.jpg) no-repeat;}
#GiranPic{background:url(./castle_control_image/giran.jpg) no-repeat;}
#GludioPic{background:url(./castle_control_image/gludio.jpg) no-repeat;}
#GoddardPic{background:url(./castle_control_image/goddard.jpg) no-repeat;}
#InnadrilPic{background:url(./castle_control_image/innadril.jpg) no-repeat;}
#OrenPic{background:url(./castle_control_image/oren.jpg) no-repeat;}
#RunePic{background:url(./castle_control_image/rune.jpg) no-repeat;}
#SchuttgartPic{background:url(./castle_control_image/schuttgart.jpg) no-repeat;}
</style>
<script language="javascript" type="text/javascript" src="./helios.js"></script>
</head>
<body> 
<center> 
  <script language="javascript">
document.write(gludioinfo);
document.write(dioninfo);
document.write(giraninfo);
document.write(oreninfo);
document.write(adeninfo);
document.write(innadrilinfo);
document.write(goddardinfo);
document.write(runeinfo);
document.write(schuttgartinfo);
</script> 
</center> 
</body>
</html>

 

 

 

If you need something Ready that already have done let me know M8

dude this is the same...

  • 0
Posted

pffffffffffffffffffffffffffff check this out

the generator.php

<?php

//---------------
// Made by Daedalus email : daedalus at hotmail dot fr
//---------------

$ServerHost="";				// Server's Host - IP
$MySQLPort="";					// Server's MySQL Port
$MySQLLogin="";					// Server's MySQL Username
$MySQLPass="";			// Server's MySQL Password
$MySQLDB="";				// Server's MySQL Database Name

$filename = './helios.js';		//generated javascript file you need to put attribute 777 in your folder

//-----------------------------------------------------------------------------------------------

// Connection
mysql_connect($ServerHost.":".$MySQLPort,$MySQLLogin,$MySQLPass) or die('Cannot connect to MySQL Server. Error in connect.php');
mysql_select_db($MySQLDB) or die('Cannot find database. Error in connect.php');
?>

index.php

<?php require 'generator.php'; ?>
<html>
<head>
<title>Castle Control</title>
<style type="text/css">
body {margin: 5px; font: 11px Verdana, Arial, Helvetica, sans-serif; background-color: #171717;}
.castleWrapper{width:405px; margin:20px; padding:10px; border:1px solid #000000; color: #FF9900; overflow: auto; text-align: left;}
.castlePic{width:149px; height:99px; border:1px solid #ff9900; float:left; margin-right:10px;}
.castleInfo div{width:400px;}
.castleName{width:450px; background: #000000; color: #FF9900; margin-bottom:5px; padding:2px;}
#AdenPic{background:url(./castle_control_image/aden.jpg) no-repeat;}
#DionPic{background:url(./castle_control_image/dion.jpg) no-repeat;}
#GiranPic{background:url(./castle_control_image/giran.jpg) no-repeat;}
#GludioPic{background:url(./castle_control_image/gludio.jpg) no-repeat;}
#GoddardPic{background:url(./castle_control_image/goddard.jpg) no-repeat;}
#InnadrilPic{background:url(./castle_control_image/innadril.jpg) no-repeat;}
#OrenPic{background:url(./castle_control_image/oren.jpg) no-repeat;}
#RunePic{background:url(./castle_control_image/rune.jpg) no-repeat;}
#SchuttgartPic{background:url(./castle_control_image/schuttgart.jpg) no-repeat;}
</style>
<script language="javascript" type="text/javascript" src="./helios.js"></script>
</head>
<body> 
  <script language="javascript">
document.write(gludioinfo);
document.write(dioninfo);
document.write(giraninfo);
document.write(oreninfo);
document.write(adeninfo);
document.write(innadrilinfo);
document.write(goddardinfo);
document.write(runeinfo);
document.write(schuttgartinfo);
</script> 
</body>
</html>

 

 

 

 

 

  • 0
Posted
  On 2/10/2010 at 8:44 PM, Osiris® said:

pffffffffffffffffffffffffffff check this out

the generator.php

<?php

//---------------
// Made by Daedalus email : daedalus at hotmail dot fr
//---------------

$ServerHost="";				// Server's Host - IP
$MySQLPort="";					// Server's MySQL Port
$MySQLLogin="";					// Server's MySQL Username
$MySQLPass="";			// Server's MySQL Password
$MySQLDB="";				// Server's MySQL Database Name

$filename = './helios.js';		//generated javascript file you need to put attribute 777 in your folder

//-----------------------------------------------------------------------------------------------

// Connection
mysql_connect($ServerHost.":".$MySQLPort,$MySQLLogin,$MySQLPass) or die('Cannot connect to MySQL Server. Error in connect.php');
mysql_select_db($MySQLDB) or die('Cannot find database. Error in connect.php');
?>

index.php

<?php require 'generator.php'; ?>
<html>
<head>
<title>Castle Control</title>
<style type="text/css">
body {margin: 5px; font: 11px Verdana, Arial, Helvetica, sans-serif; background-color: #171717;}
.castleWrapper{width:405px; margin:20px; padding:10px; border:1px solid #000000; color: #FF9900; overflow: auto; text-align: left;}
.castlePic{width:149px; height:99px; border:1px solid #ff9900; float:left; margin-right:10px;}
.castleInfo div{width:400px;}
.castleName{width:450px; background: #000000; color: #FF9900; margin-bottom:5px; padding:2px;}
#AdenPic{background:url(./castle_control_image/aden.jpg) no-repeat;}
#DionPic{background:url(./castle_control_image/dion.jpg) no-repeat;}
#GiranPic{background:url(./castle_control_image/giran.jpg) no-repeat;}
#GludioPic{background:url(./castle_control_image/gludio.jpg) no-repeat;}
#GoddardPic{background:url(./castle_control_image/goddard.jpg) no-repeat;}
#InnadrilPic{background:url(./castle_control_image/innadril.jpg) no-repeat;}
#OrenPic{background:url(./castle_control_image/oren.jpg) no-repeat;}
#RunePic{background:url(./castle_control_image/rune.jpg) no-repeat;}
#SchuttgartPic{background:url(./castle_control_image/schuttgart.jpg) no-repeat;}
</style>
<script language="javascript" type="text/javascript" src="./helios.js"></script>
</head>
<body> 
  <script language="javascript">
document.write(gludioinfo);
document.write(dioninfo);
document.write(giraninfo);
document.write(oreninfo);
document.write(adeninfo);
document.write(innadrilinfo);
document.write(goddardinfo);
document.write(runeinfo);
document.write(schuttgartinfo);
</script> 
</body>
</html>

 

 

 

 

 

not working btw in index.php i see all castles but in the space provided i only see 3 maybe smt limit it?

  • 0
Posted

oh sry for the double post :( but i found the problem, the problem was in the height at html file :(

you can lock this now thx anw ;)

Guest
This topic is now closed to further replies.


×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock