Code Monkey home page Code Monkey logo

comments's Introduction

Comments

A reusable, embeddable comments component for the Elefant CMS.

To install, copy it into your apps folder and visit Tools > Comments in the Elefant admin toolbar.

To embed comments into a view template, simply include the following:

{! comments/embed?identifier=unique-identifier-here !}

If no identifier is provided, it will use the current page URL as the identifier for all comments made on that page.

To configure moderation options, visit Tools > Comments > Settings in Elefant.

Blog comments

You can also use this app as the comment mechanism for the blog app, simply set the comments setting in the blog app configuration as follows:

comments = comments/embed

Custom email notifications

You can implement notifications or any other action when a comment is posted by creating a custom handler and adding it to the [Hooks] section of the global conf/config.php file like this:

comments/add[] = myapp/hook/comments

The above line references a handler in the file apps/myapp/handlers/hook/comments.php, which receives a $data array with the following properties:

  • id - The comment's unique ID
  • identifier - The comment identifier from the embed code
  • user - The ID of the user who made the comment
  • name - The name of the user who made the comment
  • status - 1 means published, 0 means awaiting moderation
  • ts - The comment date/time in YYYY-MM-DD HH:MM:SS format
  • date - The comment date/time in YYYY-MM-DDTHH:MM:SSZ format
  • comment - The comment itself

For more information on writing hooks, see here.

comments's People

Contributors

electrolinux avatar evan70 avatar jbroadway avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.