This is a Latest Deaths page for Modern Aac.
How to include the page?
Go to this page http://127.0.0.1/index.php/admin/createPage
create a page latestdeaths
input there the code
Then you can go into \templates\default and add somewhere in the menu
Add in config.php
If you want the same effect go into \public\css
Add somewhere
Download the attach
images.rar (6.0 KB)
And extract in \public\css\images
Regards rep me
How to include the page?
Go to this page http://127.0.0.1/index.php/admin/createPage
create a page latestdeaths
input there the code
PHP:
<?PHP
///////////////////////////
/// Deathlist Page ///
/// By Kavvson ///
/// Modern AAC ///
///////////////////////////
/* Set the
$config['site']['last_deaths_limit'] limit
in the config.php file */
require ('config.php');
/* Connection */
$ots = POT::getInstance();
$ots->connect(POT::DB_MYSQL, connection());
$SQL = POT::getInstance()->getDBHandle();
$players_deaths = $SQL->query('SELECT `player_deaths`.`id`, `player_deaths`.`date`, `player_deaths`.`level`, `players`.`name`, `players`.`world_id` FROM `player_deaths` LEFT JOIN `players` ON `player_deaths`.`player_id` = `players`.`id` ORDER BY `date` DESC LIMIT 0,'.$config['site']['last_deaths_limit']);
$players_deaths_count = 0;
if(!empty($players_deaths))
{
foreach($players_deaths as $death)
{
$players_deaths_count++;
if(is_int($players_deaths_count / 2))
$bgcolor = $config['site']['darkborder'];
else
$bgcolor = $config['site']['lightborder'];
@$players_rows .= "<TR CLASS=\"".$bgcolor."\"><TD WIDTH=\"30\"><center>".$players_deaths_count.".</center></TD><TD WIDTH=\"125\"><small>".date("j.m.Y, G:i:s",$death['date'])."</small></TD><TD><a href=\"".WEBSITE."/index.php/character/view/".$death['name']."\"><b>".$death['name']."</b></a> ";
$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 = '".$death['id']."' ORDER BY killers.final_hit DESC, killers.id ASC")->fetchAll();
$i = 0;
$count = count($killers);
foreach($killers as $killer)
{
$i++;
if($killer['player_name'] != "")
{
if($i == 1)
$players_rows .= "killed at level <b>".$death['level']."</b>";
else if($i == $count)
$players_rows .= " and";
else
$players_rows .= ",";
$players_rows .= " by ";
if($killer['monster_name'] != "")
$players_rows .= $killer['monster_name']." summoned by ";
if($killer['player_exists'] == 0)
$players_rows .= "<a >";
$players_rows .= $killer['player_name'];
if($killer['player_exists'] == 0)
$players_rows .= "</a>";
}
else
{
if($i == 1)
$players_rows .= "died at level <b>".$death['level']."</b>";
else if($i == $count)
$players_rows .= " and";
else
$players_rows .= ",";
$players_rows .= " by ".$killer['monster_name'];
}
}
$players_rows .= ".</TD></TR>";
}
}
if($players_deaths_count == 0)
ECHO '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR CLASS="'.$config['site']['vdarkborder'].'"><TD CLASS=white><B>Last Deaths</B></TD></TR><TR CLASS='.$config['site']['darkborder'].'><TD><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=1><TR><TD>No one died on '.$config['server_name'].'.</TD></TR></TABLE></TD></TR></TABLE><BR>';
else
ECHO '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR CLASS="'.$config['site']['vdarkborder'].'"><TD CLASS=white><B>Last Deaths</B></TD></TR></TABLE><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%>'.$players_rows.'</TABLE>';
?>
Code:
<li><a href="{$path}/index.php/p/v/latestdeaths">Latest Deaths</a></li>
PHP:
/* Modifications */
/* Limits for latest deaths page*/
$config['site']['last_deaths_limit'] = 50;
/* Headers for latest deaths or other pages*/
$config['site']['darkborder'] = "darkBorder";
$config['site']['vdarkborder'] = "vdarkBorder";
$config['site']['lightborder'] = "lightBorder";
Add somewhere
PHP:
.lightBorder {
-moz-background-clip:border;
-moz-background-inline-policy:continuous;
-moz-background-origin:padding;
background:#EAD194 url(images/header-1.gif) repeat-x scroll center top;
}
.vdarkBorder {
-moz-background-clip:border;
-moz-background-inline-policy:continuous;
-moz-background-origin:padding;
background:#AA5900 url('images/header-3.gif') repeat-x scroll center top;
}
.darkBorder {
-moz-background-clip:border;
-moz-background-inline-policy:continuous;
-moz-background-origin:padding;
background:#DBB96A url(images/header-2.gif) repeat-x scroll center top;
}
images.rar (6.0 KB)
And extract in \public\css\images
Regards rep me
Attachments
-
images.rar6 KB · Views: 120 · VirusTotal
Last edited by a moderator: