PageRenderTime 62ms CodeModel.GetById 25ms RepoModel.GetById 0ms app.codeStats 1ms

/themes/CurveClassic/Profile.template.php

https://github.com/Arantor/Elkarte
PHP | 3386 lines | 2757 code | 392 blank | 237 comment | 303 complexity | e22b6da194d67b2d760207a6a747e199 MD5 | raw file
Possible License(s): BSD-3-Clause, LGPL-3.0

Large files files are truncated, but you can click here to view the full file

  1. <?php
  2. /**
  3. * @name ElkArte Forum
  4. * @copyright ElkArte Forum contributors
  5. * @license BSD http://opensource.org/licenses/BSD-3-Clause
  6. *
  7. * This software is a derived product, based on:
  8. *
  9. * Simple Machines Forum (SMF)
  10. * copyright: 2011 Simple Machines (http://www.simplemachines.org)
  11. * license: BSD, See included LICENSE.TXT for terms and conditions.
  12. *
  13. * @version 1.0 Alpha
  14. */
  15. // Template for the profile side bar - goes before any other profile template.
  16. function template_profile_above()
  17. {
  18. global $context, $settings, $options, $scripturl, $modSettings, $txt;
  19. echo '
  20. <script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/profile.js"></script>';
  21. // Prevent Chrome from auto completing fields when viewing/editing other members profiles
  22. if (isBrowser('is_chrome') && !$context['user']['is_owner'])
  23. echo '
  24. <script type="text/javascript"><!-- // --><![CDATA[
  25. disableAutoComplete();
  26. // ]]></script>';
  27. // If an error occurred while trying to save previously, give the user a clue!
  28. echo '
  29. ', template_error_message();
  30. // If the profile was update successfully, let the user know this.
  31. if (!empty($context['profile_updated']))
  32. echo '
  33. <div class="infobox">
  34. ', $context['profile_updated'], '
  35. </div>';
  36. }
  37. // Template for closing off table started in profile_above.
  38. function template_profile_below()
  39. {
  40. }
  41. // This template displays users details without any option to edit them.
  42. function template_action_summary()
  43. {
  44. // Header block(s)
  45. echo '
  46. <div id="profile_header">';
  47. template_profile_block_buddies();
  48. echo '
  49. </div>';
  50. // left and right blocks, entered as left, right, left, right
  51. $templates = array(
  52. 'summary',
  53. 'user_info',
  54. 'other_info',
  55. 'contact',
  56. 'user_customprofileinfo',
  57. 'moderation',
  58. );
  59. $left = true;
  60. echo '
  61. <div id="profile_summary_container">';
  62. foreach ($templates as $template)
  63. {
  64. echo '
  65. <div class="float', $left ? 'left' : 'right', '" style="width:49.5%; margin:2px 2px; padding:0">
  66. <div>';
  67. $tcall = 'template_profile_block_' . $template;
  68. $tcall();
  69. echo '
  70. </div>
  71. </div>';
  72. // next row?
  73. if (!$left)
  74. echo '
  75. <br class="clear" />';
  76. $left = !$left;
  77. }
  78. // clear up odd number of blocks
  79. if (!$left)
  80. echo '
  81. <br class="clear" />';
  82. // end of the sidexside container
  83. echo'
  84. </div>';
  85. // Footer Block(s)
  86. echo '
  87. <div id="profile_footer">';
  88. template_profile_block_attachments();
  89. echo '
  90. <br class="clear" />
  91. </div>';
  92. }
  93. // Template for showing all the posts of the user, in chronological order.
  94. function template_action_showPosts()
  95. {
  96. global $context, $settings, $options, $scripturl, $modSettings, $txt;
  97. echo '
  98. <div class="cat_bar">
  99. <h3 class="catbg">
  100. ', (!isset($context['attachments']) && empty($context['is_topics']) ? $txt['showMessages'] : (!empty($context['is_topics']) ? $txt['showTopics'] : $txt['showAttachments'])), ' - ', $context['member']['name'], '
  101. </h3>
  102. </div>';
  103. // Are we displaying posts or attachments?
  104. if (!isset($context['attachments']))
  105. {
  106. // For every post to be displayed, give it its own div, and show the important details of the post.
  107. foreach ($context['posts'] as $post)
  108. {
  109. echo '
  110. <div class="', $post['alternate'] == 0 ? 'windowbg2' : 'windowbg', ' core_posts">
  111. <div class="content">
  112. <div class="counter">', $post['counter'], '</div>
  113. <div class="topic_details">
  114. <h5><strong><a href="', $scripturl, '?board=', $post['board']['id'], '.0">', $post['board']['name'], '</a> / <a href="', $scripturl, '?topic=', $post['topic'], '.', $post['start'], '#msg', $post['id'], '">', $post['subject'], '</a></strong></h5>
  115. <span class="smalltext">&#171;&nbsp;<strong>', $txt['on'], ':</strong> ', $post['time'], '&nbsp;&#187;</span>
  116. </div>
  117. <div class="list_posts">';
  118. if (!$post['approved'])
  119. echo '
  120. <div class="approve_post">
  121. <em>', $txt['post_awaiting_approval'], '</em>
  122. </div>';
  123. echo '
  124. ', $post['body'], '
  125. </div>';
  126. if ($post['can_reply'] || $post['can_mark_notify'] || $post['can_delete'])
  127. echo '
  128. <ul class="quickbuttons">';
  129. // If they *can* reply?
  130. if ($post['can_reply'])
  131. echo '
  132. <li><a href="', $scripturl, '?action=post;topic=', $post['topic'], '.', $post['start'], '" class="reply_button"><span>', $txt['reply'], '</span></a></li>';
  133. // If they *can* quote?
  134. if ($post['can_quote'])
  135. echo '
  136. <li><a href="', $scripturl . '?action=post;topic=', $post['topic'], '.', $post['start'], ';quote=', $post['id'], '" class="quote_button"><span>', $txt['quote'], '</span></a></li>';
  137. // Can we request notification of topics?
  138. if ($post['can_mark_notify'])
  139. echo '
  140. <li><a href="', $scripturl, '?action=notify;topic=', $post['topic'], '.', $post['start'], '" class="notify_button"><span>', $txt['notify'], '</span></a></li>';
  141. // How about... even... remove it entirely?!
  142. if ($post['can_delete'])
  143. echo '
  144. <li><a href="', $scripturl, '?action=deletemsg;msg=', $post['id'], ';topic=', $post['topic'], ';profile;u=', $context['member']['id'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], '" onclick="return confirm(\'', $txt['remove_message'], '?\');" class="remove_button"><span>', $txt['remove'], '</span></a></li>';
  145. if ($post['can_reply'] || $post['can_mark_notify'] || $post['can_delete'])
  146. echo '
  147. </ul>';
  148. echo '
  149. </div>
  150. </div>';
  151. }
  152. }
  153. else
  154. template_show_list('attachments');
  155. // No posts? Just end the table with a informative message.
  156. if ((isset($context['attachments']) && empty($context['attachments'])) || (!isset($context['attachments']) && empty($context['posts'])))
  157. echo '
  158. <div class="tborder windowbg2 padding centertext" >
  159. ', isset($context['attachments']) ? $txt['show_attachments_none'] : ($context['is_topics'] ? $txt['show_topics_none'] : $txt['show_posts_none']), '
  160. </div>';
  161. }
  162. // Template for showing all the drafts of the user.
  163. function template_showDrafts()
  164. {
  165. global $context, $settings, $options, $scripturl, $modSettings, $txt;
  166. echo '
  167. <div class="pagesection">
  168. <div class="floatleft">
  169. ', $txt['pages'], ': ', $context['page_index'], '
  170. </div>
  171. </div>';
  172. // No drafts? Just show an informative message.
  173. if (empty($context['drafts']))
  174. echo '
  175. <div class="tborder windowbg2 padding centertext">
  176. ', $txt['draft_none'], '
  177. </div>';
  178. else
  179. {
  180. // For every draft to be displayed, give it its own div, and show the important details of the draft.
  181. foreach ($context['drafts'] as $draft)
  182. {
  183. echo '
  184. <div class="', $draft['alternate'] === 0 ? 'windowbg2' : 'windowbg', ' core_posts">
  185. <div class="content">
  186. <div class="counter">', $draft['counter'], '</div>
  187. <div class="topic_details">
  188. <h5><strong><a href="', $scripturl, '?board=', $draft['board']['id'], '.0">', $draft['board']['name'], '</a> / ', $draft['topic']['link'], '</strong>&nbsp;&nbsp;';
  189. if (!empty($draft['sticky']))
  190. echo '<img src="', $settings['images_url'], '/icons/quick_sticky.png" alt="', $txt['sticky_topic'], '" title="', $txt['sticky_topic'], '" />';
  191. if (!empty($draft['locked']))
  192. echo '<img src="', $settings['images_url'], '/icons/quick_lock.png" alt="', $txt['locked_topic'], '" title="', $txt['locked_topic'], '" />';
  193. echo '
  194. </h5>
  195. <span class="smalltext">&#171;&nbsp;<strong>', $txt['draft_saved_on'], ':</strong> ', ($draft['age'] > 0 ? sprintf($txt['draft_days_ago'], $draft['age']) : $draft['time']), (!empty($draft['remaining']) ? ', ' . sprintf($txt['draft_retain'], $draft['remaining']) : ''), '&#187;</span>
  196. </div>
  197. <div class="list_posts">
  198. ', $draft['body'], '
  199. </div>
  200. <ul class="quickbuttons">
  201. <li>
  202. <a href="', $scripturl, '?action=post;', (empty($draft['topic']['id']) ? 'board=' . $draft['board']['id'] : 'topic=' . $draft['topic']['id']), '.0;id_draft=', $draft['id_draft'], '" class="reply_button"><span>', $txt['draft_edit'], '</span></a>
  203. </li>
  204. <li>
  205. <a href="', $scripturl, '?action=profile;u=', $context['member']['id'], ';area=showdrafts;delete=', $draft['id_draft'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], '" onclick="return confirm(\'', $txt['draft_remove'], '?\');" class="remove_button"><span>', $txt['draft_delete'], '</span></a>
  206. </li>
  207. </ul>
  208. </div>
  209. </div>';
  210. }
  211. }
  212. // Show page numbers.
  213. echo '
  214. <div class="pagesection">
  215. <div class="floatleft">
  216. ', $txt['pages'], ': ', $context['page_index'], '
  217. </div>
  218. </div>';
  219. }
  220. // Template for showing all the buddies of the current user.
  221. function template_editBuddies()
  222. {
  223. global $context, $settings, $options, $scripturl, $modSettings, $txt;
  224. $disabled_fields = isset($modSettings['disabled_profile_fields']) ? array_flip(explode(',', $modSettings['disabled_profile_fields'])) : array();
  225. echo '
  226. <div class="generic_list_wrapper" id="edit_buddies">
  227. <div class="title_bar">
  228. <h3 class="titlebg">
  229. <img src="', $settings['images_url'], '/icons/online.png" alt="" class="icon" />', $txt['editBuddies'], '
  230. </h3>
  231. </div>
  232. <table class="table_grid table_layout">
  233. <tr class="catbg">
  234. <th class="first_th" scope="col" width="20%">', $txt['name'], '</th>
  235. <th scope="col">', $txt['status'], '</th>';
  236. if ($context['can_send_email'])
  237. echo '
  238. <th scope="col">', $txt['email'], '</th>';
  239. echo '
  240. <th class="last_th" scope="col"></th>
  241. </tr>';
  242. // If they don't have any buddies don't list them!
  243. if (empty($context['buddies']))
  244. echo '
  245. <tr class="windowbg2">
  246. <td colspan="8" align="center"><strong>', $txt['no_buddies'], '</strong></td>
  247. </tr>';
  248. // Now loop through each buddy showing info on each.
  249. $alternate = false;
  250. foreach ($context['buddies'] as $buddy)
  251. {
  252. echo '
  253. <tr class="', $alternate ? 'windowbg' : 'windowbg2', '">
  254. <td>', $buddy['link'], '</td>
  255. <td align="center"><a href="', $buddy['online']['href'], '"><img src="', $buddy['online']['image_href'], '" alt="', $buddy['online']['text'], '" title="', $buddy['online']['text'], '" /></a></td>';
  256. if ($context['can_send_email'])
  257. echo '
  258. <td align="center">', ($buddy['show_email'] == 'no' ? '' : '<a href="' . $scripturl . '?action=emailuser;sa=email;uid=' . $buddy['id'] . '" rel="nofollow"><img src="' . $settings['images_url'] . '/email_sm.png" alt="' . $txt['email'] . '" title="' . $txt['email'] . ' ' . $buddy['name'] . '" /></a>'), '</td>';
  259. echo '
  260. <td align="center"><a href="', $scripturl, '?action=profile;area=lists;sa=buddies;u=', $context['id_member'], ';remove=', $buddy['id'], ';', $context['session_var'], '=', $context['session_id'], '"><img src="', $settings['images_url'], '/icons/delete.png" alt="', $txt['buddy_remove'], '" title="', $txt['buddy_remove'], '" /></a></td>
  261. </tr>';
  262. $alternate = !$alternate;
  263. }
  264. echo '
  265. </table>
  266. </div>';
  267. // Add a new buddy?
  268. echo '
  269. <form action="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=lists;sa=buddies" method="post" accept-charset="UTF-8">
  270. <div class="tborder add_buddy">
  271. <div class="title_bar">
  272. <h3 class="titlebg">', $txt['buddy_add'], '</h3>
  273. </div>
  274. <div class="roundframe">
  275. <dl class="settings">
  276. <dt>
  277. <label for="new_buddy"><strong>', $txt['who_member'], ':</strong></label>
  278. </dt>
  279. <dd>
  280. <input type="text" name="new_buddy" id="new_buddy" size="30" class="input_text" />
  281. </dd>
  282. </dl>';
  283. if (!empty($context['token_check']))
  284. echo '
  285. <input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '" />';
  286. echo '
  287. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  288. <input type="submit" value="', $txt['buddy_add_button'], '" class="button_submit" />
  289. <br class="clear_right" />
  290. </div>
  291. </div>
  292. </form>
  293. <script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/suggest.js?alp21"></script>
  294. <script type="text/javascript"><!-- // --><![CDATA[
  295. var oAddBuddySuggest = new smc_AutoSuggest({
  296. sSelf: \'oAddBuddySuggest\',
  297. sSessionId: smf_session_id,
  298. sSessionVar: smf_session_var,
  299. sSuggestId: \'new_buddy\',
  300. sControlId: \'new_buddy\',
  301. sSearchType: \'member\',
  302. sTextDeleteItem: \'', $txt['autosuggest_delete_item'], '\',
  303. bItemList: false
  304. });
  305. // ]]></script>';
  306. }
  307. // Template for showing the ignore list of the current user.
  308. function template_editIgnoreList()
  309. {
  310. global $context, $settings, $options, $scripturl, $modSettings, $txt;
  311. echo '
  312. <div class="generic_list_wrapper" id="edit_buddies">
  313. <div class="title_bar">
  314. <h3 class="titlebg">
  315. <img src="', $settings['images_url'], '/icons/profile_sm.png" alt="" class="icon" />', $txt['editIgnoreList'], '
  316. </h3>
  317. </div>
  318. <table class="table_grid table_layout">
  319. <tr class="catbg">
  320. <th class="first_th" scope="col" width="20%">', $txt['name'], '</th>
  321. <th scope="col">', $txt['status'], '</th>';
  322. if ($context['can_send_email'])
  323. echo '
  324. <th scope="col">', $txt['email'], '</th>';
  325. echo '
  326. <th class="last_th" scope="col"></th>
  327. </tr>';
  328. // If they don't have anyone on their ignore list, don't list it!
  329. if (empty($context['ignore_list']))
  330. echo '
  331. <tr class="windowbg2">
  332. <td colspan="8" align="center"><strong>', $txt['no_ignore'], '</strong></td>
  333. </tr>';
  334. // Now loop through each buddy showing info on each.
  335. $alternate = false;
  336. foreach ($context['ignore_list'] as $member)
  337. {
  338. echo '
  339. <tr class="', $alternate ? 'windowbg' : 'windowbg2', '">
  340. <td>', $member['link'], '</td>
  341. <td align="center"><a href="', $member['online']['href'], '"><img src="', $member['online']['image_href'], '" alt="', $member['online']['text'], '" title="', $member['online']['text'], '" /></a></td>';
  342. if ($context['can_send_email'])
  343. echo '
  344. <td align="center">', ($member['show_email'] == 'no' ? '' : '<a href="' . $scripturl . '?action=emailuser;sa=email;uid=' . $member['id'] . '" rel="nofollow"><img src="' . $settings['images_url'] . '/email_sm.png" alt="' . $txt['email'] . '" title="' . $txt['email'] . ' ' . $member['name'] . '" /></a>'), '</td>';
  345. echo '
  346. <td align="center"><a href="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=lists;sa=ignore;remove=', $member['id'], ';', $context['session_var'], '=', $context['session_id'], '"><img src="', $settings['images_url'], '/icons/delete.png" alt="', $txt['ignore_remove'], '" title="', $txt['ignore_remove'], '" /></a></td>
  347. </tr>';
  348. $alternate = !$alternate;
  349. }
  350. echo '
  351. </table>
  352. </div>';
  353. // Add to the ignore list?
  354. echo '
  355. <form action="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=lists;sa=ignore" method="post" accept-charset="UTF-8">
  356. <div class="tborder add_buddy">
  357. <div class="title_bar">
  358. <h3 class="titlebg">', $txt['ignore_add'], '</h3>
  359. </div>
  360. <div class="roundframe">
  361. <dl class="settings">
  362. <dt>
  363. <label for="new_buddy"><strong>', $txt['who_member'], ':</strong></label>
  364. </dt>
  365. <dd>
  366. <input type="text" name="new_ignore" id="new_ignore" size="25" class="input_text" />
  367. </dd>
  368. </dl>';
  369. if (!empty($context['token_check']))
  370. echo '
  371. <input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '" />';
  372. echo '
  373. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  374. <input type="submit" value="', $txt['ignore_add_button'], '" class="button_submit" />
  375. <br class="clear_right" />
  376. </div>
  377. </div>
  378. </form>
  379. <script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/suggest.js?alp21"></script>
  380. <script type="text/javascript"><!-- // --><![CDATA[
  381. var oAddIgnoreSuggest = new smc_AutoSuggest({
  382. sSelf: \'oAddIgnoreSuggest\',
  383. sSessionId: smf_session_id,
  384. sSessionVar: smf_session_var,
  385. sSuggestId: \'new_ignore\',
  386. sControlId: \'new_ignore\',
  387. sSearchType: \'member\',
  388. sTextDeleteItem: \'', $txt['autosuggest_delete_item'], '\',
  389. bItemList: false
  390. });
  391. // ]]></script>';
  392. }
  393. // This template shows an admin information on a users IP addresses used and errors attributed to them.
  394. function template_trackActivity()
  395. {
  396. global $context, $settings, $options, $scripturl, $txt;
  397. // The first table shows IP information about the user.
  398. echo '
  399. <div class="generic_list_wrapper">
  400. <div class="title_bar">
  401. <h3 class="titlebg"><strong>', $txt['view_ips_by'], ' ', $context['member']['name'], '</strong></h3>
  402. </div>';
  403. // The last IP the user used.
  404. echo '
  405. <div id="tracking" class="windowbg2">
  406. <div class="content">
  407. <dl class="noborder">
  408. <dt>', $txt['most_recent_ip'], ':
  409. ', (empty($context['last_ip2']) ? '' : '<br />
  410. <span class="smalltext">(<a href="' . $scripturl . '?action=quickhelp;help=whytwoip" onclick="return reqOverlayDiv(this.href);">' . $txt['why_two_ip_address'] . '</a>)</span>'), '
  411. </dt>
  412. <dd>
  413. <a href="', $scripturl, '?action=profile;area=history;sa=ip;searchip=', $context['last_ip'], ';u=', $context['member']['id'], '">', $context['last_ip'], '</a>';
  414. // Second address detected?
  415. if (!empty($context['last_ip2']))
  416. echo '
  417. , <a href="', $scripturl, '?action=profile;area=history;sa=ip;searchip=', $context['last_ip2'], ';u=', $context['member']['id'], '">', $context['last_ip2'], '</a>';
  418. echo '
  419. </dd>';
  420. // Lists of IP addresses used in messages / error messages.
  421. echo '
  422. <dt>', $txt['ips_in_messages'], ':</dt>
  423. <dd>
  424. ', (count($context['ips']) > 0 ? implode(', ', $context['ips']) : '(' . $txt['none'] . ')'), '
  425. </dd>
  426. <dt>', $txt['ips_in_errors'], ':</dt>
  427. <dd>
  428. ', (count($context['ips']) > 0 ? implode(', ', $context['error_ips']) : '(' . $txt['none'] . ')'), '
  429. </dd>';
  430. // List any members that have used the same IP addresses as the current member.
  431. echo '
  432. <dt>', $txt['members_in_range'], ':</dt>
  433. <dd>
  434. ', (count($context['members_in_range']) > 0 ? implode(', ', $context['members_in_range']) : '(' . $txt['none'] . ')'), '
  435. </dd>
  436. </dl>
  437. </div>
  438. </div>
  439. </div>';
  440. // Show the track user list.
  441. template_show_list('track_user_list');
  442. }
  443. // The template for trackIP, allowing the admin to see where/who a certain IP has been used.
  444. function template_trackIP()
  445. {
  446. global $context, $settings, $options, $scripturl, $txt;
  447. // This function always defaults to the last IP used by a member but can be set to track any IP.
  448. // The first table in the template gives an input box to allow the admin to enter another IP to track.
  449. echo '
  450. <div class="tborder">
  451. <div class="cat_bar">
  452. <h3 class="catbg">', $txt['trackIP'], '</h3>
  453. </div>
  454. <div class="roundframe">
  455. <form action="', $context['base_url'], '" method="post" accept-charset="UTF-8">
  456. <dl class="settings">
  457. <dt>
  458. <label for="searchip"><strong>', $txt['enter_ip'], ':</strong></label>
  459. </dt>
  460. <dd>
  461. <input type="text" name="searchip" value="', $context['ip'], '" class="input_text" />
  462. </dd>
  463. </dl>
  464. <input type="submit" value="', $txt['trackIP'], '" class="button_submit" />
  465. <br class="clear_right" />
  466. </form>
  467. </div>
  468. </div>
  469. <div class="generic_list_wrapper">';
  470. // The table inbetween the first and second table shows links to the whois server for every region.
  471. if ($context['single_ip'])
  472. {
  473. echo '
  474. <div class="title_bar">
  475. <h3 class="titlebg">', $txt['whois_title'], ' ', $context['ip'], '</h3>
  476. </div>
  477. <div class="windowbg2">
  478. <div class="padding">';
  479. foreach ($context['whois_servers'] as $server)
  480. echo '
  481. <a href="', $server['url'], '" target="_blank" class="new_win"', isset($context['auto_whois_server']) && $context['auto_whois_server']['name'] == $server['name'] ? ' style="font-weight: bold;"' : '', '>', $server['name'], '</a><br />';
  482. echo '
  483. </div>
  484. </div>';
  485. }
  486. // The second table lists all the members who have been logged as using this IP address.
  487. echo '
  488. <div class="title_bar">
  489. <h3 class="titlebg">', $txt['members_from_ip'], ' ', $context['ip'], '</h3>
  490. </div>';
  491. if (empty($context['ips']))
  492. echo '
  493. <p class="windowbg2 description"><em>', $txt['no_members_from_ip'], '</em></p>';
  494. else
  495. {
  496. echo '
  497. <table class="table_grid" cellspacing="0" width="100%">
  498. <thead>
  499. <tr class="catbg">
  500. <th class="first_th" scope="col">', $txt['ip_address'], '</th>
  501. <th class="last_th" scope="col">', $txt['display_name'], '</th>
  502. </tr>
  503. </thead>
  504. <tbody>';
  505. // Loop through each of the members and display them.
  506. foreach ($context['ips'] as $ip => $memberlist)
  507. echo '
  508. <tr>
  509. <td class="windowbg2"><a href="', $context['base_url'], ';searchip=', $ip, '">', $ip, '</a></td>
  510. <td class="windowbg2">', implode(', ', $memberlist), '</td>
  511. </tr>';
  512. echo '
  513. </tbody>
  514. </table>';
  515. }
  516. echo '
  517. </div>';
  518. template_show_list('track_message_list');
  519. echo '<br />';
  520. template_show_list('track_user_list');
  521. }
  522. function template_action_showPermissions()
  523. {
  524. global $context, $settings, $options, $scripturl, $txt;
  525. echo '
  526. <div class="cat_bar">
  527. <h3 class="catbg">
  528. <img src="', $settings['images_url'], '/icons/profile_sm.png" alt="" class="icon" />', $txt['showPermissions'], '
  529. </h3>
  530. </div>';
  531. if ($context['member']['has_all_permissions'])
  532. {
  533. echo '
  534. <p class="windowbg description">', $txt['showPermissions_all'], '</p>';
  535. }
  536. else
  537. {
  538. echo '
  539. <p class="description">',$txt['showPermissions_help'],'</p>
  540. <div id="permissions" class="flow_hidden">';
  541. if (!empty($context['no_access_boards']))
  542. {
  543. echo '
  544. <div class="cat_bar">
  545. <h3 class="catbg">', $txt['showPermissions_restricted_boards'], '</h3>
  546. </div>
  547. <div class="windowbg smalltext">
  548. <div class="content">', $txt['showPermissions_restricted_boards_desc'], ':<br />';
  549. foreach ($context['no_access_boards'] as $no_access_board)
  550. echo '
  551. <a href="', $scripturl, '?board=', $no_access_board['id'], '.0">', $no_access_board['name'], '</a>', $no_access_board['is_last'] ? '' : ', ';
  552. echo '
  553. </div>
  554. </div>';
  555. }
  556. // General Permissions section.
  557. echo '
  558. <div class="tborder">
  559. <div class="cat_bar">
  560. <h3 class="catbg">', $txt['showPermissions_general'], '</h3>
  561. </div>';
  562. if (!empty($context['member']['permissions']['general']))
  563. {
  564. echo '
  565. <table class="table_grid" width="100%" cellspacing="0">
  566. <thead>
  567. <tr class="titlebg">
  568. <th class="lefttext first_th" scope="col" width="50%">', $txt['showPermissions_permission'], '</th>
  569. <th class="lefttext last_th" scope="col" width="50%">', $txt['showPermissions_status'], '</th>
  570. </tr>
  571. </thead>
  572. <tbody>';
  573. foreach ($context['member']['permissions']['general'] as $permission)
  574. {
  575. echo '
  576. <tr>
  577. <td class="windowbg" title="', $permission['id'], '">
  578. ', $permission['is_denied'] ? '<del>' . $permission['name'] . '</del>' : $permission['name'], '
  579. </td>
  580. <td class="windowbg2 smalltext">';
  581. if ($permission['is_denied'])
  582. echo '
  583. <span class="alert">', $txt['showPermissions_denied'], ':&nbsp;', implode(', ', $permission['groups']['denied']),'</span>';
  584. else
  585. echo '
  586. ', $txt['showPermissions_given'], ':&nbsp;', implode(', ', $permission['groups']['allowed']);
  587. echo '
  588. </td>
  589. </tr>';
  590. }
  591. echo '
  592. </tbody>
  593. </table>
  594. </div><br />';
  595. }
  596. else
  597. echo '
  598. <p class="windowbg2 description">', $txt['showPermissions_none_general'], '</p>';
  599. // Board permission section.
  600. echo '
  601. <div class="tborder">
  602. <form action="' . $scripturl . '?action=profile;u=', $context['id_member'], ';area=permissions#board_permissions" method="post" accept-charset="UTF-8">
  603. <div class="cat_bar">
  604. <h3 class="catbg">
  605. <a id="board_permissions"></a>', $txt['showPermissions_select'], ':
  606. <select name="board" onchange="if (this.options[this.selectedIndex].value) this.form.submit();">
  607. <option value="0"', $context['board'] == 0 ? ' selected="selected"' : '', '>', $txt['showPermissions_global'], '&nbsp;</option>';
  608. if (!empty($context['boards']))
  609. echo '
  610. <option value="" disabled="disabled">---------------------------</option>';
  611. // Fill the box with any local permission boards.
  612. foreach ($context['boards'] as $board)
  613. echo '
  614. <option value="', $board['id'], '"', $board['selected'] ? ' selected="selected"' : '', '>', $board['name'], ' (', $board['profile_name'], ')</option>';
  615. echo '
  616. </select>
  617. </h3>
  618. </div>
  619. </form>';
  620. if (!empty($context['member']['permissions']['board']))
  621. {
  622. echo '
  623. <table class="table_grid" width="100%" cellspacing="0">
  624. <thead>
  625. <tr class="titlebg">
  626. <th class="lefttext first_th" scope="col" width="50%">', $txt['showPermissions_permission'], '</th>
  627. <th class="lefttext last_th" scope="col" width="50%">', $txt['showPermissions_status'], '</th>
  628. </tr>
  629. </thead>
  630. <tbody>';
  631. foreach ($context['member']['permissions']['board'] as $permission)
  632. {
  633. echo '
  634. <tr>
  635. <td class="windowbg" title="', $permission['id'], '">
  636. ', $permission['is_denied'] ? '<del>' . $permission['name'] . '</del>' : $permission['name'], '
  637. </td>
  638. <td class="windowbg2 smalltext">';
  639. if ($permission['is_denied'])
  640. {
  641. echo '
  642. <span class="alert">', $txt['showPermissions_denied'], ':&nbsp;', implode(', ', $permission['groups']['denied']), '</span>';
  643. }
  644. else
  645. {
  646. echo '
  647. ', $txt['showPermissions_given'], ': &nbsp;', implode(', ', $permission['groups']['allowed']);
  648. }
  649. echo '
  650. </td>
  651. </tr>';
  652. }
  653. echo '
  654. </tbody>
  655. </table>';
  656. }
  657. else
  658. echo '
  659. <p class="windowbg2 description">', $txt['showPermissions_none_board'], '</p>';
  660. echo '
  661. </div>
  662. </div>';
  663. }
  664. }
  665. // Template for user statistics, showing graphs and the like.
  666. function template_action_statPanel()
  667. {
  668. global $context, $settings, $options, $scripturl, $modSettings, $txt;
  669. // First, show a few text statistics such as post/topic count.
  670. echo '
  671. <div class="cat_bar">
  672. <h3 class="catbg">
  673. <img src="', $settings['images_url'], '/stats_info.png" alt="" class="icon" />
  674. ', $txt['statPanel_generalStats'], ' - ', $context['member']['name'], '
  675. </h3>
  676. </div>
  677. <div id="profileview">
  678. <div id="generalstats">
  679. <div class="windowbg2">
  680. <div class="content">
  681. <dl>
  682. <dt>', $txt['statPanel_total_time_online'], ':</dt>
  683. <dd>', $context['time_logged_in'], '</dd>
  684. <dt>', $txt['statPanel_total_posts'], ':</dt>
  685. <dd>', $context['num_posts'], ' ', $txt['statPanel_posts'], '</dd>
  686. <dt>', $txt['statPanel_total_topics'], ':</dt>
  687. <dd>', $context['num_topics'], ' ', $txt['statPanel_topics'], '</dd>
  688. <dt>', $txt['statPanel_users_polls'], ':</dt>
  689. <dd>', $context['num_polls'], ' ', $txt['statPanel_polls'], '</dd>
  690. <dt>', $txt['statPanel_users_votes'], ':</dt>
  691. <dd>', $context['num_votes'], ' ', $txt['statPanel_votes'], '</dd>
  692. </dl>
  693. </div>
  694. </div>
  695. </div>';
  696. // This next section draws a graph showing what times of day they post the most.
  697. echo '
  698. <div id="activitytime" class="flow_hidden">
  699. <div class="cat_bar">
  700. <h3 class="catbg">
  701. <img src="', $settings['images_url'], '/stats_history.png" alt="" class="icon" />', $txt['statPanel_activityTime'], '
  702. </h3>
  703. </div>
  704. <div class="windowbg2">
  705. <div class="content">';
  706. // If they haven't post at all, don't draw the graph.
  707. if (empty($context['posts_by_time']))
  708. echo '
  709. <span class="centertext">', $txt['statPanel_noPosts'], '</span>';
  710. // Otherwise do!
  711. else
  712. {
  713. echo '
  714. <ul class="activity_stats flow_hidden">';
  715. // The labels.
  716. foreach ($context['posts_by_time'] as $time_of_day)
  717. {
  718. echo '
  719. <li', $time_of_day['is_last'] ? ' class="last"' : '', '>
  720. <div class="bar" style="padding-top: ', ((int) (100 - $time_of_day['relative_percent'])), 'px;" title="', sprintf($txt['statPanel_activityTime_posts'], $time_of_day['posts'], $time_of_day['posts_percent']), '">
  721. <div style="height: ', (int) $time_of_day['relative_percent'], 'px;">
  722. <span>', sprintf($txt['statPanel_activityTime_posts'], $time_of_day['posts'], $time_of_day['posts_percent']), '</span>
  723. </div>
  724. </div>
  725. <span class="stats_hour">', $time_of_day['hour_format'], '</span>
  726. </li>';
  727. }
  728. echo '
  729. </ul>';
  730. }
  731. echo '
  732. <span class="clear" />
  733. </div>
  734. </div>
  735. </div>';
  736. // Two columns with the most popular boards by posts and activity (activity = users posts / total posts).
  737. echo '
  738. <div class="flow_hidden">
  739. <div id="popularposts">
  740. <div class="cat_bar">
  741. <h3 class="catbg">
  742. <img src="', $settings['images_url'], '/stats_replies.png" alt="" class="icon" />', $txt['statPanel_topBoards'], '
  743. </h3>
  744. </div>
  745. <div class="windowbg2">
  746. <div class="content">';
  747. if (empty($context['popular_boards']))
  748. echo '
  749. <span class="centertext">', $txt['statPanel_noPosts'], '</span>';
  750. else
  751. {
  752. echo '
  753. <dl>';
  754. // Draw a bar for every board.
  755. foreach ($context['popular_boards'] as $board)
  756. {
  757. echo '
  758. <dt>', $board['link'], '</dt>
  759. <dd>
  760. <div class="profile_pie" style="background-position: -', ((int) ($board['posts_percent'] / 5) * 20), 'px 0;" title="', sprintf($txt['statPanel_topBoards_memberposts'], $board['posts'], $board['total_posts_member'], $board['posts_percent']), '">
  761. ', sprintf($txt['statPanel_topBoards_memberposts'], $board['posts'], $board['total_posts_member'], $board['posts_percent']), '
  762. </div>
  763. <span>', empty($context['hide_num_posts']) ? $board['posts'] : '', '</span>
  764. </dd>';
  765. }
  766. echo '
  767. </dl>';
  768. }
  769. echo '
  770. </div>
  771. </div>
  772. </div>';
  773. echo '
  774. <div id="popularactivity">
  775. <div class="cat_bar">
  776. <h3 class="catbg">
  777. <img src="', $settings['images_url'], '/stats_replies.png" alt="" class="icon" />', $txt['statPanel_topBoardsActivity'], '
  778. </h3>
  779. </div>
  780. <div class="windowbg2">
  781. <div class="content">';
  782. if (empty($context['board_activity']))
  783. echo '
  784. <span>', $txt['statPanel_noPosts'], '</span>';
  785. else
  786. {
  787. echo '
  788. <dl>';
  789. // Draw a bar for every board.
  790. foreach ($context['board_activity'] as $activity)
  791. {
  792. echo '
  793. <dt>', $activity['link'], '</dt>
  794. <dd>
  795. <div class="profile_pie" style="background-position: -', ((int) ($activity['percent'] / 5) * 20), 'px 0;" title="', sprintf($txt['statPanel_topBoards_posts'], $activity['posts'], $activity['total_posts'], $activity['posts_percent']), '">
  796. ', sprintf($txt['statPanel_topBoards_posts'], $activity['posts'], $activity['total_posts'], $activity['posts_percent']), '
  797. </div>
  798. <span>', $activity['percent'], '%</span>
  799. </dd>';
  800. }
  801. echo '
  802. </dl>';
  803. }
  804. echo '
  805. </div>
  806. </div>
  807. </div>
  808. </div>';
  809. echo '
  810. </div>';
  811. }
  812. // Template for editing profile options.
  813. function template_edit_options()
  814. {
  815. global $context, $settings, $options, $scripturl, $modSettings, $txt;
  816. // The main header!
  817. echo '
  818. <form action="', (!empty($context['profile_custom_submit_url']) ? $context['profile_custom_submit_url'] : $scripturl . '?action=profile;area=' . $context['menu_item_selected'] . ';u=' . $context['id_member']), '" method="post" accept-charset="UTF-8" name="creator" id="creator" enctype="multipart/form-data" onsubmit="return checkProfileSubmit();">
  819. <div class="cat_bar">
  820. <h3 class="catbg">
  821. <img src="', $settings['images_url'], '/icons/profile_sm.png" alt="" class="icon" />';
  822. // Don't say "Profile" if this isn't the profile...
  823. if (!empty($context['profile_header_text']))
  824. echo '
  825. ', $context['profile_header_text'];
  826. else
  827. echo '
  828. ', $txt['profile'];
  829. echo '
  830. </h3>
  831. </div>';
  832. // Have we some description?
  833. if ($context['page_desc'])
  834. echo '
  835. <p class="windowbg description">', $context['page_desc'], '</p>';
  836. echo '
  837. <div class="windowbg2">
  838. <div class="content">';
  839. // Any bits at the start?
  840. if (!empty($context['profile_prehtml']))
  841. echo '
  842. <div>', $context['profile_prehtml'], '</div>';
  843. if (!empty($context['profile_fields']))
  844. echo '
  845. <dl>';
  846. // Start the big old loop 'of love.
  847. $lastItem = 'hr';
  848. foreach ($context['profile_fields'] as $key => $field)
  849. {
  850. // We add a little hack to be sure we never get more than one hr in a row!
  851. if ($lastItem == 'hr' && $field['type'] == 'hr')
  852. continue;
  853. $lastItem = $field['type'];
  854. if ($field['type'] == 'hr')
  855. {
  856. echo '
  857. </dl>
  858. <hr width="100%" size="1" class="hrcolor clear" />
  859. <dl>';
  860. }
  861. elseif ($field['type'] == 'callback')
  862. {
  863. if (isset($field['callback_func']) && function_exists('template_profile_' . $field['callback_func']))
  864. {
  865. $callback_func = 'template_profile_' . $field['callback_func'];
  866. $callback_func();
  867. }
  868. }
  869. else
  870. {
  871. echo '
  872. <dt>
  873. <strong', !empty($field['is_error']) ? ' class="error"' : '', '>', $field['type'] !== 'label' ? '<label for="' . $key . '">' : '', $field['label'], $field['type'] !== 'label' ? '</label>' : '', '</strong>';
  874. // Does it have any subtext to show?
  875. if (!empty($field['subtext']))
  876. echo '
  877. <br />
  878. <span class="smalltext">', $field['subtext'], '</span>';
  879. echo '
  880. </dt>
  881. <dd>';
  882. // Want to put something infront of the box?
  883. if (!empty($field['preinput']))
  884. echo '
  885. ', $field['preinput'];
  886. // What type of data are we showing?
  887. if ($field['type'] == 'label')
  888. echo '
  889. ', $field['value'];
  890. // Maybe it's a text box - very likely!
  891. elseif (in_array($field['type'], array('int', 'float', 'text', 'password')))
  892. echo '
  893. <input type="', $field['type'] == 'password' ? 'password' : 'text', '" name="', $key, '" id="', $key, '" size="', empty($field['size']) ? 30 : $field['size'], '" value="', $field['value'], '" ', $field['input_attr'], ' class="input_', $field['type'] == 'password' ? 'password' : 'text', '" />';
  894. // You "checking" me out? ;)
  895. elseif ($field['type'] == 'check')
  896. echo '
  897. <input type="hidden" name="', $key, '" value="0" /><input type="checkbox" name="', $key, '" id="', $key, '" ', !empty($field['value']) ? ' checked="checked"' : '', ' value="1" class="input_check" ', $field['input_attr'], ' />';
  898. // Always fun - select boxes!
  899. elseif ($field['type'] == 'select')
  900. {
  901. echo '
  902. <select name="', $key, '" id="', $key, '">';
  903. if (isset($field['options']))
  904. {
  905. // Is this some code to generate the options?
  906. if (!is_array($field['options']))
  907. $field['options'] = eval($field['options']);
  908. // Assuming we now have some!
  909. if (is_array($field['options']))
  910. foreach ($field['options'] as $value => $name)
  911. echo '
  912. <option value="', $value, '" ', $value == $field['value'] ? 'selected="selected"' : '', '>', $name, '</option>';
  913. }
  914. echo '
  915. </select>';
  916. }
  917. // Something to end with?
  918. if (!empty($field['postinput']))
  919. echo '
  920. ', $field['postinput'];
  921. echo '
  922. </dd>';
  923. }
  924. }
  925. if (!empty($context['profile_fields']))
  926. echo '
  927. </dl>';
  928. // Are there any custom profile fields - if so print them!
  929. if (!empty($context['custom_fields']))
  930. {
  931. if ($lastItem != 'hr')
  932. echo '
  933. <hr width="100%" size="1" class="hrcolor clear" />';
  934. echo '
  935. <dl>';
  936. foreach ($context['custom_fields'] as $field)
  937. {
  938. echo '
  939. <dt>
  940. <strong>', $field['name'], ': </strong><br />
  941. <span class="smalltext">', $field['desc'], '</span>
  942. </dt>
  943. <dd>
  944. ', $field['input_html'], '
  945. </dd>';
  946. }
  947. echo '
  948. </dl>';
  949. }
  950. // Any closing HTML?
  951. if (!empty($context['profile_posthtml']))
  952. echo '
  953. <div>', $context['profile_posthtml'], '</div>';
  954. // Only show the password box if it's actually needed.
  955. if ($context['require_password'])
  956. echo '
  957. <dl>
  958. <dt>
  959. <strong', isset($context['modify_error']['bad_password']) || isset($context['modify_error']['no_password']) ? ' class="error"' : '', '><label for="oldpasswrd">', $txt['current_password'], ': </label></strong><br />
  960. <span class="smalltext">', $txt['required_security_reasons'], '</span>
  961. </dt>
  962. <dd>
  963. <input type="password" name="oldpasswrd" id="oldpasswrd" size="20" style="margin-right: 4ex;" class="input_password" />
  964. </dd>
  965. </dl>';
  966. echo '
  967. <hr class="hrcolor" />';
  968. // The button shouldn't say "Change profile" unless we're changing the profile...
  969. if (!empty($context['submit_button_text']))
  970. echo '
  971. <input type="submit" name="save" value="', $context['submit_button_text'], '" class="button_submit" />';
  972. else
  973. echo '
  974. <input type="submit" name="save" value="', $txt['change_profile'], '" class="button_submit" />';
  975. if (!empty($context['token_check']))
  976. echo '
  977. <input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '" />';
  978. echo '
  979. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  980. <input type="hidden" name="u" value="', $context['id_member'], '" />
  981. <input type="hidden" name="sa" value="', $context['menu_item_selected'], '" />
  982. </div>
  983. </div>
  984. </form>';
  985. // Some javascript!
  986. echo '
  987. <script type="text/javascript"><!-- // --><![CDATA[
  988. function checkProfileSubmit()
  989. {';
  990. // If this part requires a password, make sure to give a warning.
  991. if ($context['require_password'])
  992. echo '
  993. // Did you forget to type your password?
  994. if (document.forms.creator.oldpasswrd.value == "")
  995. {
  996. alert("', $txt['required_security_reasons'], '");
  997. return false;
  998. }';
  999. // Any onsubmit javascript?
  1000. if (!empty($context['profile_onsubmit_javascript']))
  1001. echo '
  1002. ', $context['profile_javascript'];
  1003. echo '
  1004. }';
  1005. // Any totally custom stuff?
  1006. if (!empty($context['profile_javascript']))
  1007. echo '
  1008. ', $context['profile_javascript'];
  1009. echo '
  1010. // ]]></script>';
  1011. // Any final spellchecking stuff?
  1012. if (!empty($context['show_spellchecking']))
  1013. echo '
  1014. <form name="spell_form" id="spell_form" method="post" accept-charset="UTF-8" target="spellWindow" action="', $scripturl, '?action=spellcheck">
  1015. <input type="hidden" name="spellstring" value="" />
  1016. <input type="hidden" name="fulleditor" value="" />
  1017. </form>
  1018. <script type="text/javascript" src="' . $settings['default_theme_url'] . '/scripts/spellcheck.js"></script>';
  1019. }
  1020. // Personal Message settings.
  1021. function template_profile_pm_settings()
  1022. {
  1023. global $context, $settings, $options, $scripturl, $modSettings, $txt;
  1024. echo '
  1025. <dt>
  1026. <label for="pm_prefs">', $txt['pm_display_mode'], ':</label>
  1027. </dt>
  1028. <dd>
  1029. <select name="pm_prefs" id="pm_prefs" onchange="if (this.value == 2 &amp;&amp; !document.getElementById(\'copy_to_outbox\').checked) alert(\'', $txt['pm_recommend_enable_outbox'], '\');">
  1030. <option value="0"', $context['display_mode'] == 0 ? ' selected="selected"' : '', '>', $txt['pm_display_mode_all'], '</option>
  1031. <option value="1"', $context['display_mode'] == 1 ? ' selected="selected"' : '', '>', $txt['pm_display_mode_one'], '</option>
  1032. <option value="2"', $context['display_mode'] == 2 ? ' selected="selected"' : '', '>', $txt['pm_display_mode_linked'], '</option>
  1033. </select>
  1034. </dd>
  1035. <dt>
  1036. <label for="view_newest_pm_first">', $txt['recent_pms_at_top'], '</label>
  1037. </dt>
  1038. <dd>
  1039. <input type="hidden" name="default_options[view_newest_pm_first]" value="0" />
  1040. <input type="checkbox" name="default_options[view_newest_pm_first]" id="view_newest_pm_first" value="1"', !empty($context['member']['options']['view_newest_pm_first']) ? ' checked="checked"' : '', ' class="input_check" />
  1041. </dd>
  1042. </dl>
  1043. <hr />
  1044. <dl>
  1045. <dt>
  1046. <label for="pm_receive_from">', $txt['pm_receive_from'], '</label>
  1047. </dt>
  1048. <dd>
  1049. <select name="pm_receive_from" id="pm_receive_from">
  1050. <option value="0"', empty($context['receive_from']) || (empty($modSettings['enable_buddylist']) && $context['receive_from'] < 3) ? ' selected="selected"' : '', '>', $txt['pm_receive_from_everyone'], '</option>';
  1051. if (!empty($modSettings['enable_buddylist']))
  1052. echo '
  1053. <option value="1"', !empty($context['receive_from']) && $context['receive_from'] == 1 ? ' selected="selected"' : '', '>', $txt['pm_receive_from_ignore'], '</option>
  1054. <option value="2"', !empty($context['receive_from']) && $context['receive_from'] == 2 ? ' selected="selected"' : '', '>', $txt['pm_receive_from_buddies'], '</option>';
  1055. echo '
  1056. <option value="3"', !empty($context['receive_from']) && $context['receive_from'] > 2 ? ' selected="selected"' : '', '>', $txt['pm_receive_from_admins'], '</option>
  1057. </select>
  1058. </dd>
  1059. <dt>
  1060. <label for="pm_email_notify">', $txt['email_notify'], '</label>
  1061. </dt>
  1062. <dd>
  1063. <select name="pm_email_notify" id="pm_email_notify">
  1064. <option value="0"', empty($context['send_email']) ? ' selected="selected"' : '', '>', $txt['email_notify_never'], '</option>
  1065. <option value="1"', !empty($context['send_email']) && ($context['send_email'] == 1 || (empty($modSettings['enable_buddylist']) && $context['send_email'] > 1)) ? ' selected="selected"' : '', '>', $txt['email_notify_always'], '</option>';
  1066. if (!empty($modSettings['enable_buddylist']))
  1067. echo '
  1068. <option value="2"', !empty($context['send_email']) && $context['send_email'] > 1 ? ' selected="selected"' : '', '>', $txt['email_notify_buddies'], '</option>';
  1069. echo '
  1070. </select>
  1071. </dd>
  1072. <dt>
  1073. <label for="popup_messages">', $txt['popup_messages'], '</label>
  1074. </dt>
  1075. <dd>
  1076. <input type="hidden" name="default_options[popup_messages]" value="0" />
  1077. <input type="checkbox" name="default_options[popup_messages]" id="popup_messages" value="1"', !empty($context['member']['options']['popup_messages']) ? ' checked="checked"' : '', ' class="input_check" />
  1078. </dd>
  1079. </dl>
  1080. <hr />
  1081. <dl>
  1082. <dt>
  1083. <label for="copy_to_outbox"> ', $txt['copy_to_outbox'], '</label>
  1084. </dt>
  1085. <dd>
  1086. <input type="hidden" name="default_options[copy_to_outbox]" value="0" />
  1087. <input type="checkbox" name="default_options[copy_to_outbox]" id="copy_to_outbox" value="1"', !empty($context['member']['options']['copy_to_outbox']) ? ' checked="checked"' : '', ' class="input_check" />
  1088. </dd>
  1089. <dt>
  1090. <label for="pm_remove_inbox_label">', $txt['pm_remove_inbox_label'], '</label>
  1091. </dt>
  1092. <dd>
  1093. <input type="hidden" name="default_options[pm_remove_inbox_label]" value="0" />
  1094. <input type="checkbox" name="default_options[pm_remove_inbox_label]" id="pm_remove_inbox_label" value="1"', !empty($context['member']['options']['pm_remove_inbox_label']) ? ' checked="checked"' : '', ' class="input_check" />
  1095. </dd>';
  1096. }
  1097. // Template for showing theme settings. Note: template_options() actually adds the theme specific options.
  1098. function template_profile_theme_settings()
  1099. {
  1100. global $context, $settings, $options, $scripturl, $modSettings, $txt;
  1101. echo '
  1102. <dt>
  1103. <label for="show_board_desc">', $txt['board_desc_inside'], '</label>
  1104. </dt>
  1105. <dd>
  1106. <input type="hidden" name="default_options[show_board_desc]" value="0" />
  1107. <input type="checkbox" name="default_options[show_board_desc]" id="show_board_desc" value="1"', !empty($context['member']['options']['show_board_desc']) ? ' checked="checked"' : '', ' class="input_check" />
  1108. </dd>
  1109. <dt>
  1110. <label for="show_children">', $txt['show_children'], '</label>
  1111. </dt>
  1112. <dd>
  1113. <input type="hidden" name="default_options[show_children]" value="0" />
  1114. <input type="checkbox" name="default_options[show_children]" id="show_children" value="1"', !empty($context['member']['options']['show_children']) ? ' checked="checked"' : '', ' class="input_check" />
  1115. </dd>
  1116. <dt>
  1117. <label for="use_sidebar_menu">', $txt['use_sidebar_menu'], '</label>
  1118. </dt>
  1119. <dd>
  1120. <input type="hidden" name="default_options[use_sidebar_menu]" value="0" />
  1121. <input type="checkbox" name="default_options[use_sidebar_menu]" id="use_sidebar_menu" value="1"', !empty($context['member']['options']['use_sidebar_menu']) ? ' checked="checked"' : '', ' class="input_check" />
  1122. </dd>
  1123. <dt>
  1124. <label for="show_no_avatars">', $txt['show_no_avatars'], '</label>
  1125. </dt>
  1126. <dd>
  1127. <input type="hidden" name="default_options[show_no_avatars]" value="0" />
  1128. <input type="checkbox" name="default_options[show_no_avatars]" id="show_no_avatars" value="1"', !empty($context['member']['options']['show_no_avatars']) ? ' checked="checked"' : '', ' class="input_check" />
  1129. </dd>
  1130. <dt>
  1131. <label for="show_no_signatures">', $txt['show_no_signatures'], '</label>
  1132. </dt>
  1133. <dd>
  1134. <input type="hidden" name="default_options[show_no_signatures]" value="0" />
  1135. <input type="checkbox" name="default_options[show_no_signatures]" id="show_no_signatures" value="1"', !empty($context['member']['options']['show_no_signatures']) ? ' checked="checked"' : '', ' class="input_check" />
  1136. </dd>';
  1137. if ($settings['allow_no_censored'])
  1138. echo '
  1139. <dt>
  1140. <label for="show_no_censored">' . $txt['show_no_censored'] . '</label>
  1141. </dt>
  1142. <dd>
  1143. <input type="hidden" name="default_options[show_no_censored]" value="0" />
  1144. <input type="checkbox" name="default_options[show_no_censored]" id="show_no_censored" value="1"' . (!empty($context['member']['options']['show_no_censored']) ? ' checked="checked"' : '') . ' class="input_check" />
  1145. </dd>';
  1146. echo '
  1147. <dt>
  1148. <label for="return_to_post">', $txt['return_to_post'], '</label>
  1149. </dt>
  1150. <dd>
  1151. <input type="hidden" name="default_options[return_to_post]" value="0" />
  1152. <input type="checkbox" name="default_options[return_to_post]" id="return_to_post" value="1"', !empty($context['member']['options']['return_to_post']) ? ' checked="checked"' : '', ' class="input_check" />
  1153. </dd>
  1154. <dt>
  1155. <label for="no_new_reply_warning">', $txt['no_new_reply_warning'], '</label>
  1156. </dt>
  1157. <dd>
  1158. <input type="hidden" name="default_options[no_new_reply_warning]" value="0" />
  1159. <input type="checkbox" name="default_options[no_new_reply_warning]" id="no_new_reply_warning" value="1"', !empty($context['member']['options']['no_new_reply_warning']) ? ' checked="checked"' : '', ' class="input_check" />
  1160. </dd>';
  1161. if (!empty($modSettings['enable_buddylist']))
  1162. echo '
  1163. <dt>
  1164. <label for="posts_apply_ignore_list">', $txt['posts_apply_ignore_list'], '</label>
  1165. </dt>
  1166. <dd>
  1167. <input type="hidden" name="default_options[posts_apply_ignore_list]" value="0" />
  1168. <input type="checkbox" name="default_options[posts_apply_ignore_list]" id="posts_apply_ignore_list" value="1"', !empty($context['member']['options']['posts_apply_ignore_list']) ? ' checked="checked"' : '', ' class="input_check" />
  1169. </dd>';
  1170. echo '
  1171. <dt>
  1172. <label for="view_newest_first">', $txt['recent_posts_at_top'], '</label>
  1173. </dt>
  1174. <dd>
  1175. <input type="hidden" name="default_options[view_newest_first]" value="0" />
  1176. <input type="checkbox" name="default_options[view_newest_first]" id="view_newest_first" value="1"', !empty($context['member']['options']['view_newest_first']) ? ' checked="checked"' : '', ' class="input_check" />
  1177. </dd>';
  1178. // Choose WYSIWYG settings?
  1179. if (empty($modSettings['disable_wysiwyg']))
  1180. echo '
  1181. <dt>
  1182. <label for="wysiwyg_default">', $txt['wysiwyg_default'], '</label>
  1183. </dt>
  1184. <dd>
  1185. <input type="hidden" name="default_options[wysiwyg_default]" value="0" />
  1186. <input type="checkbox" name="default_options[wysiwyg_default]" id="wysiwyg_default" value="1"', !empty($context['member']['options']['wysiwyg_default']) ? ' checked="checked"' : '', ' class="input_check" />
  1187. </dd>';
  1188. if (empty($modSettings['disableCustomPerPage']))
  1189. {
  1190. echo '
  1191. <dt>
  1192. <label for="topics_per_page">', $txt['topics_per_page'], '</label>
  1193. </dt>
  1194. <dd>
  1195. <select name="default_options[topics_per_page]" id="topics_per_page">
  1196. <option value="0"', empty($context['member']['options']['topics_per_page']) ? ' selected="selected"' : '', '>', $txt['per_page_default'], ' (', $modSettings['defaultMaxTopics'], ')</option>
  1197. <option value="5"', !empty($context['member']['options']['topics_per_page']) && $context['member']['options']['topics_per_page'] == 5 ? ' selected="selected"' : '', '>5</option>
  1198. <option value="10"', !empty($context['member']['options']['topics_per_page']) && $context['member']['options']['topics_per_page'] == 10 ? ' selected="selected"' : '', '>10</option>
  1199. <option value="25"', !empty($context['member']['options']['topics_per_page']) && $context['member']['options']['topics_per_page'] == 25 ? ' selected="selected"' : '', '>25</option>
  1200. <option value="50"', !empty($context['member']['options']['topics_per_page']) && $context['member']['options']['topics_per_page'] == 50 ? ' selected="selected"' : '', '>50</option>
  1201. </select>
  1202. </dd>
  1203. <dt>
  1204. <label for="messages_per_page">', $txt['messages_per_page'], '</label>
  1205. </dt>
  1206. <dd>
  1207. <select name="default_options[messages_per_page]" id="messages_per_page">
  1208. <option value="0"', empty($context['member']['options']['messages

Large files files are truncated, but you can click here to view the full file