175 lines
6.3 KiB
Smarty
175 lines
6.3 KiB
Smarty
{* INCLUDE HEADER CODE *}
|
|
{include file="header_popup.tpl"}
|
|
{literal}
|
|
<style>
|
|
body {
|
|
background-color : #000000!important;
|
|
background-image: none!important;
|
|
}
|
|
</style>
|
|
{/literal}
|
|
|
|
{* $Id: user_messages_new.tpl 235 2009-11-13 04:30:39Z phil $ *}
|
|
|
|
|
|
<br />
|
|
|
|
{* JAVASCRIPT FOR CREATING SUGGESTION BOX *}
|
|
{literal}
|
|
<script type="text/javascript">
|
|
<!--
|
|
var tos = new Array();
|
|
window.addEvent('domready', function(){
|
|
var options = {
|
|
script:"misc_js.php?task=suggest_friend&limit=5&",
|
|
varname:"input",
|
|
json:true,
|
|
shownoresults:false,
|
|
maxresults:5,
|
|
blurtrigger:true,
|
|
callback: function (obj) {
|
|
{/literal}{if $setting.setting_username}obj.id = obj.value;{/if}{literal}
|
|
if(obj.id != '' && tos.indexOf(obj.id) == -1 && tos.length < {/literal}{$user->level_info.level_message_recipients}{literal}) { checkUser(obj); } else { $('to_display').value = ''; }
|
|
}
|
|
};
|
|
var as_json = new bsn.AutoSuggest('to_display', options);
|
|
|
|
{/literal}{if $to_user != ""}{literal}
|
|
tos.splice(tos.length, 0, '{/literal}{$to_id}{literal}');
|
|
var newDiv = document.createElement('div');
|
|
newDiv.id = 'to_{/literal}{$to_id}{literal}';
|
|
newDiv.innerHTML = "{/literal}{$to_user}{literal}<!--<img src='./images/icons/action_delete2.gif' class='icon' style='cursor:pointer;' onClick='removeTo(\"{/literal}{$to_id}{literal}\")' border='0'>-->";
|
|
$('tos').insertBefore(newDiv, $('to_display'));
|
|
{/literal}{/if}{literal}
|
|
});
|
|
window.addEvent('load', function(){
|
|
setTimeout("{/literal}{if $to_user == ""}$('to_display').focus();{else}$('subject').focus();{/if}{literal}", "300");
|
|
});
|
|
function addTo(obj) {
|
|
tos.splice(tos.length, 0, obj.id);
|
|
var newDiv = document.createElement('div');
|
|
newDiv.id = 'to_'+obj.id;
|
|
newDiv.innerHTML = obj.value+"<!--<img src='./images/icons/action_delete2.gif' class='icon' style='cursor:pointer;' onClick='removeTo(\""+obj.id+"\")' border='0'>-->";
|
|
$('tos').insertBefore(newDiv, $('to_display'));
|
|
$('to_display').value = '';
|
|
}
|
|
function removeTo(id) {
|
|
tos.splice(tos.indexOf(id), 1);
|
|
$('tos').removeChild($('to_'+id));
|
|
}
|
|
function fillToIds() {
|
|
|
|
$('to').value = tos.join(';');jQuery("#submit1").prop( "disabled", true );
|
|
return checkmail();
|
|
}
|
|
function checkUser(obj) {
|
|
var url = 'misc_js.php?task={/literal}{if $user->level_info.level_message_allow == 1}check_friend{else}check_user{/if}{literal}&input='+obj.id;
|
|
var request = new Request.JSON({secure: false, url: url,
|
|
onComplete: function(jsonObj) {
|
|
if(jsonObj.user_exists == 1) {
|
|
addTo(obj);
|
|
} else {
|
|
$('to_display').value = '';
|
|
}
|
|
}
|
|
}).send();
|
|
}
|
|
|
|
// THIS FUNCTION PREVENTS THE ENTER KEY FROM SUBMITTING THE FORM
|
|
function noenter(e) {
|
|
if (window.event) keycode = window.event.keyCode;
|
|
else if (e) keycode = e.which;
|
|
if(keycode == 13) {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
// THIS FUNCTION SHOWS THE ERROR OR SUCCESS MESSAGE
|
|
function messageSent(is_error, error_message) {
|
|
if(is_error != 0) {
|
|
$('error_div').style.display = 'block';
|
|
$('error_message').innerHTML = error_message;
|
|
} else {
|
|
$('form_div').style.display = 'none';
|
|
$('success_div').style.display = 'block';
|
|
setTimeout(function(){window.parent.TB_remove();closemodal();}, "1000");
|
|
}
|
|
}
|
|
|
|
{/literal}
|
|
{$pasteblock}
|
|
{literal}
|
|
//-->
|
|
</script>
|
|
{/literal}
|
|
|
|
|
|
<div id='success_div' style='display: none;'><br>{lang_print id=804}</div>
|
|
|
|
<div id='form_div'>
|
|
<div style='text-align:left; padding-left: 10px;'>
|
|
{lang_sprintf id=789 1=$user->level_info.level_message_recipients}
|
|
|
|
{* SHOW ERRORS *}
|
|
<div id='error_div' style='display: none;'>
|
|
<br>
|
|
<table cellpadding='0' cellspacing='0'>
|
|
<tr><td class='error'>
|
|
<img src='./images/error.gif' border='0' class='icon'> <span id='error_message'></span>
|
|
</td></tr>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
{literal}
|
|
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
|
|
<script>window.jQuery || document.write("<script src='/js/jquery.min.js'>\x3C/script>")</script>
|
|
<script src="/js/jquery-migrate-1.2.1.min.js"></script>
|
|
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
|
|
<script>window.jQuery.ui || document.write("<script src='/js/jquery-ui.min.js'>\x3C/script>")</script>
|
|
<script type="text/javascript">jQuery.noConflict();</script>
|
|
<script>
|
|
i=0;
|
|
function checkmail(){
|
|
if(i==0){
|
|
jQuery("#form1").submit();
|
|
}
|
|
i=1;
|
|
|
|
}</script>{/literal}<div class="text-left" style="padding:10px;">
|
|
<form action='user_messages_new.php' method='POST' target='ajaxframe' onSubmit='return fillToIds();' id="form1">
|
|
<table cellpadding='0' cellspacing='0'>
|
|
<tr>
|
|
<td><input type='submit' class='button' value='{lang_print id=791}' id="submit1" onClick="
|
|
this.value='Sending…';"> </td>
|
|
<input type='hidden' name='task' value='send'>
|
|
<td><input type='button' class='button' value='{lang_print id=39}' onClick='parent.TB_remove();'></td>
|
|
</tr>
|
|
</table>
|
|
<div class="text-left">{lang_print id=601}</div>
|
|
<div><b><a href='{$url->url_create('profile',$user->user_info.user_username)}' target='_parent'>{$user->user_displayname}</a></b></div><br>
|
|
<div>{lang_print id=790}</div>
|
|
<div> <div id='tos' style='border: none;font-family: arial, verdana, serif;font-size: 12px;color: #ffffff;vertical-align: middle;padding-left: 2px;width:178px;'>
|
|
<input type='text' name='to_display' id='to_display' value='' size='25'>
|
|
</div>
|
|
<input type='hidden' name='to' id='to' value=''>
|
|
<br>
|
|
<div>{lang_print id=520}</div><div><input type='text' name='subject' id='subject' value='{$subject}' size='30' maxlength='100'></div><br>
|
|
|
|
<div>{lang_print id=521}</div>
|
|
<div><textarea rows='10' cols='50' name='message'>{$message}</textarea></div>
|
|
|
|
<table cellpadding='0' cellspacing='0'>
|
|
<tr>
|
|
<td><input type='submit' class='button' value='{lang_print id=791}' id="submit1" onClick="
|
|
this.value='Sending…';"> </td>
|
|
<input type='hidden' name='task' value='send'>
|
|
<td><input type='button' class='button' value='{lang_print id=39}' onClick='parent.TB_remove();'></td>
|
|
</tr>
|
|
</table>
|
|
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
</body>
|
|
</html> |