[3.3][RC] Filter by country - version 1.0.16

A place for Extension Authors to post and receive feedback on Extensions still in development. No Extensions within this forum should be used within a live environment!
Suggested Hosts
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: Extensions Development rules

IMPORTANT FOR NEEDED EVENTS!!!
If you need an event for your extension please read this for the steps to follow to request the event(s)
User avatar
MarkDHamill
Registered User
Posts: 4268
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [RC] Filter by country - version 1.0.6

Post by MarkDHamill »

That database needs to be updated to change the phpbb_fbc_stats table. The country_code would need to change all ?? to ##. The next version will have a migrator program to do this.

/controller/acp_controller.php will have additional logic that will avoid invoking file_exist() if the unknown country code is selected.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. Kindle and paper versions available.
User avatar
3Di
Former Team Member
Posts: 16032
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: [RC] Filter by country - version 1.0.6

Post by 3Di »

MarkDHamill wrote:
Tue Sep 03, 2019 8:37 pm
The country_code would need to change all ?? to ##.
You could use instead of ## something personalised like wo (World), like I did for my Country flags, and use its image located here

https://github.com/3D-I/IP-Country-Flag ... ags/wo.png
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
Looking for a specific feature or alternative option? We will rock you! 🚀
User avatar
MarkDHamill
Registered User
Posts: 4268
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [RC] Filter by country - version 1.0.6

Post by MarkDHamill »

I like that better. I didn't know there was a World flag. I probably got my flags from your extension. Is this a new addition?
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. Kindle and paper versions available.
User avatar
3Di
Former Team Member
Posts: 16032
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: [RC] Filter by country - version 1.0.6

Post by 3Di »

No, I made it on purpose. The title/alt tag is "unknown IP".

Or ZZ which is located here: https://github.com/3D-I/IP-Country-Flag ... ags/zz.png - Image

ZZ is a iso code not assigned, there are many.
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
Looking for a specific feature or alternative option? We will rock you! 🚀
User avatar
MarkDHamill
Registered User
Posts: 4268
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [RC] Filter by country - version 1.0.6

Post by MarkDHamill »

Thank you for investigating this and providing some solutions.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. Kindle and paper versions available.
User avatar
3Di
Former Team Member
Posts: 16032
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: [RC] Filter by country - version 1.0.6

Post by 3Di »

There are also SVG flags here:
https://github.com/hjnilsson/country-fl ... master/svg

or even better here https://flag-icon-css.lip.is/

Which would be the better choice for 3.2 or greater.

For the user assigned codes see here: https://en.wikipedia.org/wiki/ISO_3166- ... rent_codes
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
Looking for a specific feature or alternative option? We will rock you! 🚀
User avatar
MarkDHamill
Registered User
Posts: 4268
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [RC] Filter by country - version 1.0.6

Post by MarkDHamill »

Working on the new version but notice something peculiar. "Hits" are being recorded in my phpbb_fbc_stats table every thirty minutes (approximately) while my browser page is in a browser tab. I'm in the ACP, and I filter out ACP traffic. I don't have another page open in another tab. This version exists entirely on my local machine, so there is no external traffic. It's not a matter of using a system cron as I don't use one.

I don't think phpBB's cron is triggered by ACP traffic. Any ideas?

I'm using XAMPP on a Mac if that's relevant.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. Kindle and paper versions available.
User avatar
MarkDHamill
Registered User
Posts: 4268
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Version 1.0.7-rc nearing release

Post by MarkDHamill »

I have a 1.0.7 release nearly ready. All it's missing is an updated Dutch language file. When I get that I will finish the release. Right now it's in GitHub on the master branch. You are of course welcome to take it for a spin:

https://github.com/MarkDHamill/filterbycountry

Some new features:
  • Allows VPN addresses only, ignoring requests that are found in the country codes database.
  • Allows known bots to be ignored in the statistics
  • Adds an unknown (world) flag on the reports. Thanks 3Di.
Two bug fixes:
  • Sort by country didn't actually work correctly in descending sequence.
  • Update check now works as composer.json now has a ssl:true setting.
List of changes can be seen here:

https://github.com/MarkDHamill/filterby ... 20b0afb4ad
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. Kindle and paper versions available.
User avatar
</Solidjeuh>
Registered User
Posts: 1788
Joined: Tue Mar 29, 2016 3:45 am
Location: Aalst (Belgium)
Name: Andy Dm
Contact:

Re: Version 1.0.7-rc nearing release

Post by </Solidjeuh> »

MarkDHamill wrote:
Sat Sep 07, 2019 8:13 pm
I have a 1.0.7 release nearly ready. All it's missing is an updated Dutch language file.
Here you go :D
https://github.com/Solidjeuh/filterbycountry
User avatar
MarkDHamill
Registered User
Posts: 4268
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [RC] Filter by country - version 1.0.6

Post by MarkDHamill »

Yowz! So fast! Thanks.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. Kindle and paper versions available.
User avatar
MarkDHamill
Registered User
Posts: 4268
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Filter by country - version 1.0.7 released

Post by MarkDHamill »

Follow links on the first post to download. The new features are discussed a few posts back. Thanks to </Solidjeuh> for the updated Dutch translation and 3Di for providing a flag to use when the country is unknown.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. Kindle and paper versions available.
User avatar
bubbathegimp
Registered User
Posts: 164
Joined: Tue Sep 25, 2018 8:02 pm
Location: Off Plumb
Name: Bubba
Contact:

Re: [RC] Filter by country - version 1.0.7

Post by bubbathegimp »

Just installed 1.07.
On 1.06, I saw that it was letting a country in that I had previously blocked.
I hope this fixes it. :D
Beans: Because just saying we need to socially distance doesn't always work....
User avatar
MarkDHamill
Registered User
Posts: 4268
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [RC] Filter by country - version 1.0.7

Post by MarkDHamill »

The country codes should be retained once set. You can see them in the phpbb_config_text table. Since it's possible a lot of countries will be selected, I had to allow for the possibility that it would use more than 254 characters.

You may need to scroll to see the countries selected. In my browser it highlights the first one selected in the select list, scrolling down as necessary.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. Kindle and paper versions available.
User avatar
bubbathegimp
Registered User
Posts: 164
Joined: Tue Sep 25, 2018 8:02 pm
Location: Off Plumb
Name: Bubba
Contact:

Re: [RC] Filter by country - version 1.0.7

Post by bubbathegimp »

I only have one country blocked. added it when I started getting with spammers trying to sell cheap metal detectors etc...
It is highlighted in the selection menu. when I switched to 1.06, that country started getting in, But nowhere as bad as before...
I've decided to block VPN access except for members already registered..
Hopefully that does the trick :D
Beans: Because just saying we need to socially distance doesn't always work....
User avatar
MarkDHamill
Registered User
Posts: 4268
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [RC] Filter by country - version 1.0.7

Post by MarkDHamill »

I was going to recommend turning on logging to help troubleshoot these issues. But it looks like the logging feature somehow got removed, although the setting remains. When enabled, rejected requests are written to the admin log.

It's easily fixed though if you install the extension again from the GitHub master:

https://github.com/MarkDHamill/filterbycountry

or apply the file changes here:

https://github.com/MarkDHamill/filterby ... 5a3410a3e2
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. Kindle and paper versions available.
Post Reply

Return to “Extensions in Development”