Advertisement
staceybby

wp kills func

May 23rd, 2015
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. //[csgo]
  2. function cshrsfunc( $atts ){
  3. $a = shortcode_atts( array(
  4. 'id' => 'erorasdf',
  5. 'id2' => 'erorasdf',
  6. ), $atts );
  7. if($a['id2']=="erorasdf")
  8. {
  9. $link = get_content("./csgo2id1.".$a['id'].".json",'http://api.steampowered.com/ISteamUserStats/GetUserStatsForGame/v0002/?key=4CE9904833EDA21CCB6BDDB3203505A0&steamid='.$a['id'].'&format=json&appid=730',2);
  10. $data = json_decode($link, TRUE);
  11. foreach($data["playerstats"]["stats"] as $stat)
  12. {
  13. if($stat["name"]=="total_time_played")
  14. {
  15. $timeplayed = $stat["value"];
  16. $timeplayed = $timeplayed/60;
  17. $timeplayed = $timeplayed/60;
  18. $timeplayed = floor($timeplayed);
  19. return $timeplayed;
  20. }
  21. }
  22. return "error";
  23. } else {
  24. $link = get_content("./csgo2id1.".$a['id'].".json",'http://api.steampowered.com/ISteamUserStats/GetUserStatsForGame/v0002/?key=4CE9904833EDA21CCB6BDDB3203505A0&steamid='.$a['id'].'&format=json&appid=730',2);
  25. $data = json_decode($link, TRUE);
  26. foreach($data["playerstats"]["stats"] as $stat)
  27. {
  28. if($stat["name"]=="total_time_played")
  29. {
  30. $timeplayed = $stat["value"];
  31. $timeplayed = $timeplayed/60;
  32. $timeplayed = $timeplayed/60;
  33. $timeplayed = floor($timeplayed);
  34. }
  35. }
  36. $link2 = get_content("./csgo2id2.".$a['id2'].".json",'http://api.steampowered.com/ISteamUserStats/GetUserStatsForGame/v0002/?key=4CE9904833EDA21CCB6BDDB3203505A0&steamid='.$a['id2'].'&format=json&appid=730',2);
  37. $data2 = json_decode($link2, TRUE);
  38. foreach($data2["playerstats"]["stats"] as $stat2)
  39. {
  40. if($stat2["name"]=="total_time_played")
  41. {
  42. $timeplayed2 = $stat2["value"];
  43. $timeplayed2 = $timeplayed2/60;
  44. $timeplayed2 = $timeplayed2/60;
  45. $timeplayed2 = floor($timeplayed2);
  46. $int = (int)$timeplayed;
  47. $int2 = (int)$timeplayed2;
  48. return $int + $int2;
  49. }
  50. }
  51. return "error";
  52. }
  53. }
  54. add_shortcode( 'csgo', 'cshrsfunc' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement