Моментальное удаление комментариев в профиле
в profile.tpl в заголовок вставляем
после
вставляем
после
вставляем
пользуемся!
в profile.tpl в заголовок вставляем
PHP:
{literal}
<script>
if(document.getElementById(id1).style.display=='no ne') {
document.getElementById(id1).style.display='block' ;
} else {
document.getElementById(id1).style.display='none';
}
}
function showdiv(id1) {
if(document.getElementById(id1))
document.getElementById(id1).style.display='block' ;
}
function hidediv(id1) {
if(document.getElementById(id1))
document.getElementById(id1).style.display='none';
}
function ShowHideSelectDeps(field_id) {
var elem = "field_"+field_id;
var show = document.getElementById(elem).options[document.getElementById(elem).options.selectedInde x].value;
var possible_options = document.getElementById(elem).options.length-1;
for(x=0; x<possible_options; x++) {
if(x != show | show == "") {
hidediv(elem+"_option"+x);
} else {
showdiv(elem+"_option"+x);
}
}
}
function ShowHideRadioDeps(field_id, show, dep_field, total_options) {
var elem = "field_"+field_id;
for(x=0; x<total_options; x++) {
if(x != show) {
hidediv(elem+"_radio"+x);
} else {
showdiv(elem+"_radio"+x);
if(document.getElementById(dep_field)) {
document.getElementById(dep_field).focus()
document.getElementById(dep_field).value = document.getElementById(dep_field).value;
}
}
}
}
</script>
{/literal}
после
PHP:
{* LOOP THROUGH PROFILE COMMENTS *}
{section name=comment_loop loop=$comments}
вставляем
PHP:
<form id='delpost_{$comments[comment_loop].comment_id}' action='user_editprofile_comments.php' method='post' target='DelCommentWindow_{$comments[comment_loop].comment_id}' >
<input type='hidden' name='comment_{$comments[comment_loop].comment_id}' value='1'>
<input type='hidden' name='task' value='delete'>
<input type='hidden' name='p' value='1'>
</form>
после
PHP:
<td class='profile_comment_author' align='right' nowrap='nowrap'> {if $comments[comment_loop].comment_author->user_info.user_id != 0}<a href='{$url->url_create('profile', $comments[comment_loop].comment_author->user_info.user_username)}#comments'>{$profile26 }</a> | <a href='user_messages_new.php?to={$comments[comment_loop].comment_author->user_info.user_username}'>{$profile34}</a>
вставляем
PHP:
{if $owner->user_info.user_username == $user->user_info.user_username} | <a href="javascript: document.getElementById('delpost_{$comments[comment_loop].comment_id}').submit(); showhide('comment_{math equation='t-c' t=$comments|@count c=$smarty.section.comment_loop.index}');">удалить</a>{/if}
{/if}
пользуемся!