[ABD] IP Country Flags

Any abandoned Extensions will be moved to this forum.

WARNING: Extensions in this forum are not currently being supported or maintained by the original Extension author. Proceed at your own risk.
Forum rules
IMPORTANT: Extension Development Forum rules

WARNING: Extensions in this forum are not currently being supported nor updated by the original Extension author. Proceed at your own risk.
User avatar
3Di
I've Been Banned!
Posts: 17538
Joined: Mon Apr 04, 2005 11:09 pm
Location: I'm with Ukraine 🇺🇦
Name: Marco
Contact:

[ABD] IP Country Flags

Post by 3Di »

Author: 3Di
Extension Name: IP Country Flags
Author notes:
A MOD of mine for phpBB2, Categories Hierarchy MOD and phpBB3 (Olympus). recoding it for 3.1/3.2.
Currently only the mini-profile in viewtopic and the Online users have been taken into consideration as a proof of concept. Default IP Country Avatars for those users who posted and don't have one already.

Thanks to Puchahawa (Randy) and Rogerio24 for the intensive live tests done with bleeding betas' code.

Extension Description:
That will be a sort of Country Flags invasion. Images and Avatars are shipped with the package.

Requirements:
  • phpBB >= 3.1.10 OR phpBB >= 3.2.0
  • PHP 5.3.3 or higher
  • cURL
Extension Version: [BETA] 1.0.0-b3
Extension Download: ABD
Last edited by 3Di on Wed Jul 04, 2018 1:00 pm, edited 33 times in total.
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Buy me a coffee -> Image
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
User avatar
3Di
I've Been Banned!
Posts: 17538
Joined: Mon Apr 04, 2005 11:09 pm
Location: I'm with Ukraine 🇺🇦
Name: Marco
Contact:

Re: [DEV] IP Country Flags

Post by 3Di »

Ok, new version BETA installed on my Board.

The incoming BETA version uses

Code: Select all

	/**
	 * http://freegeoip.net
	 *
	 * You're allowed up to 10,000 queries per hour by default.
	 * Once this limit is reached, all of your requests will result in
	 * HTTP 403, forbidden, until your quota is cleared.
	 */
-------------------------------------------------------------------------------------------------------------------------------
Old Topic starter for the sake of the discussion:
It is basically an RFC (Request For Comments).

I managed to re-code one of my Best Seller MOD (my first love in coding for phpBB - served phpBB2, phpBB3 and Categories Hierarchy MOD too) as an extension for phpBB 3.1/3.2.

This time I am not using loads of queries against the DB, instead this one uses a json response against an already web served GeoLocation API: http://ip-api.com/#

This free for non commercial uses API works against up to 150 different requests per minute, once this limit has been reached your server IP will be banned (can be easily un-banned though, going to PRO instead gives you an unlimited power and many more).

A part of this details, I started coding it to work for the Online List and View Topic things, based on the session IP of users, if users are not online nothing happens. :)

I think I will keep this as minimalistic as possible for the first release, until validated.

Calling voters, should I spend my spare time on this again or not?

Thanks. :)
Last edited by 3Di on Wed Jan 18, 2017 4:06 am, edited 2 times in total.
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Buy me a coffee -> Image
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
User avatar
david63
Registered User
Posts: 20646
Joined: Thu Dec 19, 2002 8:08 am

Re: [DEV] IP Country Flags

Post by david63 »

I am not sure that using GeoLocation is necessarily the best place to get this information from. I use that site for my Cookie Policy extension and it has quite a lot of "outages" - it does not matter as I bypass it when it happens, but for this type of extension it could be a problem.

Also the 150 lookups a minute is "moveable" - it used to be 250
David
Remember: You only know what you know and - you don't know what you don't know!

I now no longer support any of my extensions but they will start to become available here
User avatar
martin123456
I've Been Banned!
Posts: 726
Joined: Sat Mar 05, 2011 7:44 pm

Re: [DEV] IP Country Flags

Post by martin123456 »

Geoip maybe ?

Code: Select all

<!-- IF S_CODE_UNTIDY and S_MESS_ON_INDEX Good If_Not_TIDY_Then_SUBMIT -->
User avatar
3Di
I've Been Banned!
Posts: 17538
Joined: Mon Apr 04, 2005 11:09 pm
Location: I'm with Ukraine 🇺🇦
Name: Marco
Contact:

Re: [DEV] IP Country Flags

Post by 3Di »

Interesting, mmm.. any kind of Json response will do, it doesn't matter to me.

I will do a deeper search then about these out there, in the meanwhile the main question is to know if I should go ahead and release this one, improving it .. or not.
Depends on how many "+1" and maybe feature requests I will get.

Thx. :)
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Buy me a coffee -> Image
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
User avatar
david63
Registered User
Posts: 20646
Joined: Thu Dec 19, 2002 8:08 am

Re: [DEV] IP Country Flags

Post by david63 »

If you do ahead with this then I would suggest that you use as much caching as possible as IP countries do not change very much and it will possibly save multiple lookups
David
Remember: You only know what you know and - you don't know what you don't know!

I now no longer support any of my extensions but they will start to become available here
BF79
Registered User
Posts: 499
Joined: Fri Feb 13, 2015 1:28 pm
Name: Fouad B

Re: [DEV] IP Country Flags

Post by BF79 »

good ext !!! but cloudflare gives to my members another ip !! so will not help me much !! :(
User avatar
3Di
I've Been Banned!
Posts: 17538
Joined: Mon Apr 04, 2005 11:09 pm
Location: I'm with Ukraine 🇺🇦
Name: Marco
Contact:

Re: [DEV] IP Country Flags

Post by 3Di »

david63 wrote:I am not sure that using GeoLocation is necessarily the best place to get this information from. I use that site for my Cookie Policy extension and it has quite a lot of "outages" - it does not matter as I bypass it when it happens, but for this type of extension it could be a problem.

Also the 150 lookups a minute is "moveable" - it used to be 250
Re reading this, I checked your extension and I saw you are using also cUrl, interesting.. what's the benefit?
I am actually using "file get contents" against the jSon response, atm.. only.

I do have a suggestion about you ext, but I am a little bit of tired right now and I need a rest, tomorrow I will expand it. What about the 250 lookups? Care to expand? Thx.

It is also interesting the PHP thinghy "geoip_country_code_by_name", I am still trying to realise how to use it though. :) It relies on the maxmind site services (well known) as far as I understood after a quick read, today.
david63 wrote:If you do ahead with this then I would suggest that you use as much caching as possible as IP countries do not change very much and it will possibly save multiple lookups
Yup. I have already coded a lot on this ext today and I am using the cache wherever I can, good point.
BF79 wrote:good ext !!! but cloudflare gives to my members another ip !! so will not help me much !! :(
What does exactly do that crap? Gives a static IP, always the same, for every user or what?
If I have more infos I could try to cook something. :)

Regards.

Ah, forgot. I created a repo on github for this. If somebody wants to post feature requests here we go:
https://github.com/3D-I/IP-Country-Flags/issues

For those they know this MOD and used it.. and for the new ones. ;)

Regards.
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Buy me a coffee -> Image
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
BF79
Registered User
Posts: 499
Joined: Fri Feb 13, 2015 1:28 pm
Name: Fouad B

Re: [DEV] IP Country Flags

Post by BF79 »

3Di wrote: What does exactly do that crap? Gives a static IP, always the same, for every user or what?
If I have more infos I could try to cook something. :)
not exactly static ip but I noticed 3 or 4 ip range for all members and from usa
User avatar
3Di
I've Been Banned!
Posts: 17538
Joined: Mon Apr 04, 2005 11:09 pm
Location: I'm with Ukraine 🇺🇦
Name: Marco
Contact:

Re: [DEV] IP Country Flags

Post by 3Di »

BF79 wrote:
3Di wrote: What does exactly do that crap? Gives a static IP, always the same, for every user or what?
If I have more infos I could try to cook something. :)
not exactly static ip but I noticed 3 or 4 ip range for all members and from usa
I will investigate, there are options in that Object that could be used on purpose, like Reverse and Proxy.
At the present time, without having more infos in my basket, I am swimming in the dark though. :)
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Buy me a coffee -> Image
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
User avatar
david63
Registered User
Posts: 20646
Joined: Thu Dec 19, 2002 8:08 am

Re: [DEV] IP Country Flags

Post by david63 »

3Di wrote:I saw you are using also cUrl, interesting.. what's the benefit?
I am actually using "file get contents" against the jSon response,
Somewhere I read that Curl was more efficient and less resource hungry than file_get_contents
3Di wrote:hat about the 250 lookups?
When I first created my Cookie extension the limit was 250 lookups per minute and this has now reduced to 150 - all I am saying is that it could move again, which for your extension might become a problem
David
Remember: You only know what you know and - you don't know what you don't know!

I now no longer support any of my extensions but they will start to become available here
User avatar
3Di
I've Been Banned!
Posts: 17538
Joined: Mon Apr 04, 2005 11:09 pm
Location: I'm with Ukraine 🇺🇦
Name: Marco
Contact:

Re: [DEV] IP Country Flags

Post by 3Di »

I see, thanks David. :)

I should probably code some cases for that, not all of the Boards over there are hosted on servers that make it available cUrl to their customers. Not to mention that in some cases also the file_get_contents one could be not fully available. I will for sure use some of your already available code if you do not mind.

About the suggestions to your already validated extension I will send you a PM once I get some spare time after this WE, nothing so relevant.. ;)

I've found also some interesting code into the Rich's National Flags extension..
no need to re-invent the wheel. :)

I guess that once the core IP engine has been coded for good it will be easy to change the source of this response, let's see. In the meantime, as an exercise, it does the trick.

There are a lot of things to study before to be sure what's the best approach this time, open to read/understand all of the further hints and suggestions that could be posted.

Thanks.
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Buy me a coffee -> Image
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
User avatar
3Di
I've Been Banned!
Posts: 17538
Joined: Mon Apr 04, 2005 11:09 pm
Location: I'm with Ukraine 🇺🇦
Name: Marco
Contact:

Re: [DEV] IP Country Flags 1.0.0-dev-0001

Post by 3Di »

First post updated with the download link of the very first version and the GitHub repository.
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Buy me a coffee -> Image
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
User avatar
3Di
I've Been Banned!
Posts: 17538
Joined: Mon Apr 04, 2005 11:09 pm
Location: I'm with Ukraine 🇺🇦
Name: Marco
Contact:

Re: [DEV][3.2/3.1] IP Country Flag 1.0.0.0002

Post by 3Di »

Extension updated, see first post for details.
Changes Log of IPCF 31-32

- v1.0.0-dev-v0002
---------------------------------------------------------------------
* FEATURE: users online Flags
* TASK: code improvement (the only one SQL query has been removed)
* TASK: use of cURL where is possible
* TASK: use of constants
* new functions added
* a working version checker
* avatars Flags' folder moved to the final destination
* style moved to prosilver only
This extension is sessions based, to increase the development speed I do need testers for my live board. Feel free to PM me if interested or just register yourself over there at http://3di.space/32/

Thanks in advance. :)
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Buy me a coffee -> Image
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
User avatar
RMcGirr83
Former Team Member
Posts: 22016
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr

Re: [DEV][3.2/3.1] IP Country Flag 1.0.0.0002

Post by RMcGirr83 »

Uhmmm, your flag shows you are from the US on your test forum when I go there. :?
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Appreciate the extensions/mods/support then buy me a beer Image
Locked

Return to “Abandoned Extensions”