BioTorrents.de’s version of Gazelle
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

revisions.php 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <?php
  2. if (!isset($_GET['id']) || !is_number($_GET['id'])) {
  3. error(404);
  4. }
  5. $ArticleID = (int) $_GET['id'];
  6. $Latest = Wiki::get_article($ArticleID);
  7. list($Revision, $Title, $Body, $Read, $Edit, $Date, $AuthorID, $AuthorName) = array_shift($Latest);
  8. if ($Read > $LoggedUser['EffectiveClass']) {
  9. error(404);
  10. }
  11. if ($Edit > $LoggedUser['EffectiveClass']) {
  12. error(403);
  13. }
  14. View::show_header("Revisions of ".$Title);
  15. ?>
  16. <div>
  17. <div class="header">
  18. <h2>
  19. Revision history for
  20. <a href="wiki.php?action=article&amp;id=<?=$ArticleID?>"><?=$Title?></a>
  21. </h2>
  22. </div>
  23. <form action="wiki.php" method="get">
  24. <input type="hidden" name="action" id="action" value="compare" />
  25. <input type="hidden" name="id" id="id" value="<?=$ArticleID?>" />
  26. <table>
  27. <tr class="colhead">
  28. <td>Revision</td>
  29. <td>Title</td>
  30. <td>Author</td>
  31. <td>Age</td>
  32. <td>Old</td>
  33. <td>New</td>
  34. </tr>
  35. <tr>
  36. <td><?=$Revision?>
  37. </td>
  38. <td><?=$Title?>
  39. </td>
  40. <td><?=Users::format_username($AuthorID, false, false, false)?>
  41. </td>
  42. <td><?=time_diff($Date)?>
  43. </td>
  44. <td><input type="radio" name="old" value="<?=$Revision?>"
  45. disabled="disabled" /></td>
  46. <td><input type="radio" name="new" value="<?=$Revision?>"
  47. checked="checked" /></td>
  48. </tr>
  49. <?php
  50. $DB->query("
  51. SELECT
  52. Revision,
  53. Title,
  54. Author,
  55. Date
  56. FROM wiki_revisions
  57. WHERE ID = '$ArticleID'
  58. ORDER BY Revision DESC");
  59. while (list($Revision, $Title, $AuthorID, $Date) = $DB->next_record()) { ?>
  60. <tr>
  61. <td>
  62. <?=$Revision?>
  63. </td>
  64. <td>
  65. <?=$Title?>
  66. </td>
  67. <td>
  68. <?=Users::format_username($AuthorID, false, false, false)?>
  69. </td>
  70. <td>
  71. <?=time_diff($Date)?>
  72. </td>
  73. <td>
  74. <input type="radio" name="old" value="<?=$Revision?>" />
  75. </td>
  76. <td>
  77. <input type="radio" name="new" value="<?=$Revision?>" />
  78. </td>
  79. </tr>
  80. <?php } ?>
  81. <tr>
  82. <td class="center" colspan="6">
  83. <input type="submit" value="Compare" />
  84. </td>
  85. </tr>
  86. </table>
  87. </form>
  88. </div>
  89. <?php
  90. View::show_footer();