Help.template.php 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <?php
  2. /**
  3. * Simple Machines Forum (SMF)
  4. *
  5. * @package SMF
  6. * @author Simple Machines
  7. * @copyright 2011 Simple Machines
  8. * @license http://www.simplemachines.org/about/smf/license.php BSD
  9. *
  10. * @version 2.0
  11. */
  12. function template_popup()
  13. {
  14. global $context, $settings, $options, $txt;
  15. // Since this is a popup of its own we need to start the html, etc.
  16. echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  17. <html xmlns="http://www.w3.org/1999/xhtml"', $context['right_to_left'] ? ' dir="rtl"' : '', '>
  18. <head>
  19. <meta http-equiv="Content-Type" content="text/html; charset=', $context['character_set'], '" />
  20. <meta name="robots" content="noindex" />
  21. <title>', $context['page_title'], '</title>
  22. <link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/css/index.css" />
  23. <script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/script.js"></script>
  24. </head>
  25. <body id="help_popup">
  26. <div class="windowbg description">
  27. ', $context['help_text'], '<br />
  28. <br />
  29. <a href="javascript:self.close();">', $txt['close_window'], '</a>
  30. </div>
  31. </body>
  32. </html>';
  33. }
  34. function template_find_members()
  35. {
  36. global $context, $settings, $options, $scripturl, $modSettings, $txt;
  37. echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  38. <html xmlns="http://www.w3.org/1999/xhtml"', $context['right_to_left'] ? ' dir="rtl"' : '', '>
  39. <head>
  40. <title>', $txt['find_members'], '</title>
  41. <meta http-equiv="Content-Type" content="text/html; charset=', $context['character_set'], '" />
  42. <meta name="robots" content="noindex" />
  43. <link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/css/index.css" />
  44. <script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/script.js"></script>
  45. <script type="text/javascript"><!-- // --><![CDATA[
  46. var membersAdded = [];
  47. function addMember(name)
  48. {
  49. var theTextBox = window.opener.document.getElementById("', $context['input_box_name'], '");
  50. if (name in membersAdded)
  51. return;
  52. // If we only accept one name don\'t remember what is there.
  53. if (', JavaScriptEscape($context['delimiter']), ' != \'null\')
  54. membersAdded[name] = true;
  55. if (theTextBox.value.length < 1 || ', JavaScriptEscape($context['delimiter']), ' == \'null\')
  56. theTextBox.value = ', $context['quote_results'] ? '"\"" + name + "\""' : 'name', ';
  57. else
  58. theTextBox.value += ', JavaScriptEscape($context['delimiter']), ' + ', $context['quote_results'] ? '"\"" + name + "\""' : 'name', ';
  59. window.focus();
  60. }
  61. // ]]></script>
  62. </head>
  63. <body id="help_popup">
  64. <form action="', $scripturl, '?action=findmember;', $context['session_var'], '=', $context['session_id'], '" method="post" accept-charset="', $context['character_set'], '" class="padding description">
  65. <span class="upperframe"><span></span></span>
  66. <div class="roundframe">
  67. <div class="innerframe">
  68. <div class="cat_bar">
  69. <h3 class="catbg">', $txt['find_members'], '</h3>
  70. </div>
  71. <div class="padding">
  72. <strong>', $txt['find_username'], ':</strong><br />
  73. <input type="text" name="search" id="search" value="', isset($context['last_search']) ? $context['last_search'] : '', '" style="margin-top: 4px; width: 96%;" class="input_text" /><br />
  74. <span class="smalltext"><em>', $txt['find_wildcards'], '</em></span><br />';
  75. // Only offer to search for buddies if we have some!
  76. if (!empty($context['show_buddies']))
  77. echo '
  78. <span class="smalltext"><label for="buddies"><input type="checkbox" class="input_check" name="buddies" id="buddies"', !empty($context['buddy_search']) ? ' checked="checked"' : '', ' /> ', $txt['find_buddies'], '</label></span><br />';
  79. echo '
  80. <div class="padding righttext">
  81. <input type="submit" value="', $txt['search'], '" class="button_submit" />
  82. <input type="button" value="', $txt['find_close'], '" onclick="window.close();" class="button_submit" />
  83. </div>
  84. </div>
  85. </div>
  86. </div>
  87. <span class="lowerframe"><span></span></span>
  88. <br />
  89. <span class="upperframe"><span></span></span>
  90. <div class="roundframe">
  91. <div class="innerframe">
  92. <div class="cat_bar">
  93. <h3 class="catbg">', $txt['find_results'], '</h3>
  94. </div>';
  95. if (empty($context['results']))
  96. echo '
  97. <p class="error">', $txt['find_no_results'], '</p>';
  98. else
  99. {
  100. echo '
  101. <ul class="reset padding">';
  102. $alternate = true;
  103. foreach ($context['results'] as $result)
  104. {
  105. echo '
  106. <li class="', $alternate ? 'windowbg2' : 'windowbg', '">
  107. <a href="', $result['href'], '" target="_blank" class="new_win"><img src="', $settings['images_url'], '/icons/profile_sm.gif" alt="', $txt['view_profile'], '" title="', $txt['view_profile'], '" /></a>
  108. <a href="javascript:void(0);" onclick="addMember(this.innerHTML); return false;">', $result['name'], '</a>
  109. </li>';
  110. $alternate = !$alternate;
  111. }
  112. echo '
  113. </ul>
  114. <div class="pagesection">
  115. ', $txt['pages'], ': ', $context['page_index'], '
  116. </div>';
  117. }
  118. echo '
  119. </div>
  120. </div>
  121. <span class="lowerframe"><span></span></span>
  122. <input type="hidden" name="input" value="', $context['input_box_name'], '" />
  123. <input type="hidden" name="delim" value="', $context['delimiter'], '" />
  124. <input type="hidden" name="quote" value="', $context['quote_results'] ? '1' : '0', '" />
  125. </form>';
  126. if (empty($context['results']))
  127. echo '
  128. <script type="text/javascript"><!-- // --><![CDATA[
  129. document.getElementById("search").focus();
  130. // ]]></script>';
  131. echo '
  132. </body>
  133. </html>';
  134. }
  135. // The main help page.
  136. function template_manual()
  137. {
  138. global $context, $scripturl, $txt;
  139. echo '
  140. <div class="cat_bar">
  141. <h3 class="catbg">', $txt['manual_smf_user_help'], '</h3>
  142. </div>
  143. <div id="help_container">
  144. <div class="windowbg2">
  145. <span class="topslice"><span></span></span>
  146. <div id="helpmain">
  147. <p>', sprintf($txt['manual_welcome'], $context['forum_name']), '</p>
  148. <p>', $txt['manual_introduction'], '</p>
  149. <ul>';
  150. foreach ($context['manual_sections'] as $section_id => $wiki_id)
  151. {
  152. echo '
  153. <li><a href="', $context['wiki_url'], '/', $wiki_id, ($txt['lang_dictionary'] != 'en' ? '/' . $txt['lang_dictionary'] : ''), '" target="_blank" class="new_win">', $txt['manual_section_' . $section_id . '_title'], '</a> - ', $txt['manual_section_' . $section_id . '_desc'], '</li>';
  154. }
  155. echo '
  156. </ul>
  157. <p>', sprintf($txt['manual_docs_and_credits'], $context['wiki_url'], $scripturl . '?action=credits'), '</p>
  158. </div>
  159. <span class="botslice"><span></span></span>
  160. </div>
  161. </div>';
  162. }
  163. ?>