Leaderboard Script?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Slack-Master

    #1

    Leaderboard Script?

    I was wondering if you guys new of a leaderboard script I could throw up on my clan's site so we could all see where we stan (at a glance.)
  • Flashbugga

    #2
    Ummm

    Yup :)

    Comment

    • FPS[VT_NERD]
      Member
      • Aug 2007
      • 844

      #3
      What kind of CMS do you use? I've got one for e107 sort of, but it's nothing spectacular.

      Comment

      • -2d- Recoil.

        #4
        Any floating around that we could embed into a forum post? =/

        Comment

        • Slack-Master

          #5
          Originally posted by Flashbugga View Post
          Yup :)
          Would you mind sharing with us this script?

          Originally posted by VT Nerd View Post
          What kind of CMS do you use? I've got one for e107 sort of, but it's nothing spectacular.
          If you could give us a link to the script we may be able to mod it enough to make it a standalone.

          Comment

          • MrLyramion

            #6
            Heres a 2142 Leaderboard but you need everyone on it to register to 2142-stats.de






            Comment

            • imported_dr-nick-au

              #7
              yepp

              here we go u have to manually edit it all it displays is score, KDR and name.

              you can add in new players by copying and pasting the $player line and adding new ID in.

              you can embed this in any HTML file - if you want to contact the author - please PM me

              [PHP]<?php
              //Player IDs writen by Stevil
              $Player[] = "xxxxxxxx";


              foreach($Player as $value=> $key){
              //Sets URL
              $URL = "http://battlefield.ea.com/battlefield/bf2142/PlayerSummary.aspx?Lang=us&PID=$key&SrchName=&Prof iles=";

              //Gets Data
              $BFData = file_get_contents($URL);
              $Score = GetBetweenText($BFData, "<span id=\"ctl00_ctl00_content_MainContent_SummaryConten t1_lblGlobalVal\">", "</span>");
              $KDR = GetBetweenText($BFData, "<span id=\"ctl00_ctl00_content_MainContent_SummaryConten t1_lblKDRatioVal\">", "</span>");
              $Name = GetBetweenText($BFData, "<span id=\"ctl00_ctl00_content_PlayerAvatar_lblNickName\ ">", "</span>");
              print "<span style=\"\">$Name: score: $Score and K/D $KDR</span><br />
              ";

              }

              ////////////////////////////////////////////
              // Functions //
              ////////////////////////////////////////////

              //Gets Text Between Text (Used To Read Elements)
              function GetBetweenText($Text, $Start, $End) {
              if($Text == "" || $Start == "" || $End == ""){
              return "";
              }
              $StartPos = strpos($Text, $Start) + strlen($Start);
              $ReturnTxt = substr($Text, $StartPos, strpos($Text, $End, $StartPos) - $StartPos);
              return $ReturnTxt;
              }
              ?>[/PHP]

              Comment

              • Maller

                #8
                Thank for the script, it works quite well, and can easily be edited to show images and more stats :)

                [php]
                <?php
                //Player IDs writen by Stevil
                $Player[] = "YOUR_PID";


                foreach($Player as $value=> $key){
                //Sets URL
                $URL = "http://battlefield.ea.com/battlefield/bf2142/PlayerSummary.aspx?Lang=us&PID=$key&SrchName=&Prof iles=";
                $URL1 = "http://battlefield.ea.com/battlefield/bf2142/PlayerDetails.aspx?Lang=us&PID=$key&SrchName=&Prof iles=";

                //Gets Data
                $BFData = file_get_contents($URL);
                $BFData1 = file_get_contents($URL1);
                $Score = GetBetweenText($BFData, "<span id=\"ctl00_ctl00_content_MainContent_SummaryConten t1_lblGlobalVal\">", "</span>");
                $dogtags = GetBetweenText($BFData1, "<span id=\"ctl00_ctl00_content_MainContent_OverviewConte nt1_lblDogTags\">", "</span>");
                $rank = GetBetweenText($BFData, "<span id=\"ctl00_ctl00_content_QuickStatsContent_PlayerQ uickStats_lblCurrentRank\">", "</span>");
                $bftime = GetBetweenText($BFData, "<span id=\"ctl00_ctl00_content_MainContent_SummaryConten t1_lblTotal\">", "</span>");
                $Rankimg = GetBetweenText($BFData, "<img id=\"ctl00_ctl00_content_QuickStatsContent_PlayerQ uickStats_imgCurrentRank\" src=\"images/Ranks/", "/>");
                $flag = GetBetweenText($BFData, "<img id=\"ctl00_ctl00_content_PlayerAvatar_imgFlag\" title=\"DK\" src=\"images/Flags/", "/>");
                $Score1 = GetBetweenText($BFData, "<span id=\"ctl00_ctl00_content_MainContent_SummaryConten t1_lblCareerVal\">", "</span>");
                $KDR = GetBetweenText($BFData, "<span id=\"ctl00_ctl00_content_MainContent_SummaryConten t1_lblKDRatioVal\">", "</span>");
                $ACC = GetBetweenText($BFData, "<span id=\"ctl00_ctl00_content_MainContent_SummaryConten t1_lblAccuracyVal\">", "</span>");
                $Name = GetBetweenText($BFData, "<span id=\"ctl00_ctl00_content_PlayerAvatar_lblNickName\ ">", "</span>");
                print "<span style=\"\">$rank<br />$Name <img src=\"http://battlefield.ea.com/battlefield/bf2142/images/Flags/$flag><br /><img src=\"http://battlefield.ea.com/battlefield/bf2142/images/Ranks/$Rankimg><br /><br /> Career Score: $Score1 <br />Global Score: $Score<br /> K/D Ratio $KDR<br />Accuracy: $ACC<br />Dog Tags: $dogtags</span><br />";

                }

                ////////////////////////////////////////////
                // Functions //
                ////////////////////////////////////////////

                //Gets Text Between Text (Used To Read Elements)
                function GetBetweenText($Text, $Start, $End) {
                if($Text == "" || $Start == "" || $End == ""){
                return "";
                }
                $StartPos = strpos($Text, $Start) + strlen($Start);
                $ReturnTxt = substr($Text, $StartPos, strpos($Text, $End, $StartPos) - $StartPos);
                return $ReturnTxt;
                }
                ?>
                [/php]

                Comment

                • Mutley

                  #9
                  Can you have stats like these just for your server? So a list of the best players and what their stats are in the server?

                  Thanks.

                  Comment

                  Working...