Files
Testing/templates/user_friends_manage1.tpl
sean 0e8a8b3028
Some checks failed
deploy-testing / deploy (push) Has been cancelled
Initial testing snapshot
2026-11-17 16:15:01 -05:00

446 lines
15 KiB
Smarty

{* INCLUDE HEADER CODE *}
{include file="header_modal.tpl"}
{literal}
<style>
.modal-content{background:black;}
</style>
<script src="/include/js/jquery.form.js"></script>
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('#form1').ajaxForm({
success: function(){
jQuery('#form_div').hide();
jQuery('#success_div').html(successtext);
if(changetext==1){
jQuery('#pendingfriend_{/literal}{$owner->user_info.user_id}{literal}').show();
jQuery('#addfriend_{/literal}{$owner->user_info.user_id}{literal}').hide();
}
if(changetext==2||changetext==3||changetext==4||changetext==6){
jQuery('#request_{/literal}{$owner->user_info.user_id}{literal}').hide();
}
if(changetext==6){
jQuery('#removefriend_{/literal}{$owner->user_info.user_id}{literal}').hide();
jQuery('#addfriend_{/literal}{$owner->user_info.user_id}{literal}').show();
}
jQuery('#success_div').show();
setTimeout(closemodal, 5000);
}
});
});
</script>
{/literal}
{*
*}
<div id='success_div' style='display: none;'></div>
<div id='form_div'>
{* SHOW CONFIRMATION OF FRIENDSHIP ADDITION *}
{if $result != 0}
{* JAVASCRIPT FOR CLOSING BOX *}
{literal}
<script type="text/javascript">
<!--
setTimeout("closemodal();", "1000");
if(window.parent.friend_update) { setTimeout("window.parent.friend_update('{/literal}{$status}{literal}', '{/literal}{$owner->user_info.user_id}{literal}');", "800"); }
//-->
</script>
{/literal}
<br />
<div>{lang_print id=$result}</div>
{* SHOW CANCEL FRIEND REQUEST FORM *}
{elseif $subpage == "cancel"}
<script type="text/javascript">
successtext='You have successfully canceled your friendship request to this user.';
changetext=2;
</script>
<div style='text-align:left; padding-left: 10px; padding-top: 10px;'>
{lang_sprintf id=918 1=$owner->user_displayname}
<br />
<br />
<form action='user_friends_manage.php' method='POST' id="form1" onsubmit="jQuery('#submitbutton').prop('disabled', true); jQuery('#submitbutton').val('Canceling...'); ">
<table cellpadding='0' cellspacing='0'>
<tr><td colspan='2'>&nbsp;</td></tr>
<tr>
<td colspan='2'>
<table cellpadding='0' cellspacing='0'>
<tr>
<td>
<input type='submit' class='button' value='{lang_print id=919}' id="submitbutton" />&nbsp;
<input type='hidden' name='task' value='cancel_do' />
<input type='hidden' name='user' value='{$owner->user_info.user_username}' />
</form>
</td>
<td>
<input type='button' class='button' value='{lang_print id=39}' onClick='closemodal();' />
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
{* SHOW REJECT FRIEND REQUEST FORM *}
{elseif $subpage == "reject"}
<script type="text/javascript">
successtext='You have rejected the friendship request of this user.';
changetext=3;
</script>
<div style='text-align:left; padding-left: 10px; padding-top: 10px;'>
{lang_sprintf id=912 1=$owner->user_displayname}
<br />
<br />
<form action='user_friends_manage.php' method='POST' id="form1" onsubmit="jQuery('#submitbutton').prop('disabled', true); jQuery('#submitbutton').val('Rejecting...'); ">
<table cellpadding='0' cellspacing='0'>
<tr><td colspan='2'>&nbsp;</td></tr>
<tr>
<td colspan='2'>
<table cellpadding='0' cellspacing='0'>
<tr>
<td>
<input type='submit' class='button' value='{lang_print id=913}' id="submitbutton" />&nbsp;
<input type='hidden' name='task' value='reject_do' />
<input type='hidden' name='user' value='{$owner->user_info.user_username}' />
</form>
</td>
<td>
<input type='button' class='button' value='{lang_print id=39}' onClick='closemodal();' />
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
{* SHOW REMOVE FRIEND FORM *}
{elseif $subpage == "remove"}
<script type="text/javascript">
successtext='You have removed this user from your friend list.';
changetext=6;
</script>
<div style='text-align:left; padding-left: 10px; padding-top: 10px;'>
{lang_sprintf id=877 1=$owner->user_displayname}
<br />
<form action='user_friends_manage.php' method='POST' id="form1" onsubmit="jQuery('#submitbutton').prop('disabled', true); jQuery('#submitbutton').val('Removing...'); ">
<table cellpadding='0' cellspacing='0'>
<tr><td colspan='2'>&nbsp;</td></tr>
<tr>
<td colspan='2'>
<table cellpadding='0' cellspacing='0'>
<tr>
<td>
<input type='submit' class='button' value='{lang_print id=889}' id="submitbutton" />&nbsp;
<input type='hidden' name='task' value='remove_do' />
<input type='hidden' name='user' value='{$owner->user_info.user_username}' />
</form>
</td>
<td>
<input type='button' class='button' value='{lang_print id=39}' onClick='closemodal();' />
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
{* SHOW CONFIRM FRIEND FORM *}
{elseif $subpage == "confirm"}
<script type="text/javascript">
successtext='You have accepted the friendship.';
changetext=4;
</script>
<div style='text-align:left; padding-left: 10px; padding-top: 10px;'>
{lang_sprintf id=888 1=$owner->user_displayname}
<br />
<br />
<form action='user_friends_manage.php' method='POST' id="form1" onsubmit="return false;" onsubmit="jQuery('#submitbutton').prop('disabled', true); jQuery('#submitbutton').val('Confirming...'); ">
<table cellpadding='0' cellspacing='0'>
<tr><td colspan='2'>&nbsp;</td></tr>
<tr>
<td colspan='2'>
<table cellpadding='0' cellspacing='0'>
<tr>
<td>
<input type='submit' class='button' value='{lang_print id=887}' id="submitbutton" />&nbsp;
<input type='hidden' name='task' value='add_do' />
<input type='hidden' name='user' value='{$owner->user_info.user_username}' />
</form>
</td>
<td>
<input type='button' class='button' value='{lang_print id=39}' onClick='closemodal();' />
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
{* SHOW EDIT FRIENDSHIP FORM *}
{elseif $subpage == "edit"}
<script type="text/javascript">
successtext='Friendship updated.';
changetext=5;
</script>
<div style='text-align:left; padding-left: 10px; padding-top: 10px;'>
{lang_sprintf id=921 1=$owner->user_displayname}
<br />
<br />
<form action='user_friends_manage.php' method='post' id="form1" onsubmit="jQuery('#submitbutton').prop('disabled', true); jQuery('#submitbutton').val('Updating...'); ">
{* SHOW FRIEND TYPES IF APPLICABLE *}
<table cellpadding='0' cellspacing='0'>
{if $connection_types|@count != 0}
<tr>
<td class='form1'>{lang_print id=882}</td>
<td class='form2'>
<select name='friend_type' onChange="{literal}if(jQuery(this).val() == 'other_friendtype') { jQuery('#other').style.display = 'block'; } else { jQuery('#other').style.display = 'none'; }{/literal}">
<option></option>
{section name=type_loop loop=$connection_types}
<option value='{$connection_types[type_loop]}'{if $friend_type == $connection_types[type_loop]} SELECTED{/if}>{$connection_types[type_loop]}</option>
{/section}
{if $setting.setting_connection_other != 0}<option value='other_friendtype'{if $friend_type_other != ""} SELECTED{/if}>{lang_print id=863}:</option>{/if}
</select>
</td>
{if $setting.setting_connection_other != 0}
<td class='form2' style='display: {if $friend_type_other != ""}block{else}none{/if};' id='other'>&nbsp;<input type='text' class='text' name='friend_type_other' value='{$friend_type_other}' maxlength='50'></td>
{/if}
</tr>
{else}
{if $setting.setting_connection_other != 0}
<tr>
<td class='form1'>{lang_print id=882}</td>
<td class='form2'><input type='text' name='friend_type_other' value='{$friend_type_other}' maxlength='50' /></td>
</tr>
{/if}
{/if}
</table>
<br>
{* SHOW FRIEND EXPLANATION IF APPLICABLE *}
{* if $setting.setting_connection_explain != 0}
<div>
<b>Message:</b><br>
<textarea name='friend_explain' rows='5' cols='60'>{$friend_explain}</textarea>
</div>
{/if *}
<br>
<table cellpadding='0' cellspacing='0'>
<tr>
<td>
<input type='submit' class='button' value='{lang_print id=922}' />&nbsp;
<input type='hidden' name='task' value='edit_do' />
<input type='hidden' name='user' value='{$owner->user_info.user_username}' />
</form>
</td>
<td>
<input type='button' class='button' value='{lang_print id=39}' onClick='closemodal();' />
</td>
</tr>
</table>
</div>
{* SHOW ADD FRIEND FORM *}
{elseif $confirm==1}
<script type="text/javascript">
successtext='You are now friends.';
changetext=4;
</script>
<div style='text-align: left; padding-left: 10px; padding-top: 10px;'>
{lang_sprintf id=880 1=$owner->user_displayname}
<br><br>
<form action='user_friends_manage.php' method='POST' id="form1" onsubmit="jQuery('#submitbutton').prop('disabled', true); jQuery('#submitbutton').val('Confirming...'); ">
{* IF FRIEND TYPE OR EXPLANATION IS ENABLED *}
{if $connection_types|@count != 0 || $setting.setting_connection_other != 0 || $setting.setting_connection_explain != 0}
{lang_sprintf id=881 1=$owner->user_displayname}
<br />
<table cellpadding='0' cellspacing='0'>
{* SHOW FRIEND TYPES IF APPLICABLE *}
{if $connection_types|@count != 0}
<tr>
<td class='form1'>{lang_print id=882}</td>
<td class='form2'>
<select name='friend_type' onChange="{literal}if(jQuery(this).val() == 'other_friendtype') { jQuery('#other').show(); } else { jQuery('#other').hide(); }{/literal}">
<option></option>
{section name=type_loop loop=$connection_types}
<option value='{$connection_types[type_loop]}'>{$connection_types[type_loop]}</option>
{/section}
{if $setting.setting_connection_other != 0}<option value='other_friendtype'>{lang_print id=863}:</option>{/if}
</select>
</td>
{if $setting.setting_connection_other != 0}
<td class='form2' style='display: none;' id='other'>&nbsp;<input type='text' class='text' name='friend_type_other' maxlength='50' /></td>
{/if}
</tr>
{else}
{if $setting.setting_connection_other != 0}
<tr>
<td class='form1'>{lang_print id=882}</td>
<td class='form2'><input type='text' name='friend_type_other' maxlength='50' /></td>
</tr>
{/if}
{/if}
</table>
<br>
{* SHOW FRIEND EXPLANATION IF APPLICABLE *}
{if $setting.setting_connection_explain != 0 && $confirm!=1}
<div>
<b>You have the option to leave a message with this request (you cannot add links):</b><br>
<textarea name='friend_explain' rows='5' cols='60'></textarea>
</div>
{/if}
{/if}
<table cellpadding='0' cellspacing='0'>
<tr><td colspan='2'>&nbsp;</td></tr>
<tr>
<td colspan='2'>
<table cellpadding='0' cellspacing='0'>
<tr>
<td>
<input type='submit' class='button' value='{lang_print id=884}' id="submitbutton" />&nbsp;
<input type='hidden' name='task' value='add_do' />
<input type='hidden' name='user' value='{$owner->user_info.user_username}' />
</form>
</td>
<td>
<input type='button' class='button' value='{lang_print id=39}' onClick='closemodal();' />
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
{elseif $subpage == "add"}
<script type="text/javascript">
successtext='A message has been sent to this user to confirm your friendship.';
changetext=1;
</script>
<div style='text-align: left; padding-left: 10px; padding-top: 10px;'>
{lang_sprintf id=880 1=$owner->user_displayname}
<br><br>
<form action='user_friends_manage.php' method='POST' id="form1" onsubmit="jQuery('#submitbutton').prop('disabled', true); jQuery('#submitbutton').val('Sending...'); ">
{* IF FRIEND TYPE OR EXPLANATION IS ENABLED *}
{if $connection_types|@count != 0 || $setting.setting_connection_other != 0 || $setting.setting_connection_explain != 0}
{lang_sprintf id=881 1=$owner->user_displayname}
<br />
<table cellpadding='0' cellspacing='0'>
{* SHOW FRIEND TYPES IF APPLICABLE *}
{if $connection_types|@count != 0}
<tr>
<td class='form1'>{lang_print id=882}</td>
<td class='form2'>
<select name='friend_type' onChange="{literal}if(jQuery(this).val() == 'other_friendtype') { jQuery('#other').show(); } else { jQuery('#other').hide(); }{/literal}">
<option></option>
{section name=type_loop loop=$connection_types}
<option value='{$connection_types[type_loop]}'>{$connection_types[type_loop]}</option>
{/section}
{if $setting.setting_connection_other != 0}<option value='other_friendtype'>{lang_print id=863}:</option>{/if}
</select>
</td>
{if $setting.setting_connection_other != 0}
<td class='form2' style='display: none;' id='other'>&nbsp;<input type='text' class='text' name='friend_type_other' maxlength='50' /></td>
{/if}
</tr>
{else}
{if $setting.setting_connection_other != 0}
<tr>
<td class='form1'>{lang_print id=882}</td>
<td class='form2'><input type='text' name='friend_type_other' maxlength='50' /></td>
</tr>
{/if}
{/if}
</table>
<br>
{* SHOW FRIEND EXPLANATION IF APPLICABLE *}
{if $setting.setting_connection_explain != 0 && $confirm!=1}
<div>
<b>You have the option to leave a message with this request (you cannot add links):</b><br>
<textarea name='friend_explain' rows='5' cols='60'></textarea>
</div>
{/if}
{/if}
<table cellpadding='0' cellspacing='0'>
<tr><td colspan='2'>&nbsp;</td></tr>
<tr>
<td colspan='2'>
<table cellpadding='0' cellspacing='0'>
<tr>
<td>
<input type='submit' class='button' value='{lang_print id=884}' id="submitbutton" />&nbsp;
<input type='hidden' name='task' value='add_do' />
<input type='hidden' name='user' value='{$owner->user_info.user_username}' />
</form>
</td>
<td>
<input type='button' class='button' value='{lang_print id=39}' onClick='closemodal();' />
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
{/if}
</div>
</body>
</html>