2012-06-20, 06:28 PM
I made some edits to my buddy/ignore list template. Now there seems to be some issues -- it doesn't give the "user added" messages, the number doesn't update dynamically, and if you try to remove the last person on either list, they will appear there until you refresh the page.
I tried to keep my removal of items pretty minimal so I'm not sure why it's not working anymore. Here's my usercp_editlists template.
I tried to keep my removal of items pretty minimal so I'm not sure why it's not working anymore. Here's my usercp_editlists template.
<html>
<head>
<title>{$mybb->settings['bbname']} - {$lang->edit_lists}</title>
{$headerinclude}
<script type="text/javascript" src="jscripts/usercp.js"></script>
<script type="text/javascript">
lang.remove_buddy = '{$lang->confirm_remove_buddy}';
lang.remove_ignored = '{$lang->confirm_remove_ignored}';
lang.adding_buddy = '{$lang->adding_buddy}';
lang.adding_ignored = '{$lang->adding_ignored}';
</script>
</head>
<body>
{$header}
<table width="100%" border="0" align="center">
<tr>
<td valign="top">
{$usercpnav}
<form action="usercp.php" method="post" id="buddy" onsubmit="return UserCP.addBuddy('buddy');">
<input type="hidden" name="action" value="do_editlists" />
<input type="hidden" name="manage" value="buddy" />
<input type="hidden" name="my_post_key" value="{$mybb->post_code}" />
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td class="thead" colspan="2"></td>
</tr>
<tr>
<td class="trow1" valign="top">
<h2>Friends</h2>
<span class="smalltext">{$lang->add_buddies_desc}</span><br />
<div style="text-align: center; margin: 15px 0px;"><input type="text" name="add_username" id="buddy_add_username" placeholder="ENTER USERNAME(S) OF FRIENDS" style="width: 70%;" class="textboxL" /> <input type="submit" value="{$lang->add_to_buddies}" id="buddy_submit" class="button" style="position: relative; top: -3px;" /></div>
<script type="text/javascript" src="jscripts/autocomplete.js?ver=1400"></script>
<script type="text/javascript">
<!--
if(use_xmlhttprequest == "1")
{
new autoComplete("buddy_add_username", "xmlhttp.php?action=get_users", {valueSpan: "username", delimChar: ","});
}
// -->
</script>
<fieldset id="buddy_container" style="min-height: 87px;">
<legend>{$lang->current_buddies}</legend>
<ul id="buddy_list" style="list-style: none;">
{$buddy_list}
</ul>
</fieldset>
</td>
</form>
<form action="usercp.php" method="post" id="ignored" onsubmit="return UserCP.addBuddy('ignored');">
<input type="hidden" name="action" value="do_editlists" />
<input type="hidden" name="manage" value="ignored" />
<input type="hidden" name="my_post_key" value="{$mybb->post_code}" />
<td class="trow1" valign="top">
<h2>Foes</h2>
<span class="smalltext">{$lang->add_ignored_users_desc}</span><br />
<div style="text-align: center; margin: 15px 0px;"><input type="text" name="add_username" id="ignored_add_username" placeholder="ENTER USERNAME(S) OF FOES" style="width: 70%;" class="textboxL" /> <input type="submit" value="{$lang->ignore_users}" id="ignored_submit" class="button" style="position: relative; top: -3px;" /></div>
<script type="text/javascript">
<!--
if(use_xmlhttprequest == "1")
{
new autoComplete("ignored_add_username", "xmlhttp.php?action=get_users", {valueSpan: "username", delimChar: ","});
}
// -->
</script>
</fieldset>
<fieldset id="ignored_container" style="min-height: 87px;">
<legend>{$lang->current_ignored_users}</legend>
<ul id="ignore_list" style="list-style: none;">
{$ignore_list}
</ul>
</fieldset>
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
{$footer}
</body>
</html>