Hello,
this change will require changes to an encoded file, i will attach this file without encoding and you will have to place it in the directory <joomla installation>/components/com_masterleaguepro/views/standings/
Unzip the file first
file_to_replace_UNZIP_FIRST.zip
then you will have to change the file <joomla installation>/components/com_masterleaguepro/views/standings/tmpl/default.php
~ Line 122
Code:
<td><a href='<?php echo jRoute::_("index.php?option=com_masterleaguepro&view=playerprediction&user=".$item->id); ?>'><?php echo $item->username;?></a></td>
to
Code:
<td class='mlp-left'>
<a href='<?php echo jRoute::_("index.php?option=com_masterleaguepro&view=playerprediction&user=".$item->id); ?>'>
<?php echo $item->username;?>
</a>
<?php
if(isset($this->trophies[$item->id])){
//user got trophy (we got 3 type of trophies with id 1,2 and 3)
if(isset($this->trophies[$item->id][1])){
for($j=0;$j<$this->trophies[$item->id][1]["trophy_count"];$j++){
echo "<img alt='".$this->trophies[$item->id][1]["trophy_desc"]."' title='".$this->trophies[$item->id][1]["trophy_desc"]."' src='".$this->trophies[$item->id][1]["trophy_icon"]."'/>";
}
}
if(isset($this->trophies[$item->id][2])){
for($j=0;$j<$this->trophies[$item->id][2]["trophy_count"];$j++){
echo "<img alt='".$this->trophies[$item->id][2]["trophy_desc"]."' title='".$this->trophies[$item->id][2]["trophy_desc"]."' src='".$this->trophies[$item->id][2]["trophy_icon"]."'/>";
}
}
if(isset($this->trophies[$item->id][3])){
for($j=0;$j<$this->trophies[$item->id][3]["trophy_count"];$j++){
echo "<img alt='".$this->trophies[$item->id][3]["trophy_desc"]."' title='".$this->trophies[$item->id][3]["trophy_desc"]."' src='".$this->trophies[$item->id][3]["trophy_icon"]."'/>";
}
}
}
if(isset($this->trophies[$item->id][4])){
for($j=0;$j<$this->trophies[$item->id][4]["trophy_count"];$j++){
echo "<img alt='".$this->trophies[$item->id][4]["trophy_desc"]."' title='".$this->trophies[$item->id][4]["trophy_desc"]."' src='".$this->trophies[$item->id][4]["trophy_icon"]."'/>";
}
}
?>
and last you will have to add code to the file <joomla installation>/components/com_masterleaguepro/models/standings.php
you can place the following code before the closing bracket "}" (last line)
Code:
public function getTrophies(){
$query="SELECT ut.user_id,t.id,t.icon,t.description,COUNT(*) as times ".
" FROM `#__masterleaguepro_user_trophy` ut ".
" INNER JOIN `#__masterleaguepro_trophies` t ON t.id=ut.trophy_id ".
" GROUP BY user_id,trophy_id ";
$this->db->setQuery($query);
$trophyList=$this->db->loadObjectList();
$returnArr=array();
foreach ($trophyList as $i => $item) {
$returnArr[$item->user_id][$item->id]=array("trophy_icon"=>$item->icon,"trophy_desc"=>$item->description,"trophy_count"=>$item->times);
}
return $returnArr;
}