2
0

ManageMembers.template.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  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="date" 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="email" 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="url" name="website" id="website" value="" class="input_text">
  116. </dd>
  117. <dt class="righttext">
  118. <strong><label for="ip">', $txt['ip_address'], ':</label></strong>
  119. </dt>
  120. <dd>
  121. <input type="text" name="ip" id="ip" value="" class="input_text">
  122. </dd>
  123. </dl>
  124. </div>
  125. </div>
  126. <div class="flow_hidden">
  127. <div class="msearch_details floatright">
  128. <fieldset>
  129. <legend>', $txt['activation_status'], '</legend>
  130. <label for="activated-0"><input type="checkbox" name="activated[]" value="1" id="activated-0" checked class="input_check"> ', $txt['activated'], '</label>&nbsp;&nbsp;
  131. <label for="activated-1"><input type="checkbox" name="activated[]" value="0" id="activated-1" checked class="input_check"> ', $txt['not_activated'], '</label>
  132. </fieldset>
  133. </div>
  134. </div>
  135. </div>
  136. </div>
  137. <div class="cat_bar">
  138. <h3 class="catbg">', $txt['member_part_of_these_membergroups'], '</h3>
  139. </div>
  140. <div class="flow_hidden">
  141. <table width="49%" class="table_grid floatleft">
  142. <thead>
  143. <tr class="catbg">
  144. <th scope="col" class="first_th">', $txt['membergroups'], '</th>
  145. <th scope="col" class="centercol">', $txt['primary'], '</th>
  146. <th scope="col" class="last_th centercol">', $txt['additional'], '</th>
  147. </tr>
  148. </thead>
  149. <tbody>';
  150. foreach ($context['membergroups'] as $membergroup)
  151. echo '
  152. <tr class="windowbg2">
  153. <td>', $membergroup['name'], '</td>
  154. <td class="centercol">
  155. <input type="checkbox" name="membergroups[1][]" value="', $membergroup['id'], '" checked class="input_check">
  156. </td>
  157. <td class="centercol">
  158. ', $membergroup['can_be_additional'] ? '<input type="checkbox" name="membergroups[2][]" value="' . $membergroup['id'] . '" checked class="input_check">' : '', '
  159. </td>
  160. </tr>';
  161. echo '
  162. <tr class="windowbg2">
  163. <td>
  164. <em>', $txt['check_all'], '</em>
  165. </td>
  166. <td class="centercol">
  167. <input type="checkbox" onclick="invertAll(this, this.form, \'membergroups[1]\');" checked class="input_check">
  168. </td>
  169. <td class="centercol">
  170. <input type="checkbox" onclick="invertAll(this, this.form, \'membergroups[2]\');" checked class="input_check">
  171. </td>
  172. </tr>
  173. </tbody>
  174. </table>
  175. <table width="49%" class="table_grid floatright">
  176. <thead>
  177. <tr class="catbg">
  178. <th scope="col" class="first_th">
  179. ', $txt['membergroups_postgroups'], '
  180. </th>
  181. <th class="last_th">&nbsp;</th>
  182. </tr>
  183. </thead>
  184. <tbody>';
  185. foreach ($context['postgroups'] as $postgroup)
  186. echo '
  187. <tr class="windowbg2">
  188. <td>
  189. ', $postgroup['name'], '
  190. </td>
  191. <td width="40" class="centercol">
  192. <input type="checkbox" name="postgroups[]" value="', $postgroup['id'], '" checked class="input_check">
  193. </td>
  194. </tr>';
  195. echo '
  196. <tr class="windowbg2">
  197. <td>
  198. <em>', $txt['check_all'], '</em>
  199. </td>
  200. <td class="centercol">
  201. <input type="checkbox" onclick="invertAll(this, this.form, \'postgroups[]\');" checked class="input_check">
  202. </td>
  203. </tr>
  204. </tbody>
  205. </table>
  206. </div>
  207. <br>
  208. <input type="submit" value="', $txt['search'], '" class="button_submit">
  209. </form>
  210. </div>';
  211. }
  212. function template_admin_browse()
  213. {
  214. global $context, $scripturl, $txt, $modSettings;
  215. echo '
  216. <div id="admincenter">';
  217. template_show_list('approve_list');
  218. // If we have lots of outstanding members try and make the admin's life easier.
  219. if ($context['approve_list']['total_num_items'] > 20)
  220. {
  221. echo '
  222. <br>
  223. <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();">
  224. <div class="cat_bar">
  225. <h3 class="catbg">', $txt['admin_browse_outstanding'], '</h3>
  226. </div>
  227. <script><!-- // --><![CDATA[
  228. function onOutstandingSubmit()
  229. {
  230. if (document.forms.postFormOutstanding.todo.value == "")
  231. return;
  232. var message = "";
  233. if (document.forms.postFormOutstanding.todo.value.indexOf("delete") != -1)
  234. message = "', $txt['admin_browse_w_delete'], '";
  235. else if (document.forms.postFormOutstanding.todo.value.indexOf("reject") != -1)
  236. message = "', $txt['admin_browse_w_reject'], '";
  237. else if (document.forms.postFormOutstanding.todo.value == "remind")
  238. message = "', $txt['admin_browse_w_remind'], '";
  239. else
  240. message = "', $context['browse_type'] == 'approve' ? $txt['admin_browse_w_approve'] : $txt['admin_browse_w_activate'], '";
  241. if (confirm(message + " ', $txt['admin_browse_outstanding_warn'], '"))
  242. return true;
  243. else
  244. return false;
  245. }
  246. // ]]></script>
  247. <div class="windowbg">
  248. <div class="content">
  249. <dl class="settings">
  250. <dt>
  251. ', $txt['admin_browse_outstanding_days_1'], ':
  252. </dt>
  253. <dd>
  254. <input type="text" name="time_passed" value="14" maxlength="4" size="3" class="input_text"> ', $txt['admin_browse_outstanding_days_2'], '.
  255. </dd>
  256. <dt>
  257. ', $txt['admin_browse_outstanding_perform'], ':
  258. </dt>
  259. <dd>
  260. <select name="todo">
  261. ', $context['browse_type'] == 'activate' ? '
  262. <option value="ok">' . $txt['admin_browse_w_activate'] . '</option>' : '', '
  263. <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' ? '' : '
  264. <option value="require_activation">' . $txt['admin_browse_w_approve_require_activate'] . '</option>', '
  265. <option value="reject">', $txt['admin_browse_w_reject'], '</option>
  266. <option value="rejectemail">', $txt['admin_browse_w_reject'], ' ', $txt['admin_browse_w_email'], '</option>
  267. <option value="delete">', $txt['admin_browse_w_delete'], '</option>
  268. <option value="deleteemail">', $txt['admin_browse_w_delete'], ' ', $txt['admin_browse_w_email'], '</option>', $context['browse_type'] == 'activate' ? '
  269. <option value="remind">' . $txt['admin_browse_w_remind'] . '</option>' : '', '
  270. </select>
  271. </dd>
  272. </dl>
  273. <input type="submit" value="', $txt['admin_browse_outstanding_go'], '" class="button_submit">
  274. <input type="hidden" name="type" value="', $context['browse_type'], '">
  275. <input type="hidden" name="sort" value="', $context['approve_list']['sort']['id'], '">
  276. <input type="hidden" name="start" value="', $context['approve_list']['start'], '">
  277. <input type="hidden" name="orig_filter" value="', $context['current_filter'], '">
  278. <input type="hidden" name="sa" value="approve">', !empty($context['approve_list']['sort']['desc']) ? '
  279. <input type="hidden" name="desc" value="1">' : '', '
  280. </div>
  281. </div>
  282. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
  283. </form>';
  284. }
  285. echo '
  286. </div>';
  287. }
  288. ?>