[3.1][3.2][BETA] IP Country Flags

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)
User avatar
3Di
Registered User
Posts: 12550
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

[3.1][3.2][BETA] IP Country Flags

Post by 3Di » Wed Jun 22, 2016 2:14 am

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: Click!
. Image
. Image
. Image

Installation: Copy the content of the uncompressed package into PHPBB_ROOT/ext/
So the result would be ./ext/threedi/ipcf

Update from previous version:
1) disable - 2) delete data - 3) delete files - 4) upload the new ones - 5) Enable it again.

Changes Log: click here!
Issues/feature requests: https://github.com/3D-I/IP-Country-Flags/issues

If you think this extension it's worth using consider to Image
Last edited by 3Di on Sat Aug 12, 2017 4:48 am, edited 32 times in total.
Want to compensate me for my interest? Donate
Please PM me only to request paid works. Thx.
Extensions, Scripts, MOD porting, Update/Upgrades
My development's activity º PhpStorm's proud user

User avatar
3Di
Registered User
Posts: 12550
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: [DEV] IP Country Flags

Post by 3Di » Wed Jun 22, 2016 2:15 am

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.
Want to compensate me for my interest? Donate
Please PM me only to request paid works. Thx.
Extensions, Scripts, MOD porting, Update/Upgrades
My development's activity º PhpStorm's proud user

User avatar
david63
Jr. Extension Validator
Posts: 14340
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: [DEV] IP Country Flags

Post by david63 » Wed Jun 22, 2016 7:33 am

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!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

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 » Wed Jun 22, 2016 9:35 am

Geoip maybe ?

Code: Select all

<!-- IF S_CODE_UNTIDY and S_MESS_ON_INDEX Good If_Not_TIDY_Then_SUBMIT -->

User avatar
3Di
Registered User
Posts: 12550
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: [DEV] IP Country Flags

Post by 3Di » Wed Jun 22, 2016 11:02 pm

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. :)
Want to compensate me for my interest? Donate
Please PM me only to request paid works. Thx.
Extensions, Scripts, MOD porting, Update/Upgrades
My development's activity º PhpStorm's proud user

User avatar
david63
Jr. Extension Validator
Posts: 14340
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: [DEV] IP Country Flags

Post by david63 » Thu Jun 23, 2016 8:33 am

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!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

BF79
Registered User
Posts: 255
Joined: Fri Feb 13, 2015 1:28 pm

Re: [DEV] IP Country Flags

Post by BF79 » Thu Jun 23, 2016 3:16 pm

good ext !!! but cloudflare gives to my members another ip !! so will not help me much !! :(

User avatar
3Di
Registered User
Posts: 12550
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: [DEV] IP Country Flags

Post by 3Di » Fri Jun 24, 2016 1:50 am

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.
Want to compensate me for my interest? Donate
Please PM me only to request paid works. Thx.
Extensions, Scripts, MOD porting, Update/Upgrades
My development's activity º PhpStorm's proud user

BF79
Registered User
Posts: 255
Joined: Fri Feb 13, 2015 1:28 pm

Re: [DEV] IP Country Flags

Post by BF79 » Fri Jun 24, 2016 1:54 am

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
Registered User
Posts: 12550
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: [DEV] IP Country Flags

Post by 3Di » Fri Jun 24, 2016 1:59 am

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. :)
Want to compensate me for my interest? Donate
Please PM me only to request paid works. Thx.
Extensions, Scripts, MOD porting, Update/Upgrades
My development's activity º PhpStorm's proud user

User avatar
david63
Jr. Extension Validator
Posts: 14340
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: [DEV] IP Country Flags

Post by david63 » Fri Jun 24, 2016 7:38 am

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!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

User avatar
3Di
Registered User
Posts: 12550
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: [DEV] IP Country Flags

Post by 3Di » Sat Jun 25, 2016 1:27 am

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.
Want to compensate me for my interest? Donate
Please PM me only to request paid works. Thx.
Extensions, Scripts, MOD porting, Update/Upgrades
My development's activity º PhpStorm's proud user

User avatar
3Di
Registered User
Posts: 12550
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

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

Post by 3Di » Tue Jun 28, 2016 4:11 am

First post updated with the download link of the very first version and the GitHub repository.
Want to compensate me for my interest? Donate
Please PM me only to request paid works. Thx.
Extensions, Scripts, MOD porting, Update/Upgrades
My development's activity º PhpStorm's proud user

User avatar
3Di
Registered User
Posts: 12550
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

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

Post by 3Di » Wed Jul 06, 2016 1:31 am

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. :)
Want to compensate me for my interest? Donate
Please PM me only to request paid works. Thx.
Extensions, Scripts, MOD porting, Update/Upgrades
My development's activity º PhpStorm's proud user

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 20794
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

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

Post by RMcGirr83 » Wed Jul 06, 2016 1:37 am

Uhmmm, your flag shows you are from the US on your test forum when I go there. :?
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored

Post Reply

Return to “Extensions in Development”

Who is online

Users browsing this forum: alex75, lopoto and 26 guests