Skip to content

Commit

Permalink
Nicer Layout for the portal module
Browse files Browse the repository at this point in the history
  • Loading branch information
GodMod committed Oct 21, 2019
1 parent f45055b commit 0e9a365
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
5 changes: 3 additions & 2 deletions hooks/warcraftlogs_viewraid_hook.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,14 @@ public function viewraid($data){
$arrFightData = json_decode($strFightData, true);

$arrFights = $arrFightData['fights'];
$arrGlobalFights = array();

foreach($arrFights as $arrMyFightData){
$duration = $arrMyFightData['end_time'] - $arrMyFightData['start_time'];
$duration = gmdate("H:i:s", ($duration /1000));


$arrGlobalFights[] = array(
$arrGlobalFights[] = array (
'boss' => (int)$arrMyFightData['boss'],
'name' => $arrMyFightData['name'],
'kill' => (strlen($arrMyFightData['kill'])),
Expand All @@ -108,7 +109,7 @@ public function viewraid($data){
}
}

$this->pdc->put('plugins.warcraftlogs.fights.'.$strID, $arrGlobalFights, 6000);
$this->pdc->put('plugins.warcraftlogs.fights.'.$strID, $arrGlobalFights, 3600);
} else {
$arrGlobalFights = $strFightData;
}
Expand Down
18 changes: 14 additions & 4 deletions portal/wcl_lastlogs_portal.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,26 @@ public function output(){
if(is_array($arrReports)){
$i = 0;

$strOut ="<table class='table fullwidth colorswitch'>";
$strOut = '<div class="table" style="width:100%">';
foreach($arrReports as $arrReport){
if($i == $intMax) break;

$date = $this->time->user_date(round($arrReport['start']/1000, 0), true);
$strOut .= '<div class="tr">';

$strOut.="<tr><td><a href='".$objHelper->get_warcraftlogsurl()."/reports/".sanitize($arrReport['id'])."' target='_blank'>".$date.' - '.sanitize($arrReport['title'])."</a></td></tr>";
$strOut .= '<div class="td" style="width: 28px;"><a href="'.$objHelper->get_warcraftlogsurl()."/reports/".sanitize($arrReport['id']).'" target="_blank"><div class="user-avatar-small user-avatar-border">';
$strOut .='<img src="https://dmszsuqyoe6y6.cloudfront.net/img/warcraft/zones/zone-'.sanitize($arrReport['zone']).'.png" class="user-avatar small"/>';
$strOut .= '</div></a>';
$strOut .= '</div>';

$date = $this->time->nice_date(round($arrReport['start']/1000, 0), 60*60*2*3, true);
$strOut .= '<div class="td"><a href="'.$objHelper->get_warcraftlogsurl()."/reports/".sanitize($arrReport['id']).'" target="_blank">'.sanitize($arrReport['title'])."</a>
<div class=\"small\">".$date."</div>
</div>";

$strOut .= '</div>';
$i++;
}
$strOut .= "</table>";
$strOut .= "</div>";
return $strOut;

}
Expand Down
2 changes: 1 addition & 1 deletion warcraftlogs_plugin_class.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

class warcraftlogs extends plugin_generic {
public $vstatus = 'Stable';
public $version = '0.2.1';
public $version = '0.2.2';
public $copyright = 'GodMod';

protected static $apiLevel = 23;
Expand Down

0 comments on commit 0e9a365

Please sign in to comment.