get( "usergroup" ); if( ! $user_group ) {$user_group = array (); $db->query( "SELECT * FROM " . USERPREFIX . "_usergroups ORDER BY id ASC" ); while ( $row = $db->get_row() ) {$user_group[$row['id']] = array (); foreach ( $row as $key => $value ) {$user_group[$row['id']][$key] = stripslashes($value);} } $cache->set( "usergroup", $user_group ); $db->free(); } $row = $db->super_query("SELECT * FROM " . PREFIX . "_comments where id = '$id'"); $author = $row['autor']; $is_reg = $row['is_register']; $post_id = $row['post_id']; if ($row['id'] AND $post_id){ $have_perm = false; if (($member_id['user_id'] == $row['user_id'] and $row['is_register'] and $user_group[$member_id['user_group']]['allow_delc']) or $member_id['user_group'] == '1' or $user_group[$member_id['user_group']]['del_allc'] ) $have_perm = true; //if ( $user_group[$member_id['user_group']]['edit_limit'] AND (($row['date'] + ($user_group[$member_id['user_group']]['edit_limit'] * 60)) < $_TIME) ) {$have_perm = false;} Ограничение на удаление комментов днем позже if($have_perm){ $db->query("DELETE FROM " . PREFIX . "_comments where id = '$id'"); if ($is_reg) $author = $db->safesql($author); {$db->query("UPDATE " . USERPREFIX . "_users set comm_num=comm_num-1 where name ='$author'");} $db->query("UPDATE " . PREFIX . "_post set comm_num=comm_num-1 where id='$post_id'") ; $cache->clear( array( 'news_', 'comments-last', 'comm_'.$post_id, 'full_'.$post_id ) ); @header( "Content-type: text/html; charset=" . $config['charset'] ); echo "