function comments_mass_prune() { $is_admin = $_SESSION['user']['type'] == 'a'; if (!$is_admin) { return '{"error":"not_authorized"}'; } $ids = $_POST['comment_ids']; foreach ($ids as $k => $v) { if (!$v) { unset($ids[$k]); } if ($v != (int) $v) { unset($ids[$k]); } $ids[$k] = (int) $v; } if (!count($ids)) { return '{"error":"no_comment_ids"}'; } $ids_str = implode(',', $ids); $sql = "UPDATE prefix_comments SET `deleted`='Y' WHERE `id` IN ({$ids_str})"; db()->query($sql); return comments_block($_POST['hash'], true); }
} else { ?> <a id="basketAdd<?php echo $product['id']; ?> " href="<?php echo linkByModule('Basket'); ?> /add?id=<?php echo $product['id']; ?> ">Заказать</a> <?php } ?> </div> <h2><?php echo number_format($product['price'], 0, ',', ' '); ?> <?php echo plural($product['price'], 'рублей', 'рубль', 'рубля'); ?> </h2> <?php echo $product['text']; ?> </div> </div> <?php echo comments_block('catalog-' . $product['id']);