ManageMembers.template.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323
  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.1 Alpha 1
  11. */
  12. function template_search_members()
  13. {
  14. global $context, $settings, $options, $scripturl, $txt;
  15. echo '
  16. <div id="admincenter">
  17. <form action="', $scripturl, '?action=admin;area=viewmembers" method="post" accept-charset="', $context['character_set'], '" id="admin_form_wrapper">
  18. <div class="cat_bar">
  19. <h3 class="catbg">
  20. <span class="floatleft">', $txt['search_for'], '</span>
  21. <span class="smalltext floatright">', $txt['wild_cards_allowed'], '</span>
  22. </h3>
  23. </div>
  24. <input type="hidden" name="sa" value="query" />
  25. <div class="windowbg">
  26. <div class="content">
  27. <div class="flow_hidden">
  28. <div class="msearch_details floatleft">
  29. <dl class="settings right">
  30. <dt class="righttext">
  31. <strong><label for="mem_id">', $txt['member_id'], ':</label></strong>
  32. <select name="types[mem_id]">
  33. <option value="--">&lt;</option>
  34. <option value="-">&lt;=</option>
  35. <option value="=" selected="selected">=</option>
  36. <option value="+">&gt;=</option>
  37. <option value="++">&gt;</option>
  38. </select>
  39. </dt>
  40. <dd>
  41. <input type="text" name="mem_id" id="mem_id" value="" size="6" class="input_text" />
  42. </dd>
  43. <dt class="righttext">
  44. <strong><label for="age">', $txt['age'], ':</label></strong>
  45. <select name="types[age]">
  46. <option value="--">&lt;</option>
  47. <option value="-">&lt;=</option>
  48. <option value="=" selected="selected">=</option>
  49. <option value="+">&gt;=</option>
  50. <option value="++">&gt;</option>
  51. </select>
  52. </dt>
  53. <dd>
  54. <input type="text" name="age" id="age" value="" size="6" class="input_text" />
  55. </dd>
  56. <dt class="righttext">
  57. <strong><label for="posts">', $txt['member_postcount'], ':</label></strong>
  58. <select name="types[posts]">
  59. <option value="--">&lt;</option>
  60. <option value="-">&lt;=</option>
  61. <option value="=" selected="selected">=</option>
  62. <option value="+">&gt;=</option>
  63. <option value="++">&gt;</option>
  64. </select>
  65. </dt>
  66. <dd>
  67. <input type="text" name="posts" id="posts" value="" size="6" class="input_text" />
  68. </dd>
  69. <dt class="righttext">
  70. <strong><label for="reg_date">', $txt['date_registered'], ':</label></strong>
  71. <select name="types[reg_date]">
  72. <option value="--">&lt;</option>
  73. <option value="-">&lt;=</option>
  74. <option value="=" selected="selected">=</option>
  75. <option value="+">&gt;=</option>
  76. <option value="++">&gt;</option>
  77. </select>
  78. </dt>
  79. <dd>
  80. <input type="text" name="reg_date" id="reg_date" value="" size="10" class="input_text" /><span class="smalltext">', $txt['date_format'], '</span>
  81. </dd>
  82. <dt class="righttext">
  83. <strong><label for="last_online">', $txt['viewmembers_online'], ':</label></strong>
  84. <select name="types[last_online]">
  85. <option value="--">&lt;</option>
  86. <option value="-">&lt;=</option>
  87. <option value="=" selected="selected">=</option>
  88. <option value="+">&gt;=</option>
  89. <option value="++">&gt;</option>
  90. </select>
  91. </dt>
  92. <dd>
  93. <input type="text" name="last_online" id="last_online" value="" size="10" class="input_text" /><span class="smalltext">', $txt['date_format'], '</span>
  94. </dd>
  95. </dl>
  96. </div>
  97. <div class="msearch_details floatright">
  98. <dl class="settings right">
  99. <dt class="righttext">
  100. <strong><label for="membername">', $txt['username'], ':</label></strong>
  101. </dt>
  102. <dd>
  103. <input type="text" name="membername" id="membername" value="" class="input_text" />
  104. </dd>
  105. <dt class="righttext">
  106. <strong><label for="email">', $txt['email_address'], ':</label></strong>
  107. </dt>
  108. <dd>
  109. <input type="text" name="email" id="email" value="" class="input_text" />
  110. </dd>
  111. <dt class="righttext">
  112. <strong><label for="website">', $txt['website'], ':</label></strong>
  113. </dt>
  114. <dd>
  115. <input type="text" name="website" id="website" value="" class="input_text" />
  116. </dd>
  117. <dt class="righttext">
  118. <strong><label for="location">', $txt['location'], ':</label></strong>
  119. </dt>
  120. <dd>
  121. <input type="text" name="location" id="location" value="" class="input_text" />
  122. </dd>
  123. <dt class="righttext">
  124. <strong><label for="ip">', $txt['ip_address'], ':</label></strong>
  125. </dt>
  126. <dd>
  127. <input type="text" name="ip" id="ip" value="" class="input_text" />
  128. </dd>
  129. <dt class="righttext">
  130. <strong><label for="messenger">', $txt['messenger_address'], ':</label></strong>
  131. </dt>
  132. <dd>
  133. <input type="text" name="messenger" id="messenger" value="" class="input_text" />
  134. </dd>
  135. </dl>
  136. </div>
  137. </div>
  138. <div class="flow_hidden">
  139. <div class="msearch_details floatleft">
  140. <fieldset>
  141. <legend>', $txt['gender'], '</legend>
  142. <label for="gender-0"><input type="checkbox" name="gender[]" value="0" id="gender-0" checked="checked" class="input_check" /> ', $txt['undefined_gender'], '</label>&nbsp;&nbsp;
  143. <label for="gender-1"><input type="checkbox" name="gender[]" value="1" id="gender-1" checked="checked" class="input_check" /> ', $txt['male'], '</label>&nbsp;&nbsp;
  144. <label for="gender-2"><input type="checkbox" name="gender[]" value="2" id="gender-2" checked="checked" class="input_check" /> ', $txt['female'], '</label>
  145. </fieldset>
  146. </div>
  147. <div class="msearch_details floatright">
  148. <fieldset>
  149. <legend>', $txt['activation_status'], '</legend>
  150. <label for="activated-0"><input type="checkbox" name="activated[]" value="1" id="activated-0" checked="checked" class="input_check" /> ', $txt['activated'], '</label>&nbsp;&nbsp;
  151. <label for="activated-1"><input type="checkbox" name="activated[]" value="0" id="activated-1" checked="checked" class="input_check" /> ', $txt['not_activated'], '</label>
  152. </fieldset>
  153. </div>
  154. </div>
  155. </div>
  156. </div>
  157. <div class="title_bar">
  158. <h3 class="titlebg">', $txt['member_part_of_these_membergroups'], '</h3>
  159. </div>
  160. <div class="flow_hidden">
  161. <table width="49%" class="table_grid floatleft">
  162. <thead>
  163. <tr class="catbg">
  164. <th scope="col" class="first_th">', $txt['membergroups'], '</th>
  165. <th scope="col">', $txt['primary'], '</th>
  166. <th scope="col" class="last_th">', $txt['additional'], '</th>
  167. </tr>
  168. </thead>
  169. <tbody>';
  170. foreach ($context['membergroups'] as $membergroup)
  171. echo '
  172. <tr class="windowbg2">
  173. <td>', $membergroup['name'], '</td>
  174. <td align="center">
  175. <input type="checkbox" name="membergroups[1][]" value="', $membergroup['id'], '" checked="checked" class="input_check" />
  176. </td>
  177. <td align="center">
  178. ', $membergroup['can_be_additional'] ? '<input type="checkbox" name="membergroups[2][]" value="' . $membergroup['id'] . '" checked="checked" class="input_check" />' : '', '
  179. </td>
  180. </tr>';
  181. echo '
  182. <tr class="windowbg2">
  183. <td>
  184. <em>', $txt['check_all'], '</em>
  185. </td>
  186. <td align="center">
  187. <input type="checkbox" onclick="invertAll(this, this.form, \'membergroups[1]\');" checked="checked" class="input_check" />
  188. </td>
  189. <td align="center">
  190. <input type="checkbox" onclick="invertAll(this, this.form, \'membergroups[2]\');" checked="checked" class="input_check" />
  191. </td>
  192. </tr>
  193. </tbody>
  194. </table>
  195. <table width="49%" class="table_grid floatright">
  196. <thead>
  197. <tr class="catbg">
  198. <th scope="col" class="first_th">
  199. ', $txt['membergroups_postgroups'], '
  200. </th>
  201. <th class="last_th">&nbsp;</th>
  202. </tr>
  203. </thead>
  204. <tbody>';
  205. foreach ($context['postgroups'] as $postgroup)
  206. echo '
  207. <tr class="windowbg2">
  208. <td>
  209. ', $postgroup['name'], '
  210. </td>
  211. <td width="40" align="center">
  212. <input type="checkbox" name="postgroups[]" value="', $postgroup['id'], '" checked="checked" class="input_check" />
  213. </td>
  214. </tr>';
  215. echo '
  216. <tr class="windowbg2">
  217. <td>
  218. <em>', $txt['check_all'], '</em>
  219. </td>
  220. <td align="center">
  221. <input type="checkbox" onclick="invertAll(this, this.form, \'postgroups[]\');" checked="checked" class="input_check" />
  222. </td>
  223. </tr>
  224. </tbody>
  225. </table>
  226. </div><br />
  227. <input type="submit" value="', $txt['search'], '" class="button_submit" />
  228. </form>
  229. </div>';
  230. }
  231. function template_admin_browse()
  232. {
  233. global $context, $settings, $options, $scripturl, $txt, $modSettings;
  234. echo '
  235. <div id="admincenter">';
  236. template_show_list('approve_list');
  237. // If we have lots of outstanding members try and make the admin's life easier.
  238. if ($context['approve_list']['total_num_items'] > 20)
  239. {
  240. echo '
  241. <br />
  242. <form id="admin_form_wrapper" action="', $scripturl, '?action=admin;area=viewmembers" method="post" accept-charset="', $context['character_set'], '" name="postFormOutstanding" id="postFormOutstanding" onsubmit="return onOutstandingSubmit();">
  243. <div class="cat_bar">
  244. <h3 class="catbg">', $txt['admin_browse_outstanding'], '</h3>
  245. </div>
  246. <script type="text/javascript"><!-- // --><![CDATA[
  247. function onOutstandingSubmit()
  248. {
  249. if (document.forms.postFormOutstanding.todo.value == "")
  250. return;
  251. var message = "";
  252. if (document.forms.postFormOutstanding.todo.value.indexOf("delete") != -1)
  253. message = "', $txt['admin_browse_w_delete'], '";
  254. else if (document.forms.postFormOutstanding.todo.value.indexOf("reject") != -1)
  255. message = "', $txt['admin_browse_w_reject'], '";
  256. else if (document.forms.postFormOutstanding.todo.value == "remind")
  257. message = "', $txt['admin_browse_w_remind'], '";
  258. else
  259. message = "', $context['browse_type'] == 'approve' ? $txt['admin_browse_w_approve'] : $txt['admin_browse_w_activate'], '";
  260. if (confirm(message + " ', $txt['admin_browse_outstanding_warn'], '"))
  261. return true;
  262. else
  263. return false;
  264. }
  265. // ]]></script>
  266. <div class="windowbg">
  267. <div class="content">
  268. <dl class="settings">
  269. <dt>
  270. ', $txt['admin_browse_outstanding_days_1'], ':
  271. </dt>
  272. <dd>
  273. <input type="text" name="time_passed" value="14" maxlength="4" size="3" class="input_text" /> ', $txt['admin_browse_outstanding_days_2'], '.
  274. </dd>
  275. <dt>
  276. ', $txt['admin_browse_outstanding_perform'], ':
  277. </dt>
  278. <dd>
  279. <select name="todo">
  280. ', $context['browse_type'] == 'activate' ? '
  281. <option value="ok">' . $txt['admin_browse_w_activate'] . '</option>' : '', '
  282. <option value="okemail">', $context['browse_type'] == 'approve' ? $txt['admin_browse_w_approve'] : $txt['admin_browse_w_activate'], ' ', $txt['admin_browse_w_email'], '</option>', $context['browse_type'] == 'activate' ? '' : '
  283. <option value="require_activation">' . $txt['admin_browse_w_approve_require_activate'] . '</option>', '
  284. <option value="reject">', $txt['admin_browse_w_reject'], '</option>
  285. <option value="rejectemail">', $txt['admin_browse_w_reject'], ' ', $txt['admin_browse_w_email'], '</option>
  286. <option value="delete">', $txt['admin_browse_w_delete'], '</option>
  287. <option value="deleteemail">', $txt['admin_browse_w_delete'], ' ', $txt['admin_browse_w_email'], '</option>', $context['browse_type'] == 'activate' ? '
  288. <option value="remind">' . $txt['admin_browse_w_remind'] . '</option>' : '', '
  289. </select>
  290. </dd>
  291. </dl>
  292. <input type="submit" value="', $txt['admin_browse_outstanding_go'], '" class="button_submit" /><br class="clear_right">
  293. <input type="hidden" name="type" value="', $context['browse_type'], '" />
  294. <input type="hidden" name="sort" value="', $context['approve_list']['sort']['id'], '" />
  295. <input type="hidden" name="start" value="', $context['approve_list']['start'], '" />
  296. <input type="hidden" name="orig_filter" value="', $context['current_filter'], '" />
  297. <input type="hidden" name="sa" value="approve" />', !empty($context['approve_list']['sort']['desc']) ? '
  298. <input type="hidden" name="desc" value="1" />' : '', '
  299. </div>
  300. </div>
  301. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  302. </form>';
  303. }
  304. echo '
  305. </div>';
  306. }
  307. ?>