ManageMembers.template.php 12 KB

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