Code: Select all
<?php
require_once("SSI.php");
require_once("Sources/Subs.php");
//The two lines above is only if you use SMF as cms/forum. Else you will have to setup the db connection manually
if(!function_exists('mysql_fetch_rowsarr')) {
function mysql_fetch_rowsarr($result, $numass=MYSQL_BOTH) {
$i=0;
if (mysql_num_rows($result) == 0) return null;
$keys=array_keys(mysql_fetch_array($result, $numass));
mysql_data_seek($result, 0);
while ($row = mysql_fetch_array($result, $numass)) {
foreach ($keys as $speckey) {
$got[$i][$speckey]=$row[$speckey];
}
$i++;
}
return $got;
}
}
function get25mandkpplus()
{
$content ="";
$dkp_prefix = "database and table prefix here";
$msql = 'SELECT event_icon, event_name FROM '.$dkp_prefix.'events';
//echo $msql;
$result = mysql_query($msql);
$icon = mysql_fetch_rowsarr($result);
//print_r ($icon);
//echo $icon['event_name']. " - ". $icon['event_icon'] . "<br/>";
if(is_array($icon)){
foreach ($icon as $myicons){
$pleventicons[$myicons['event_name']] = $myicons['event_icon'];
//echo $myicons[event_name] . " - ". $myicons[event_icon] . "<br/>";
}
}
$msql = 'SELECT * FROM '.$dkp_prefix.'raidplan_raids'.
' WHERE (raid_date >'.time().') and (`raid_closed` = \'0\')'.
' ORDER BY `raid_date` ASC'.
' LIMIT 5';
//echo $msql;
$result = mysql_query($msql);
$eqdkplist = mysql_fetch_rowsarr($result);
//print_r ($eqdkplist);
$content .="<table cellpadding=\"1\" border=\"0\">";
$content .="<tr><td>";
$content .="</td></tr>";
if(is_array($eqdkplist)){
foreach ($eqdkplist as $meseqdkp){
$myURL = 'plugins/raidplan/viewraid.php';
$myURL = '/dkp/'.$myURL.'?r='.stripslashes($meseqdkp['raid_id']);
$content .="<td width='56px'>
<a href='".$myURL."'>
<img width='48px' border='0' src=/dkp/games/WoW/events/".$pleventicons[$meseqdkp['raid_name']].">
</a>
</td>";
$msql = "SELECT count(*) FROM ".$dkp_prefix."raidplan_raid_attendees WHERE attendees_subscribed=1 AND raid_id='".$meseqdkp['raid_id']."'";
$result = mysql_query($msql);
$signedin = mysql_result($result,0);
$result = mysql_query("SELECT count(*) FROM ".$dkp_prefix."raidplan_raid_attendees WHERE attendees_subscribed=0 AND raid_id='".$meseqdkp['raid_id']."'");
$confirmed = mysql_result($result,0);
$result = mysql_query("SELECT count(*) FROM ".$dkp_prefix."raidplan_raid_attendees WHERE attendees_subscribed=2 AND raid_id='".$meseqdkp['raid_id']."'");
$signedout = mysql_result($result,0);
$result = mysql_query("SELECT raid_attendees FROM ".$dkp_prefix."raidplan_raids WHERE raid_id='".$meseqdkp['raid_id']."'");
$total_memb = mysql_result($result,0);
$content .='<td align="left">';
$content .='<a class="raid_name" href="'.$myURL.'">'.stripslashes($meseqdkp['raid_name']).'</a><br/>';
$content .= timeformat($meseqdkp['raid_date']-28800).'<br/>';
$content .=" <span class='confirmed'>".$confirmed."</span>/
<span class='total'>".$total_memb."</span><span class='signedin'>(".($signedin) .")</span>";
$content .="</td></tr>";
}
}else{
$content .='<td><tr><span="no_raids">No upcoming raids.</span></td></tr>';
}
$content.="</table>";
echo $content;
}
get25mandkpplus();
?>
I've created a few blocks already, but it was mostly plain text, or an <iframe> for ventrilo status, so those were simple. But I have NO idea how to include php code in the block itself. Completely love Board3, but I have yet to find a block that would display any sort of info from Raidplanner, which is a popular raid planning tool from EQDKP+ and it really is the only thing missing on my site.
Raidplanner also supports RSS feeds, it creates one of the upcomming raids and whatnot, so maybe people could pull that data out of it? and display the RSS in a block?
Example of RSS feed: http://www.lotro-latino.com/dkp/data/a4 ... an/rss.xml
The goal would be to get something like this:
EQDKP+ already does on its own site, but I want to make it a block in the main portal.
Any help will be greatly appreciated!