micmania1/silverstripe-flagcomments 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

micmania1/silverstripe-flagcomments

Composer 安装命令:

composer require micmania1/silverstripe-flagcomments

包简介

Allow users to flag comments

README 文档

README

This module extends the comments module core functionality and adds the ability for a front-end user to flag a comment.

When a comment has been flagged, it cannot be flagged by anyone else.

Requirements

  • silverstripe/comments ^3.1
  • silverstripe/framework ^4.0

Note: This branch is compatible with SilverStripe 4. For a SilverStripe 3 release, please see the 1.x release line.

Installation

composer require nzta/silverstripe-flagcomments

Configuration

Assuming you've already added comments to your page as per instructions than all you need to do is enable flagging via config and add the flag to your template.

SilverStripe\CMS\Model\SiteTree:
  extensions:
    - 'NZTA\FlagComments\Extensions\FlagCommentsExtension'
  comments:
    can_flag: true

Adding the flag to your template:

The endpoint expects an ajax request and only responds with JSON. You'll have to handle this yourself, but to add the flag to your HTML you need to edit the CommentInterface_singlecomment.ss template. There's no reason why you can't add this to another template (this is just a helping hand).

<% if $canFlag %>
	<a href="$FlagLink">Flag</a>
<% end_if %>

统计信息

  • 总下载量: 1.01k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-2-Clause
  • 更新时间: 2016-07-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固