• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Windows Converting Modern to gesior script help

RoHaN-OTs

RoHaN-OTs.com
Joined
Jul 28, 2010
Messages
1,594
Reaction score
82
Location
Sweden
Would be grateful if someone could convert this war script (modern aac) to gesior aac!
PHP:
<?PHP
 // Made by master-m for customera, original script by noobelf 
 // Contact Znote on otland if you want support.
 // Script for Modern AAC. View describtion on vapus store for installation guide.
 // Guild logo displaying fixed by Kito

 
 echo " <script type=\"text/javascript\"><!--
function show_hide(flip)
{
	var tmp = document.getElementById(flip);
	if(tmp)
		tmp.style.display = tmp.style.display == 'none' ? '' : 'none';
}
--></script>";
 // Reject any unwanted access.
 if ( !defined( 'BASEPATH' ) ) exit( 'No direct script access allowed' );

 echo "
 <center>
 <h2>Guild Wars</h2>
 <p> To invite, say !war invite, guild name</center>
  <table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"4\">
   <tr>
    <td><b>Aggressor</b></td>
    <td align=\"center\"><b>Information</b></td>
    <td><b><b>Enemy</b></b></td>
   </tr>";
   
$ots = POT::getInstance();
$ots->connect(POT::DB_MYSQL, connection());
$SQL = $ots->getDBHandle(); 
$count = 0;
foreach($SQL->query('SELECT * FROM `guild_wars` WHERE `status` IN (1,4) OR ((`end` >= (UNIX_TIMESTAMP() - 604800) OR `end` = 0) AND `status` IN (0,5));') as $war)
{
 $a = $ots->createObject('Guild');
 $a->load($war['guild_id']);
 if(!$a->isLoaded())
  continue;
 
 $e = $ots->createObject('Guild');
 $e->load($war['enemy_id']);
 if(!$e->isLoaded())
  continue;
 
 $alogoid = $a->getId();
  $alogo = 'default.gif';
 if(file_exists($_SERVER{'DOCUMENT_ROOT'} . '/public/guild_logos/'. $alogoid .'.gif'))
  $alogo = $alogoid .'.gif';
 
 $elogoid = $e->getId();
  $elogo = 'default.gif';
 if(file_exists($_SERVER{'DOCUMENT_ROOT'} . '/public/guild_logos/'. $elogoid .'.gif'))
  $elogo = $elogoid .'.gif'; 


  
 $count++;
 
 echo "<tr>
		<td align=\"center\">
		<a href=\"../../guilds/view/".$a->getId()."\">
		<img src=\"http://www.mtibia.cl/public/guild_logos/".$alogo."\" width=\"64\" height=\"64\" border=\"0\"/>
		<br />
		".$a->getName()."
		</a>
		</td>
		<td class=\"white\" align=\"center\">";
 switch($war['status'])
 {
  case 0:
  {
   echo "<b>Pending acceptation</b><br />Invited on " . date("M d Y, H:i:s", $war['begin']) . " for " . ($war['end'] > 0 ? (($war['end'] - $war['begin']) / 86400) : "unspecified") . " days. The frag limit is set to " . $war['frags'] . " frags, " . ($war['payment'] > 0 ? "with payment of " . $war['payment'] . " bronze coins." : "without any payment.")."<br />Will expire in three days.";
   break;
  }
 
  case 3:
  {
   echo "<s>Canceled invitation</s><br />Sent invite on " . date("M d Y, H:i:s", $war['begin']) . ", canceled on " . date("M d Y, H:i:s", $war['end']) . ".";
   break;
  }
 
  case 2:
  {
   echo "Rejected invitation<br />Invited on " . date("M d Y, H:i:s", $war['begin']) . ", rejected on " . date("M d Y, H:i:s", $war['end']) . ".";
   break;
  }
 
  case 1:
  {
   echo "<font size=\"10\" color=\"red\">" . $war['guild_kills'] . "</font> : <font size=\"10\" color=\"lime\">" . $war['enemy_kills'] . "</font>
		<br />
		<br />
		<span style=\"color: orange; font-weight: bold;\">On a brutal war</span>
		<br />Began on " . date("M d Y, H:i:s", $war['begin']) . ($war['end'] > 0 ? ", will end up at " . date("M d Y, H:i:s", $war['end']) : "") . ".<br />The frag limit is set to " . $war['frags'] . " frags, " . ($war['payment'] > 0 ? "with payment of " . $war['payment'] . " bronze coins." : "without any payment.");
   break;
  }
 
  case 4:
  {
   echo "<font size=\"10\" color=\"red\">" . $war['guild_kills'] . "</font> : <font size=\"10\" color=\"lime\">" . $war['enemy_kills'] . "</font>
		<br />
		<br />
		<span style=\"color: orange;\">Pending end</span><br />Began on " . date("M d Y, H:i:s", $war['begin']) . ", signed armstice on " . date("M d Y, H:i:s", $war['end']) . ".<br />Will expire after reaching " . $war['frags'] . " frags. ".($war['payment'] > 0 ? "The payment is set to " . $war['payment'] . " bronze coins." : "There's no payment set.");
   break;
  }
 
  case 5:
  {
   echo "<i>Ended</i><br />Began on " . date("M d Y, H:i:s", $war['begin']) . ", ended on " . date("M d Y, H:i:s", $war['end']) . ". Frag statistics: <span style=\"color: red;\">" . $war['guild_kills'] . "</span> to <span style=\"color: lime;\">" . $war['enemy_kills'] . "</span>.";
   break;
  }
 
  default:
  {
   echo "Unknown, please contact with gamemaster.";
   break;
  }
 }
 
 echo "<br /><br /><a onclick=\"show_hide('war-details:" . $war['id'] . "'); return false;\" style=\"cursor: pointer;\">&raquo; Details &laquo;</a></td>
<td align=\"center\"><a href=\"../../guilds/view/".$e->getId()."\"><img src=\"http://www.mtibia.cl/public/guild_logos/".$elogo."\" width=\"64\" height=\"64\" border=\"0\"/><br />".$e->getName()."</a></td>
</tr>
<tr id=\"war-details:" . $war['id'] . "\" style=\"display: none;\">
<td colspan=\"3\">";
 if(in_array($war['status'], array(1,4,5)))
 {
  $deaths = $SQL->query('SELECT `pd`.`id`, `pd`.`date`, `gk`.`guild_id` AS `enemy`, `p`.`name`, `pd`.`level`
FROM `guild_kills` gk
 LEFT JOIN `player_deaths` pd ON `gk`.`death_id` = `pd`.`id`
 LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id`
WHERE `gk`.`war_id` = ' . $war['id'] . ' AND `p`.`deleted` = 0
 ORDER BY `pd`.`date` DESC')->fetchAll();
  if(!empty($deaths))
  {
   foreach($deaths as $death)
   {
    $killers = $SQL->query('SELECT `p`.`name` AS `player_name`, `p`.`deleted` AS `player_exists`, `k`.`war` AS `is_war`
FROM `killers` k
 LEFT JOIN `player_killers` pk ON `k`.`id` = `pk`.`kill_id`
 LEFT JOIN `players` p ON `p`.`id` = `pk`.`player_id`
WHERE `k`.`death_id` = ' . $death['id'] . '
 ORDER BY `k`.`final_hit` DESC, `k`.`id` ASC')->fetchAll();
    $count = count($killers); $i = 0;
 
    $others = false;
    echo date("j M Y, H:i", $death['date']) . " <span style=\"font-weight: bold; color: " . ($death['enemy'] == $war['guild_id'] ? "red" : "lime") . ";\">+</span>
<a ><b>".$death['name']."</b></a> ";
    foreach($killers as $killer)
    {
     $i++;
     if($killer['is_war'] != 0)
     {
      if($i == 1)
       echo "killed at level <b>".$death['level']."</b> by ";
      else if($i == $count && $others == false)
       echo " and by ";
      else
       echo ", ";
 
      if($killer['player_exists'] == 0)
       echo "<a >";
 
      echo $killer['player_name'];
      if($killer['player_exists'] == 0)
       echo "</a>";
     }
     else
      $others = true;
 
     if($i == $count)
     {
      if($others == true)
       echo " and few others";
 
      echo ".<br />";
     }
    }
   }
  }
  else
   echo "<center>There were no frags on this war so far.</center>";
 }
 else
  echo "<center>This war did not began yet.</center>";
 
 echo "</td>
</tr>";
}
 
if($count == 0)
 echo "<tr>
<td colspan=\"3\">Currently there are no active wars.</td>
</tr>";
 
 
?>

Thanks in advance,

RoHaN
 
Back
Top