Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 12-31-2005, 11:38 PM
akanevsky akanevsky is offline
 
Join Date: Apr 2005
Posts: 3,972
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default PHP - Identify User's Continent?

How can you identify user's continent via PHP? (ex: http://www.talkloud.net/forums/vbsta...&action=region)
Or maybe there is a country=>continent mapping database? Thanks.
Reply With Quote
  #2  
Old 12-31-2005, 11:46 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Simple answer - you can't.

You could try a reverse dns lookup on their ip and see if it's a country based url (like xxxx.co.uk) - but if it's .net or .com you're out of luck.

You could also see if you can extract any language information from their browser user-agent, or possibly a bit of JS to check their pc locale - but there is no foolproof method.
Reply With Quote
  #3  
Old 12-31-2005, 11:50 PM
akanevsky akanevsky is offline
 
Join Date: Apr 2005
Posts: 3,972
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There is no "you can't" in this world. Every question has an answer.

As for this, simple and honest answer is "I don't know."

Now, there are databases which have the info.
My question is: Where can I get such database (for free)? Even if it's not PHP?
Reply With Quote
  #4  
Old 12-31-2005, 11:54 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Even they are not perfect - they normally rely on ip to location lookups, but even that is not 100% accurate (even assuming you can get the users real ip). I'm afraid I don't know where you could get such a database.
Reply With Quote
  #5  
Old 12-31-2005, 11:56 PM
akanevsky akanevsky is offline
 
Join Date: Apr 2005
Posts: 3,972
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is just for statistics, it does not need to be accurate. I making a stats hack, whose features are to be a rip off of Bane's vbstats hack which will apparently never be released... So I just want to know any method to replicate that.

EDIT:
I think I just found a nice database. I'll need to adjust its syntax to fit my needs... and I don't even think I'ma do it by hands. I'ma make me a nice lil php script that will do all the dirty work of syntax conversion for me
Reply With Quote
  #6  
Old 01-01-2006, 12:11 AM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Most stats hacks use the reverse dns lookup method - and assume .net and .com to be the USA. If you 've found a usable database then that would probably be better.
Reply With Quote
  #7  
Old 01-01-2006, 12:22 AM
akanevsky akanevsky is offline
 
Join Date: Apr 2005
Posts: 3,972
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Last time I checked, regular site visitors don't have a domain name associated with them Happy new year btw!
Reply With Quote
  #8  
Old 01-01-2006, 12:55 AM
soulfly soulfly is offline
 
Join Date: Dec 2005
Location: Germany
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ment you in postbit? or for every action the user does
Reply With Quote
  #9  
Old 01-01-2006, 03:39 AM
baronvonwalz baronvonwalz is offline
 
Join Date: Apr 2005
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well IP address blocks are reserved by various companies, which vary from area to area.

I suppose you could create a database in which it would analyze their ip and match it to a list of known IP address blocks, which would compare it to a list of blocks by country.
Reply With Quote
  #10  
Old 01-01-2006, 05:30 AM
soulfly soulfly is offline
 
Join Date: Dec 2005
Location: Germany
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Psionic Vision, if you need an ip->country db let me know i have one *bg*, there are which includes the shortname of country and longname, but no continent info, you could add id by yourself, if needed->post here.

best regards, soulfly
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:02 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.09120 seconds
  • Memory Usage 2,235KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete