overzicht.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. error_reporting(-1); ini_set('display_errors', 'On');
  3. error_reporting(E_ALL);
  4. ini_set("display_errors", 1);
  5. if($stmt = $mysqli -> prepare("SELECT username FROM Twitch WHERE uid = ?")){
  6. $stmt -> bind_param("i", $userid);
  7. $stmt -> execute();
  8. $stmt -> bind_result($TwitchUsername);
  9. $stmt -> fetch();
  10. $stmt -> close();
  11. }
  12. $ch = curl_init();
  13. curl_setopt($ch, CURLOPT_URL, "https://api.twitch.tv/kraken/users/".$TwitchUsername."/follows/channels");
  14. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  15. $jsonreturn = json_decode(curl_exec($ch), true);
  16. //$jsonreturn = curl_exec($ch);
  17. ?>
  18. <div class="col-lg-12">
  19. <div class="ibox float-e-margins">
  20. <div class="ibox-title">
  21. <h5>Twitch Integratie</h5>
  22. <div class="ibox-tools">
  23. <a class="collapse-link">
  24. <i class="fa fa-chevron-up"></i>
  25. </a>
  26. <a class="dropdown-toggle" data-toggle="dropdown" href="#">
  27. <i class="fa fa-wrench"></i>
  28. </a>
  29. <ul class="dropdown-menu dropdown-user">
  30. <li><a href="twitch.php?i=configuration">Configure Twitch Account</a></li>
  31. </ul>
  32. <a class="close-link">
  33. <i class="fa fa-times"></i>
  34. </a>
  35. </div>
  36. </div>
  37. <div class="ibox-content">
  38. <label>Ingelogd als: <?php print($TwitchUsername); ?> </label>
  39. <br />
  40. <label>Aan het volgen:</label>
  41. <br />
  42. <label><?php
  43. for($x = 0; $x < count($jsonreturn["follows"]); $x++ )
  44. {
  45. echo $jsonreturn["follows"][$x]["channel"]["display_name"]."<br />";
  46. }
  47. ?></label>
  48. </div>
  49. </div>
  50. </div>