<?php
$eqdkp_prefix = "mcdkp_";
require_once('itemstats/itemstats.php');
require_once('itemstats/includes/itemcache.php');
//$is = new ItemCache;
$result = mysql_query("SELECT item_name, item_buyer FROM ".$eqdkp_prefix."items order by item_date desc limit 5") or die(mysql_error());
while ($row = mysql_fetch_array($result)) {
$last_mc_loot = $row[item_name];
$buyer = $row[item_buyer];
$currloot = itemstatsthis($last_mc_loot);
$loot .= $currloot." by ".$buyer."<br>";
}
function itemstatsthis($name)
{
$item_stats = new ItemStats();
$item_name = trim($name);
$item_name = $item_stats->getItemName($item_name, true);
// Initialize the html.
$item_html = '[' . $item_name . ']';
// Get the color of this item and apply it to the html.
$item_color = $item_stats->getItemColor($item_name);
if (!empty($item_color))
{
$item_html = "<span class='" . $item_color . "'>" . $item_html . "</span>";
}
// Get the tooltip html for this item and apply it to the html.
$item_tooltip_html = $item_stats->getItemTooltipHtml($item_name);
if (!empty($item_tooltip_html))
{
$item_html = "<span " . $item_tooltip_html . ">" . $item_html . "</span>";
}
// Add the icon to the name.
$item_icon_link = $item_stats->getItemIconLink($name);
if (!empty($item_icon_link))
{
$decorated_name = "<img class='smallitemicon' src='" . $item_icon_link . "'> " . $decorated_name;
}
// If this item has a link to the info site, add this link to the HTML. If it doesn't have a link, it
// means the item hasn't been found yet, so put up a link to the update page instead.
$item_link = $item_stats->getItemLink($item_name);
if (!empty($item_link))
{
$item_html = "<a class='forumitemlink' target='_blank' href='" . $item_link . "'>" . $item_html . "</a>";
}
else
{
$item_link = 'itemstats/updateitem.php?item=' . urlencode(urlencode($item_name));
$item_html = "<a class='forumitemlink' href='$item_link'>" . $item_html . "</a>";
}
return $item_html;
}
?>