markguinn/silverstripe-fb-comments

Really simple FB comments for Silverstripe.

Installs: 150

Dependents: 0

Suggesters: 0

Security: 0

Stars: 5

Watchers: 2

Forks: 1

Open Issues: 1

Type:silverstripe-module

dev-master 2016-02-18 09:53 UTC

This package is not auto-updated.

Last update: 2024-11-06 13:10:40 UTC


README

A really simple module for adding Facebook comments to a silverstripe site. There are probably better ones out there, but this is meant to get you up and running in 5 minutes or so.

INSTALLATION:

  1. Create an app in the fb developers area.
  2. Either 'composer require markguinn/silverstripe-fb-comments' or download from github into an 'fb-comments' folder in your site root.
  3. Either install 'tractorcow/silverstripe-opengraph' module (recommended) or add an 'OGApplicationID' method to SiteConfig with your fb application ID. If you do the former, you'll need/want to add $OGNS to your html tag and probably set OpenGraphObjectExtension::$default_image in _config.php.
  4. Add 'FBCommentsExtension' to BlogEntry or Page (or whichever classes you want comments available). Probably something like:
BlogEntry::add_extension('FBComments');
  1. Add the following just after the opening body tag IF you're not already including the FB API for something else (like buttons, etc):
<% include OptionalFBAPI %>
  1. Add the following where you want comments to show up:
<% include FBComments %>

CONFIG OPTIONS:

The following configuration options are available on FBComments:

  • num_posts - The number of comments to show initially. Default is 3.
  • comment_width - The width of the comment area. Default is 600
  • color_scheme - See FB documentation for details. Default is light.
  • notify - list of email addresses to notify if there's a comment
  • notify_from - address from which the notification should come
  • notify_subject - subject of the notification email

By default, there is no notification when a new comment is posted, but if you set a list of addresses, the plugin will send an email to those people.

SAMPLE CONFIG FILE

---
name: 'fbcomments'
---
BlogEntry:
  extensions:
    0: 'FBComments'
FBComments:
  num_posts: 10
  comment_width: 600
  color_scheme: light
  notify:
    0: 'mark@adaircreative.com'
  notify_from: 'noreply@yoursite.com'
  notify_subject: 'New comment on yoursite.com'
---

DEVELOPERS:

LICENSE (MIT):

Copyright (c) 2013 Mark Guinn

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.