1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Player Favourites on homepage of BF2sClone

Discussion in 'BF2Statistics discussion' started by Ghostfire, Jun 15, 2014.

  1. Ghostfire

    Ghostfire New Member

    Hi there,

    I am currently working on new interface of the web stats and I was wondering if it is possible to display every players favourites (weapons, army, vehicle and class) on homepage?
    I know which functions work on playerstats page, but I don't have as clue on how to put them to the top players table.

    Thanks in advance.
    Ghostfire.
     
  2. SharK

    SharK Member

    more detail you can?
     
  3. Ghostfire

    Ghostfire New Member

    Thanks for reply.

    I want the home table (with top players), to include every players favourite army, kit, weapon and vehicle.
    Now the table looks like this: # | Nick | Global Score | Time | etc
    I'm trying to make it look like this: # | Nick | Global Score | Time | Fav Army | Fav Kit | Fav Weapon | Fav Vehicle

    The problem is I don't know how to extract this data for each player on each table row.
    What do I have to include on homepage / each table row, to get the Player Favourite Function to work?

    I'm sorry if it still doesn't make sense, but my english and php skills aren't half as good as I'd like.
     
  4. SharK

    SharK Member

  5. Ghostfire

    Ghostfire New Member

    Yes, that's exactly what I'm talking about.
     
  6. SharK

    SharK Member

  7. SharK

    SharK Member

    http://shark.tgamer.ru/developweb/BF2SCLONERemake2/ - demo for B.F.2.S.Clone
    <www>/bf2scolone/template/home.php
    add after
    Code:
                    foreach ($topten as $key => $value)
                     {
    it
    Code:
      $player = getPlayerDataFromPID($value['id']); // receive player data
       $armies = getArmyData($value['id']); // receive army data
       $weapons = getWeaponData($value['id'], $player); // retrieve Weapon data
       $kits = getKitData($value['id']); // retrieve kit data
       $playerSummary = getPlayerSummary($player, $weapons, $vehicles, $kits, $armies, $maps); // get player summary
    and
    add after
    Code:
                          <img src="'.$ROOT.'game-images/ranks/icon/rank_'.$value['rank'].'.gif">&nbsp;
                           <a href="'.$ROOT.'?pid='.$value['id'].'">'.$value['name'].'</a>&nbsp;
                           <img src="'.$ROOT.'game-images/flags/'.strtoupper($value['country']).'.png" height="12" width="16">
    it
    Code:
    ';
                           for ($i=0; $i<=10;$i++)
                           {
                             if($value['weapon'] == $i)
                             $template .= '
                             <td id="weapon-'.$i.'">'.$weapons[$playerSummary['weapon']]['name'].'</td>';
                           }
                           for ($i=0; $i<getArmyCount(); $i++)
                           {
                             if($value['army'] == $i)
                             $template .= '
                             <td id="army-'.$i.'"><img width=23 height=15 align="top" src="' . $ROOT . 'game-images/armies/'. $playerSummary['army'] .'.png"/></td>';
                           }
                           for ($i=0; $i<=getKitCount()-1; $i++)
                           {
                             if($value['kit'] == $i)
                             $template .= '
                             <td id="kit-'.$i.'"><img width=15 height=15 align="top" src="' . $ROOT . 'game-images/kits/'. $playerSummary['kit'] .'.png"/></td>';
                           }
                         $template .= '
    
    :D
     
  8. Ghostfire

    Ghostfire New Member

    That's genius! Thank you so much :)
     
  9. Ghostfire

    Ghostfire New Member

    It's running fine right now. You'll get credit in my theme for this :)

    One more thing - could you tell me what version on ASP and Web Files are you running? I'm having some problems with "last rounds" (displaying times and player history) and few other things. I found older version of web files by MGM.BY, but it didn't help either.

    Thanks in advance.
     
    Last edited: Jul 1, 2014