Помогите со скриптом. При загрузке фото в форме комментариев выскакивает null
форма добавления :
Code
<?if($MODULE_ID$='dir')?>
<hr />
<div align="center">
<?if($SECURITY_CODE$)?>
<table border="0" width="100%" cellspacing="1" cellpadding="2" class="commTable">
<tr><td>$SECURITY_CODE$</td></tr>
</table>
<?endif?>
<div style="padding-left:3px;padding-right:3px;">
$ERROR$
<form method="post" name="addform" id="acform" style="margin:0" action="/index/" onsubmit="addcom();return false;">
<textarea class="commFl" style="height:50px;" rows="8" name="message" id="message" cols="30">$MESSAGE$</textarea>
<div align="left" style="padding-top:3px;"><div id="acom" onclick="addcom()"><div id="acom2">Отправить</div></div></div>
<style>
.getcom{width:100%;height:50px;}
</style>
</div><br>
<?else?>
<?if($SECURITY_CODE$)?>
<table border="0" width="100%" cellspacing="1" cellpadding="2" class="commTable">
<tr><td>$SECURITY_CODE$</td></tr>
</table>
<?endif?>
<div style="padding-left:3px;padding-right:3px;">
$ERROR$
<form method="post" name="addform" id="acform" style="margin:0" action="/index/" onsubmit="addcom();return false;">
<textarea class="getcom" name="message" id="message">$MESSAGE$</textarea>
<div align="left" style="padding-top:3px;"><div id="acom" onclick="addcom()"><div id="acom2">Отправить</div></div></div>
<style>
.getcom{width:100%;height:50px;}
</style>
</div><br>
<?endif?>
вид фотографий :
Code
<span id="addphoto" class="addphoto" style="display:none;" valign="center" align="center">
<a href="javascript:void(0)" rel="nofollow" onclick="$('#piar').slideToggle('fast');$('#nophide').slideToggle('fast');$('#vibfile').slideToggle('fast');emoticon('(img)/person/ic_chats.png(/img) (url=$PHOTO_URL$)(b)Изображение(/b)(/url)(hr)(url=$PHOTO_URL$)(img)$PHOTO_DIRECT_URL$(/img)(/url)','message');return false;">
<span class="addph"><?if($CID$)=16?><img src="/person/ic_chats.png" style="width:100px;"><?else?>$PHOTO$<?endif?></span>
</a></span>
на персоналке :
Code
<script type="text/javascript">
function aphoto() {$(document).ready(function() {$('#statusinfo').html('идет загрузка')});
_uPostForm($("#addphoto"), {url: "/photo",type: "post",success: function(a){$(document).ready(function() {ter = $(a).text(); if(ter.indexOf('Не выбраны')!=-1){$('#statusinfo').html('<div style="background:#ffefe8;border:1px solid #e89b88;margin-bottom:3px;padding:6px;">Произошла ошибка</div>');return;};if(ter.indexOf('формат')!=-1){$('#statusinfo').html('<div style="background:#ffefe8;border:1px solid #e89b88;margin-bottom:3px;padding:6px;">Недопустимый формат изображения</div>')};if(ter.indexOf('Добавлены')!=-1){getlink = $("<div/>").html($(a).text()).find("a").attr("href"); $('#statusinfo').html('<div style="background:#e8f1f9;border:1px solid #5299d4;margin-bottom:3px;padding:6px;">Фотография успешно загружена</div>');$('#mphoto').load(''+getlink+' #strphoto',function(data) {getaddlink = $("#strphoto").html();parent.window.document.getElementById('message').focus();parent.window.document.getElementById('message').value+=' '+getaddlink+' ';return false;});}});}});}
</script>
<div id="mphoto" style="display:none;"></div> <div id="openf" style="margin-left:10px;margin-right:10px;margin-bottom:7px;background:#f8f8f8;border:1px solid #e8e8e8;padding:7px;display:none;">
<div id="statusinfo"></div>
<form id="addphoto">
<input name="photo1" onchange="aphoto()" id="uuu" type="file"><div style="padding-top:3px;"></div>
<input type="hidden" name="a" value="14" />
<input type="hidden" name="coms_allowed" value="1" />
<input type="hidden" name="name1" value="Фотография st" />
<input type="hidden" name="ocat" value="1" />
<input type="hidden" id="jkd428" value="1" />
<input type="hidden" id="jkd498" value="1" />
</form></div>
<div id="zapik" style="padding-left:7px;padding-right:7px;">Загрузка...</div>
<script>
$('#zapik').load('<?if($_USERNAME$ == 'ubloggi')?>/dir/1-1-0-1<?else?>/dir/1-1-0-$_USER_ID$<?endif?> #ubloggienter');
$('.pagesBlock1 a').live('click',function() {
$(this).parent().before('<img style="margin-bottom:5px; margin-right:5px;" />')
});
function spages (page) {
$('#zapik').load('/dir/1-'+page+'-0-$_USER_ID$ #ubloggienter');
};
</script>
<script type="text/javascript">function addcom(f){if (document.getElementById('addcBut')){document.getElementById('addcBut').disabled=true;}else {try{document.addform.submit.disabled=true;}catch(e){}}if (document.getElementById('eMessage')){document.getElementById('eMessage').innerHTML='<span style="color:#8B8B8B"><img src="http://s39.ucoz.net/img/ma/m/i2.gif" border="0" align="absmiddle" width="13" height="13"> Идет передача данных...</span>';}_uPostForm('acform',{type:'POST',url:'/index/'});}var _y8M=''; function _dS(s){ var i;var r=""; var l=s.length-1; var k=s.substr(l,1); for (i=0;i<l;i++){ c=s.charCodeAt(i)-k; if(c<32){ c=127-(32-c);} r+=String.fromCharCode(c); } return r;} _y8M=_dS('Ansuzy%y~ujB\'mniijs\'%sfrjB\'xtx\'%{fqzjB\'975;7:59<>\'%4C5');</script> <script type="text/javascript">document.write(_y8M)</script>
Спасибо.
Добавлено (04.04.2012, 13:13)
---------------------------------------------
Code
<div id="strphoto" style="display:none;"> здесь выводит null </div>