Mod description: adds small flags to the post details of each post (see screenshot below). These small flags are based on the IP of the poster.
Phpbb version: 3.0.11/12
Mod version: 1.0.0
Comments: this existed for phpbb2 but after searching for a while, I realized that the attempts for this modification were all abandoned nowadays. Maybe there exists a working mod but I did not find it. Anyway, this is my version.
Before installing: Install this in production on your own risk!
Files changes In case of problems, I keep the manual file changes below Note: files of Ver 0.11.
Downloads:
This Mod has been packed for phpBB 3.0.14
Download: phpBB country IP flags in posts (by zac2613, I did not check this version personally)
3.0.11/12 phpBB Country flags in posts based on ip Ver 1.0.0 (by zac2613, I did not check this version personally)
3.0.11/12 phpBB Country flags in posts based on ip Ver 0.11
FAQ / Known issues
1. SEO-mod compatibility
I presume there will be a problem if you're using a SEO-mod but post here if you do and I can help you solved the problem.
Old instructions (now available in the download package)
Additions to update 1.0.01. Upload these files
Click here to download them.
the /flags/ directory --> /images/flags/
the /geolitedb/ directory in /geolitedb/
Note that the geoIP.dat file is the September 2013 database file from http://dev.maxmind.com/geoip/legacy/geolite/ . Maxmind updates it every month around the 6th. You can simply overwrite the file with a newer version.
2. Make the following changes in viewtopic.php
FIND
AFTER, ADDCode: Select all
include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
FINDCode: Select all
//needed for Goz geoiplite db mod include($phpbb_root_path . 'geolitedb/geoip.inc');
AFTER, ADDCode: Select all
// Posts are stored in the $rowset array while $attach_list, $user_cache // and the global bbcode_bitfield are built while ($row = $db->sql_fetchrow($result)) {
FINDCode: Select all
//Goz geoiplite db mod $correctlink = "".substr($_SERVER['SCRIPT_FILENAME'], 0, -13)."geolitedb/GeoIP.dat"; $gi = geoip_open("$correctlink",GEOIP_STANDARD); $user_country_code = geoip_country_code_by_addr($gi, $row['poster_ip']); $user_country_name = geoip_country_name_by_addr($gi, $row['poster_ip']); geoip_close($gi); $user_country_flag = "<img src='" . $phpbb_root_path . "images/flags/" . strtolower($user_country_code) .".png' alt='$user_country_name' title='$user_country_name'>";
AFTER, ADDCode: Select all
'post_edit_locked' => $row['post_edit_locked'],
FINDCode: Select all
//Goz geoiplite db mod 'country_flag' => $user_country_flag,
AFTER, ADDCode: Select all
'POSTER_ID' => $poster_id,
IF YOU WANT EVERYONE TO SEE THE FLAGSIF YOU ONLY WANT MODERATORS OR ADMINS TO SEE THE FLAGSCode: Select all
//Goz geoiplite db mod 'USER_COUNTRY_FLAG' => $row['country_flag'],
3. Make the following changes in styles/prosilver/template/viewtopic_body.htmlCode: Select all
//Goz geoiplite db mod 'USER_COUNTRY_FLAG' => (($auth->acl_get('a_') || $auth->acl_get('m_')) && $user->data['is_registered']) ? $row['country_flag'] : '',
Find:Inline find:Code: Select all
<p class="author"><!-- IF S_IS_BOT -->{postrow.MINI_POST_IMG}<!-- ELSE --><a href="{postrow.U_MINI_POST}">{postrow.MINI_POST_IMG}</a><!-- ENDIF -->{L_POST_BY_AUTHOR} <strong>{postrow.POST_AUTHOR_FULL}</strong> » {postrow.POST_DATE} </p>
Add after:Code: Select all
{postrow.POST_DATE}
[/color]Code: Select all
<!-- IF postrow.USER_COUNTRY_FLAG --> {postrow.USER_COUNTRY_FLAG}<!-- ENDIF -->
[Added] Mod enable/disable now controlled via Board configuration/Board features.
[Added] Enable/disable Switch for view by everyone or Admin/Mods only.
[Added] Enable/disable Posted by.
[Added] SubSilver2 style edits.
[Fix] W3C validation on Image code.
Downloads:
3.0.11/12 phpBB Country flags in posts based on ip Ver 1.0.0 (by zac2613, I did not check this version personally)
3.0.11/12 phpBB Country flags in posts based on ip Ver 0.11
Update: 14th July 2014