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

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!
Scam Warning
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
</Solidjeuh>
Registered User
Posts: 1788
Joined: Tue Mar 29, 2016 3:45 am
Location: Aalst (Belgium)
Name: Andy Dm
Contact:

Re: [RC] Filter by country - version 1.0.4

Post by </Solidjeuh> »

Yeah sorry, I needed to change that in your "new' code :D
Now I see the images, and

Code: Select all

be.png
cn.png
de.png
fr.png
hn.png
ie.png
nl.png
ua.png
ru.png
cz.png
gb.png
us.png
User avatar
MarkDHamill
Registered User
Posts: 4299
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [RC] Filter by country - version 1.0.4

Post by MarkDHamill »

Thank goodness. So there is something about the way PHP is parsing interactively that's the root of the issue. Thanks for your help in debugging.

Remove the echo line. I'll make the changes to my version of the source code.
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
</Solidjeuh>
Registered User
Posts: 1788
Joined: Tue Mar 29, 2016 3:45 am
Location: Aalst (Belgium)
Name: Andy Dm
Contact:

Re: [RC] Filter by country - version 1.0.4

Post by </Solidjeuh> »

Everything okay now. Thank you for the help and time :lol:
User avatar
janus_zonstraal
Registered User
Posts: 4904
Joined: Sat Aug 30, 2014 1:30 pm

Re: [RC] Filter by country - version 1.0.4

Post by janus_zonstraal »

Hi Mark,

I think there is a problem with one country but I can't find which one.
There is a country missing on the top
Image

When I do the echo line you mention before I get this output:

Code: Select all

.png
fr.png
de.png
nl.png
Is there a way to find that country, maybe in the database?
Sorry! My English is bat ;) !!!
User avatar
MarkDHamill
Registered User
Posts: 4299
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [RC] Filter by country - version 1.0.4

Post by MarkDHamill »

I thought that was "Unknown" but I think the country code stored in a table is blank. The table is phpbb_fbc_stats. If you know SQL could you please use phpMyAdmin or a similar tool to look in the table and see if there are any rows with a blank country_code? The column is not allowed to be blank. It should be varchar(2) not null. But it could be that one or two space represent the country code.

If there are any with ?? this means the country code was not found, but it would show on the report as "VPN (unknown)".

Have you been using the extension a long time? It's possible an early version allowed blank country codes to be stored.
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
janus_zonstraal
Registered User
Posts: 4904
Joined: Sat Aug 30, 2014 1:30 pm

Re: [RC] Filter by country - version 1.0.4

Post by janus_zonstraal »

No I use your extension since yesterday. version 1.0.4rc
There are "blank" country_code rows.

And the are varchar(2)
Sorry! My English is bat ;) !!!
User avatar
MarkDHamill
Registered User
Posts: 4299
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [RC] Filter by country - version 1.0.4

Post by MarkDHamill »

Thank you for your testing.

It's unclear to me why this is happening. If the IP is not found in the MaxMind database, the country_code should be stored as ??. Perhaps the MaxMind database is returning a null string. That's the only flaw in my logic that I can see, but the MaxMind program should return a PHP exception. So I'll add after line 175 in /event/main_listener.php the following code:

Code: Select all

			if (trim($country_code) == '')
			{
				$country_code = '??';
			}
You might want to remove the blank rows and add the following code. If so I'll be interested in knowing if it recurs.
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
janus_zonstraal
Registered User
Posts: 4904
Joined: Sat Aug 30, 2014 1:30 pm

Re: [RC] Filter by country - version 1.0.4

Post by janus_zonstraal »

Hi Mark,
It looks that it is working, no more blank rows any-more, but only 1 or 2 unknown (vpn) today and yesterday more than 50 blanks??
Sorry! My English is bat ;) !!!
User avatar
MarkDHamill
Registered User
Posts: 4299
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [RC] Filter by country - version 1.0.4

Post by MarkDHamill »

I appreciate your testing. You are the first to uncover this bug. I'm pretty sure it's triggered by the MaxMind database.
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
janus_zonstraal
Registered User
Posts: 4904
Joined: Sat Aug 30, 2014 1:30 pm

Re: [RC] Filter by country - version 1.0.4

Post by janus_zonstraal »

6 hours later

Code: Select all

VPN (onbekend)	91
And no blanks, so everything is Ok. :D
Sorry! My English is bat ;) !!!
John Leeuwis
Registered User
Posts: 20
Joined: Mon Sep 28, 2009 3:08 pm
Location: Netherlands
Name: John Leeuwis
Contact:

Re: [RC] Filter by country - version 1.0.4

Post by John Leeuwis »

Hello Mark,

Are all the changes implemented in the current download?
User avatar
</Solidjeuh>
Registered User
Posts: 1788
Joined: Tue Mar 29, 2016 3:45 am
Location: Aalst (Belgium)
Name: Andy Dm
Contact:

Re: [RC] Filter by country - version 1.0.4

Post by </Solidjeuh> »

John Leeuwis wrote:
Wed Jul 31, 2019 9:56 am
Are all the changes implemented in the current download?
Not yet.

===

I updated the NL language. janus_zonstraal found a mistake :D

https://github.com/Solidjeuh/filterbycountry
User avatar
MarkDHamill
Registered User
Posts: 4299
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [RC] Filter by country - version 1.0.4

Post by MarkDHamill »

I have updated the Master on GitHub with the minor bug fixes and the latest Dutch language translations. I don't count this as a new release.

https://github.com/MarkDHamill/filterbycountry

You can see a list of file changes since 1.0.4-rc here:

https://github.com/MarkDHamill/filterby ... 58e13af407

The 1.0.4-rc branch of course is unchanged for historical reasons.

Thanks to all contributing to the testing and internationalization of the extension.
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
</Solidjeuh>
Registered User
Posts: 1788
Joined: Tue Mar 29, 2016 3:45 am
Location: Aalst (Belgium)
Name: Andy Dm
Contact:

Re: [RC] Filter by country - version 1.0.4

Post by </Solidjeuh> »

Strange, now I have a ghost country. Updated to latest version. :lol:

Image
User avatar
MarkDHamill
Registered User
Posts: 4299
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [RC] Filter by country - version 1.0.4

Post by MarkDHamill »

That is strange. Does the unknown line show in the report?
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”