<?php

/* ====================
[BEGIN_COT_EXT]
Hooks=polls.functions.delete
[END_COT_EXT]
==================== */
/**
 * Comments system for Cotonti
 *
 * @package Comments
 * @copyright (c) Cotonti Team
 * @license https://github.com/Cotonti/Cotonti/blob/master/License.txt
 */
defined('COT_CODE') or die('Wrong URL');
require_once cot_incfile('comments', 'plug');
cot_comments_remove('polls', $id2);
<?php

/* ====================
[BEGIN_COT_EXT]
Hooks=page.edit.delete.done
[END_COT_EXT]
==================== */
/**
 * Comments system for Cotonti
 *
 * @package Comments
 * @copyright (c) Cotonti Team
 * @license https://github.com/Cotonti/Cotonti/blob/master/License.txt
 */
defined('COT_CODE') or die('Wrong URL');
require_once cot_incfile('comments', 'plug');
cot_comments_remove('page', $id);
Example #3
0
 protected function beforeDelete()
 {
     // Удалить все файлы и изображения
     if (cot_module_active('files')) {
         $files = files_model_File::find(array(array('file_source', 'advboard'), array('file_item', $this->_data['id'])));
         if (!empty($files)) {
             foreach ($files as $fileRow) {
                 $fileRow->delete();
             }
         }
     }
     // Удалить все комментарии к этому отзыву
     if (cot_plugin_active('comments')) {
         cot_comments_remove('advboard', $this->_data['id']);
     }
     return parent::beforeDelete();
 }