download-docs.php 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <?php
  2. require_once('include/prepend.php');
  3. $SIDEBAR_DATA='
  4. <h3>Documentation online</h3>
  5. <p>
  6. You can read the <a href="/docs.php">documentation online</a>.
  7. </p>
  8. <h3>File sizes and dates</h3>
  9. <p>
  10. If you are using a capable browser, the file size and
  11. date will show up when you move the mouse above the link.
  12. If you use another browser, or would like to see all the
  13. information, you can <a href="/download-docs.php?sizes=1">click
  14. here to see all the file sizes and dates</a>.
  15. </p>
  16. <h3>Tip for Windows users</h3>
  17. <p>
  18. Note, that the recent versions of WinZip and other
  19. zip programs on Windows can handle .tar.gz compressed
  20. files. If you have such a program, you can save
  21. download time for yourself, if you choose the .tar.gz
  22. formats, instead of .zip.
  23. </p>
  24. ';
  25. commonHeader("Download documentation");
  26. # array structure: (header, link_text, show_size_for_package)
  27. $formats = array(
  28. "manual.txt.gz" => array("Plain text", "txt.gz"),
  29. "bigmanual.html.gz" => array("Single HTML", "html.gz"),
  30. "manual.tar.gz" => array("Many HTML files", "tar.gz"),
  31. "manual.tar.bz2" => array("Many HTML files", "tar.bz2"),
  32. "manual.zip" => array("Many HTML files", "zip")
  33. );
  34. ?>
  35. <h1>Download documentation</h1>
  36. <p>
  37. Both the PHP-GTK 2 and the PHP-GTK 1 manual are available in various formats.
  38. Pick a version, a language and a format from the table below to start downloading.
  39. </p>
  40. <p>
  41. Note that the packaged HTML versions of the manual
  42. (tar.gz, tar.bz2 and zip) don't contain any directories,
  43. so all of the files will be dumped into your current working
  44. directory when you expand the archive unless the tool you
  45. use does otherwise.
  46. </p>
  47. <table border="0" cellpadding="2" cellspacing="1" width="100%">
  48. <tr bgcolor="#bbbbbb">
  49. <th colspan="<?php echo (sizeof($formats) + 1); ?>"><b>PHP-GTK 2 manual</b></td>
  50. </tr>
  51. <tr bgcolor="#cccccc">
  52. <td>&nbsp;</td>
  53. <?php
  54. while (list($k, $v) = each($formats)) {
  55. echo "<th valign=\"bottom\">$v[0]</th>\n";
  56. }?>
  57. </tr>
  58. <?php
  59. while (list(,$langcode) = each($man2_languages)) {
  60. $language = $LANGUAGES[$langcode];
  61. echo "<tr>\n<td bgcolor=\"#dddddd\"><b>$language</b></td>\n";
  62. reset($formats);
  63. while (list($fn,$details) = each($formats)) {
  64. echo "<td align=\"center\" bgcolor=\"#eeeeee\">";
  65. $link_to = "";
  66. if (file_exists("manual/$langcode/$fn")) {
  67. $link_to = "manual/$langcode/$fn";
  68. }
  69. elseif (file_exists("distributions/manual/php_gtk_manual_$langcode.$details[1]")) {
  70. $link_to = "distributions/manual/php_gtk_manual_$langcode.$details[1]";
  71. }
  72. elseif (file_exists("distributions/manual/manual-$langcode.$details[1]")) {
  73. $link_to = "distributions/manual/manual-$langcode.$details[1]";
  74. }
  75. if (!$link_to) {
  76. echo "&nbsp;";
  77. }
  78. else {
  79. $size = @filesize($link_to);
  80. $changed = @filemtime($link_to);
  81. $date_format = "j M Y"; // Part of the RFC date type (to be short)
  82. if ($size) {
  83. echo "<a href=\"$link_to\" title=\" Size: ", (int) ($size/1024), "Kb\n Date: ", date($date_format, $changed), "\">$details[1]</a>";
  84. if ($sizes) {
  85. echo "<br /><small>Size: ", (int) ($size/1024), "Kb<br />Date: ", date($date_format, $changed), "</small>";
  86. }
  87. } else {
  88. echo "&nbsp;";
  89. }
  90. }
  91. echo "</td>\n";
  92. }
  93. echo "</tr>\n";
  94. }
  95. reset($formats);
  96. ?>
  97. <tr bgcolor="#bbbbbb">
  98. <th colspan="<?php echo (sizeof($formats) + 1); ?>"><b>PHP-GTK 1 manual</b></td>
  99. </tr>
  100. <tr bgcolor="#cccccc">
  101. <td>&nbsp;</td>
  102. <?php
  103. while (list($k, $v) = each($formats)) {
  104. echo "<th valign=\"bottom\">$v[0]</th>\n";
  105. }?>
  106. </tr>
  107. <?php
  108. while (list(,$langcode) = each($man_languages)) {
  109. $language = $LANGUAGES[$langcode];
  110. echo "<tr>\n<td bgcolor=\"#dddddd\"><b>$language</b></td>\n";
  111. reset($formats);
  112. while (list($fn,$details) = each($formats)) {
  113. echo "<td align=\"center\" bgcolor=\"#eeeeee\">";
  114. $link_to = "";
  115. if (file_exists("manual1/$langcode/$fn")) {
  116. $link_to = "manual1/$langcode/$fn";
  117. }
  118. elseif (file_exists("distributions/manual1/php_gtk_manual_$langcode.$details[1]")) {
  119. $link_to = "distributions/manual1/php_gtk_manual_$langcode.$details[1]";
  120. }
  121. elseif (file_exists("distributions/manual1/manual-$langcode.$details[1]")) {
  122. $link_to = "distributions/manual1/manual-$langcode.$details[1]";
  123. }
  124. if (!$link_to) {
  125. echo "&nbsp;";
  126. }
  127. else {
  128. $size = @filesize($link_to);
  129. $changed = @filemtime($link_to);
  130. $date_format = "j M Y"; // Part of the RFC date type (to be short)
  131. if ($size) {
  132. echo "<a href=\"$link_to\" title=\" Size: ", (int) ($size/1024), "Kb\n Date: ", date($date_format, $changed), "\">$details[1]</a>";
  133. if ($sizes) {
  134. echo "<br /><small>Size: ", (int) ($size/1024), "Kb<br />Date: ", date($date_format, $changed), "</small>";
  135. }
  136. } else {
  137. echo "&nbsp;";
  138. }
  139. }
  140. echo "</td>\n";
  141. }
  142. echo "</tr>\n";
  143. }
  144. ?>
  145. </table>
  146. <?php commonFooter(); ?>