SimplePortal
Customization => Blocks and Modifications => Block Requests => Topic started by: danzou on May 08, 2009, 03:30:37 AM
-
Im just curious if someone could help me fix a block that shows the recent drops from my eqdkp item list.
there is a block to tinyportal that looks like this:
$db_host = 'XXXX';
$db_user = 'XXXX';
$db_pass = 'XXXX';
$db_table = 'XXXX';
// edit variables above to your site's requirements
mysql_connect ($db_host, $db_user, $db_pass);
mysql_select_db ($db_table);
// Get latest items from each dkp pool
$dkp_tables = array('eqdkp'); // Your prefix may be different of course
$items = array();
print "<table border=0 class=text cellspacing=0 cellpadding=0 color=555652 face=Verdana>";
foreach ($dkp_tables as $table) {
$result = mysql_query("SELECT item_ctrt_wowitemid, item_name, item_buyer, raid_date
FROM eqdkp_items AS i
INNER JOIN eqdkp_raids AS r ON i.raid_id=r.raid_id
ORDER BY raid_date DESC LIMIT 7") or die(mysql_error());
while ($row = mysql_fetch_array($result))
{
//$row['dkpsite'] = $table;
//$items[] = $row;
$time = $row['raid_date'];
print "<tr><td>Item: </td>
<td><a href='http://www.wowhead.com/?item=" . $row['item_ctrt_wowitemid'] . "'>" . $row['item_name'] . "</a></td></tr>
<tr><td>Buyer: </td>
<td>" . $row['item_buyer'] ."
</td></tr>";
}
}
print "</table>";
also if it is possible to integrate so that the items that show up have the tooltip from itemstats on them would be awsome!
grateful for all help i can get
/danzou
this is how i would like it to look like:
http://bollklubben.mine.nu/test/recent_loot.jpg (http://bollklubben.mine.nu/test/recent_loot.jpg)
-
Got it to work. only thing now is to get it to work with itemstats
The PHP File:
<?php
$db_host = 'XXXXXX';
$db_user = 'XXXXXX';
$db_pass = 'XXXXXX';
$db_db = 'XXXXXX';
// edit variables above to your site's requirements
mysql_connect ($db_host, $db_user, $db_pass);
mysql_select_db ($db_db);
print "<head><link rel=stylesheet type=text/css href=lewt.css /></head><body>";
$items = array();
print "<table border=0 cellspacing=0 cellpadding=0>";
$result = mysql_query("SELECT item_ctrt_wowitemid, item_name, item_buyer, raid_date
FROM YOURPREFIXHERE_items AS i
INNER JOIN YOURPREFIXHERE_raids AS r ON i.raid_id=r.raid_id
ORDER BY raid_date DESC LIMIT 7") or die(mysql_error());
while ($row = mysql_fetch_array($result))
{
$time = $row['raid_date'];
print "<tr><td class=left><a href='http://www.wowhead.com/?item=" . $row['item_ctrt_wowitemid'] . "' target=_blank>[" . $row['item_name'] . "]</a></td></tr><tr><td class=right>Looted by: <a href='http://eu.wowarmory.com/character-sheet.xml?r=Quel%27Thalas&n=" . $row['item_buyer'] ."' target=_blank><b>" . $row['item_buyer'] ."</b></a></td></tr>";
}
print "</table></body>";
?>
The CSS File
a:link, a:visited {
color: #b43c01;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
td.left{
text-align: left;
vertical-align: middle;
font-size: 10px !important;
}
td.center{
text-align: center;
vertical-align: middle;
font-size: 11px !important;
}
td.right{
text-align: right;
vertical-align: middle;
font-size: 9px !important;
}
body, td, th, tr {
line-height: 150%;
font-family: tahoma, sans-serif;
color: #565656;
font-size: 12px;
}
body {
background: #efefe6;
padding: 0;
margin: 0;
}
The css file is tuned into my site ofc. you will have to change it so that it fits your site if u want to use this :P
also in the php file there is eu.wowarmory.com as default. if ur playing any other realm change that to whatever locale your armory is.
problem i got if i made it in a php block is that it tryed to add smff. befor the db name aka so in this example it got smff.XXXXXX.
so what i did was create the php file. and the css file seperatly and then just made a html block calling the php file via a iframe.
well got all that sorted out now so now i just need to get the file to work with itemstats.