index.php 5.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <?php
  2. /**
  3. * LiveEdu.tv Badges Demos
  4. *
  5. * @package LctvBadges\Demos
  6. * @version 0.0.9
  7. * @since 0.0.8
  8. */
  9. /* LctvBadge Constants. */
  10. require('badges/LctvBadgeConstants.inc') ;
  11. /* LctvApi Constants. */
  12. require('api/LctvApiConstants.inc') ;
  13. /* LCTV API Credentials. */
  14. if (file_exists('api/' . CREDENTIALS_FILE)) require('api/' . CREDENTIALS_FILE) ;
  15. else die(NOT_AUTHORIZED_MSG) ;
  16. $STATUS_V2_HTML = "<a href=\"demos/?title=Online%20Status%20-%20Logo%20Pill&amp;badge-style=" . STATUS_V2_STYLE . "\">click here for embed code</a>" ;
  17. $STATUS_V3_HTML = "<a href=\"demos/?title=Online%20Status%20-%20Glassy%20Button&amp;badge-style=" . STATUS_V3_STYLE . "\">click here for embed code</a>" ;
  18. $STATUS_V1_HTML = "<a href=\"demos/?title=Online%20Status%20-%20Customizable%20SVG%20Pill&amp;badge-style=" . STATUS_V1_STYLE . "\">click here for embed code</a>" ;
  19. $VIEWERS_V1_HTML = "<a href=\"demos/?title=Number%20of%20Viewers%20-%20Customizable%20SVG%20Pill&amp;badge-style=" . VIEWERS_V1_STYLE . "\">click here for embed code</a>" ;
  20. $FOLLOWERS_V1_HTML = "<a href=\"demos/?title=Number%20of%20Followers%20-%20Customizable%20SVG%20Pill&amp;badge-style=" . FOLLOWERS_V1_STYLE . "\">click here for embed code</a>" ;
  21. $LASTSTREAM_V1_HTML = "<a href=\"demos/?title=Last%20Stream%20-%20Customizable%20SVG%20Pill&amp;badge-style=" . LASTSTREAM_V1_STYLE . "\">click here for embed code</a>" ;
  22. $NEXTSTREAM_V1_HTML = "<a href=\"demos/?title=Next%20Stream%20-%20Customizable%20SVG%20Pill&amp;badge-style=" . NEXTSTREAM_V1_STYLE . "\">click here for embed code</a>" ;
  23. $GITHUB_HTML = "<a href=\"https://github.com/bill-auger/lctv-badges/\">GitHub</a>" ;
  24. $NOTABUG_HTML = "<a href=\"https://notabug.org/bill-auger/lctv-badges/\">NotABug</a>" ;
  25. $ISSUES_HTML = "<a href=\"https://github.com/bill-auger/lctv-badges/issues\">issue tracker</a>" ;
  26. $INSTALL_HTML = "<a href=\"https://github.com/bill-auger/lctv-badges/INSTALL.md\">INSTALL.md</a>" ;
  27. ?>
  28. <!DOCTYPE html><html lang="en"><head><meta charset="utf-8" /><title>LCTV Badges</title></head>
  29. <body><link rel="stylesheet" type="text/css" href="demos/lctv-badges.css" />
  30. <h2>LCTV Badges</h2>
  31. <p>HTML badges and link buttons for liveedu.tv online status and stream stats</p>
  32. <table id="demos-table">
  33. <tr><th colspan="4">Online Status Badges </th></tr>
  34. <tr><td>Logo Pill </td>
  35. <td><img src="img/v2/lctv-online.png" /></td>
  36. <td><img src="img/v2/lctv-offline.png" /></td>
  37. <td><?php echo $STATUS_V2_HTML ; ?></td></tr>
  38. <tr><td>Glassy Button </td>
  39. <td><img src="img/v3/lctv-online.png" id="online" /></td>
  40. <td><img src="img/v3/lctv-offline.png" id="offline" /></td>
  41. <td><?php echo $STATUS_V3_HTML ; ?></td></tr>
  42. <tr><td>Customizable SVG Pill </td>
  43. <td><img src="img/v1/faux-online.png" /></td>
  44. <td><img src="img/v1/faux-offline.png" /></td>
  45. <td><?php echo $STATUS_V1_HTML ; ?></td></tr>
  46. <tr><th colspan="4">Number of Viewers Badges </th></tr>
  47. <tr><td>Customizable SVG Pill </td>
  48. <td colspan="2"><img src="img/v1/faux-n-viewers.png" /></td>
  49. <td><?php echo $VIEWERS_V1_HTML ; ?></td></tr>
  50. <tr><th colspan="4">Number of Followers Badges </th></tr>
  51. <tr><td>Customizable SVG Pill </td>
  52. <td colspan="2"><img src="img/v1/faux-n-followers.png" /></td>
  53. <td><?php echo $FOLLOWERS_V1_HTML ; ?></td></tr>
  54. <tr><th colspan="4">Last Streamed Badges </th></tr>
  55. <tr><td>Customizable SVG Pill </td>
  56. <td colspan="2"><img src="img/v1/faux-last-stream.png" /></td>
  57. <td><?php echo $LASTSTREAM_V1_HTML ; ?></td></tr>
  58. <tr><th colspan="4">Next Stream Badges </th></tr>
  59. <tr><td>Customizable SVG Pill </td>
  60. <td colspan="2"><img src="img/v1/faux-next-stream.png" /></td>
  61. <td><?php echo $NEXTSTREAM_V1_HTML ; ?></td></tr>
  62. </table>
  63. <p>The GPLv3 licensed source code for ths service is hosted on <?php echo $GITHUB_HTML ; ?> and <?php echo $NOTABUG_HTML ; ?>.</p>
  64. <p>Feel free to post any comments or suggestions to the <?php echo $ISSUES_HTML ; ?>.</p>
  65. <p>Pull Requests are welcome. Please do contribute your design ideas.</p>
  66. <p>If you would like to host your own badges, see the <?php echo $INSTALL_HTML ; ?> file in the sources.</p>
  67. <script type="text/javascript">
  68. // set v3 image flips
  69. ['online' , 'offline'].forEach(function(img_id)
  70. {
  71. var v3_img = document.getElementById(img_id) ;
  72. v3_img.onmouseover = function() { v3_img.src = "img/v3/lctv-" + img_id + "-hover.png" ; }
  73. v3_img.onmouseleave = function() { v3_img.src = "img/v3/lctv-" + img_id + ".png" ; }
  74. v3_img.onmousedown = function() { v3_img.src = "img/v3/lctv-" + img_id + "-pushed.png" ; }
  75. v3_img.onmouseup = function() { v3_img.src = "img/v3/lctv-" + img_id + "-hover.png" ; }
  76. }) ;
  77. </script>
  78. </body></html>