displaystories.php 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <!DOCTYPE html>
  2. <html>
  3. <meta charset="utf-8">
  4. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  5. <link rel="stylesheet" type="text/css" href="css/style.css">
  6. <head>
  7. <title>An African Language Short Story Competition</title>
  8. </head>
  9. <body>
  10. <ul>
  11. <li><a id="home" href="index.php">Home</a></li>
  12. <li><a id="original" href="submit.php">Original Story Submission</a></li>
  13. <li><a id="translation" href="submittranslation.php">Translated Story Submission</a></li>
  14. <li><a id="stories" class=active href="#">Submitted Stories</a></li>
  15. <li><a id="statistics" href="submissionstatistics.php">Submissions per Language</a></li>
  16. <li><a id="contact" href="contact.php">Contact</a></li>
  17. <li><a id="resources" href="resources.php">Resources</a></li>
  18. <li><a id="flyers" href="flyers.php">Flyers</a></li>
  19. <li><a id="faq" href="faq.php">Frequently Asked Questions</a></li>
  20. <li><a id="privacy" href="privacy.php">Privacy</a></li>
  21. </ul>
  22. <header>
  23. <h1>Tuvute Pamoja
  24. <a href="https://deeplearningindaba.com">
  25. <img src="images/deeplearningindaba.svg" alt="Deeplearning Indaba" style="height:60px">
  26. </a></h1>
  27. </header>
  28. <?php include 'submitdatabaseinfo.php';?>
  29. <?php include 'submitsetup.php';?>
  30. <?php include 'storycommentsdatabaseinfo.php';?>
  31. <h1 id="title">An African Language Short Story Competition</h1>
  32. <div>
  33. <p>The stories are provided under a creative commons attribution license that allows others to distribute, remix, adapt and build upon the work, even commercially, as long as they credit the authors for the original creation. For more on this license see <a href="https://creativecommons.org/licenses/by/4.0/">https://creativecommons.org/licenses/by/4.0/</a>. The submitted stories are provided here to allow for translation and evaluation. To enable a fairer evaluation of the stories, the authors and translators will remain unknown until after the evaluation process. Should you wish to reuse and redistribute the stories please be sure to do so once you can attribute the authors and translators.</p>
  34. </div>
  35. <div>
  36. <h3 id="languageselection">Choose a language you want to read stories in</h3>
  37. </div>
  38. <div>
  39. <select class="language" id="languagefromoptions" name="languagefromoptions"
  40. onchange="getstorytitles(this.value)">
  41. <?php include 'languagelist.php';?>
  42. </select>
  43. </p>
  44. </div>
  45. </section>
  46. <section>
  47. <div>
  48. <table id="titles"></table>
  49. </div>
  50. </section>
  51. <section>
  52. <div class="storycontainer">
  53. <div class="story">
  54. <p id="story">
  55. </p>
  56. </div>
  57. </div>
  58. </section>
  59. <section>
  60. <h4 id="comments">Comments</h4>
  61. <p id="comments">
  62. </p>
  63. </section>
  64. <section>
  65. <h4 id="newcomment">New Comment</h4>
  66. </section>
  67. </body>
  68. <?php include 'footer.php';?>
  69. <script>
  70. function getstorytitles(lang) {
  71. //use ajax to get stories from database in that language
  72. var xmlhttp = new XMLHttpRequest();
  73. xmlhttp.onreadystatechange = function() {
  74. if (this.readyState == 4 && this.status == 200) {
  75. document.getElementById("titles").innerHTML = this.responseText;
  76. }
  77. };
  78. xmlhttp.open("GET","gettitles.php?lang="+lang,true);
  79. xmlhttp.send();
  80. }
  81. function getstory(storyid) {
  82. //use ajax to get stories from database in that language
  83. var xmlhttp = new XMLHttpRequest();
  84. xmlhttp.onreadystatechange = function() {
  85. if (this.readyState == 4 && this.status == 200) {
  86. document.getElementById("story").innerHTML = this.responseText;
  87. }
  88. };
  89. xmlhttp.open("GET","getstory.php?primarykey="+storyid,true);
  90. xmlhttp.send();
  91. }
  92. </script>
  93. </html>