Jump to content

Stats page for XPKillers Stats Logger Plugin


ImportBot

Recommended Posts

  • 1 month later...
  • Replies 241
  • Created
  • Last Reply
  • 4 weeks later...
  • 1 month later...

Originally Posted by utopiate*:

 

Hey all, any chance of some nooby help? lol. I have this installed but as a bit of a web noob don't know how to add my servers. I'm guessing they need to be defined in bf3conn.php but don't know how to do this. Looking to add 3 BF3 servers.

 

cheers :ohmy:

* Restored post. It could be that the author is no longer active.
Link to comment
  • 3 weeks later...

Originally Posted by Pegasus829*:

 

Hi guys,

 

Does this still work with ver 1.5? Can't get it to connect and show stats, also can't see where you now add the game server detail.

 

If you have to insert it directly into the bf3conn file, where?

 

Stats aren't displaying either even though DB info is 100% and IP's are allowed. Any help/documentation would be great. Used to be dead easy to set up with first version...

* Restored post. It could be that the author is no longer active.
Link to comment
  • 1 month later...

Originally Posted by supermillhouse*:

 

Is there anybody who can update this to use the new DB live stats as my host doesn't allow connection to the game server?

Im afraid my php skills are not up to it

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ty_ger07*:

I have a stats page with db live scoreboard here:
www.phogue.net/forumvb/showth...apstats-Logger*

:ohmy:

Here is my scoreboard function:
Code:

// make an array of game modes
$mode_array = array('Team Deathmatch'=>'TeamDeathMatchC0','Conquest Assault Large'=>'ConquestAssaultLarge0','Conquest Assault Small'=>'ConquestAssaultSmall1','Conquest Assault Small'=>'ConquestAssaultSmall0','Gun Master'=>'GunMaster0','Conquest Domination'=>'Domination0','Scavenger'=>'Scavenger0','Tank Superiority'=>'TankSuperiority0','Rush'=>'RushLarge0','Conquest Large'=>'ConquestLarge0','Conquest Small'=>'ConquestSmall0','Team Deathmatch'=>'TeamDeathMatch0','Squad Rush'=>'SquadRush0','Squad Deathmatch'=>'SquadDeathMatch0');
// make an array of map names
$map_array = array('Talah Market'=>'XP4_RUBBLE','Azadi Palace'=>'XP4_PARL','Markaz Monolith'=>'XP4_FD','Epicenter'=>'XP4_QUAKE','Bandar Desert'=>'XP3_DESERT','Alborz Mountains'=>'XP3_ALBORZ','Armored Shield'=>'XP3_SHIELD','Death Valley'=>'XP3_VALLEY','Scrapmetal'=>'XP2_FACTORY','Operation 925'=>'XP2_OFFICE','Donya Fortress'=>'XP2_PALACE','Ziba Tower'=>'XP2_SKYBAR','Grand Bazaar'=>'MP_001','Tehran Highway'=>'MP_003','Caspian Border'=>'MP_007','Seine Crossing'=>'MP_011','Operation Firestorm'=>'MP_012','Damavand Peak'=>'MP_013','Noshahar Canals'=>'MP_017','Kharg Island'=>'MP_018','Operation Metro'=>'MP_SUBWAY','Strike at Karkand'=>'XP1_001','Gulf of Oman'=>'XP1_002','Sharqi Peninsula'=>'XP1_003','Wake Island'=>'XP1_004');
// make an array of squad names
$squad_array = array('None'=>'0','Alpha'=>'1','Bravo'=>'2','Charlie'=>'3','Delta'=>'4','Echo'=>'5','Foxtrot'=>'6','Golf'=>'7','Hotel'=>'8','India'=>'9','Juliet'=>'10','Kilo'=>'11','Lima'=>'12','Mike'=>'13','November'=>'14','Oscar'=>'15','Papa'=>'16','Quebec'=>'17','Romeo'=>'18','Sierra'=>'19','Tango'=>'20','Uniform'=>'21','Victor'=>'22','Whiskey'=>'23','X-Ray'=>'24','Yankee'=>'25','Zulu'=>'26');
// make an array of country names
$country_array = array('Null'=>'','Unknown'=>'--','Afghanistan'=>'AF','Albania'=>'AL','Algeria'=>'DZ','American Samoa'=>'AS','Andorra'=>'AD','Angola'=>'AO','Anguilla'=>'AI','Antarctica'=>'AQ','Antigua'=>'AG','Argentina'=>'AR','Armenia'=>'AM','Aruba'=>'AW','Australia'=>'AU','Austria'=>'AT','Azerbaijan'=>'AZ','Bahamas'=>'BS','Bahrain'=>'BH','Bangladesh'=>'BD','Barbados'=>'BB','Belarus'=>'BY','Belgium'=>'BE','Belize'=>'BZ','Benin'=>'BJ','Bermuda'=>'BM','Bhutan'=>'BT','Bolivia'=>'BO','Bosnia'=>'BA','Botswana'=>'BW','Bouvet Island'=>'BV','Brazil'=>'BR','Indian Ocean'=>'IO','Brunei Darussalum'=>'BN','Bulgaria'=>'BG','Burkina Faso'=>'BF','Burundi'=>'BI','Cambodia'=>'KH','Cameroon'=>'CM','Canada'=>'CA','Cape Verde'=>'CV','Cayman Islands'=>'KY','Central Africa'=>'CF','Chad'=>'TD','Chile'=>'CL','China'=>'CN','Christmas Island'=>'CX','Cocos Islands'=>'CC','Columbia'=>'CO','Comoros'=>'KM','Congo'=>'CG','Republic of Congo'=>'CD','Cook Islands'=>'CK','Costa Rica'=>'CR','Ivory Coast'=>'CI','Croatia'=>'HR','Cuba'=>'CU','Cyprus'=>'CY','Czech Repuplic'=>'CZ','Denmark'=>'DK','Djibouti'=>'DJ','Dominica'=>'DM','Dominican Republic'=>'DO','East Timor'=>'TP','Ecuador'=>'EC','Egypt'=>'EG','El Salvador'=>'SV','Equatorial Guinea'=>'GQ','Eritrea'=>'ER','Estonia'=>'EE','Ethiopia'=>'ET','Falkland Islands'=>'FK','Faroe Islands'=>'FO','Fiji'=>'FJ','Finland'=>'FI','France'=>'FR','Metropolitan France'=>'FX','French Guiana'=>'GF','French Polynesia'=>'PF','French Territories'=>'TF','Gabon'=>'GA','Gambia'=>'GM','Georgia'=>'GE','Germany'=>'DE','Ghana'=>'GH','Gibraltar'=>'GI','Greece'=>'GR','Greenland'=>'GL','Grenada'=>'GD','Guadeloupe'=>'GP','Guam'=>'GU','Guatemala'=>'GT','Guinea'=>'GN','Guinea-Bissau'=>'GW','Guyana'=>'GY','Haiti'=>'HT','McDonald Islands'=>'HM','Vatican City'=>'VA','Honduras'=>'HN','Hong Kong'=>'HK','Hungary'=>'HU','Iceland'=>'IS','India'=>'IN','Indonesia'=>'ID','Iran'=>'IR','Iraq'=>'IQ','Ireland'=>'IE','Israel'=>'IL','Italy'=>'IT','Jamaica'=>'JM','Japan'=>'JP','Jordan'=>'JO','Kazakstan'=>'KZ','Kenya'=>'KE','Kiribati'=>'KI','North Korea'=>'KP','South Korea'=>'KR','Kuwait'=>'KW','Kyrgyzstan'=>'KG','Lao'=>'LA','Latvia'=>'LV','Lebanon'=>'LB','Lesotho'=>'LS','Liberia'=>'LR','Libya'=>'LY','Liechtenstein'=>'LI','Lithuania'=>'LT','Luxembourg'=>'LU','Macau'=>'MO','Macedonia'=>'MK','Madagascar'=>'MG','Malawi'=>'MW','Malaysia'=>'MY','Maldives'=>'MV','Mali'=>'ML','Malta'=>'MT','Marshall Islands'=>'MH','Martinique'=>'MQ','Mauritania'=>'MR','Mauritius'=>'MU','Mayotte'=>'YT','Mexico'=>'MX','Micronesia'=>'FM','Moldova'=>'MD','Monaco'=>'MC','Mongolia'=>'MN','Montserrat'=>'MS','Morocco'=>'MA','Mozambique'=>'MZ','Myanmar'=>'MM','Namibia'=>'NA','Nauru'=>'NR','Nepal'=>'NP','Netherlands'=>'NL','Netherlands Antilles'=>'AN','New Caledonia'=>'NC','New Zealand'=>'NZ','Nicaragua'=>'NI','Niger'=>'NE','Nigeria'=>'NG','Niue'=>'NU','Norfolk Island'=>'NF','Mariana Islands'=>'MP','Norway'=>'NO','Oman'=>'OM','Pakistan'=>'PK','Palau'=>'PW','Palestine'=>'PS','Panama'=>'PA','Papua New Guinea'=>'PG','Paraguay'=>'PY','Peru'=>'PE','Philippines'=>'PH','Pitcairn'=>'PN','Poland'=>'PL','Portugal'=>'PT','Puerto Rico'=>'PR','Qatar'=>'QA','Reunion'=>'RE','Romania'=>'RO','Russia'=>'RU','Rwanda'=>'RW','Saint Helena'=>'SH','Saint Kitts'=>'KN','Saint Lucia'=>'LC','Saint Pierre'=>'PM','Saint Vincent'=>'VC','Samoa'=>'WS','San Marino'=>'SM','Sao Tome'=>'ST','Saudi Arabia'=>'SA','Senegal'=>'SN','Seychelles'=>'SC','Sierra Leone'=>'SL','Singapore'=>'SG','Slovakia'=>'SK','Slovenia'=>'SI','Solomon Islands'=>'SB','Somalia'=>'SO','South Africa'=>'ZA','Sandwich Islands'=>'GS','Spain'=>'ES','Sri Lanka'=>'LK','Sudan'=>'SD','Suriname'=>'SR','Svalbard'=>'SJ','Swaziland'=>'SZ','Sweden'=>'SE','Switzerland'=>'CH','Syria'=>'SY','Taiwan'=>'TW','Tajikistan'=>'TJ','Tanzania'=>'TZ','Thailand'=>'TH','Togo'=>'TG','Tokelau'=>'TK','Tonga'=>'TO','Trinidad'=>'TT','Tunisia'=>'TN','Turkey'=>'TR','Turkmenistan'=>'TM','Turks Islands'=>'TC','Tuvalu'=>'TV','Uganda'=>'UG','Ukraine'=>'UA','United Arab Emirates'=>'AE','United Kingdom'=>'GB','United States'=>'US','US Minor Outlying Islands'=>'UM','Uruguay'=>'UY','Uzbekistan'=>'UZ','Vanuatu'=>'VU','Venezuela'=>'VE','Vietnam'=>'VN','Virgin Islands (British)'=>'VG','Virgin Islands (US)'=>'VI','Wallis and Futuna'=>'WF','Western Sahara'=>'EH','Yemen'=>'YE','Yugoslavia'=>'YU','Zambia'=>'ZM','Zimbabwe'=>'ZW');

// function to create and display scoreboard
function scoreboard()
{
    global $table_suffix, $server_ID, $server_name, $mode_array, $map_array, $squad_array, $country_array;
    echo'
    <div class="middlecontent">
    
    <table width="100%" border="0">
    <tr>
    <th>' . $server_name . ' Scoreboard</th>
    </tr>
    <tr>
    <td>
    ';
    // query for player in server and order them by team
    $scoreboard_players = @mysql_query("SELECT `TeamID` FROM tbl_currentplayers{$table_suffix} WHERE `ServerID` = '$server_ID' ORDER BY `TeamID` ASC");
    if(@mysql_num_rows($scoreboard_players)==0)
    {
        // initialize values
        $mode_name = 'Unknown';
        $map_name = 'Unknown';
        $mode = 'Unknown';
        // figure out current game mode and map name
        $mode_query = @mysql_query("SELECT `mapName`, `Gamemode` FROM tbl_server{$table_suffix} WHERE `ServerID` = '$server_ID'");
        if(@mysql_num_rows($mode_query)!=0)
        {
            $mode_row = @mysql_fetch_assoc($mode_query);
            // convert mode to friendly name
            $mode = $mode_row['Gamemode'];
            $mode_name = array_search($mode,$mode_array);
            // convert map to friendly name
            $map_name = strtoupper($mode_row['mapName']);
            $map_name = array_search($map_name,$map_array);
        }
        echo '
        <div class="innercontent">
        <table width="65%" align="center" border="0" class="prettytable">
        <tr>
        <td width="25%" style="text-align:left">     <font class="information">Current Game Mode:</font></td>
        <td width="25%" style="text-align:left">     ' . $mode_name . '</td>
        <td width="25%" style="text-align:left">     <font class="information">Current Map:</font></td>
        <td width="25%" style="text-align:left">     ' . $map_name . '</td>
        </tr>
        <tr>
        <td colspan="4"> </td>
        </tr>
        <tr>
        <td colspan="4"><center><font class="information">No players currently in ' . $server_name . ' server.</font></center></td>
        </tr>
        </table>
        </div>
        ';
    }
    else
    {
        echo '
        <div class="innercontent">
        <table width="95%" align="center" border="0">
        <tr>
        <td>
        ';
        // initialize values
        $mode_name = 'Unknown';
        $map_name = 'Unknown';
        $mode = 'Unknown';
        // figure out current game mode and map name
        $mode_query = @mysql_query("SELECT `mapName`, `Gamemode` FROM tbl_server{$table_suffix} WHERE `ServerID` = '$server_ID'");
        if(@mysql_num_rows($mode_query)!=0)
        {
            $mode_row = @mysql_fetch_assoc($mode_query);
            // convert mode to friendly name
            $mode = $mode_row['Gamemode'];
            $mode_name = array_search($mode,$mode_array);
            // convert map to friendly name
            $map_name = strtoupper($mode_row['mapName']);
            $map_name = array_search($map_name,$map_array);
        }
        // initialize values
        $mode_shown = 0;
        $last_team = -1;
        while($team_row = @mysql_fetch_assoc($scoreboard_players))
        {
            $this_team = $team_row['TeamID'];
            if($this_team != $last_team)
            {
                // only show the header information once
                if($mode_shown == 0)
                {
                    echo '
                    <table width="75%" align="center" border="0" class="prettytable">
                    <tr>
                    <td width="25%" style="text-align:left">     <font class="information">Current Game Mode:</font></td>
                    <td width="25%" style="text-align:left">     ' . $mode_name . '</td>
                    <td width="25%" style="text-align:left">     <font class="information">Current Map:</font></td>
                    <td width="25%" style="text-align:left">     ' . $map_name . '</td>
                    </tr>
                    </table>
                    
                    ';
                    $mode_shown = 1;
                }
                // change team name shown depending on team number
                if($this_team == 0)
                {
                    $team_name = 'Loading In';
                }
                else
                {
                    if(($mode == 'RushLarge0') OR ($mode == 'SquadRush0'))
                    {
                        if($this_team == 1)
                        {
                            $team_name = 'Attackers';
                        }
                        elseif($this_team == 2)
                        {
                            $team_name = 'Defenders';
                        }
                        else
                        {
                            $team_name = 'Team ' . $this_team;
                        }
                    }
                    elseif(($mode == 'TeamDeathMatchC0') OR ($mode == 'ConquestAssaultLarge0') OR ($mode == 'ConquestAssaultSmall1') OR ($mode == 'ConquestAssaultSmall0') OR ($mode == 'GunMaster0') OR ($mode == 'Domination0') OR ($mode == 'Scavenger0') OR ($mode == 'TankSuperiority0') OR ($mode == 'ConquestLarge0') OR ($mode == 'ConquestSmall0') OR ($mode == 'TeamDeathMatch0'))
                    {
                        if($this_team == 1)
                        {
                            $team_name = 'US Army';
                        }
                        elseif($this_team == 2)
                        {
                            $team_name = 'Russian Army';
                        }
                        else
                        {
                            $team_name = 'Team ' . $this_team;
                        }
                    }
                    elseif(($mode == 'SquadDeathMatch0'))
                    {
                        if($this_team == 1)
                        {
                            $team_name = 'Alpha';
                        }
                        elseif($this_team == 2)
                        {
                            $team_name = 'Bravo';
                        }
                        elseif($this_team == 3)
                        {
                            $team_name = 'Charlie';
                        }
                        elseif($this_team == 4)
                        {
                            $team_name = 'Delta';
                        }
                        else
                        {
                            $team_name = 'Team ' . $this_team;
                        }
                    }
                    else
                    {
                        $team_name = 'Team ' . $this_team;
                    }
                }
                echo '
                <table width="75%" align="center" border="0" class="prettytable">
                <tr>
                ';
                // change team color depending...
                if($this_team == 0)
                {
                    echo '<th width="15%" class="prettyheader">' . $team_name . '</th>';
                }
                else
                {
                    echo '<th width="15%" class="prettyheader"><font class="teamname">' . $team_name . '</font></th>';
                }
                echo '<th width="30%" class="prettyheader" colspan="2" style="text-align:left">Player</th>';
                
                // if player is loading in, don't show the score, kills, deaths, or squad name headers
                if($this_team == 0)
                {
                    echo '<th width="55%" class="prettyheader" colspan="4"> </th>';
                }
                else
                {
                    echo'
                    <th width="14%" class="prettyheader" style="text-align:left">Score</th>
                    <th width="13%" class="prettyheader" style="text-align:left">Kills</th>
                    <th width="14%" class="prettyheader" style="text-align:left">Deaths</th>
                    <th width="14%" class="prettyheader" style="text-align:left">Squad</th>
                    ';
                }
                echo'</tr>';
                // query all players on this team
                $scoreboard_query = @mysql_query("SELECT `ServerID`, `Soldiername`, `Score`, `Kills`, `Deaths`, `TeamID`, `SquadID`, `CountryCode` FROM tbl_currentplayers{$table_suffix} WHERE ServerID = '$server_ID' AND `TeamID` = '$this_team' ORDER BY `Score` Desc");
                if(@mysql_num_rows($scoreboard_query)!=0)
                {
                    $count = 1;
                    while($scoreboard_row = @mysql_fetch_assoc($scoreboard_query))
                    {
                        $player = $scoreboard_row['Soldiername'];
                        $score = $scoreboard_row['Score'];
                        $kills = $scoreboard_row['Kills'];
                        $deaths = $scoreboard_row['Deaths'];
                        $team = $scoreboard_row['TeamID'];
                        $squad = $scoreboard_row['SquadID'];
                        // convert squad name and country name to friendly names
                        $squad_name = array_search($squad,$squad_array);
                        $country = strtoupper($scoreboard_row['CountryCode']);
                        $country_name = array_search($country,$country_array);
                        echo '
                        <tr>
                        <td style="text-align:right" width="12%">' . $count . ':  </td>
                        <td style="text-align:left" width="15%">     <a href="' . $_SERVER['PHP_SELF'] . '_player_name=' . $player . '&search_player=Search"><font size="2">' . $player . '</font></a></td>
                        <td style="text-align:left" width="15%">     ' . $country_name . '</td>
                        ';
                        // if player is loading in, don't show the score, kills, deaths, or squad name
                        if($this_team == 0)
                        {
                            echo '
                            <td style="text-align:left" colspan="4"> </td>
                            </tr>
                            ';
                        }
                        else
                        {
                            echo '
                            <td style="text-align:left" width="12%">     ' . $score . '</td>
                            <td style="text-align:left" width="12%">     ' . $kills . '</td>
                            <td style="text-align:left" width="15%">     ' . $deaths . '</td>
                            <td style="text-align:left" width="12%">     ' . $squad_name . '</td>
                            </tr>
                            ';
                        }
                        $count++;
                    }
                }
                echo '
                </table>
                
                ';
            }
            $last_team = $this_team;
        }
        echo '
        </td>
        </tr>
        </table>
        
        </div>
        ';
    }
    echo '
    </td></tr>
    </table>
    </div>
    
    ';
}
It can be called up in the code by scoreboard();.  It requires global variables $table_suffix, $server_ID, $server_name, $mode_array, $map_array, $squad_array, and $country_array to be set ahead of time.  I have included $mode_array, $map_array, $squad_array, and $country_array in the code above already.  $table_suffix should be set to null if no table suffix is used.

This will create a scoreboard like this:
score_board.png

It will work, but you will need to format the HTML and CSS to use RMG-Dr4k3's format otherwise it will look funny.  Also, the player name links will need to be modified to properly link to RMG-Dr4k3's player pages.

Hope that gives someone a head start.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by supermillhouse*:

 

Code:

// query all players on this team
				$scoreboard_query = mysqli_query($dbconn,"SELECT ServerID, Soldiername, Score, Kills, Deaths, TeamID, SquadID, CountryCode FROM tbl_currentplayers WHERE ServerID = 1 AND TeamID = $this_team ORDER BY Score Desc");
				if(mysqli_num_rows($scoreboard_query)!=0)
				{
					$count = 1;
					while($scoreboard_row = mysqli_fetch_assoc($scoreboard_query))
					{
						$player = $scoreboard_row['Soldiername'];
						$score = $scoreboard_row['Score'];
						$kills = $scoreboard_row['Kills'];
						$deaths = $scoreboard_row['Deaths'];
						$team = $scoreboard_row['TeamID'];
						$squad = $scoreboard_row['SquadID'];
						// convert squad name and country name to friendly names
						$squad_name = array_search($squad,$squad_array);
						$country = strtoupper($scoreboard_row['CountryCode']);
						$country_name = array_search($country,$country_array);
						echo '
						<tr>
						<td style="text-align:right" width="12%">' . $count. ':  </td>
						<td style="text-align:left" width="15%">     <a href="' . $_SERVER['PHP_SELF'] . '_player_name=' . $player . '&search_player=Search"><font size="2">' . $player . '</font></a></td>
						<td style="text-align:left" width="15%">     ' . $country_name . '</td>
						';
						// if player is loading in, don't show the score, kills, deaths, or squad name
						if($this_team == 0)
						{
							echo '
							<td style="text-align:left" colspan="4"> </td>
							</tr>
							';
						}
						else
						{
							echo '
							<td style="text-align:left" width="12%">     ' . $score . '</td>
							<td style="text-align:left" width="12%">     ' . $kills . '</td>
							<td style="text-align:left" width="15%">     ' . $deaths . '</td>
							<td style="text-align:left" width="12%">     ' . $squad_name . '</td>
							</tr>
							';
						}
						$count++;
					}
				}
How do i go about using "$player" to look up the playerID that is in the tbl_playerdata table so i can use it to select a player in players.php

 

I know too many uses of the word "player"

 

Every way i have tried fails so far. I assume i have to do the mysqli_query within in the "while"

 

Rergrds

 

Ian

 

so far

http://test.slagsareus.com/index.php

only just got it to connect

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ty_ger07*:

 

I am confused. What are you asking? What do you need the player for and what are you trying to do?

 

The code already has the queries necessary to get and display the current players in the server on a scoreboard.

 

Here is a brief summary of the code I pasted above:

 

$mode_array = ...;

$map_array = ...;

$squad_array = ...;

$country_array = ...;

 

function scoreboard()

{

magic;

}

To make it work, all it needs is some stuff added. I will highlight the things which need to be added.

$table_suffix = '';

$server_ID = '1';

$mode_array = ...;

$map_array = ...;

$squad_array = ...;

$country_array = ...;

function scoreboard()

{

magic;

}

...

 

scoreboard();

If you aren't using table suffixes, just set table suffix to null ( '' ). Default server ID is 1.

 

Then, call up the scoreboard later on in the code wherever you want it to appear by calling function scoreboard();.

 

 

How to incorporate it into RMG-Dr4k3's code? I have no idea. I haven't looked at his code. I assume he has a general place where functions are stored where the functions are available to all the different scoreboard pages. And I assume that he handled the connecting to the database part already.

 

EDIT: Oh, I understand your question now...

You need to know the player ID to link to the player's stats page since his code searches players based on player ID instead of player name.

New post coming...

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ty_ger07*:

 

You know that I have a "competing" stats page code, right?

 

www.phogue.net/forumvb/showth...apstats-Logger*

 

It's kind of funny that the original author isn't helping you with this instead of me...

 

First of all, you have to realize that players on the scoreboard may not yet be in the stats database. The database updates player stats when the round is over. So, if a player joins for the first time, the first round they play, they will be on the scoreboard but not in the stats system (no player ID). So, you will need to expect this issue in the code.

 

So, we will initialize $player_id as 'Unknown'. If it finds a player ID for that player, it will update the player ID to the correct player ID. Then, later, if $player_id is 'Unknown', we will not make it a link. Otherwise, we will make it a link.

 

You are correct. The modification needs to be made within the while loop.

 

Here is the modified while loop code:

Code:

while($scoreboard_row = @mysql_fetch_assoc($scoreboard_query))
{
	$player = $scoreboard_row['Soldiername'];

	// initialize value
	$player_id = 'Unknown';
	// query for player id
	$query = @mysql_query("SELECT `PlayerID` FROM tbl_playerdata{$table_suffix} WHERE `SoldierName` = '$player'");
	if(@mysql_num_rows($query)!=0)
	{
		$row = @mysql_fetch_assoc($query);
		$player_id = $row['PlayerID'];
	}

	$score = $scoreboard_row['Score'];
	$kills = $scoreboard_row['Kills'];
	$deaths = $scoreboard_row['Deaths'];
	$team = $scoreboard_row['TeamID'];
	$squad = $scoreboard_row['SquadID'];
	// convert squad name and country name to friendly names
	$squad_name = array_search($squad,$squad_array);
	$country = strtoupper($scoreboard_row['CountryCode']);
	$country_name = array_search($country,$country_array);
	echo '
	<tr>
	<td style="text-align:right" width="12%">' . $count . ':  </td>
	
	// if player ID is not 'Unknown', make it a link
	if($player_id != 'Unknown')
	{
		<td style="text-align:left" width="15%">     <a href="' . $_SERVER['PHP_SELF'] . '_pid=' . $player_id . '"><font size="2">' . $player . '</font></a></td>
	}
	else
	{
		<td style="text-align:left" width="15%">     <font size="2">' . $player . '</font></td>
	}
	
	<td style="text-align:left" width="15%">     ' . $country_name . '</td>
	';
	// if player is loading in, don't show the score, kills, deaths, or squad name
	if($this_team == 0)
	{
		echo '
		<td style="text-align:left" colspan="4"> </td>
		</tr>
		';
	}
	else
	{
		echo '
		<td style="text-align:left" width="12%">     ' . $score . '</td>
		<td style="text-align:left" width="12%">     ' . $kills . '</td>
		<td style="text-align:left" width="15%">     ' . $deaths . '</td>
		<td style="text-align:left" width="12%">     ' . $squad_name . '</td>
		</tr>
		';
	}
	$count++;
}
I haven't tested it, but that should work.

 

Then, you will just need to fix some of your integration errors where the DIVs or Tables are competing and throwing the page a bit out of whack. Primarily the "Select returned 0 rows." thing looks a bit odd. Don't know what it means or why it is there.

 

http://validator.w3.org/check_uri=ht...alidator%2F1.2

 

EDIT: Really confused about his methodology of identifying players. I don't know if he is using player id or stats id and also don't know if he is taking server id into consideration. Good luck. Either it will work or will link to the wrong person's profile.

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by supermillhouse*:

 

You know that I have a "competing" stats page code, right?

 

www.phogue.net/forumvb/showth...apstats-Logger*

 

It's kind of funny that the original author isn't helping you with this instead of me...

 

First of all, you have to realize that players on the scoreboard may not yet be in the stats database. The database updates player stats when the round is over. So, if a player joins for the first time, the first round they play, they will be on the scoreboard but not in the stats system (no player ID). So, you will need to expect this issue in the code.

 

So, we will initialize $player_id as 'Unknown'. If it finds a player ID for that player, it will update the player ID to the correct player ID. Then, later, if $player_id is 'Unknown', we will not make it a link. Otherwise, we will make it a link.

 

You are correct. The modification needs to be made within the while loop.

 

Here is the modified while loop code:

Code:

while($scoreboard_row = @mysql_fetch_assoc($scoreboard_query))
{
	$player = $scoreboard_row['Soldiername'];

	// initialize value
	$player_id = 'Unknown';
	// query for player id
	$query = @mysql_query("SELECT `PlayerID` FROM tbl_playerdata{$table_suffix} WHERE `SoldierName` = '$player'");
	if(@mysql_num_rows($query)!=0)
	{
		$row = @mysql_fetch_assoc($query);
		$player_id = $row['PlayerID'];
	}

	$score = $scoreboard_row['Score'];
	$kills = $scoreboard_row['Kills'];
	$deaths = $scoreboard_row['Deaths'];
	$team = $scoreboard_row['TeamID'];
	$squad = $scoreboard_row['SquadID'];
	// convert squad name and country name to friendly names
	$squad_name = array_search($squad,$squad_array);
	$country = strtoupper($scoreboard_row['CountryCode']);
	$country_name = array_search($country,$country_array);
	echo '
	<tr>
	<td style="text-align:right" width="12%">' . $count . ':  </td>
	
	// if player ID is not 'Unknown', make it a link
	if($player_id != 'Unknown')
	{
		<td style="text-align:left" width="15%">     <a href="' . $_SERVER['PHP_SELF'] . '_pid=' . $player_id . '"><font size="2">' . $player . '</font></a></td>
	}
	else
	{
		<td style="text-align:left" width="15%">     <font size="2">' . $player . '</font></td>
	}
	
	<td style="text-align:left" width="15%">     ' . $country_name . '</td>
	';
	// if player is loading in, don't show the score, kills, deaths, or squad name
	if($this_team == 0)
	{
		echo '
		<td style="text-align:left" colspan="4"> </td>
		</tr>
		';
	}
	else
	{
		echo '
		<td style="text-align:left" width="12%">     ' . $score . '</td>
		<td style="text-align:left" width="12%">     ' . $kills . '</td>
		<td style="text-align:left" width="15%">     ' . $deaths . '</td>
		<td style="text-align:left" width="12%">     ' . $squad_name . '</td>
		</tr>
		';
	}
	$count++;
}
I haven't tested it, but that should work.

 

Then, you will just need to fix some of your integration errors where the DIVs or Tables are competing and throwing the page a bit out of whack. Primarily the "Select returned 0 rows." thing looks a bit odd. Don't know what it means or why it is there.

 

http://validator.w3.org/check_uri=ht...alidator%2F1.2

 

EDIT: Really confused about his methodology of identifying players. I don't know if he is using player id or stats id and also don't know if he is taking server id into consideration. Good luck. Either it will work or will link to the wrong person's profile.

Worked pretty well, just had to change a few things so it worked with mysqli

 

Just had a look through the playerstats.php and your correct in saying he is using StatsID. At what point would they ever be different? I had a look through the database and the all, I think, look the same.

 

I am very grateful for your help and I will an a link to your site on the bottom for your efforts if that's OK.

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by XpKiller*:

 

The PlayerID is belong to the general Playerinfos like guid, name or ip.

 

The StatsID is assign as to a combination of PlayerID and ServerID.

 

In a result of that if you have one server StatID and PlayerID looks identically.

If you have more than one server a PlayerID can have multiply StatsIDs.

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ty_ger07*:

 

Take a look see now. Think I'm getting there, need to tidy up the code a bit yet but visually I am happy with it

 

http://www.test.slagsareus.com/index.php

Looks like you are almost there.

 

I did notice that all three table widths are different. Might want to make the US Army and Russians have the same scoreboard width.

 

table_width.jpg

 

Also, might want to remove this from the bottom of the page "Real time server stat by: BF3_Conn |".

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by supermillhouse*:

I see what you are saying, i take it that is in firefox or chrome is it. On IE9 it looks ok, i believe it is down to firefox not liking

<div width = "100%">    ...stuff... </div>
I could probably substitute the div for something else or do you know of a way of geting it to work?

do you know if moving the width control to a style sheet works?
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ty_ger07*:

 

Did you look at the previous half-dozen posts?

 

I just got done helping supermillhouse with that issue.

 

Also, I have stats page code here which does not have that issue:

www.phogue.net/forumvb/showth...apstats-Logger*

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ronald32*:

 

I had look at previous posts i nearly read all of them but some of them didnt make sense since i am a noob in php and if someone can help me in simple php terms i mite understand and sorry about being a pain in your ass my apologizes and i just want the page because it looks cool and i already got your page working like charm and your work is very nice was amazing :biggrin:!!

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by supermillhouse*:

 

I will get around to posting the mod when I get it completed. A formatting problem with Firefox and safari needs to be sorted and I need do remove irrelevant code. If you can get it to work from the posts previous them go for it but there is no point going through the same processes repeatedly.

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by supermillhouse*:

 

Getting there. Have updated the weapon images, just have maps to go. There is a bug with player rank and ie9. At the top were it lists 12 headings it doesn't create a row below with the rank. If any web page coders can figure it out let me know. It works ok in firefox and safari just not ie9.

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ty_ger07*:

 

Should be sorted now, take a look at

http://www.test.slagsareus.com

 

Download:

http://www.downloads.supermillhouse....t_v1.5.0.1.zip

 

see if you can find any problems with it.

 

website is a bit laggy at the mo, 500 internal server errors and such

I am wondering why the content refreshes every ~8 seconds. That is quite excessive and might be contributing to your high server load if multiple users are viewing the page. The scoreboard information is usually only updated every 30 - 60 seconds, so it isn't necessary to refresh the content every 8 seconds.
* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by supermillhouse*:

 

I am wondering why the content refreshes every ~8 seconds. That is quite excessive and might be contributing to your high server load if multiple users are viewing the page. The scoreboard information is usually only updated every 30 - 60 seconds, so it isn't necessary to refresh the content every 8 seconds.

I just left it at what RMG-Dr4k3 set it at, but on your advice i have put a second one in at 30 sec

Change header('Refresh: 10'); in the index.php file to 30 or 60 to slow it down.

I will check with XPKiller to se how often it is updated

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by ty_ger07*:

 

XpKiller says:

The table gets updated everytime procon gets new full playerlist update (around every 30 sec. its adjustable to less updates.)

Source:

www.phogue.net/forumvb/showth...er-1-1-0-0-BF3*

(in changelog)

* Restored post. It could be that the author is no longer active.
Link to comment

Originally Posted by SuizideFF*:

 

I doesent see thisMageses but i had aktivate it in the procon plugin

 

Ich kann die NAchrichten nicht sehen habe sie aber Aktiviert benutze BF3 Chat, GUID, Stats and Map Logger - 1.0.1.0 die Version

vom Plugin was mach ich Falsch

* Restored post. It could be that the author is no longer active.
Link to comment

Archived

This topic is now archived and is closed to further replies.




  • Our picks

    • Game Server Hosting:

      We're happy to announce that EZRCON will branch out into the game server provider scene. This is a big step for us so please having patience if something doesn't go right in this area. Now, what makes us different compared to other providers? Well, we're going with the idea of having a scaleable server hosting and providing more control in how you set up your server. For example, in Minecraft, you have the ability to control how many CPU cores you wish your server to have access to, how much RAM you want to use, how much disk space you want to use. This type of control can't be offered in a single service package so you're able to configure a custom package the way you want it.

      You can see all the available games here. Currently, we have the following games available.

      Valheim (From $1.50 USD)


      Rust (From $3.20 USD)


      Minecraft (Basic) (From $4.00 USD)


      Call of Duty 4X (From $7.00 USD)


      OpenTTD (From $4.00 USD)


      Squad (From $9.00 USD)


      Insurgency: Sandstorm (From $6.40 USD)


      Changes to US-East:

      Starting in January 2022, we will be moving to a different provider that has better support, better infrastructure, and better connectivity. We've noticed that the connection/routes to this location are not ideal and it's been hard getting support to correct this. Our contract for our two servers ends in March/April respectively. If you currently have servers in this location you will be migrated over to the new provider. We'll have more details when the time comes closer to January. The new location for this change will be based out of Atlanta, GA. If you have any questions/concerns please open a ticket and we'll do our best to answer them.
      • 5 replies
    • Hello All,

      I wanted to give an update to how EZRCON is doing. As of today we have 56 active customers using the services offered. I'm glad its doing so well and it hasn't been 1 year yet. To those that have services with EZRCON, I hope the service is doing well and if not please let us know so that we can improve it where possible. We've done quite a few changes behind the scenes to improve the performance hopefully. 

      We'll be launching a new location for hosting procon layers in either Los Angeles, USA or Chicago, IL. Still being decided on where the placement should be but these two locations are not set in stone yet. We would like to get feedback on where we should have a new location for hosting the Procon Layers, which you can do by replying to this topic. A poll will be created where people can vote on which location they would like to see.

      We're also looking for some suggestions on what else you would like to see for hosting provider options. So please let us know your thoughts on this matter.
      • 4 replies
    • Added ability to disable the new API check for player country info


      Updated GeoIP database file


      Removed usage sending stats


      Added EZRCON ad banner



      If you are upgrading then you may need to add these two lines to your existing installation in the file procon.cfg. To enable these options just change False to True.

      procon.private.options.UseGeoIpFileOnly False
      procon.private.options.BlockRssFeedNews False



       
      • 2 replies
    • I wanted I let you know that I am starting to build out the foundation for the hosting services that I talked about here. The pricing model I was originally going for wasn't going to be suitable for how I want to build it. So instead I decided to offer each service as it's own product instead of a package deal. In the future, hopefully, I will be able to do this and offer discounts to those that choose it.

      Here is how the pricing is laid out for each service as well as information about each. This is as of 7/12/2020.

      Single MySQL database (up to 30 GB) is $10 USD per month.



      If you go over the 30 GB usage for the database then each additional gigabyte is charged at $0.10 USD each billing cycle. If you're under 30GB you don't need to worry about this.


      Databases are replicated across 3 zones (regions) for redundancy. One (1) on the east coast of the USA, One (1) in Frankfurt, and One (1) in Singapore. Depending on the demand, this would grow to more regions.


      Databases will also be backed up daily and retained for 7 days.




      Procon Layer will be $2 USD per month.


      Each layer will only allow one (1) game server connection. The reason behind this is for performance.


      Each layer will also come with all available plugins installed by default. This is to help facilitate faster deployments and get you up and running quickly.


      Each layer will automatically restart if Procon crashes. 


      Each layer will also automatically restart daily at midnight to make sure it stays in tip-top shape.


      Custom plugins can be installed by submitting a support ticket.




      Battlefield Admin Control Panel (BFACP) will be $5 USD per month


      As I am still working on building version 3 of the software, I will be installing the last version I did. Once I complete version 3 it will automatically be upgraded for you.





      All these services will be managed by me so you don't have to worry about the technical side of things to get up and going.

      If you would like to see how much it would cost for the services, I made a calculator that you can use. It can be found here https://ezrcon.com/calculator.html

       
      • 11 replies
    • I have pushed out a new minor release which updates the geodata pull (flags in the playerlisting). This should be way more accurate now. As always, please let me know if any problems show up.

       
      • 9 replies
×
×
  • Create New...

Important Information

Please review our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.