FolioComments Installation and Guides
- PHP 5+.
- MYSQL database with PDO extension.
- Download and expand the zip file to your computer.
- Upload the contents of "foliocomments-master" to the root directory of your domain.
- On your server, create a database, if you already have one, skip this step.
- Edit comments/includes/config.php file and enter your database info in it.
- In your browser go to "YOUR WEBSITE ADDRESS/install/" ie. http://example.com/install/
- This will install the database and you're done with the installation.
- IMPORTANT: At this point you must delete the "install" directory and its contents.
- In your page's html, paste the following wherever you want comments to appear:
In the <head"> section of your web page you must have the following, don't forget to enter the correct page id number:
<link rel="stylesheet" href="comments/trumbowyg/dist/ui/trumbowyg.min.css">
<link type="text/css" rel="stylesheet" href="comments/assets/foliocomments.css">
var pagid = 35;
- To enable responsive view, you must have the following line of code in head section of your page's html:
<meta name="viewport" content="initial-scale=1, width=device-width" />
- Congrats you just completed the installation process!
Sign In As Administrator
- Once you're done with the installation, point your browser to the page you just installed folioComments and it should show up
- IMPORTANT: As soon as the comment box shows up, sign in as the default administrator with the following email and password and change them,
There are number of configuration options available, in config.php file. Each function is briefly explained in this file:
- $c_db_server = 'localhost'; // database server
- $c_db_name = ''; // database name
- $c_db_user = ''; // database username
- $c_db_pass = ''; // database password
Settings For Comments
$website_url = ''; URL of your website (required)
$comments_dir = 'comments'; this is the folder where comment files are located (required)
$website_name = ''; required if any of the options that send email are enabled
$perpage = 5; number of main comments per page, does not account reply comments
$no_new_comments = ; an array of page ids that do not accept new comments but show existing ones. For example ['2','15'] means that pages with ids of 2 & 15 will not accet new comments
$no_voting = ; an array of page ids that you don't want to display comment votes
$allow_anonymous = TRUE; TRUE allows anonymous visitors to post comments (but users can still sign up), FALSE requires login
$approve_everyone = FALSE; TRUE approves all comments automatically for both anonymous and logged in users, FALSE requires moderation
$min_approved_comments = 5; if $approve_everyone=FALSE, this will automatically approve a comment if logged in user has minimum of this many previously approved comments
$require_activation = FALSE; require users to activate account by email during sign up - must configure SMTP email server below
$activation_time_limit = 24*60; (24 hours) activation token will expire after this many minutes, applicable only if $require_activation is TRUE
$enable_password_reset = FALSE; if $allow_anonymous=FALSE, this will enable users to reset their password - must configure SMTP email server below and $website_url above
$email_notify_admin = FALSE; notify admin by email when new comment is posted - must configure SMTP email server below
folioComments uses PHPMailer to send SMTP emails which is included in the package and is already installed and fully functional. The SMTP settings in config.php file are pretty much self explanatory.
For information and documentation refer to PHPMailer's Github Page
If you wish to remove the WYSIWYG editor altogether from your installation and replace it with a texarea box:
- Refer to the installation section in this page and remove Trumbowyg CSS & JS file references from your page.
In "comments/comment-box.php" find following line:
And replace it with:
<div class="comment-textbox" id="comment-textbox-<?php echo $comment_id; ?>" placeholder="<?php echo $comment_placeholder; ?>"></div>
<textarea rows="1" id="comment-textbox-<?php echo $comment_id; ?>" placeholder="<?php echo $comment_placeholder; ?>"></textarea>
In "comments/assets/coments.js" find the following line:
And replace it with:
commentbody = $('#comment-textbox-'+cid).trumbowyg('html'),
commentbody = $('#comment-textbox-'+cid).val(),
- Moderating comments: As mentioned earlier, you may configure settings for variuos options. You can simply delete a comment or approve it, when you're signed in as an administrator. You may also choose to automatically approve signed in user comments if they previously have certain amount of approved comments.
- Pinninig Comments: You can pin a comment and it will display at the top regardless of how comments are sorted. A pinned comment will display all replies under it. Reply comments cannot be pinned. If you pin multiple comments they will all show at the top, sorted by date, so most recent one will show first.
- Banning a user: If you want to ban a user, login as an administrator and simply click on the user's avatar to view user's profile and take action.
For question, please use the comments at folioComments' main page.