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

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!
Anti-Spam Guide
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)
bug-i
Registered User
Posts: 133
Joined: Fri Feb 17, 2017 12:45 pm

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

Post by bug-i »

Some of my users report the following sql-error related to Filter by Country. Any ideas how to solve this?
Screenshot_20201105-144210.jpg
User avatar
MarkDHamill
Registered User
Posts: 4347
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

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

Post by MarkDHamill »

I'm guessing you have a busy board because this is triggered by trying to log more than one access for a country for a given second. That's a test case I didn't consider. But this should fix it.

In /ext/phpbbservices/filterbycountry/event/main_listener.php at line 481 find:

Code: Select all

		if (isset($insert_sql_ary) && count($insert_sql_ary) > 0)
		{
after add:

Code: Select all

			$insert_sql_ary = array_unique($insert_sql_ary);
You may need to purge the cache afterward.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. eBook and paper versions available.
User avatar
MarkDHamill
Registered User
Posts: 4347
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Filter by country - version 1.0.17 released

Post by MarkDHamill »

Version 1.0.17 is available. Version 1.0.16 survived an extension team review in August and I finally got around to making a new version. The extension was denied but the issues were quite minor. You can see a list of changes from version 1.0.16 here. See the first post for download links.

Summary of notable changes, with most important first:
  • Fixed an issue with duplicate key inserts when inserting new statistics into the phpbb_fbc_stats table.
  • A list of country codes are now in a constants file. The review team suggested this approach, which also meant substantial changes to the common.php language file. So if you have a language translation, note these changes and update your translation accordingly.
  • The page title (content in the <head> tag) is now correct for the Settings and Stats ACP pages.
  • Certain language variables embedded in Javascript are now properly escaped.
  • services.yml file now correctly passes the phpbb_fbc_stats table name to two services.
I'll wait a week or two to see if you report any issues, and if not resubmit for another review.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. eBook and paper versions available.
User avatar
stone23
Registered User
Posts: 50
Joined: Sat Nov 02, 2019 4:44 pm
Location: France
Contact:

Re: [3.3][RC] Filter by country - version 1.0.17

Post by stone23 »

I do not understand, I get an error with the French language file :
Parse error: syntax error, unexpected ''ACP_FBC_COUNTRY_A_Z'' (T_CONSTANT_ENCAPSED_STRING), expecting ')' in C:\Wamp.NET\sites\encreuse.local\forum\ext\phpbbservices\filterbycountry\language\fr\common.php on line 303
while the english file which has the same code is working :

Code: Select all

	'ACP_FBC_COUNTRY_A_Z'		=> 'Pays, A-Z',
in french

Code: Select all

	'ACP_FBC_COUNTRY_A_Z'				=> 'Country, A-Z',
in english...
This is on my test forum.

On the online forum I have an error 500
User avatar
Mike-on-Tour
Registered User
Posts: 160
Joined: Wed Jan 15, 2020 3:51 pm
Location: Germany
Name: Michael
Contact:

Re: [3.3][RC] Filter by country - version 1.0.17

Post by Mike-on-Tour »

Is this the content of line 303 in your French language file? If it is line 304 please check the line above, perhaps there is a comma missing at the end of the line because the software is expecting a closing ")" parenthis.
Watz fo lunch?
If you like my extensions and maybe want to buy me lunch: Image
User avatar
stone23
Registered User
Posts: 50
Joined: Sat Nov 02, 2019 4:44 pm
Location: France
Contact:

Re: [3.3][RC] Filter by country - version 1.0.17

Post by stone23 »

Well done, Mike, the comma in the line above was missing.
Everything works well.
Midway
Registered User
Posts: 60
Joined: Tue Dec 09, 2014 8:02 pm

Re: [3.3][RC] Filter by country - version 1.0.17

Post by Midway »

Hello,

Is it possible to have a box where I can put a redirection link of all the countries because I have in the acp tab maintenance 6 pages of countries not allowed
User avatar
MarkDHamill
Registered User
Posts: 4347
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [3.3][RC] Filter by country - version 1.0.17

Post by MarkDHamill »

So you want a feature if the traffic is blocked to send to another page?

Since you have so many blocked countries, it might be easier/better to allow in only certain countries.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. eBook and paper versions available.
Midway
Registered User
Posts: 60
Joined: Tue Dec 09, 2014 8:02 pm

Re: [3.3][RC] Filter by country - version 1.0.17

Post by Midway »

So you want a feature if the traffic is blocked to send to another page?
yes
So you want a feature if the traffic is blocked to send to another page?
OK, but how to do it?
I block the Germany the Netherlands and other also I have this
Filter by country: Anonymous was denied board access from IP(s) 127.0.0.1 because access from country/countries “Unknown“ is not allowed.
and I thinks it's the same guy with an VPN
User avatar
MarkDHamill
Registered User
Posts: 4347
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [3.3][RC] Filter by country - version 1.0.17

Post by MarkDHamill »

IP 127.0.0.1 is localhost and I added it so I could test on my local machine successfully. It may be that some sort of VPN is injecting this IP into one or more HTTP headers, in which case I need an option to allow or deny access to it.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. eBook and paper versions available.
User avatar
MarkDHamill
Registered User
Posts: 4347
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

[3.3][RC] Filter by country - version 1.0.18 released

Post by MarkDHamill »

This version incorporates the suggestion that administrator should be able to redirect blocked requests to a static page. There is an interface in the ACP settings page for the extension for specifying this URL. Note that if you allow board logins from blocked countries, this redirect will not occur. That's because there would be no way to login from a blocked country otherwise.

I also removed some code that made exceptions for IP 127.0.0.1 (localhost). This facilitated my development and testing but I found a workaround.

A full list of changes since version 1.0.17 can be seen here.

See the first post for details on downloading.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. eBook and paper versions available.
Midway
Registered User
Posts: 60
Joined: Tue Dec 09, 2014 8:02 pm

Re: [3.3][RC] Filter by country - version 1.0.18

Post by Midway »

Hello I've just tested this new version and it's perfect for me, it's exactly what I wanted.

Bravo for the work you did and thank you. ;)
User avatar
MarkDHamill
Registered User
Posts: 4347
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [3.3][RC] Filter by country - version 1.0.18

Post by MarkDHamill »

Fortunately, the requested functionality was easy to do. I'm wanting to get this into the approval queue, so I had a good reason to be hasty.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. eBook and paper versions available.
User avatar
stone23
Registered User
Posts: 50
Joined: Sat Nov 02, 2019 4:44 pm
Location: France
Contact:

Re: [3.3][RC] Filter by country - version 1.0.18

Post by stone23 »

Hello,
I noticed duplicate country codes in constants/constants.php:

Code: Select all

const FBC_COUNTRY_CODES = ['AF', 'AX', 'AF', 'AX',...
User avatar
MarkDHamill
Registered User
Posts: 4347
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [3.3][RC] Filter by country - version 1.0.18

Post by MarkDHamill »

Thanks! Yes, the first two items in this array can be removed. Their presence though should not cause an error.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. eBook and paper versions available.
Post Reply

Return to “Extensions in Development”