Printpage.template.php 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <?php
  2. /**
  3. * Simple Machines Forum (SMF)
  4. *
  5. * @package SMF
  6. * @author Simple Machines
  7. * @copyright 2012 Simple Machines
  8. * @license http://www.simplemachines.org/about/smf/license.php BSD
  9. *
  10. * @version 2.1 Alpha 1
  11. */
  12. function template_print_above()
  13. {
  14. global $context, $settings, $options, $txt;
  15. echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  16. <html xmlns="http://www.w3.org/1999/xhtml"', $context['right_to_left'] ? ' dir="rtl"' : '', '>
  17. <head>
  18. <meta http-equiv="Content-Type" content="text/html; charset=', $context['character_set'], '" />
  19. <meta name="robots" content="noindex" />
  20. <link rel="canonical" href="', $context['canonical_url'], '" />
  21. <title>', $txt['print_page'], ' - ', $context['topic_subject'], '</title>
  22. <style type="text/css">
  23. body, a
  24. {
  25. color: #000;
  26. background: #fff;
  27. }
  28. body, td, .normaltext
  29. {
  30. font-family: Verdana, arial, helvetica, serif;
  31. font-size: small;
  32. }
  33. h1#title
  34. {
  35. font-size: large;
  36. font-weight: bold;
  37. }
  38. h2#linktree
  39. {
  40. margin: 1em 0 2.5em 0;
  41. font-size: small;
  42. font-weight: bold;
  43. }
  44. dl#posts
  45. {
  46. width: 90%;
  47. margin: 0;
  48. padding: 0;
  49. list-style: none;
  50. }
  51. div.postheader, #poll_data
  52. {
  53. border: solid #000;
  54. border-width: 1px 0;
  55. padding: 4px 0;
  56. }
  57. div.postbody
  58. {
  59. margin: 1em 0 2em 2em;
  60. }
  61. table
  62. {
  63. empty-cells: show;
  64. }
  65. blockquote, code
  66. {
  67. border: 1px solid #000;
  68. margin: 3px;
  69. padding: 1px;
  70. display: block;
  71. }
  72. code
  73. {
  74. font: x-small monospace;
  75. }
  76. blockquote
  77. {
  78. font-size: x-small;
  79. }
  80. .smalltext, .quoteheader, .codeheader
  81. {
  82. font-size: x-small;
  83. }
  84. .largetext
  85. {
  86. font-size: large;
  87. }
  88. .centertext
  89. {
  90. text-align: center;
  91. }
  92. hr
  93. {
  94. height: 1px;
  95. border: 0;
  96. color: black;
  97. background-color: black;
  98. }
  99. .voted
  100. {
  101. font-weight: bold;
  102. }
  103. </style>
  104. </head>
  105. <body>
  106. <h1 id="title">', $context['forum_name_html_safe'], '</h1>
  107. <h2 id="linktree">', $context['category_name'], ' => ', (!empty($context['parent_boards']) ? implode(' => ', $context['parent_boards']) . ' => ' : ''), $context['board_name'], ' => ', $txt['topic_started'], ': ', $context['poster_name'], ' ', $txt['search_on'], ' ', $context['post_time'], '</h2>
  108. <div id="posts">';
  109. }
  110. function template_main()
  111. {
  112. global $context, $settings, $options, $txt;
  113. if (!empty($context['poll']))
  114. {
  115. echo '
  116. <div id="poll_data">', $txt['poll'], '
  117. <div class="question">', $txt['poll_question'], ': <strong>', $context['poll']['question'], '</strong>';
  118. $options = 1;
  119. foreach ($context['poll']['options'] as $option)
  120. echo '
  121. <div class="', $option['voted_this'] ? 'voted' : '', '">', $txt['option'], ' ', $options++, ': <strong>', $option['option'], '</strong>
  122. ', $context['allow_poll_view'] ? $txt['votes'] . ': ' . $option['votes'] . '' : '', '
  123. </div>';
  124. echo '
  125. </div>';
  126. }
  127. foreach ($context['posts'] as $post)
  128. echo '
  129. <div class="postheader">
  130. ', $txt['title'], ': <strong>', $post['subject'], '</strong><br />
  131. ', $txt['post_by'], ': <strong>', $post['member'], '</strong> ', $txt['search_on'], ' <strong>', $post['time'], '</strong>
  132. </div>
  133. <div class="postbody">
  134. ', $post['body'], '
  135. </div>';
  136. }
  137. function template_print_below()
  138. {
  139. global $context, $settings, $options;
  140. echo '
  141. </div>
  142. <div id="footer" class="smalltext">
  143. ', theme_copyright(), '
  144. </div>
  145. </body>
  146. </html>';
  147. }
  148. ?>