Plugin / Hikari Enhanced Comments

Hikari

Installation

Installation

Hikari Enhanced Comments requires at least WordPress 2.8 and PHP5 to work.

You can use the built in installer and upgrader, or you can install the plugin manually.

  1. Download the zip file, upload it to your server and extract all its content to your /wp-content/plugins folder. Make sure the plugin has its own folder (for exemple /wp-content/plugins/hikari-enhanced-comments/).
  2. Activate the plugin through the ‘Plugins’ menu in WordPress admin page.
  3. Now you can go to widgets admin page and you’ll find 2 new widgets available: “Hikari Enhanced Recent Comments” and “Hikari Most Commented Posts”

Installing and configuring ip2nation

ip2nation is a website that provides a MySQL database table, listing all world’s IPs and relating them to their respective country, together with each country name and code.

This table is provided in a downloadable .sql file. I don’t add this table together with the plugin because it’s updated from time to time, so it’s better to just get it from the source and install it.

You are not required to have ip2nation installed to use Hikari Enhanced Comments. The plugin uses it just to get country flags. If ip2nation is not available, or if you are not able to install it, all other features from the plugin will still work, only flags won’t be shown (the place where they’d go will be blank, don’t worry with broken code 🙂

First of course you must download the file. You can go to their home page and follow the ‘Download’ menu, or just download it directly: http://ip2nation.com/ip2nation.zip.

Once you have the file, you must upload it to your database. But here’s a cool feature: since its tables so big (somewhat 3MB the uncompressed .sql file, and 1MB after importing to MySQL) and rarely updated, I provided a way to add it to a different database, separated from your WordPress one. Doing so, you’re not forced to back it up together with your website content (after all, it’s not a relevant data worthy backing up, if you lose it you can just download it back from their site), and also if you have multiple sites you can have it stored only once.

If you wanna have ip2nation in the same database as your WordPress install, just use it to import the .sql file. If you wanna use a different database, I suggest creating a new one only for it. The trick is to assign over this new database, full access from your WordPress database’s user (you can find its name in WordPress config.php. If the same user can access more than 1 database, it’s easy for MySQL to provide simultaneous access to all of them. And if your WordPress database user only has access to these 2 databases, and ip2nation table only has this data, you shouldn’t have security issues. To know how to assing user permissions to databases, please call your webhost provider. Don’t install each table in separated database, ip2nation tables can be separated from WordPress but both tables must be in the same database!

As I’ve said, ip2nation database is big, I had trouble uploading it with phpMySQL. I just split the file in 3 and imported them separately, it’s just 2 CREATE TABLE in the begining and then a bunch of endless INSERT INTO. If you have timeout trouble, try splitting it in more files, or again request your webhost assistance.

Once you have your ip2nation database created, configured and populated with its data, and database user has privilege to it, go take a look if data was imported correctly. It creates 2 tables, ‘ip2nation’ with more than 40.000 records, and ‘ip2nationcountries’ with somewhat 250 records.

Now, to finish ip2nation installation, you must go to Hikari Enhanced Comments admin page, and under ‘ip2nation Database‘ option, set ip2nation database name. If you just installed it in WordPress database, leave this option blank. If it has its own database, the full database name must be added here. Pay attention because many shared hostings only let you define part of databases names and hide the part you can’t change, make sure you’re using the full name here.

To help you diagnose ip2nation and see if flags and countries are working, in this same page there is a section just below options where you can see it working. This section uses a testing IP from Brasil to query ip2nation tables, and if it was configured correctly you’ll see its country code as ‘br‘ and country name as ‘Brazil‘, and just below you’ll see Brasil’s flag.

If you see all these info, you are good to go, gratz! If you see Brasil name and code but doesn’t see its flag, assure you have properly extracted the plugin. If it was installed in /wp-content/plugins/hikari-enhanced-comments/, you should have a folder /wp-content/plugins/hikari-enhanced-comments/flags/ and inside it a bunch of files with those flags.

And if you don’t even see Brasil’s name and code in diagnose, then ip2nation is not properly configured. Verify its database again, and then assure WordPress database user can access it. If you have any trouble setting up your tables, or flags are in their place but are not accessible, please again go to your hosting provider ask for assistance.

Adding flags to your theme

You don’t need to tweak your theme to have flags shown in it, Hikari Enhanced Comments adds them automatically to your comments authors. In the plugin admin page you can choose if flag should be added before or after author’s name, where it better fits your theme layout.

But you can also add it manually, if you want a more customized layout. For that, just use the function HkEC_flag($ip), where $ip is the IP whose flag you want. Flag image will be echoed automatically.

If that IP is from a comment author, you just use kEC_flag($comment->comment_author_IP) and you are done.

Upgrading

If you have to upgrade manually, simply delete hikari-enhanced-comments folder and follow installation steps again.

You don’t need to touch ip2nation tables once they are installed, but since they are updated from time to time, you may want to update them to have info about all IPs. In this case, just import the lastest .sql file to your database.

Uninstalling

If you go to plugins list page and deactivate the plugin, it’s config stored in database will remain stored and won’t be deleted.

If you want to fully uninstall the plugin and clean up database, go to its options page and use its uninstall feature. This feature deletes all stored options, restoring them to default (which can also be used if you want defaults restored back), and then gives you direct link to securely deactive the plugin so that no database data remains stored.

Plugin uninstall feature doesn’t delete ip2nation tables, regarding if they are in same database as WordPress or in a separated one. If they are not used anymore, currently you must delete them manually if you don’t need them anymore.

Also, make sure to delete plugin’s widgets before uninstalling the plugin. ATM it’s not deleted upon uninstalling, I’ll fix it in a future version 🙁

Ratings

0
0 reviews

Rating breakdown

Details Information

Version

0.03.05

First Released

19 Mar, 2010

Total Downloads

6,711

Wordpress Version

2.8.0 or higher

Tested up to:

2.9.2

Require PHP Version:

-

Tags

Contributors

Languages

The plugin hasn't been transalated in any language other than English.

DIRECTORY DISCLAIMER

The information provided in this THEME/PLUGIN DIRECTORY is made available for information purposes only, and intended to serve as a resource to enable visitors to select a relevant theme or plugin. wpSocket gives no warranty of any kind, express or implied with regard to the information, including without limitation any warranty that the particular theme or plugin that you select is qualified on your situation.

The information in the individual theme or plugin displayed in the Directory is provided by the owners and contributors themselves. wpSocket gives no warranty as to the accuracy of the information and will not be liable to you for any loss or damage suffered by you as a consequence of your reliance on the information.

Links to respective sites are offered to assist in accessing additional information. The links may be outdated or broken. Connect to outside sites at your own risk. The Theme/Plugin Directory does not endorse the content or accuracy of any listing or external website.

While information is made available, no guarantee is given that the details provided are correct, complete or up-to-date.

wpSocket is not related to the theme or plugin, and also not responsible and expressly disclaims all liability for, damages of any kind, arising out of the use, reference to, or reliance on, any information or business listed throughout our site.

Keep Leading Your Followers!
Share it for them.