||1 year ago|
|hashover||1 year ago|
|CHANGELOG||1 year ago|
|LICENSE||1 year ago|
|README.md||1 year ago|
|USAGE.md||1 year ago|
|hashover.php||1 year ago|
For submitting bugs and feature requests, please visit our bug tracker.
This version is an enhanced fork of https://github.com/jacobwb/hashover which fixes some of the glitches that the last version of hashover had.
There is ongoing development of a completely new implementation at https://github.com/jacobwb/hashover-next
To install or update hashover on your webserver you need to take the following steps:
- Clone the repo from: https://www.codewolke.net/hashover-legacy/
- Extract the archive and upload all files/folders to your webspace
- Give directories and PHP files permissions "0755" (readable by all, writable by owner, executable by all).
-> It is not recommended that permissions "0777" ever be used. For security reasons, the "hashover/pages" directory should be "given" (chown) to the user that the server is configured to execute PHP scripts as, for example "www-data". And then simply give the "hashover/pages" directory permissions "0755".**
The following actions are required before using HashOver for the first time. Your custom settings will not be overriden when upgrading.
Rename the following files in
Edit the file
hashover/scripts/secrets.php and make the following changes.
- Set a UNIQUE 8 to 32 character value for the
- Set the
$notification_emailvariable to any valid e-mail address.
- Set a UNIQUE value for the
- Set a UNIQUE value for the
Edit the file
hashover/scripts/settings.php to fit your needs.
Once the files have successfully been downloaded, extracted, proper permissions set, and setup, all you need to do is copy the code to one of the two following implementation methods and paste it into your webpage(s):
<?php $mode = 'php'; include('hashover.php'); ?>
<script> tag mentioned above:
In the file
hashover/scripts/php-mode.php a list of variables nearly identical to the ones mentioned above will be found that allow specific input fields to be disabled.
You may set the "count_link" query to display only a comment count linking to a specified page's comments. For example the following code will display "9 Comments (11 counting replies)".
Identify an HTML element as "cmtcount"
<span id="cmtcount"></span> for example, and that element will display a comment count. This is useful in creating comment "widgets" / "buttons" that display the comment count and link to the comment section. The following code displays a link similar to the previous code:
<a href="#comments"><span id="cmtcount"></span> Comments</a>
In the file
hashover/scripts/settings.php settings for things such as language, default name, HTML design template, avatar icons, "Popular Comments", spam checking, default timezone, and more may be adjusted.
Styling the Comments
To change how the comments look, use a Cascading Style Sheet (CSS.) HashOver comes with a default style sheet named "comments.css" under the "hashover" directory.
<link> element be placed in the
<head> element of your website's webpage(s):
<link href="/hashover/comments.css" rel="stylesheet" type="text/css">
Alternatively, the following may be placed at the top of an existing style sheet:
Need more control over how the comments look?
Editing the file
hashover/html-templates/default.html allows you to move around the HTML elements of each comment, meaning you may change where each commenter's avatar icon and name appears, as well as where the date/permalinks, "Reply", "Edit", "Like" and "Top of Thread" links appear.
However, rather than editing the
hashover/html-templates/default.html file, it is recommended you edit a copy of that file, and then merely change the
$template variable in the
hashover/scripts/settings.php file. This way your changes won't be lost when you upgrade HashOver, and you will have a working fallback just in case.
HTML in comments
Users may post comments with a limited number of allowed HTML tags. These tags include
<blockquote>. A user may also include an image in their posts using
The hyperlink tag
<a> is not allowed in comments, instead users can post URLs as-is and they will become links. This is done to help protect users against scams and SPAM, since links can't say something different than where they actually link to, thereby preventing phishing, for example.
Use a canonical URL
A canonical URL uses the canonical link element in the
<head> section of a webpage to prevent the creation of multiple separate comment directories for multiple page URLs that present the same content. For example,
http://example.com/page.html?parameter=1 will have separate comment threads because the URLs are different, even if both URLs return the same content.
<script>var canon_url = (document.querySelector('link[rel="canonical"]') != null) ? '?canon_url=' + encodeURIComponent(document.querySelector('link[rel="canonical"]').getAttribute('href')) : ''; document.write('<script src="/hashover.php' + canon_url + '"><\/script>');</script>
In PHP adding a
$canon_url variable before the include function will trigger the canonical URL behavior:
<?php $mode = 'php'; $canon_url = 'http://example.com/page.html'; include('hashover.php'); ?>
Need more control than a canonical URL offers?
If you need more fine tuned control over URL parsing, particularly what URL queries should be ignored, add unwanted URL queries, one per line, to a file named "ignore_queries.txt" under the "hashover" directory.
Adding a query name without a value will remove the query from comment directory names no matter what its value is. Adding a query name with a value (name=value) will only remove that specific query with that specific value from comment directory names. For example, add "lang" to the "ignore_queries.txt" file and the URLs
http://example.com/page.html?lang=jp will be treated as being the same page and thus display the same comment thread.
Need to block an IP address?
$ip_addrs variable in the
hashover/scripts/settings.php file is set to "yes", user IP addresses will be stored in their respective comment file(s). Those IP addresses can be used to block spamming, abusive, and/or obstructive users from posting and interacting with the comments all together. Simply add them, one per line, to a file named "blocklist.txt" in the "hashover" directory.
In addition to that, if the variable
The value of
$spam_IP_check to "both" will enable spam checking in both modes, for those who make use of both modes.