function template_ignoreboards() { global $context, $txt, $settings, $scripturl; // The main containing header. echo ' <form action="', $scripturl, '?action=profile;area=ignoreboards;save" method="post" accept-charset="', $context['character_set'], '" name="creator" id="creator"> <div class="cat_bar"> <h3 class="catbg"> <img src="', $settings['images_url'], '/icons/profile_sm.png" alt="" class="icon" />', $txt['profile'], ' </h3> </div> <p class="description">', $txt['ignoreboards_info'], '</p> <div class="windowbg2"> <div class="content flow_hidden"> <ul class="ignoreboards floatleft">'; $i = 0; $limit = ceil($context['num_boards'] / 2); foreach ($context['categories'] as $category) { if ($i == $limit) { echo ' </ul> <ul class="ignoreboards floatright">'; $i++; } echo ' <li class="category"> <a href="javascript:void(0);" onclick="selectBoards([', implode(', ', $category['child_ids']), '], \'creator\'); return false;">', $category['name'], '</a> <ul>'; foreach ($category['boards'] as $board) { if ($i == $limit) { echo ' </ul> </li> </ul> <ul class="ignoreboards floatright"> <li class="category"> <ul>'; } echo ' <li class="board" style="margin-', $context['right_to_left'] ? 'right' : 'left', ': ', $board['child_level'], 'em;"> <label for="ignore_brd', $board['id'], '"><input type="checkbox" id="ignore_brd', $board['id'], '" name="ignore_brd[', $board['id'], ']" value="', $board['id'], '"', $board['selected'] ? ' checked="checked"' : '', ' class="input_check" /> ', $board['name'], '</label> </li>'; $i++; } echo ' </ul> </li>'; } echo ' </ul>'; // Show the standard "Save Settings" profile button. template_profile_save(); echo ' </div> </div> </form> <br />'; }
function template_edit_tea_ts() { global $tea, $teats, $teainfo, $sourcedir, $context, $settings, $options, $scripturl, $modSettings, $txt, $smcFunc; echo ' <form action="', $scripturl, '?action=profile;area=tea;sa=ts;save" method="post" accept-charset="', $context['character_set'], '" name="creator" id="creator"> <table border="0" width="100%" cellspacing="1" cellpadding="4" align="center" class="bordercolor"> <tr class="titlebg"> <td height="26"> <img src="', $settings['images_url'], '/icons/profile_sm.gif" alt="" border="0" align="top" /> ', $txt['tea_tea'], ' </td> </tr><tr class="windowbg"> <td class="smalltext" height="25" style="padding: 2ex;"> ', $txt['tea_ts_userinfo'], ' </td> </tr><tr> <td class="windowbg2" style="padding-bottom: 2ex;"> <table border="0" width="100%" cellpadding="3">'; if (!$modSettings["tea_ts_enable"]) { echo '<tr><td>' . $txt['tea_ts_disabled'] . '</td></tr>'; } else { if (isset($modSettings['tea_ts_info'])) { echo '<tr><td>' . str_replace("\n", "<br>", $modSettings['tea_ts_info']) . '</td></tr>'; } echo '<tr><td colspan="2"><hr></td></tr>'; if (!empty($_SESSION['tea_ts_error'])) { foreach ($_SESSION['tea_ts_error'] as $e) { echo "<tr><td>[ERROR] " . $e . "</td></tr>"; } unset($_SESSION['tea_ts_error']); } if (!empty($teainfo) || !$modSettings["tea_enable"]) { $memberID = $tea->memid; $tsinfo = $smcFunc['db_query']('', "SELECT tsid, dbid, name FROM {db_prefix}tea_ts_users WHERE id = " . $memberID); $tsinfo = $tea->select($tsinfo); if (!empty($tsinfo)) { $sname = $tsinfo[0][2]; $uniqueid = $tsinfo[0][0]; $tsname = $teats->format_ts_name($memberID, $sname); echo '<tr><td>Name</td><td>' . $tsname . '</td></tr>'; echo '<tr><td>UniqueID</td><td>' . $uniqueid . '</td></tr>'; } else { echo '<tr><td>Not Registered on TS</td></tr>'; } echo '<tr><td colspan="2"><hr></td></tr>'; if (isset($modSettings["tea_ts_method_online"]) && $modSettings["tea_ts_method_online"]) { $count[] = 'online'; } if (isset($modSettings["tea_ts_method_create"]) && $modSettings["tea_ts_method_create"]) { $count[] = 'create'; } if (isset($modSettings["tea_ts_method_priv"]) && $modSettings["tea_ts_method_priv"]) { $count[] = 'priv'; } if (count($count) == 1) { echo '<tr><td><input type="hidden" name="method" value="' . $count[0] . '">'; } if (isset($modSettings["tea_ts_method_online"]) && $modSettings["tea_ts_method_online"]) { if (count($count) != 1) { echo '<tr><td><input type="radio" name="method" value="online"> Online Name Check</td></tr>'; } } echo '<tr><td>Main Char</td></tr>'; echo '<tr><td>'; if (!$modSettings["tea_enable"]) { echo '<tr><td>Name: <input type="text" name="tea_ts_char" value="">'; } elseif (!empty($teainfo)) { echo '<select name="tea_ts_char">'; foreach ($teainfo as $i => $info) { foreach ($info['charnames'] as $i => $info) { $name = $teats->format_ts_name($memberID, $info[0]); echo '<option value="' . $info[0] . '"', $info[0] == $sname ? ' SELECTED ' : '', '>' . $name . '</option>'; } } echo '</select>'; } echo '</td></tr>'; if (isset($modSettings["tea_ts_method_create"]) && $modSettings["tea_ts_method_create"]) { if (count($count) != 1) { echo '<tr><td><input type="radio" name="method" value="create"> Use TS Unique ID</td></tr>'; } echo '<tr><td>Register Using your TS Unique ID</td></tr>'; echo '<tr><td><input type="text" name="tsid" value="' . $uniqueid . '"></td></tr>'; } echo '<tr><td>'; $txt['change_profile'] = 'Register'; template_profile_save(); echo '</td></tr>'; } else { echo "<tr><td>[ERROR] No API Info Found and is Required for Character Info</td></tr>"; } // echo '<tr><td colspan="3"><hr class="hrcolor" width="100%" size="1"/></td></tr>'; // echo '<tr><td> // <b>', $txt['tea_status'], ':</b></td><td>'.$info['status']; // if($info['status'] == 'API Error') // echo ' ('.$info['error'].')'; // echo '</td> // </tr><tr><td><b>', $txt['tea_mainrule'], ':</b></td><td>'.$info['mainrule'].'</td> // </tr><tr><td><b>', $txt['tea_aditrules'], ':</b></td><td>'.$info['aditrules'].'</td> // </tr><tr><td> // <b>', $txt['tea_characters'], ':</b></td><td>'; // if(!empty($info['charnames'])) // { // echo '<style type="text/css"> //green {color:green} //blue {color:blue} //red {color:red} //</style>'; // $echo = array(); // foreach($info['charnames'] as $char) // { // $char[3] = $char[3] != '' ? ' / <blue>'.$char[3].'</blue>' : ''; // $echo[] = '['.$char[1].'] '.$char[0].' (<green>'.$char[2].'</green>'.$char[3].')'; // } // echo implode('<br>', $echo); // } // echo '</td></tr> // <tr><td> // <b>', $txt['tea_userid'], ':</b></td> // <td>'; // if($info['userid'] == "") // echo '<input type="text" name="tea_user_id[]" value="'.$info['userid'].'" size="20" />'; // else // { // echo '<input type="hidden" name="tea_user_id[]" value="'.$info['userid'].'" size="20" />'; // echo $info['userid'].'</td><td> <input type="checkbox" name="del_api[]" value="'.$info['userid'].'" /> Delete</td>'; // } // echo ' </td> // </tr><tr> // <td width="40%"> <b>', $txt['tea_api'], ':</b></td> // <td><input type="text" name="tea_user_api[]" value="'.$info['api'].'" size="64" /> // </td> // </tr>'; // } } echo ' </table> </td> </tr> </table> </form>'; }
function template_ignoreboards() { global $context, $txt, $settings, $scripturl; // The main containing header. echo ' <script type="text/javascript"><!-- // --><![CDATA[ function selectBoards(ids) { var toggle = true; for (i = 0; i < ids.length; i++) toggle = toggle & document.forms.creator["ignore_brd" + ids[i]].checked; for (i = 0; i < ids.length; i++) document.forms.creator["ignore_brd" + ids[i]].checked = !toggle; } // ]]></script> <form action="', $scripturl, '?action=profile;area=ignoreboards;save" method="post" accept-charset="UTF-8" name="creator" id="creator"> <div class="cat_bar2"> <h3> <span class="ie6_header floatleft">', $txt['ignoreboards'], '</span> </h3> </div> <div class="orange_container smalltext cleantop norounded gradient_darken_down mediumpadding">', $txt['ignoreboards_info'], '</div> <br> <div class="blue_container"> <div class="content flow_hidden">'; template_boardlisting('ignore_brd'); // Show the standard "Save Settings" profile button. template_profile_save(); echo ' </div> </div> </form> <br />'; }
/** * Display a list of boards so a user can choose to ignore some */ function template_ignoreboards() { global $txt, $scripturl; // The main containing header. echo ' <form action="', $scripturl, '?action=profile;area=ignoreboards;save" method="post" accept-charset="UTF-8" name="creator" id="creator"> <h2 class="category_header hdicon cat_img_profile"> ', $txt['profile'], ' </h2> <p class="description">', $txt['ignoreboards_info'], '</p> <div class="windowbg2"> <div class="content flow_hidden">'; template_pick_boards('creator', 'ignore_brd', false); // Show the standard "Save Settings" profile button. template_profile_save(); echo ' </div> </div> </form> <br />'; }
function template_pmprefs() { global $context, $settings, $options, $scripturl, $modSettings, $txt; // The main containing header. echo ' <form action="', $scripturl, '?action=profile2" method="post" accept-charset="', $context['character_set'], '" name="creator" id="creator"> <table border="0" width="85%" cellspacing="0" cellpadding="4" align="center" class="tborder"> <tr class="titlebg"> <td height="26"> <img src="', $settings['images_url'], '/icons/profile_sm.gif" alt="" align="top" /> ', $txt[79], ' </td> </tr><tr class="windowbg"> <td class="smalltext" style="padding: 2ex;"> ', $txt['pmprefs_info'], ' </td> </tr><tr> <td class="windowbg2" style="padding-bottom: 2ex;"> <table border="0" width="100%" cellpadding="3">'; // A text box for the user to input usernames of everyone they want to ignore personal messages from. echo ' <tr> <td valign="top"> <b>', $txt[325], ':</b> <div class="smalltext"> ', $txt[326], '<br /> <br /> <a href="', $scripturl, '?action=findmember;input=pm_ignore_list;delim=\\\\n;sesc=', $context['session_id'], '" onclick="return reqWin(this.href, 350, 400);"><img src="', $settings['images_url'], '/icons/assist.gif" alt="', $txt['find_members'], '" align="middle" /> ', $txt['find_members'], '</a> </div> </td> <td> <textarea name="pm_ignore_list" id="pm_ignore_list" rows="10" cols="50">', $context['ignore_list'], '</textarea> </td> </tr>'; // Extra options available to the user for personal messages. echo ' <tr> <td colspan="2"> <input type="hidden" name="default_options[copy_to_outbox]" value="0" /> <label for="copy_to_outbox"><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="check" /> ', $txt['copy_to_outbox'], '</label><br /> <input type="hidden" name="default_options[popup_messages]" value="0" /> <label for="popup_messages"><input type="checkbox" name="default_options[popup_messages]" id="popup_messages" value="1"', !empty($context['member']['options']['popup_messages']) ? ' checked="checked"' : '', ' class="check" /> ', $txt['popup_messages'], '</label><br /> <label for="pm_email_notify">', $txt[327], '</label> <select name="pm_email_notify" id="pm_email_notify"> <option value="0"', empty($context['send_email']) ? ' selected="selected"' : '', '>', $txt['email_notify_never'], '</option> <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>'; if (!empty($modSettings['enable_buddylist'])) { echo ' <option value="2"', !empty($context['send_email']) && $context['send_email'] > 1 ? ' selected="selected"' : '', '>', $txt['email_notify_buddies'], '</option>'; } echo ' </select><br /> </td> </tr>'; // Show the standard "Save Settings" profile button. template_profile_save(); echo ' </table> </td> </tr> </table> </form>'; }
function template_edittea() { global $tea, $teainfo, $sourcedir, $context, $settings, $options, $scripturl, $modSettings, $txt; if ($tea->memid == $context['user']['id']) { if (allowedTo(array('tea_edit_own', 'tea_edit_any'))) { $edit = TRUE; } } else { if (allowedTo(array('tea_edit_any'))) { $edit = TRUE; } } if (isset($_GET['sa']) && strtolower($_GET['sa']) == "ts") { return template_edit_tea_ts(); } elseif (isset($_GET['sa']) && strtolower($_GET['sa']) == "jabber") { return template_edit_tea_jabber(); } echo ' <form action="', $scripturl, '?action=profile;area=tea;save" method="post" accept-charset="', $context['character_set'], '" name="creator" id="creator"> <table border="0" width="100%" cellspacing="1" cellpadding="4" align="center" class="bordercolor"> <tr class="titlebg"> <td height="26"> <img src="', $settings['images_url'], '/icons/profile_sm.gif" alt="" border="0" align="top" /> ', $txt['tea_tea'], ' </td> </tr><tr class="windowbg"> <td class="smalltext" height="25" style="padding: 2ex;"> ', $txt['tea_userinfo'], ' </td> </tr><tr> <td class="windowbg2" style="padding-bottom: 2ex;"> <table border="0" width="100%" cellpadding="3">'; if (!empty($_SESSION['tea_error'])) { foreach ($_SESSION['tea_error'] as $e) { echo "<tr><td>[ERROR] " . $e . "</td></tr>"; } unset($_SESSION['tea_error']); } if (!$modSettings["tea_enable"]) { echo '<tr><td>' . $txt['tea_disabled'] . '</td></tr>'; } else { if (!empty($teainfo)) { foreach ($teainfo as $info) { foreach ($info['charnames'] as $i => $char) { $charlist[$i] = $char[0]; } } } echo '<tr><td>' . $txt['tea_charid'] . '</td><td>'; if ($edit) { echo '<select name="tea_charid" id="tea_charid" >'; } if (!empty($charlist)) { if (!isset($charlist[$teainfo[0]['main']])) { echo '<option value="-", SELECTED>-</option>'; } foreach ($charlist as $i => $c) { if ($edit) { echo '<option value="' . $i . '"', $i == $teainfo[0]['main'] ? 'SELECTED' : '', '>' . $c . '</option>'; } } if (!$edit) { echo $charlist[$teainfo[0]['main']]; } } else { if ($edit) { echo '<option value="-", SELECTED>-</option>'; } else { echo '-'; } } if ($edit) { echo '</select>'; } echo '</td></tr>'; if ($edit) { $teainfo[] = array("userid" => '', "api" => '', 'charnames' => '', 'status' => '', 'mainrule' => '', 'aditrules' => '', 'error' => ''); } foreach ($teainfo as $i => $info) { echo '<tr><td colspan="3"><hr class="hrcolor" width="100%" size="1"/></td></tr>'; echo '<tr><td> <b>', $txt['tea_status'], ':</b></td><td>' . $info['status']; if ($info['status'] == 'API Error') { echo ' (' . $info['error'] . ')'; } echo '</td> </tr><tr><td><b>', $txt['tea_mainrule'], ':</b></td><td>' . $info['mainrule'] . '</td> </tr><tr><td><b>', $txt['tea_aditrules'], ':</b></td><td>' . $info['aditrules'] . '</td> </tr><tr><td> <b>', $txt['tea_characters'], ':</b></td><td>'; if (!empty($info['charnames'])) { echo '<style type="text/css"> green {color:green} blue {color:blue} red {color:red} </style>'; $echo = array(); foreach ($info['charnames'] as $char) { $char[3] = $char[3] != '' ? ' / <blue>' . $char[3] . '</blue>' : ''; $echo[] = '[' . $char[1] . '] ' . $char[0] . ' (<green>' . $char[2] . '</green>' . $char[3] . ')'; } echo implode('<br>', $echo); } echo '</td></tr> <tr><td> <b>', $txt['tea_userid'], ':</b></td> <td>'; if ($edit) { if ($info['userid'] == "") { echo '<input type="text" name="tea_user_id[]" value="' . $info['userid'] . '" size="20" />'; } else { echo '<input type="hidden" name="tea_user_id[]" value="' . $info['userid'] . '" size="20" />'; echo $info['userid'] . '</td><td> <input type="checkbox" name="del_api[]" value="' . $info['userid'] . '" /> Delete</td>'; } echo '</td> </tr><tr> <td width="40%"> <b>', $txt['tea_api'], ':</b></td> <td><input type="text" name="tea_user_api[]" value="' . $info['api'] . '" size="64" /> </td> </tr>'; if ($info['userid'] == "") { echo '<tr><td><b>TEA Required Options:</b></td> <td> CharacterInfo, CharacterSheet, FacWarStats </td></tr>'; } } else { echo $info['userid']; echo '</td> </tr><tr> <td width="40%"> <b>', $txt['tea_api'], ':</b></td> <td>' . $info['api'] . ' </td> </tr>'; } } template_profile_save(); } echo ' </table> </td> </tr> </table> </form>'; }