comparison forum/Themes/default/Help.template.php @ 76:e3e11437ecea website

Add forum code
author Chris Cannam
date Sun, 07 Jul 2013 11:25:48 +0200
parents
children
comparison
equal deleted inserted replaced
75:72f59aa7e503 76:e3e11437ecea
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
13 function template_popup()
14 {
15 global $context, $settings, $options, $txt;
16
17 // Since this is a popup of its own we need to start the html, etc.
18 echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
19 <html xmlns="http://www.w3.org/1999/xhtml"', $context['right_to_left'] ? ' dir="rtl"' : '', '>
20 <head>
21 <meta http-equiv="Content-Type" content="text/html; charset=', $context['character_set'], '" />
22 <meta name="robots" content="noindex" />
23 <title>', $context['page_title'], '</title>
24 <link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/css/index.css" />
25 <script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/script.js"></script>
26 </head>
27 <body id="help_popup">
28 <div class="windowbg description">
29 ', $context['help_text'], '<br />
30 <br />
31 <a href="javascript:self.close();">', $txt['close_window'], '</a>
32 </div>
33 </body>
34 </html>';
35 }
36
37 function template_find_members()
38 {
39 global $context, $settings, $options, $scripturl, $modSettings, $txt;
40
41 echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
42 <html xmlns="http://www.w3.org/1999/xhtml"', $context['right_to_left'] ? ' dir="rtl"' : '', '>
43 <head>
44 <title>', $txt['find_members'], '</title>
45 <meta http-equiv="Content-Type" content="text/html; charset=', $context['character_set'], '" />
46 <meta name="robots" content="noindex" />
47 <link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/css/index.css" />
48 <script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/script.js"></script>
49 <script type="text/javascript"><!-- // --><![CDATA[
50 var membersAdded = [];
51 function addMember(name)
52 {
53 var theTextBox = window.opener.document.getElementById("', $context['input_box_name'], '");
54
55 if (name in membersAdded)
56 return;
57
58 // If we only accept one name don\'t remember what is there.
59 if (', JavaScriptEscape($context['delimiter']), ' != \'null\')
60 membersAdded[name] = true;
61
62 if (theTextBox.value.length < 1 || ', JavaScriptEscape($context['delimiter']), ' == \'null\')
63 theTextBox.value = ', $context['quote_results'] ? '"\"" + name + "\""' : 'name', ';
64 else
65 theTextBox.value += ', JavaScriptEscape($context['delimiter']), ' + ', $context['quote_results'] ? '"\"" + name + "\""' : 'name', ';
66
67 window.focus();
68 }
69 // ]]></script>
70 </head>
71 <body id="help_popup">
72 <form action="', $scripturl, '?action=findmember;', $context['session_var'], '=', $context['session_id'], '" method="post" accept-charset="', $context['character_set'], '" class="padding description">
73 <span class="upperframe"><span></span></span>
74 <div class="roundframe">
75 <div class="innerframe">
76 <div class="cat_bar">
77 <h3 class="catbg">', $txt['find_members'], '</h3>
78 </div>
79 <div class="padding">
80 <strong>', $txt['find_username'], ':</strong><br />
81 <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 />
82 <span class="smalltext"><em>', $txt['find_wildcards'], '</em></span><br />';
83
84 // Only offer to search for buddies if we have some!
85 if (!empty($context['show_buddies']))
86 echo '
87 <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 />';
88
89 echo '
90 <div class="padding righttext">
91 <input type="submit" value="', $txt['search'], '" class="button_submit" />
92 <input type="button" value="', $txt['find_close'], '" onclick="window.close();" class="button_submit" />
93 </div>
94 </div>
95 </div>
96 </div>
97 <span class="lowerframe"><span></span></span>
98 <br />
99 <span class="upperframe"><span></span></span>
100 <div class="roundframe">
101 <div class="innerframe">
102 <div class="cat_bar">
103 <h3 class="catbg">', $txt['find_results'], '</h3>
104 </div>';
105
106 if (empty($context['results']))
107 echo '
108 <p class="error">', $txt['find_no_results'], '</p>';
109 else
110 {
111 echo '
112 <ul class="reset padding">';
113
114 $alternate = true;
115 foreach ($context['results'] as $result)
116 {
117 echo '
118 <li class="', $alternate ? 'windowbg2' : 'windowbg', '">
119 <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>
120 <a href="javascript:void(0);" onclick="addMember(this.innerHTML); return false;">', $result['name'], '</a>
121 </li>';
122
123 $alternate = !$alternate;
124 }
125
126 echo '
127 </ul>
128 <div class="pagesection">
129 ', $txt['pages'], ': ', $context['page_index'], '
130 </div>';
131 }
132
133 echo '
134 </div>
135 </div>
136 <span class="lowerframe"><span></span></span>
137 <input type="hidden" name="input" value="', $context['input_box_name'], '" />
138 <input type="hidden" name="delim" value="', $context['delimiter'], '" />
139 <input type="hidden" name="quote" value="', $context['quote_results'] ? '1' : '0', '" />
140 </form>';
141
142 if (empty($context['results']))
143 echo '
144 <script type="text/javascript"><!-- // --><![CDATA[
145 document.getElementById("search").focus();
146 // ]]></script>';
147
148 echo '
149 </body>
150 </html>';
151 }
152
153 // The main help page.
154 function template_manual()
155 {
156 global $context, $scripturl, $txt;
157
158 echo '
159 <div class="cat_bar">
160 <h3 class="catbg">', $txt['manual_smf_user_help'], '</h3>
161 </div>
162 <div id="help_container">
163 <div class="windowbg2">
164 <span class="topslice"><span></span></span>
165 <div id="helpmain">
166 <p>', sprintf($txt['manual_welcome'], $context['forum_name']), '</p>
167 <p>', $txt['manual_introduction'], '</p>
168 <ul>';
169
170 foreach ($context['manual_sections'] as $section_id => $wiki_id)
171 {
172 echo '
173 <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>';
174 }
175
176 echo '
177 </ul>
178 <p>', sprintf($txt['manual_docs_and_credits'], $context['wiki_url'], $scripturl . '?action=credits'), '</p>
179 </div>
180 <span class="botslice"><span></span></span>
181 </div>
182 </div>';
183 }
184
185 ?>