ManageMembers.template.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  1. <?php
  2. /**
  3. * Simple Machines Forum (SMF)
  4. *
  5. * @package SMF
  6. * @author Simple Machines http://www.simplemachines.org
  7. * @copyright 2014 Simple Machines and individual contributors
  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, $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>=</option>
  36. <option value="+">&gt;=</option>
  37. <option value="++">&gt;</option>
  38. </select>
  39. </dt>
  40. <dd>
  41. <input type="number" 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>=</option>
  49. <option value="+">&gt;=</option>
  50. <option value="++">&gt;</option>
  51. </select>
  52. </dt>
  53. <dd>
  54. <input type="number" 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>=</option>
  62. <option value="+">&gt;=</option>
  63. <option value="++">&gt;</option>
  64. </select>
  65. </dt>
  66. <dd>
  67. <input type="number" 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>=</option>
  75. <option value="+">&gt;=</option>
  76. <option value="++">&gt;</option>
  77. </select>
  78. </dt>
  79. <dd>
  80. <input type="date" 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>=</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="number" 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 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 class="input_check"> ', $txt['male'], '</label>&nbsp;&nbsp;
  144. <label for="gender-2"><input type="checkbox" name="gender[]" value="2" id="gender-2" 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 class="input_check"> ', $txt['activated'], '</label>&nbsp;&nbsp;
  151. <label for="activated-1"><input type="checkbox" name="activated[]" value="0" id="activated-1" 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" class="centercol">', $txt['primary'], '</th>
  166. <th scope="col" class="last_th centercol">', $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 class="centercol">
  175. <input type="checkbox" name="membergroups[1][]" value="', $membergroup['id'], '" checked class="input_check">
  176. </td>
  177. <td class="centercol">
  178. ', $membergroup['can_be_additional'] ? '<input type="checkbox" name="membergroups[2][]" value="' . $membergroup['id'] . '" 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 class="centercol">
  187. <input type="checkbox" onclick="invertAll(this, this.form, \'membergroups[1]\');" checked class="input_check">
  188. </td>
  189. <td class="centercol">
  190. <input type="checkbox" onclick="invertAll(this, this.form, \'membergroups[2]\');" 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" class="centercol">
  212. <input type="checkbox" name="postgroups[]" value="', $postgroup['id'], '" 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 class="centercol">
  221. <input type="checkbox" onclick="invertAll(this, this.form, \'postgroups[]\');" checked class="input_check">
  222. </td>
  223. </tr>
  224. </tbody>
  225. </table>
  226. </div>
  227. <br>
  228. <input type="submit" value="', $txt['search'], '" class="button_submit">
  229. </form>
  230. </div>';
  231. }
  232. function template_admin_browse()
  233. {
  234. global $context, $scripturl, $txt, $modSettings;
  235. echo '
  236. <div id="admincenter">';
  237. template_show_list('approve_list');
  238. // If we have lots of outstanding members try and make the admin's life easier.
  239. if ($context['approve_list']['total_num_items'] > 20)
  240. {
  241. echo '
  242. <br>
  243. <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();">
  244. <div class="cat_bar">
  245. <h3 class="catbg">', $txt['admin_browse_outstanding'], '</h3>
  246. </div>
  247. <script><!-- // --><![CDATA[
  248. function onOutstandingSubmit()
  249. {
  250. if (document.forms.postFormOutstanding.todo.value == "")
  251. return;
  252. var message = "";
  253. if (document.forms.postFormOutstanding.todo.value.indexOf("delete") != -1)
  254. message = "', $txt['admin_browse_w_delete'], '";
  255. else if (document.forms.postFormOutstanding.todo.value.indexOf("reject") != -1)
  256. message = "', $txt['admin_browse_w_reject'], '";
  257. else if (document.forms.postFormOutstanding.todo.value == "remind")
  258. message = "', $txt['admin_browse_w_remind'], '";
  259. else
  260. message = "', $context['browse_type'] == 'approve' ? $txt['admin_browse_w_approve'] : $txt['admin_browse_w_activate'], '";
  261. if (confirm(message + " ', $txt['admin_browse_outstanding_warn'], '"))
  262. return true;
  263. else
  264. return false;
  265. }
  266. // ]]></script>
  267. <div class="windowbg">
  268. <div class="content">
  269. <dl class="settings">
  270. <dt>
  271. ', $txt['admin_browse_outstanding_days_1'], ':
  272. </dt>
  273. <dd>
  274. <input type="text" name="time_passed" value="14" maxlength="4" size="3" class="input_text"> ', $txt['admin_browse_outstanding_days_2'], '.
  275. </dd>
  276. <dt>
  277. ', $txt['admin_browse_outstanding_perform'], ':
  278. </dt>
  279. <dd>
  280. <select name="todo">
  281. ', $context['browse_type'] == 'activate' ? '
  282. <option value="ok">' . $txt['admin_browse_w_activate'] . '</option>' : '', '
  283. <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' ? '' : '
  284. <option value="require_activation">' . $txt['admin_browse_w_approve_require_activate'] . '</option>', '
  285. <option value="reject">', $txt['admin_browse_w_reject'], '</option>
  286. <option value="rejectemail">', $txt['admin_browse_w_reject'], ' ', $txt['admin_browse_w_email'], '</option>
  287. <option value="delete">', $txt['admin_browse_w_delete'], '</option>
  288. <option value="deleteemail">', $txt['admin_browse_w_delete'], ' ', $txt['admin_browse_w_email'], '</option>', $context['browse_type'] == 'activate' ? '
  289. <option value="remind">' . $txt['admin_browse_w_remind'] . '</option>' : '', '
  290. </select>
  291. </dd>
  292. </dl>
  293. <input type="submit" value="', $txt['admin_browse_outstanding_go'], '" class="button_submit">
  294. <input type="hidden" name="type" value="', $context['browse_type'], '">
  295. <input type="hidden" name="sort" value="', $context['approve_list']['sort']['id'], '">
  296. <input type="hidden" name="start" value="', $context['approve_list']['start'], '">
  297. <input type="hidden" name="orig_filter" value="', $context['current_filter'], '">
  298. <input type="hidden" name="sa" value="approve">', !empty($context['approve_list']['sort']['desc']) ? '
  299. <input type="hidden" name="desc" value="1">' : '', '
  300. </div>
  301. </div>
  302. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
  303. </form>';
  304. }
  305. echo '
  306. </div>';
  307. }
  308. ?>