Mercurial > hg > vamp-website
comparison forum/Themes/Vamp/Memberlist.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 // Displays a sortable listing of all members registered on the forum. | |
14 function template_main() | |
15 { | |
16 global $context, $settings, $options, $scripturl, $txt; | |
17 | |
18 // Build the memberlist button array. | |
19 $memberlist_buttons = array( | |
20 'view_all_members' => array('text' => 'view_all_members', 'image' => 'mlist.gif', 'lang' => true, 'url' => $scripturl . '?action=mlist' . ';sa=all', 'active'=> true), | |
21 'mlist_search' => array('text' => 'mlist_search', 'image' => 'mlist.gif', 'lang' => true, 'url' => $scripturl . '?action=mlist' . ';sa=search'), | |
22 ); | |
23 | |
24 echo ' | |
25 <div class="main_section" id="memberlist"> | |
26 <div class="cat_bar"> | |
27 <h4 class="catbg"> | |
28 <span class="floatleft">', $txt['members_list'], '</span>'; | |
29 if (!isset($context['old_search'])) | |
30 echo ' | |
31 <span class="floatright">', $context['letter_links'], '</span>'; | |
32 echo ' | |
33 </h4> | |
34 </div> | |
35 <div class="pagesection"> | |
36 ', template_button_strip($memberlist_buttons, 'right'), ' | |
37 <div class="pagelinks floatleft">', $txt['pages'], ': ', $context['page_index'], '</div> | |
38 </div>'; | |
39 | |
40 echo ' | |
41 <div id="mlist" class="tborder topic_table"> | |
42 <table class="table_grid" cellspacing="0" width="100%"> | |
43 <thead> | |
44 <tr class="catbg">'; | |
45 | |
46 // Display each of the column headers of the table. | |
47 foreach ($context['columns'] as $column) | |
48 { | |
49 // We're not able (through the template) to sort the search results right now... | |
50 if (isset($context['old_search'])) | |
51 echo ' | |
52 <th scope="col" class="', isset($column['class']) ? ' ' . $column['class'] : '', '"', isset($column['width']) ? ' width="' . $column['width'] . '"' : '', isset($column['colspan']) ? ' colspan="' . $column['colspan'] . '"' : '', '> | |
53 ', $column['label'], '</th>'; | |
54 // This is a selected column, so underline it or some such. | |
55 elseif ($column['selected']) | |
56 echo ' | |
57 <th scope="col" class="', isset($column['class']) ? ' ' . $column['class'] : '', '" style="width: auto;"' . (isset($column['colspan']) ? ' colspan="' . $column['colspan'] . '"' : '') . ' nowrap="nowrap"> | |
58 <a href="' . $column['href'] . '" rel="nofollow">' . $column['label'] . ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" /></a></th>'; | |
59 // This is just some column... show the link and be done with it. | |
60 else | |
61 echo ' | |
62 <th scope="col" class="', isset($column['class']) ? ' ' . $column['class'] : '', '"', isset($column['width']) ? ' width="' . $column['width'] . '"' : '', isset($column['colspan']) ? ' colspan="' . $column['colspan'] . '"' : '', '> | |
63 ', $column['link'], '</th>'; | |
64 } | |
65 echo ' | |
66 </tr> | |
67 </thead> | |
68 <tbody>'; | |
69 | |
70 // Assuming there are members loop through each one displaying their data. | |
71 if (!empty($context['members'])) | |
72 { | |
73 foreach ($context['members'] as $member) | |
74 { | |
75 echo ' | |
76 <tr ', empty($member['sort_letter']) ? '' : ' id="letter' . $member['sort_letter'] . '"', '> | |
77 <td class="windowbg2"> | |
78 ', $context['can_send_pm'] ? '<a href="' . $member['online']['href'] . '" title="' . $member['online']['text'] . '">' : '', $settings['use_image_buttons'] ? '<img src="' . $member['online']['image_href'] . '" alt="' . $member['online']['text'] . '" align="middle" />' : $member['online']['label'], $context['can_send_pm'] ? '</a>' : '', ' | |
79 </td> | |
80 <td class="windowbg lefttext">', $member['link'], '</td> | |
81 <td class="windowbg2">', $member['show_email'] == 'no' ? '' : '<a href="' . $scripturl . '?action=emailuser;sa=email;uid=' . $member['id'] . '" rel="nofollow"><img src="' . $settings['images_url'] . '/email_sm.gif" alt="' . $txt['email'] . '" title="' . $txt['email'] . ' ' . $member['name'] . '" /></a>', '</td>'; | |
82 | |
83 if (!isset($context['disabled_fields']['website'])) | |
84 echo ' | |
85 <td class="windowbg">', $member['website']['url'] != '' ? '<a href="' . $member['website']['url'] . '" target="_blank" class="new_win"><img src="' . $settings['images_url'] . '/www.gif" alt="' . $member['website']['title'] . '" title="' . $member['website']['title'] . '" /></a>' : '', '</td>'; | |
86 | |
87 // ICQ? | |
88 if (!isset($context['disabled_fields']['icq'])) | |
89 echo ' | |
90 <td class="windowbg2">', $member['icq']['link'], '</td>'; | |
91 | |
92 // AIM? | |
93 if (!isset($context['disabled_fields']['aim'])) | |
94 echo ' | |
95 <td class="windowbg2">', $member['aim']['link'], '</td>'; | |
96 | |
97 // YIM? | |
98 if (!isset($context['disabled_fields']['yim'])) | |
99 echo ' | |
100 <td class="windowbg2">', $member['yim']['link'], '</td>'; | |
101 | |
102 // MSN? | |
103 if (!isset($context['disabled_fields']['msn'])) | |
104 echo ' | |
105 <td class="windowbg2">', $member['msn']['link'], '</td>'; | |
106 | |
107 // Group and date. | |
108 echo ' | |
109 <td class="windowbg lefttext">', empty($member['group']) ? $member['post_group'] : $member['group'], '</td> | |
110 <td class="windowbg lefttext">', $member['registered_date'], '</td>'; | |
111 | |
112 if (!isset($context['disabled_fields']['posts'])) | |
113 { | |
114 echo ' | |
115 <td class="windowbg2" style="white-space: nowrap" width="15">', $member['posts'], '</td> | |
116 <td class="windowbg statsbar" width="120">'; | |
117 | |
118 if (!empty($member['post_percent'])) | |
119 echo ' | |
120 <div class="bar" style="width: ', $member['post_percent'] + 4, 'px;"> | |
121 <div style="width: ', $member['post_percent'], 'px;"></div> | |
122 </div>'; | |
123 | |
124 echo ' | |
125 </td>'; | |
126 } | |
127 | |
128 echo ' | |
129 </tr>'; | |
130 } | |
131 } | |
132 // No members? | |
133 else | |
134 echo ' | |
135 <tr> | |
136 <td colspan="', $context['colspan'], '" class="windowbg">', $txt['search_no_results'], '</td> | |
137 </tr>'; | |
138 | |
139 // Show the page numbers again. (makes 'em easier to find!) | |
140 echo ' | |
141 </tbody> | |
142 </table> | |
143 </div>'; | |
144 | |
145 echo ' | |
146 <div class="pagesection"> | |
147 <div class="pagelinks floatleft">', $txt['pages'], ': ', $context['page_index'], '</div>'; | |
148 | |
149 // If it is displaying the result of a search show a "search again" link to edit their criteria. | |
150 if (isset($context['old_search'])) | |
151 echo ' | |
152 <div class="floatright"> | |
153 <a href="', $scripturl, '?action=mlist;sa=search;search=', $context['old_search_value'], '">', $txt['mlist_search_again'], '</a> | |
154 </div>'; | |
155 echo ' | |
156 </div> | |
157 </div>'; | |
158 | |
159 } | |
160 | |
161 // A page allowing people to search the member list. | |
162 function template_search() | |
163 { | |
164 global $context, $settings, $options, $scripturl, $txt; | |
165 | |
166 // Build the memberlist button array. | |
167 $memberlist_buttons = array( | |
168 'view_all_members' => array('text' => 'view_all_members', 'image' => 'mlist.gif', 'lang' => true, 'url' => $scripturl . '?action=mlist' . ';sa=all'), | |
169 'mlist_search' => array('text' => 'mlist_search', 'image' => 'mlist.gif', 'lang' => true, 'url' => $scripturl . '?action=mlist' . ';sa=search', 'active' => true), | |
170 ); | |
171 | |
172 // Start the submission form for the search! | |
173 echo ' | |
174 <form action="', $scripturl, '?action=mlist;sa=search" method="post" accept-charset="', $context['character_set'], '"> | |
175 <div id="memberlist"> | |
176 <div class="cat_bar"> | |
177 <h3 class="catbg mlist"> | |
178 <span class="ie6_header floatleft">', !empty($settings['use_buttons']) ? '<img src="' . $settings['images_url'] . '/buttons/search.gif" alt="" class="icon" />' : '', $txt['mlist_search'], '</span> | |
179 </h3> | |
180 </div> | |
181 <div class="pagesection"> | |
182 ', template_button_strip($memberlist_buttons, 'right'), ' | |
183 </div>'; | |
184 // Display the input boxes for the form. | |
185 echo ' <div id="memberlist_search" class="clear"> | |
186 <span class="upperframe"><span></span></span> | |
187 <div class="roundframe"> | |
188 <div id="mlist_search" class="flow_hidden"> | |
189 <div id="search_term_input"><br /> | |
190 <strong>', $txt['search_for'], ':</strong> | |
191 <input type="text" name="search" value="', $context['old_search'], '" size="35" class="input_text" /> <input type="submit" name="submit" value="' . $txt['search'] . '" class="button_submit" /> | |
192 </div> | |
193 <span class="floatleft">'; | |
194 | |
195 $count = 0; | |
196 foreach ($context['search_fields'] as $id => $title) | |
197 { | |
198 echo ' | |
199 <label for="fields-', $id, '"><input type="checkbox" name="fields[]" id="fields-', $id, '" value="', $id, '" ', in_array($id, $context['search_defaults']) ? 'checked="checked"' : '', ' class="input_check" />', $title, '</label><br />'; | |
200 // Half way through? | |
201 if (round(count($context['search_fields']) / 2) == ++$count) | |
202 echo ' | |
203 </span> | |
204 <span class="floatleft">'; | |
205 } | |
206 echo ' | |
207 </span> | |
208 </div> | |
209 </div> | |
210 <span class="lowerframe"><span></span></span> | |
211 </div> | |
212 </div> | |
213 </form>'; | |
214 } | |
215 | |
216 ?> |