• 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!

Modern AAC Injection - DeathList

$main_content in modern aac was replaced by echo's for purpose.
Also, learn to tab.
PHP:
<?php
	// lrn2tab noob

	if(!defined( 'BASEPATH' )) exit('No direct script access allowed');
	
	list($player, $lightBg, $darkBg, $rows, $killers) = array($GLOBALS['player'], "#FF02DD", "#BBB12B", 0, NULL);
	$SQL = POT::getInstance()->getDBHandle();
	$deaths = $SQL->query("SELECT `player_deaths`.`id`, `player_deaths`.`date`, `player_deaths`.`level` FROM `player_deaths` WHERE `player_deaths`.`player_id` = {$player->getId()} ORDER BY `player_deaths`.`date` DESC LIMIT 0,10;");

	if($deaths->rowCount())
	{
		echo "<br /><table border=\"0\" cellspacing=\"1\" cellpadding=\"4\" width=\"100%\"><tr class=\"vdarkBorder\"><td colspan=\"2\" class=\"white\"><b>Deaths</b></td></tr>";

		foreach($deaths as $death)
		{
			$rows++;
			echo "<tr bgcolor=\"".(is_int($rows / 2) ? $darkBg : $lightBg)."\"><td width=\"30%\" align=\"center\">".date("j M Y, H:i", $death['date'])."</td><td>";
			
			$killers = $SQL->query("SELECT `environment_killers`.`name` AS `monster_name`, `players`.`name` AS `player_name`, `players`.`deleted` AS `player_exists` FROM `killers` LEFT JOIN `environment_killers` ON `killers`.`id` = `environment_killers`.`kill_id`
				LEFT JOIN `player_killers` ON `killers`.`id` = `player_killers`.`kill_id` LEFT JOIN `players` ON `players`.`id` = `player_killers`.`player_id`
				WHERE `killers`.`death_id` = {$SQL->quote($death['id'])} ORDER BY `killers`.`final_hit` DESC, `killers`.`id` ASC")->fetchAll();

			$i = 0;

			foreach($killers as $killer)
			{
				$i++;
				if(!empty($killer['monster_name']))
					$killer['monster_name'] = (in_array($i, array(1, count($killers))) ? str_replace(array("an ", "a "), array("", ""), $killer['monster_name']) : $killer['monster_name']);

				echo (!empty($killer['player_name']) ? ($i == 1 ? "Killed at level <b>{$death['level']}</b> by " : ($i == count($killers) ? " and by " : ", ")).(!empty($killer['monster_name']) ? "{$killer['monster_name']} summoned by " : "").($killer['player_exists'] == 0 ? "<a href=\"".WEBSITE."/index.php/character/view/{$killer['player_name']}\">{$killer['player_name']}</a>" : $killer['player_name']) : ($i == 1 ? "Died at level <b>{$death['level']}</b> by {$killer['monster_name']}" : ($i == count($killers) ? " and by {$killer['monster_name']}" : ", {$killer['monster_name']}")));
				
			}
			
			echo ".</td></tr>";
		}

		echo "</table><br />";
	}
?>

i dont have main_content :eek:?
 
Why :p? I just want to learn a bit more :rolleyes:

Because if nick has single apotrophe, it will break the link. For example:

<a href='index.php/character/view/Paxton's'>Paxton's</a>

It will break and the link will end at Paxton not Paxton's
 
Because if nick has single apotrophe, it will break the link. For example:

<a href='index.php/character/view/Paxton's'>Paxton's</a>

It will break and the link will end at Paxton not Paxton's
Ohhh, right! I forgot about that, thanks xD! :p
 
what about this?

A PHP Error was encountered

Severity: Notice

Message: Undefined variable: player

Filename: G-DeathList/injection.php

Line Number: 15
 
Back
Top