PHP Help

tobie_69

New member
I'm trying to intergate a mod into my website but I keep getting error
Code:
[SIZE=2]<?php[/SIZE]
 
[SIZE=2]//[/SIZE]
[SIZE=2]// Joomla Security[/SIZE]
[SIZE=2]//[/SIZE]
[SIZE=2]if( ! defined( '_VALID_MOS' ) ) {[/SIZE]
[SIZE=2]if( ! defined('_JEXEC') ) die('Restricted access');[/SIZE]
[SIZE=2]**[/SIZE]
[SIZE=2]class Leaderboard[/SIZE]
[SIZE=2]{ [/SIZE]
[SIZE=2]function display($leaderboard, $profileid=0)[/SIZE]
[SIZE=2]{[/SIZE]
[SIZE=2]global $bf2stats_version, $bf2stats_history_num_days, $bf2stats_max_players, $bf2stats_progress_bgcolor, $bf2stats_progress_color,[/SIZE]
[SIZE=2]$bf2stats_display_ver, $bf2stats_legend, $bf2stats_css, $bf2stats_styles, $bf2stats_title, $bf2stats_heading, $bf2stats_ext_stats,[/SIZE]
[SIZE=2]$bf2stats_rem_struc, $bf2stats_shownick, $bf2stats_refreshbtn, $bf2stats_l_cs, $bf2stats_l_ts, $bf2stats_l_coms, $bf2stats_l_spm,[/SIZE]
[SIZE=2]$bf2stats_l_kd, $bf2stats_l_pro;[/SIZE]
 
[SIZE=2]// For Leaderboard Colomn Calculation[/SIZE]
[SIZE=2]$leaderboard_cols = 2; // minimun cols; incremented some lines below[/SIZE]
 
[SIZE=2]if ( !$leaderboard ) {[/SIZE]
[SIZE=2]echo "<h1>No Stats available!</h1><h2>Use the updatestats.php script or click here: <a href='index.php?option=com_bf2stats&task=update'>index.php?option=com_bf2stats&task=update</a></h1>";[/SIZE]
[SIZE=2]return FALSE;[/SIZE]
[SIZE=2]**[/SIZE]
[SIZE=2]?>[/SIZE]
[SIZE=2]<script type="text/javascript">[/SIZE]
[SIZE=2]var contractsymbol='components/com_bf2stats/images/minus.gif' //Path to image to represent contract state.[/SIZE]
[SIZE=2]var expandsymbol='components/com_bf2stats/images/plus.gif' //Path to image to represent expand state.[/SIZE]
[SIZE=2]/////No need to edit beyond here //////////////////////////[/SIZE]
[SIZE=2]function expandcontent(curobj, cid){[/SIZE]
[SIZE=2]document.getElementById(cid).style.display=(document.getElementById(cid).style.display!="none")? "none" : ""[/SIZE]
[SIZE=2]curobj.src=(document.getElementById(cid).style.display=="none")? expandsymbol : contractsymbol[/SIZE]
[SIZE=2]**[/SIZE]
[SIZE=2]</script>[/SIZE]
[SIZE=2]<style type="text/css">[/SIZE]
[SIZE=2]<!--[/SIZE]
[SIZE=2]@import url("components/com_bf2stats/style/<?=$bf2stats_styles[$bf2stats_css][0]?>");[/SIZE]
[SIZE=2]-->[/SIZE]
[SIZE=2]</style>[/SIZE]
[SIZE=2]<?[/SIZE]
[SIZE=2]/**[/SIZE]
[SIZE=2]* Output Header Title and Refresh Button if needed[/SIZE]
[SIZE=2]*/[/SIZE]
[SIZE=2]if($bf2stats_title<>'')[/SIZE]
[SIZE=2]echo '<h'.$bf2stats_heading.'>'.$bf2stats_title.'</h'.$bf2stats_heading.'>';[/SIZE]
 
[SIZE=2]if($bf2stats_refreshbtn)[/SIZE]
[SIZE=2]echo '<div style="width:100%;margin-bottom:8px;text-align:right;line-height:0.8em;font-size:0.9em;"><a href="index.php?option=com_bf2stats&task=update" style="border:0px"><img src="components/com_bf2stats/images/reload.gif" alt="Refresh Stats" style="valign:middle;border:0"/> Refresh Stats</a></div>';[/SIZE]
[SIZE=2]?>[/SIZE]
[SIZE=2]<!-- Battlefield 2 Leaderboard by Tom Kremer aka KOMTiKi -->[/SIZE]
[SIZE=2]<table id="leaderboard" width="100%" border="0" cellspacing="1" cellpadding="0">[/SIZE]
[SIZE=2]<tr>[/SIZE]
[SIZE=2]<th><img src="components/com_bf2stats/images/player.gif" alt="Rank and Player-Name" /></th>[/SIZE]
[SIZE=2]<th id="bf2score"><img src="components/com_bf2stats/images/score.gif" alt="Global Score" /></th>[/SIZE]
[SIZE=2]<? if($bf2stats_l_cs == 1){ ?><th id="bf2team"><img src="components/com_bf2stats/images/combat.gif" alt="Combat Score" /></th><? $leaderboard_cols++; ** ?>[/SIZE]
[SIZE=2]<? if($bf2stats_l_ts == 1){ ?><th id="bf2combat"><img src="components/com_bf2stats/images/team.gif" alt="Team Score" /></th><? $leaderboard_cols++; ** ?>[/SIZE]
[SIZE=2]<? if($bf2stats_l_coms == 1){ ?><th id="bf2com"><img src="components/com_bf2stats/images/commander.gif" alt="Commander Score" /></th><? $leaderboard_cols++; ** ?>[/SIZE]
[SIZE=2]<? if($bf2stats_l_spm == 1){ ?><th id="bf2spm"><img src="components/com_bf2stats/images/spm.gif" alt="Score per minute" /></th><? $leaderboard_cols++; ** ?>[/SIZE]
[SIZE=2]<? if($bf2stats_l_kd == 1){ ?><th id="bf2kd"><img src="components/com_bf2stats/images/kd.gif" alt="Kill to Death Ratio" /></th><? $leaderboard_cols++; ** ?>[/SIZE]
[SIZE=2]<? if($bf2stats_l_pro == 1){ ?><th id="bf2progress"><img src="components/com_bf2stats/images/progress.gif" alt="Progress till next rank" /></th><? $leaderboard_cols++; ** ?>[/SIZE]
[SIZE=2]</tr>[/SIZE]
[SIZE=2]<?[/SIZE]
[SIZE=2]if($bf2stats_max_players > count($leaderboard)) $ct = count($leaderboard);[/SIZE]
[SIZE=2]else $ct = $bf2stats_max_players;[/SIZE]
 
[SIZE=2]for($i=0;$i<$ct;$i++)[/SIZE]
[SIZE=2]{ [/SIZE]
[SIZE=2]if($bf2stats_ext_stats<>"") {[/SIZE]
[SIZE=2]$iPlayer = str_replace("{nick**", $leaderboard[$i]['nick'] , $bf2stats_ext_stats);[/SIZE]
[SIZE=2]$iPlayer = str_replace("{id**" , $leaderboard[$i]['bf2id'], $iPlayer);[/SIZE]
 
[SIZE=2]if($bf2stats_shownick=="joomla") $leaderboard[$i]['nick'] = $leaderboard[$i]['jnick']; // Set Joomla Username if selected in config[/SIZE]
[SIZE=2]$iPlayer = "<a href='".$iPlayer."' target='_blank'>".$leaderboard[$i]['nick']."</a>";[/SIZE]
[SIZE=2]**else{[/SIZE]
[SIZE=2]if($bf2stats_shownick=="joomla") $leaderboard[$i]['nick'] = $leaderboard[$i]['jnick']; // Set Joomla Username if selected in config[/SIZE]
[SIZE=2]$iPlayer = $leaderboard[$i]['nick'];[/SIZE]
[SIZE=2]**[/SIZE]
[SIZE=2]?>[/SIZE]
[SIZE=2]<tr>[/SIZE]
[SIZE=2]<td class="<?=($leaderboard[$i]['profileid']==$profileid)?"myLine":'bf2bg1'?>">[/SIZE]
[SIZE=2]<span style="float:left;"><img src="components/com_bf2stats/images/plus.gif" class="plusminusbtn" onClick="expandcontent(this, 'pl<?=$i?>')" /><?=($i+1)?>.<img src="components/com_bf2stats/images/rank_small_<?=$leaderboard[$i]['rank']?>.gif" alt="<?=$leaderboard[$i]['ranktxt']?>" title="<?=$leaderboard[$i]['ranktxt']?>" class="bf2rankicon" /> <?=$iPlayer?></span>[/SIZE]
[SIZE=2]<?[/SIZE]
[SIZE=2]if($leaderboard[$i]['status']<>"")[/SIZE]
[SIZE=2]echo "<span style='float:right;margin-right:5px;'>".mosToolTip([/SIZE]
[SIZE=2]$leaderboard[$i]['status']['srvname']."<br />".$leaderboard[$i]['status']['srvip']."<br />".$leaderboard[$i]['status']['srvmap']."<br />".$leaderboard[$i]['status']['srvplayers'], [/SIZE]
[SIZE=2]"Server Details (click to play)", [/SIZE]
[SIZE=2]'250', [/SIZE]
[SIZE=2]'tooltip.png',[/SIZE]
[SIZE=2]" <img src='components/com_bf2stats/images/playing.gif' alt='online' border='0' />",[/SIZE]
[SIZE=2]"bf2://".$leaderboard[$i]['status']['srvip'], 1[/SIZE]
[SIZE=2])."</span>";[/SIZE]
[SIZE=2]?>[/SIZE]
[SIZE=2]</td>[/SIZE]
[SIZE=2]<td class="<?=($leaderboard[$i]['profileid']==$profileid)?"myLine bf2r":'bf2bg2 bf2r'?>"><?=$leaderboard[$i]['score_overall']?></td>[/SIZE]
[SIZE=2]<? if($bf2stats_l_cs == 1){ ?><td class="<?=($leaderboard[$i]['profileid']==$profileid)?"myLine bf2r":'bf2bg1 bf2r'?>"><?=$leaderboard[$i]['score_combat']?></td><? ** ?>[/SIZE]
[SIZE=2]<? if($bf2stats_l_ts == 1){ ?><td class="<?=($leaderboard[$i]['profileid']==$profileid)?"myLine bf2r":'bf2bg2 bf2r'?>"><?=$leaderboard[$i]['score_team']?></td><? ** ?>[/SIZE]
[SIZE=2]<? if($bf2stats_l_coms == 1){ ?><td class="<?=($leaderboard[$i]['profileid']==$profileid)?"myLine bf2r":'bf2bg1 bf2r'?>"><?=$leaderboard[$i]['score_command']?></td><? ** ?>[/SIZE]
[SIZE=2]<? if($bf2stats_l_spm == 1){ ?><td class="<?=($leaderboard[$i]['profileid']==$profileid)?"myLine bf2r":'bf2bg2 bf2r'?>"><?=$leaderboard[$i]['spm']?></td><? ** ?>[/SIZE]
[SIZE=2]<? if($bf2stats_l_kd == 1){ ?><td class="<?=($leaderboard[$i]['profileid']==$profileid)?"myLine bf2r":'bf2bg1 bf2r'?>"><?=$leaderboard[$i]['kd_ratio']?></td><? ** ?>[/SIZE]
[SIZE=2]<? if($bf2stats_l_pro == 1){ ?><td class="<?=($leaderboard[$i]['profileid']==$profileid)?"myLine bf2r":'bf2bg2 bf2r'?>"><img src="components/com_bf2stats/progress.php?max=<?=$leaderboard[$i]['diff_score']?>&current=<?=$leaderboard[$i]['score_rank']?>&color=<?=$bf2stats_progress_color?>&bgcolor=<?=$bf2stats_progress_bgcolor?>"> <img src="components/com_bf2stats/images/rank_small_<?=$leaderboard[$i]['nextrankid']?>.gif" alt="<?=$leaderboard[$i]['nextranktxt']?>" title="<?=$leaderboard[$i]['nextranktxt']?>" /></td><? ** ?>[/SIZE]
[SIZE=2]</tr>[/SIZE]
[SIZE=2]<tr class="switchcontent" id="pl<?=$i?>" style="display:none">[/SIZE]
[SIZE=2]<td colspan="<?=$leaderboard_cols;?>">[/SIZE]
[SIZE=2]<table width="100%" border="0" cellspacing="1" cellpadding="0" class="playerhistory">[/SIZE]
[SIZE=2]<tr>[/SIZE]
[SIZE=2]<th><img src="components/com_bf2stats/images/date.gif" alt="Date" /></th>[/SIZE]
[SIZE=2]<th><img src="components/com_bf2stats/images/score2.gif" alt="Score" /></th>[/SIZE]
[SIZE=2]<th><img src="components/com_bf2stats/images/spm2.gif" alt="SPM" /></th>[/SIZE]
[SIZE=2]<th><img src="components/com_bf2stats/images/kd2.gif" alt="K:D" /></th>[/SIZE]
[SIZE=2]<th><img src="components/com_bf2stats/images/time.gif" alt="Time" /></th>[/SIZE]
[SIZE=2]<th><img src="components/com_bf2stats/images/combat2.gif" alt="Combat" /></th>[/SIZE]
[SIZE=2]<th><img src="components/com_bf2stats/images/team2.gif" alt="Team" /></th>[/SIZE]
[SIZE=2]<th><img src="components/com_bf2stats/images/commander2.gif" alt="Commander" /></th>[/SIZE]
[SIZE=2]<th><img src="components/com_bf2stats/images/kills.gif" alt="Kills" /></th>[/SIZE]
[SIZE=2]<th><img src="components/com_bf2stats/images/kpm.gif" alt="Kills per Minute" /></th>[/SIZE]
[SIZE=2]<th><img src="components/com_bf2stats/images/deaths.png" width="8" height="11" alt="Deaths" /></th>[/SIZE]
[SIZE=2]<th><img src="components/com_bf2stats/images/dpm.gif" alt="Deaths per Minute" /></th>[/SIZE]
[SIZE=2]<th><img src="components/com_bf2stats/images/heal.gif" alt="Heals" /></th>[/SIZE]
[SIZE=2]<th><img src="components/com_bf2stats/images/revive.gif" alt="Revive" /></th>[/SIZE]
[SIZE=2]<th><img src="components/com_bf2stats/images/support.gif" alt="Support" /></th>[/SIZE]
[SIZE=2]<th><img src="components/com_bf2stats/images/repair.gif" alt="Repair" /></th>[/SIZE]
[SIZE=2]</tr>[/SIZE]
[SIZE=2]<tr>[/SIZE]
[SIZE=2]<td class="bf2bg3">Total</td>[/SIZE]
[SIZE=2]<td class="bf2bg4"><?=$leaderboard[$i]['history'][0]['score']?></td>[/SIZE]
[SIZE=2]<td class="bf2bg3"><?=$leaderboard[$i]['history'][0]['spm']?></td>[/SIZE]
[SIZE=2]<td class="bf2bg4"><? if($leaderboard[$i]['history'][0]['score'] > 0) echo @round($leaderboard[$i]['history'][0]['kills']/$leaderboard[$i]['history'][0]['deaths'], 2); else echo "-"; ?></td>[/SIZE]
[SIZE=2]<td class="bf2bg3"><?=$leaderboard[$i]['history'][0]['timeplayed']?></td>[/SIZE]
[SIZE=2]<td class="bf2bg4"><?=$leaderboard[$i]['history'][0]['combat']?></td>[/SIZE]
[SIZE=2]<td class="bf2bg3"><?=$leaderboard[$i]['history'][0]['team']?></td>[/SIZE]
[SIZE=2]<td class="bf2bg4"><?=$leaderboard[$i]['history'][0]['commander']?></td>[/SIZE]
[SIZE=2]<td class="bf2bg3"><?=$leaderboard[$i]['history'][0]['kills']?></td>[/SIZE]
[SIZE=2]<td class="bf2bg4"><?=$leaderboard[$i]['history'][0]['kpm']?></td>[/SIZE]
[SIZE=2]<td class="bf2bg3"><?=$leaderboard[$i]['history'][0]['deaths']?></td>[/SIZE]
[SIZE=2]<td class="bf2bg4"><?=$leaderboard[$i]['history'][0]['dpm']?></td>[/SIZE]
[SIZE=2]<td class="bf2bg3"><?=$leaderboard[$i]['history'][0]['heals']?></td>[/SIZE]
[SIZE=2]<td class="bf2bg4"><?=$leaderboard[$i]['history'][0]['revive']?></td>[/SIZE]
[SIZE=2]<td class="bf2bg3"><?=$leaderboard[$i]['history'][0]['support']?></td>[/SIZE]
[SIZE=2]<td class="bf2bg4"><?=$leaderboard[$i]['history'][0]['repair']?></td>[/SIZE]
[SIZE=2]</tr>[/SIZE]
[SIZE=2]<?[/SIZE]
[SIZE=2]if(($bf2stats_history_num_days+1) > count($leaderboard[$i]['history'])) $ct2 = (count($leaderboard[$i]['history']) - 1);[/SIZE]
[SIZE=2]else $ct2 = $bf2stats_history_num_days;[/SIZE]
 
[SIZE=2]for($j=0;$j<$ct2;$j++) {[/SIZE]
[SIZE=2]?>[/SIZE]
[SIZE=2]<tr>[/SIZE]
[SIZE=2]<td class="bf2bg3"><?=date("d.m D",$leaderboard[$i]['history'][$j+1][date])?></td>[/SIZE]
[SIZE=2]<td class="bf2bg4"><?=$leaderboard[$i]['history'][$j+1]['score']?></td>[/SIZE]
[SIZE=2]<td class="bf2bg3"><?=$leaderboard[$i]['history'][$j+1]['spm']?></td>[/SIZE]
[SIZE=2]<td class="bf2bg4"><? if($leaderboard[$i]['history'][$j+1]['deaths']<>0) echo @round($leaderboard[$i]['history'][$j+1]['kills']/$leaderboard[$i]['history'][$j+1]['deaths'], 2); else echo $leaderboard[$i]['history'][$j+1]['kills']; ?></td>[/SIZE]
[SIZE=2]<td class="bf2bg3"><?=$leaderboard[$i]['history'][$j+1]['timeplayed']?></td>[/SIZE]
[SIZE=2]<td class="bf2bg4"><?=$leaderboard[$i]['history'][$j+1]['combat']?></td>[/SIZE]
[SIZE=2]<td class="bf2bg3"><?=$leaderboard[$i]['history'][$j+1]['team']?></td>[/SIZE]
[SIZE=2]<td class="bf2bg4"><?=$leaderboard[$i]['history'][$j+1]['commander']?></td>[/SIZE]
[SIZE=2]<td class="bf2bg3"><?=$leaderboard[$i]['history'][$j+1]['kills']?></td>[/SIZE]
[SIZE=2]<td class="bf2bg4"><?=$leaderboard[$i]['history'][$j+1]['kpm']?></td>[/SIZE]
[SIZE=2]<td class="bf2bg3"><?=$leaderboard[$i]['history'][$j+1]['deaths']?></td>[/SIZE]
[SIZE=2]<td class="bf2bg4"><?=$leaderboard[$i]['history'][$j+1]['dpm']?></td>[/SIZE]
[SIZE=2]<td class="bf2bg3"><?=$leaderboard[$i]['history'][$j+1]['heals']?></td>[/SIZE]
[SIZE=2]<td class="bf2bg4"><?=$leaderboard[$i]['history'][$j+1]['revive']?></td>[/SIZE]
[SIZE=2]<td class="bf2bg3"><?=$leaderboard[$i]['history'][$j+1]['support']?></td>[/SIZE]
[SIZE=2]<td class="bf2bg4"><?=$leaderboard[$i]['history'][$j+1]['repair']?></td>[/SIZE]
[SIZE=2]</tr>[/SIZE]
[SIZE=2]<?[/SIZE]
[SIZE=2]** // for[/SIZE]
[SIZE=2]?>[/SIZE]
[SIZE=2]</table>[/SIZE]
[SIZE=2]</td>[/SIZE]
[SIZE=2]</tr>[/SIZE]
[SIZE=2]<?php[/SIZE]
[SIZE=2]** // end for ... leaderboard player history[/SIZE]
 
[SIZE=2][B]echo "</table>";  <-------- this code right here[/B][/SIZE]
 
[SIZE=2]if ( $bf2stats_legend == 1 ) echo "<div style='float:left;margin-top:10px;'><img src='components/com_bf2stats/images/legend.gif' alt='Legend' /></div>";[/SIZE]
[SIZE=2]if ( $bf2stats_display_ver == 1) echo "<div style='float:right;margin-top:10px;font-size:0.9em;'><a href='http://joomlacode.org/gf/project/bf2stats/' target='_blank'>v$bf2stats_version</a></div>";[/SIZE]
[SIZE=2]** // end display[/SIZE]
 
[SIZE=2]** // end class[/SIZE]
 
[SIZE=2]?>[/SIZE]

This is the error I get:
Parse error: syntax error, unexpected T_ECHO, expecting T_FUNCTION in C:\wamp\www\joomla-new\components\com_bf2stats\bf2stats.html.php on line 179

I've bolded the area I'm having problems with. If you have any suggestion they would be most welcomed.
 
Last edited:
I'm not really a php expert but the syntax looks screwed up to me. I fixed it (maybe) but without being able to test the file live I have no idea if it will work or not.

Code:
<?php
 
//
// Joomla Security
//
if( ! defined( '_VALID_MOS' ) ) {
if( ! defined('_JEXEC') ) die('Restricted access');
class Leaderboard
{ 
function display($leaderboard, $profileid=0)
{
global $bf2stats_version, $bf2stats_history_num_days, $bf2stats_max_players, $bf2stats_progress_bgcolor, $bf2stats_progress_color,
$bf2stats_display_ver, $bf2stats_legend, $bf2stats_css, $bf2stats_styles, $bf2stats_title, $bf2stats_heading, $bf2stats_ext_stats,
$bf2stats_rem_struc, $bf2stats_shownick, $bf2stats_refreshbtn, $bf2stats_l_cs, $bf2stats_l_ts, $bf2stats_l_coms, $bf2stats_l_spm,
$bf2stats_l_kd, $bf2stats_l_pro;
 
// For Leaderboard Colomn Calculation
$leaderboard_cols = 2; // minimun cols; incremented some lines below
 
if ( !$leaderboard ) {
echo "<h1>No Stats available!</h1><h2>Use the updatestats.php script or click here: <a href='index.php?option=com_bf2stats&task=update'>index.php?option=com_bf2stats&task=update</a></h1>";
return FALSE;
**
?>
<script type="text/javascript">
var contractsymbol='components/com_bf2stats/images/minus.gif' //Path to image to represent contract state.
var expandsymbol='components/com_bf2stats/images/plus.gif' //Path to image to represent expand state.
/////No need to edit beyond here //////////////////////////
function expandcontent(curobj, cid){
document.getElementById(cid).style.display=(document.getElementById(cid).style.display!="none")? "none" : ""
curobj.src=(document.getElementById(cid).style.display=="none")? expandsymbol : contractsymbol
</script>
<style type="text/css">
<!--
@import url("components/com_bf2stats/style/<?=$bf2stats_styles[$bf2stats_css][0]?>");
-->
</style>
<?
/**
* Output Header Title and Refresh Button if needed
*/
if($bf2stats_title<>'')
echo '<h'.$bf2stats_heading.'>'.$bf2stats_title.'</h'.$bf2stats_heading.'>';
 
if($bf2stats_refreshbtn)
echo '<div style="width:100%;margin-bottom:8px;text-align:right;line-height:0.8em;font-size:0.9em;"><a href="index.php?option=com_bf2stats&task=update" style="border:0px"><img src="components/com_bf2stats/images/reload.gif" alt="Refresh Stats" style="valign:middle;border:0"/> Refresh Stats</a></div>';
?>
<!-- Battlefield 2 Leaderboard by Tom Kremer aka KOMTiKi -->
<table id="leaderboard" width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<th><img src="components/com_bf2stats/images/player.gif" alt="Rank and Player-Name" /></th>
<th id="bf2score"><img src="components/com_bf2stats/images/score.gif" alt="Global Score" /></th>
<? if($bf2stats_l_cs == 1){ ?><th id="bf2team"><img src="components/com_bf2stats/images/combat.gif" alt="Combat Score" /></th><? $leaderboard_cols++; ** ?>
<? if($bf2stats_l_ts == 1){ ?><th id="bf2combat"><img src="components/com_bf2stats/images/team.gif" alt="Team Score" /></th><? $leaderboard_cols++; ** ?>
<? if($bf2stats_l_coms == 1){ ?><th id="bf2com"><img src="components/com_bf2stats/images/commander.gif" alt="Commander Score" /></th><? $leaderboard_cols++; ** ?>
<? if($bf2stats_l_spm == 1){ ?><th id="bf2spm"><img src="components/com_bf2stats/images/spm.gif" alt="Score per minute" /></th><? $leaderboard_cols++; ** ?>
<? if($bf2stats_l_kd == 1){ ?><th id="bf2kd"><img src="components/com_bf2stats/images/kd.gif" alt="Kill to Death Ratio" /></th><? $leaderboard_cols++; ** ?>
<? if($bf2stats_l_pro == 1){ ?><th id="bf2progress"><img src="components/com_bf2stats/images/progress.gif" alt="Progress till next rank" /></th><? $leaderboard_cols++; ** ?>
</tr>
<?
if($bf2stats_max_players > count($leaderboard)) $ct = count($leaderboard);
else $ct = $bf2stats_max_players;
 
for($i=0;$i<$ct;$i++)
{ 
	if($bf2stats_ext_stats<>"") {
	$iPlayer = str_replace("{nick**", $leaderboard[$i]['nick'] , $bf2stats_ext_stats);
	$iPlayer = str_replace("{id**" , $leaderboard[$i]['bf2id'], $iPlayer);
	 
		if($bf2stats_shownick=="joomla") $leaderboard[$i]['nick'] = $leaderboard[$i]['jnick']; // Set Joomla Username if selected in config
		$iPlayer = "<a href='".$iPlayer."' target='_blank'>".$leaderboard[$i]['nick']."</a>";
		** else{
			if($bf2stats_shownick=="joomla") $leaderboard[$i]['nick'] = $leaderboard[$i]['jnick']; // Set Joomla Username if selected in config
			$iPlayer = $leaderboard[$i]['nick'];
		**
	?>
	<tr>
	<td class="<?=($leaderboard[$i]['profileid']==$profileid)?"myLine":'bf2bg1'?>">
	<span style="float:left;"><img src="components/com_bf2stats/images/plus.gif" class="plusminusbtn" onClick="expandcontent(this, 'pl<?=$i?>')" /><?=($i+1)?>.<img src="components/com_bf2stats/images/rank_small_<?=$leaderboard[$i]['rank']?>.gif" alt="<?=$leaderboard[$i]['ranktxt']?>" title="<?=$leaderboard[$i]['ranktxt']?>" class="bf2rankicon" /> <?=$iPlayer?></span>
	<?
	if($leaderboard[$i]['status']<>"")
			echo "<span style='float:right;margin-right:5px;'>".mosToolTip(
	$leaderboard[$i]['status']['srvname']."<br />".$leaderboard[$i]['status']['srvip']."<br />".$leaderboard[$i]['status']['srvmap']."<br />".$leaderboard[$i]['status']['srvplayers'], 
	"Server Details (click to play)", 
	'250', 
	'tooltip.png',
	" <img src='components/com_bf2stats/images/playing.gif' alt='online' border='0' />",
	"bf2://".$leaderboard[$i]['status']['srvip'], 1
	)."</span>";
?>
</td>
<td class="<?=($leaderboard[$i]['profileid']==$profileid)?"myLine bf2r":'bf2bg2 bf2r'?>"><?=$leaderboard[$i]['score_overall']?></td>
<? if($bf2stats_l_cs == 1){ ?><td class="<?=($leaderboard[$i]['profileid']==$profileid)?"myLine bf2r":'bf2bg1 bf2r'?>"><?=$leaderboard[$i]['score_combat']?></td><? ** ?>
<? if($bf2stats_l_ts == 1){ ?><td class="<?=($leaderboard[$i]['profileid']==$profileid)?"myLine bf2r":'bf2bg2 bf2r'?>"><?=$leaderboard[$i]['score_team']?></td><? ** ?>
<? if($bf2stats_l_coms == 1){ ?><td class="<?=($leaderboard[$i]['profileid']==$profileid)?"myLine bf2r":'bf2bg1 bf2r'?>"><?=$leaderboard[$i]['score_command']?></td><? ** ?>
<? if($bf2stats_l_spm == 1){ ?><td class="<?=($leaderboard[$i]['profileid']==$profileid)?"myLine bf2r":'bf2bg2 bf2r'?>"><?=$leaderboard[$i]['spm']?></td><? ** ?>
<? if($bf2stats_l_kd == 1){ ?><td class="<?=($leaderboard[$i]['profileid']==$profileid)?"myLine bf2r":'bf2bg1 bf2r'?>"><?=$leaderboard[$i]['kd_ratio']?></td><? ** ?>
<? if($bf2stats_l_pro == 1){ ?><td class="<?=($leaderboard[$i]['profileid']==$profileid)?"myLine bf2r":'bf2bg2 bf2r'?>"><img src="components/com_bf2stats/progress.php?max=<?=$leaderboard[$i]['diff_score']?>&current=<?=$leaderboard[$i]['score_rank']?>&color=<?=$bf2stats_progress_color?>&bgcolor=<?=$bf2stats_progress_bgcolor?>"> <img src="components/com_bf2stats/images/rank_small_<?=$leaderboard[$i]['nextrankid']?>.gif" alt="<?=$leaderboard[$i]['nextranktxt']?>" title="<?=$leaderboard[$i]['nextranktxt']?>" /></td><? ** ?>
</tr>
<tr class="switchcontent" id="pl<?=$i?>" style="display:none">
<td colspan="<?=$leaderboard_cols;?>">
<table width="100%" border="0" cellspacing="1" cellpadding="0" class="playerhistory">
<tr>
<th><img src="components/com_bf2stats/images/date.gif" alt="Date" /></th>
<th><img src="components/com_bf2stats/images/score2.gif" alt="Score" /></th>
<th><img src="components/com_bf2stats/images/spm2.gif" alt="SPM" /></th>
<th><img src="components/com_bf2stats/images/kd2.gif" alt="K:D" /></th>
<th><img src="components/com_bf2stats/images/time.gif" alt="Time" /></th>
<th><img src="components/com_bf2stats/images/combat2.gif" alt="Combat" /></th>
<th><img src="components/com_bf2stats/images/team2.gif" alt="Team" /></th>
<th><img src="components/com_bf2stats/images/commander2.gif" alt="Commander" /></th>
<th><img src="components/com_bf2stats/images/kills.gif" alt="Kills" /></th>
<th><img src="components/com_bf2stats/images/kpm.gif" alt="Kills per Minute" /></th>
<th><img src="components/com_bf2stats/images/deaths.png" width="8" height="11" alt="Deaths" /></th>
<th><img src="components/com_bf2stats/images/dpm.gif" alt="Deaths per Minute" /></th>
<th><img src="components/com_bf2stats/images/heal.gif" alt="Heals" /></th>
<th><img src="components/com_bf2stats/images/revive.gif" alt="Revive" /></th>
<th><img src="components/com_bf2stats/images/support.gif" alt="Support" /></th>
<th><img src="components/com_bf2stats/images/repair.gif" alt="Repair" /></th>
</tr>
<tr>
<td class="bf2bg3">Total</td>
<td class="bf2bg4"><?=$leaderboard[$i]['history'][0]['score']?></td>
<td class="bf2bg3"><?=$leaderboard[$i]['history'][0]['spm']?></td>
<td class="bf2bg4"><? if($leaderboard[$i]['history'][0]['score'] > 0) echo @round($leaderboard[$i]['history'][0]['kills']/$leaderboard[$i]['history'][0]['deaths'], 2); else echo "-"; ?></td>
<td class="bf2bg3"><?=$leaderboard[$i]['history'][0]['timeplayed']?></td>
<td class="bf2bg4"><?=$leaderboard[$i]['history'][0]['combat']?></td>
<td class="bf2bg3"><?=$leaderboard[$i]['history'][0]['team']?></td>
<td class="bf2bg4"><?=$leaderboard[$i]['history'][0]['commander']?></td>
<td class="bf2bg3"><?=$leaderboard[$i]['history'][0]['kills']?></td>
<td class="bf2bg4"><?=$leaderboard[$i]['history'][0]['kpm']?></td>
<td class="bf2bg3"><?=$leaderboard[$i]['history'][0]['deaths']?></td>
<td class="bf2bg4"><?=$leaderboard[$i]['history'][0]['dpm']?></td>
<td class="bf2bg3"><?=$leaderboard[$i]['history'][0]['heals']?></td>
<td class="bf2bg4"><?=$leaderboard[$i]['history'][0]['revive']?></td>
<td class="bf2bg3"><?=$leaderboard[$i]['history'][0]['support']?></td>
<td class="bf2bg4"><?=$leaderboard[$i]['history'][0]['repair']?></td>
</tr>
<?
if(($bf2stats_history_num_days+1) > count($leaderboard[$i]['history'])) $ct2 = (count($leaderboard[$i]['history']) - 1);
else $ct2 = $bf2stats_history_num_days;
 
for($j=0;$j<$ct2;$j++) {
?>
<tr>
<td class="bf2bg3"><?=date("d.m D",$leaderboard[$i]['history'][$j+1][date])?></td>
<td class="bf2bg4"><?=$leaderboard[$i]['history'][$j+1]['score']?></td>
<td class="bf2bg3"><?=$leaderboard[$i]['history'][$j+1]['spm']?></td>
<td class="bf2bg4"><? if($leaderboard[$i]['history'][$j+1]['deaths']<>0) echo @round($leaderboard[$i]['history'][$j+1]['kills']/$leaderboard[$i]['history'][$j+1]['deaths'], 2); else echo $leaderboard[$i]['history'][$j+1]['kills']; ?></td>
<td class="bf2bg3"><?=$leaderboard[$i]['history'][$j+1]['timeplayed']?></td>
<td class="bf2bg4"><?=$leaderboard[$i]['history'][$j+1]['combat']?></td>
<td class="bf2bg3"><?=$leaderboard[$i]['history'][$j+1]['team']?></td>
<td class="bf2bg4"><?=$leaderboard[$i]['history'][$j+1]['commander']?></td>
<td class="bf2bg3"><?=$leaderboard[$i]['history'][$j+1]['kills']?></td>
<td class="bf2bg4"><?=$leaderboard[$i]['history'][$j+1]['kpm']?></td>
<td class="bf2bg3"><?=$leaderboard[$i]['history'][$j+1]['deaths']?></td>
<td class="bf2bg4"><?=$leaderboard[$i]['history'][$j+1]['dpm']?></td>
<td class="bf2bg3"><?=$leaderboard[$i]['history'][$j+1]['heals']?></td>
<td class="bf2bg4"><?=$leaderboard[$i]['history'][$j+1]['revive']?></td>
<td class="bf2bg3"><?=$leaderboard[$i]['history'][$j+1]['support']?></td>
<td class="bf2bg4"><?=$leaderboard[$i]['history'][$j+1]['repair']?></td>
</tr>
<?
** // for
?>
</table>
</td>
</tr>
<?php
** // end for ... leaderboard player history
 
echo "</table>";  //<-------- this code right here
 
if ( $bf2stats_legend == 1 ) echo "<div style='float:left;margin-top:10px;'><img src='components/com_bf2stats/images/legend.gif' alt='Legend' /></div>";
if ( $bf2stats_display_ver == 1) echo "<div style='float:right;margin-top:10px;font-size:0.9em;'><a href='http://joomlacode.org/gf/project/bf2stats/' target='_blank'>v$bf2stats_version</a></div>";
** // end display
 
** // end class

**
?>
 
Thanks for your help. I was running the mod on my test site on my computer using WAMP 5. When I uploaded it to my website it works. So I must have so setting(s) wrong on my test site.

Thanks for you help though.
 
Back
Top