Advertisement
xt3z0ne

functions

Jun 19th, 2014
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.27 KB | None | 0 0
  1. <?php
  2.     /*
  3.     * Sign Functions
  4.     * by `Internal
  5.     * www.Vgames.co.il
  6.     */
  7.     function parse_ini_file2($f)
  8.     {
  9.          $newline = "<br>";
  10.          $null = "";
  11.          $r=$null;
  12.          $first_char = "";
  13.          $sec=$null;
  14.          $comment_chars="/*<;?>";
  15.          $num_comments = "0";
  16.          $header_section = "";
  17.  
  18.          //Read to end of file with the newlines still attached into $f
  19.          $f=@file($f);
  20.          // Process all lines from 0 to count($f)
  21.          for ($i=0;$i<@count($f);$i++)
  22.          {
  23.               $newsec=0;
  24.               $w=@trim($f[$i]);
  25.               $first_char = @substr($w,0,1);
  26.               if ($w)
  27.               {
  28.                    if ((!$r) or ($sec))
  29.                    {
  30.                        // Look for [] chars round section headings
  31.                        if ((@substr($w,0,1)=="[") and (@substr($w,-1,1))=="]") {$sec=@substr($w,1,@strlen($w)-2);$newsec=1;}
  32.                        // Look for comments and number into array
  33.                        if ((stristr($comment_chars, $first_char) === FALSE)) {} else {$sec=$w;$k="Comment".$num_comments;$num_comments = $num_comments +1;$v=$w;$newsec=1;$r[$k]=$v;}
  34.                        //
  35.                    }
  36.                    if (!$newsec)
  37.                    {
  38.                        //
  39.                        // Look for the = char to allow us to split the section into key and value
  40.                        $w=@explode("=",$w);$k=@trim($w[0]);unset($w[0]); $v=@trim(@implode("=",$w));
  41.                        // look for the new lines
  42.                        if ((@substr($v,0,1)=="\"") and (@substr($v,-1,1)=="\"")) {$v=@substr($v,1,@strlen($v)-2);}
  43.                        if ($sec) {$r[$sec][$k]=$v;} else {$r[$k]=$v;}
  44.                    }
  45.               }
  46.          }
  47.          return $r;
  48.     }
  49.     function getLevelName($level)
  50.     {
  51.         $levels = array(
  52.         "Guest",
  53.         "Noob",
  54.         "Newbie",
  55.         "New Player",
  56.         "Beginner",
  57.         "Novice",
  58.         "Nice Player",
  59.         "Good Player",
  60.         "Great Player",
  61.         "Criminal",
  62.         "Killer",
  63.         "Wanted",
  64.         "Super Player",
  65.         "Gangster",
  66.         "Pro", 
  67.         "Super Pro",
  68.         "Amazing Player",
  69.         "Terminator",
  70.         "Champion",
  71.         "Genius",
  72.         "Superman",
  73.         "The Game",
  74.         "Veteran",
  75.         "Mega Man",
  76.         "Ultra Man",
  77.         "Crazy",
  78.         "Evil",
  79.         "Pro Gamer",
  80.         "DeathMatch Pro",
  81.         "Revenger",
  82.         "Cheater",
  83.         "Routine Cheater",
  84.         "Scary!",
  85.         "Incredible!",
  86.         "Fantastic!",
  87.         "MadMan",
  88.         "PoisoN",
  89.         "SmarT",
  90.         "Hell",
  91.         "ExtremE",
  92.         "GTA Pro",
  93.         "King",
  94.         "H4ck3r",
  95.         "Master",
  96.         "Angel",
  97.         "Pro",
  98.         "Imp",
  99.         "Devil",
  100.         "Goddess",
  101.         "GOD", 
  102.         "GOD of GOD");
  103.         return $level >= 0 && $level <= 50 ? $levels[$level] : "Unknown";
  104.     }
  105. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement