GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   How to sort by brorser language?? (https://gfy.com/showthread.php?t=647969)

polle54 08-24-2006 12:33 PM

How to sort by brorser language??
 
Hey can someone remind how you sort traffic by browser langauage

it's not more than a couple of lines of code as far as I recall...

polle54 08-24-2006 12:46 PM

I of course mean Browser Language.

polle54 08-24-2006 02:22 PM

nobody knows how to do this?

JOKER 08-24-2006 02:50 PM

For reliability I'd rather go with system-language or even better GeoIP...

Anyways, this code should do it.

Code:

<s c r i p t>
targetLanguage = "COUNTRY-CODE HERE";
targetURL = "http://URL.HERE";
bLang = navigator.Language ? navigator.Language : navigator.userLanguage;
if (bLang.indexOf(targetLanguage) >= 0) window.location.href=targetURL;
</s c r i p t>

Take the spaces out of the s c r i p t tags of course and enter CountryCode and URL

polle54 08-24-2006 03:07 PM

Quote:

Originally Posted by JOKER | JOKEREMPIRE Inc.
For reliability I'd rather go with system-language or even better GeoIP...

Anyways, this code should do it.

Code:

<s c r i p t>
targetLanguage = "COUNTRY-CODE HERE";
targetURL = "http://URL.HERE";
bLang = navigator.Language ? navigator.Language : navigator.userLanguage;
if (bLang.indexOf(targetLanguage) >= 0) window.location.href=targetURL;
</s c r i p t>

Take the spaces out of the s c r i p t tags of course and enter CountryCode and URL

thanks man

can it be made so I can exexute a special line of for a specific country, not redirect to a new site just maybe print a line of html text

JOKER 08-24-2006 03:14 PM

Yes, just replace
Code:

window.location.href=targetURL
with whatever code you want to use if the country is XY

polle54 08-24-2006 03:19 PM

Quote:

Originally Posted by JOKER | JOKEREMPIRE Inc.
Yes, just replace
Code:

window.location.href=targetURL
with whatever code you want to use if the country is XY

thanks for your help

Let me know if I can do anything for ya in return :thumbsup

JOKER 08-24-2006 03:23 PM

Quote:

Originally Posted by polle54
thanks for your help

Let me know if I can do anything for ya in return :thumbsup

Welcome, I've added you to ICQ and keep you in mind :thumbsup

If you have german-speaking traffic, let me know :pimp

polle54 08-24-2006 04:13 PM

Quote:

Originally Posted by JOKER | JOKEREMPIRE Inc.
Welcome, I've added you to ICQ and keep you in mind :thumbsup

If you have german-speaking traffic, let me know :pimp


I have really much german traffic!!

E$_manager 08-24-2006 05:17 PM

That was really a hard question about brorser language :( :)


All times are GMT -7. The time now is 10:39 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123