当前位置: 首页>>代码示例>>PHP>>正文


PHP comments::delete方法代码示例

本文整理汇总了PHP中comments::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP comments::delete方法的具体用法?PHP comments::delete怎么用?PHP comments::delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在comments的用法示例。


在下文中一共展示了comments::delete方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: delete

 /**
  * Метод удаления комментария
  * @param int $id ID комментария
  * @return null
  * @throws EngineException
  */
 protected function delete($id)
 {
     check_formkey();
     $id = (int) $id;
     lang::o()->get('comments');
     if (!$id) {
         throw new EngineException();
     }
     $this->comments->delete($id);
 }
开发者ID:SjayLiFe,项目名称:CTRev,代码行数:16,代码来源:comments_manage.php

示例2: clearDuplicates

 /**
  * Clear duplicate comments
  * 
  * There are times that the system may end up with duplicate comments, like when
  * copying content. This function is used to effectively eliminate duplicates.
  * <br/>Example:
  * <code>
  * comments :: clearDuplicates($currentLesson);
  * </code>
  * 
  * @param mixed $lesson a lesson id or an EfrontLesson object
  * @access public
  * @static
  * @since 3.6.0
  */
 public static function clearDuplicates($lesson)
 {
     if ($lesson instanceof EfrontLesson) {
         $lessonId = $lesson->lesson['id'];
     } elseif (eF_checkParameter($lesson, 'id')) {
         $lessonId = $lesson;
     } else {
         throw new EfrontLessonException(_INVALIDID . ": {$lesson}", EfrontLessonException::INVALID_ID);
     }
     $result = eF_getTableData("comments", "*", "lessons_ID=" . $lessonId, "id");
     foreach ($result as $value) {
         $commentsTerms[$value['id']] = $value;
         $id = $value['id'];
         unset($value['id']);
         $checksums[$id] = md5(serialize($value));
     }
     $uniques = array_unique($checksums);
     $duplicates = array_diff_key($checksums, $uniques);
     foreach ($duplicates as $key => $value) {
         $comments = new comments($commentsTerms[$key]);
         $comments->delete();
     }
 }
开发者ID:bqq1986,项目名称:efront,代码行数:38,代码来源:comments.class.php

示例3: json_encode

<?php

// +----------------------------------------------------------------------
// | Demila [ Beautiful Digital Content Trading System ]
// +----------------------------------------------------------------------
// | Copyright (c) 2015 http://demila.org All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Email author@demila.org
// +----------------------------------------------------------------------
define('USING_LANGUAGE', false);
require_once '../../../config.php';
require_once $config['root_path'] . '/core/functions.php';
include_once $config['system_core'] . "/initEngine.php";
admin_login();
if (isset($_POST['delete']) && isset($_POST['id']) && isset($_SESSION['user']['access']['items'])) {
    require_once ROOT_PATH . "/apps/items/models/items.class.php";
    $cms = new items();
    $cms->delete(intval($_POST['id']));
    die(json_encode(array_merge($_POST, array('status' => 'true'))));
} elseif (isset($_POST['deleteComment']) && isset($_POST['id']) && isset($_SESSION['user']['access']['items'])) {
    require_once ROOT_PATH . "/apps/items/models/comments.class.php";
    $cms = new comments();
    $cms->delete(intval($_POST['id']));
    die(json_encode(array_merge($_POST, array('status' => 'true'))));
}
echo json_encode(array_merge($_POST, array('status' => 'unknown error')));
die;
开发者ID:yunsite,项目名称:demila,代码行数:29,代码来源:delete.php


注:本文中的comments::delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。