open All Channels
seplocked EVE Technology Lab
blankseplocked if EVE-IGB (php check for IGB browser use)
 
This thread is older than 90 days and has been locked due to inactivity.


 
Author Topic

Alaska
Minmatar
T.R.I.A.D
Posted - 2010.01.05 17:47:00 - [1]
 

Hi,

Need some help to check if the IGB is being used. Before, i would put something like this (off the top of my head so excuse it if not correct):

$browser = $HTTP_SERVER_VARS['HTTP_USER_AGENT'];
$ingame = (substr($browser,0,16) = 'EVE-minibrowser/');

Then i'd run an if statement to see if ($ingame) returns true to redirect to an ingame website.

Something tells me EVE-minibrowser no longer returns as it is now moondoggie. If i run my if statement in the IGB to

echo"$browser";

i get Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/3.0.195.27 Safari/532.0 EVE-IGB

out of game i get Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; GTB6.3; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 1.1.4322; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30618)

echo"$ingame"; returns nothing

What should i now be checking for?

Cheers


Catari Taga
Centre Of Attention
Middle of Nowhere
Posted - 2010.01.05 17:50:00 - [2]
 

Originally by: Alaska
i get Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/3.0.195.27 Safari/532.0 EVE-IGB

For example.

Alaska
Minmatar
T.R.I.A.D
Posted - 2010.01.05 18:04:00 - [3]
 

Originally by: Catari Taga
Originally by: Alaska
i get Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/3.0.195.27 Safari/532.0 EVE-IGB

For example.


Yea i guessed it might be that, but am not entirely sure how to check it.

$ingame = (substr($browser,0,16) = 'EVE-IGB'); does nothing

I'm missing something, or having a magic moment Embarassed


Dragonaire
Caldari
Corax.
PURgE Alliance
Posted - 2010.01.05 18:48:00 - [4]
 

<?php
if (strpos($HTTP_SERVER_VARS['HTTP_USER_AGENT'], 'EVE-IGB')) {//My IGB code};
?>

That should detect it for you then you can go from there.

Alaska
Minmatar
T.R.I.A.D
Posted - 2010.01.05 19:25:00 - [5]
 

Excellent, works perfectly.

Thankyou :)

Catari Taga
Centre Of Attention
Middle of Nowhere
Posted - 2010.01.05 23:35:00 - [6]
 

Originally by: Dragonaire
<?php
if (strpos($HTTP_SERVER_VARS['HTTP_USER_AGENT'], 'EVE-IGB')) {//My IGB code};
?>

That should detect it for you then you can go from there.

replace $HTTP_SERVER_VARS with $_SERVER though since it's deprecated since PHP4 and disabled by default in PHP5

Johnathan Roark
Caldari
The Graduates
Morsus Mihi
Posted - 2010.01.06 01:01:00 - [7]
 

Edited by: Johnathan Roark on 06/01/2010 01:02:43
Mine:

if(preg_match('/'.EVE-IGB.'/i', $_SERVER['HTTP_USER_AGENT'])) {
//igb code
}

Catari Taga
Centre Of Attention
Middle of Nowhere
Posted - 2010.01.06 03:49:00 - [8]
 

mine:

function is_igb() {
return isset($_SERVER['HTTP_EVE_TRUSTED']);
}

Mark Galean
Mercurialis Inc.
RAZOR Alliance
Posted - 2010.01.06 15:59:00 - [9]
 

Edited by: Mark Galean on 06/01/2010 16:00:10
Originally by: Catari Taga
mine:

function is_igb() {
return isset($_SERVER['HTTP_EVE_TRUSTED']);
}


Wouldn't this be inaccurate, as it means the client would have to preset the page as trusted ingame?
If I understand the OP, he want to check if it's the IGB being used or not, so the headers can actually be sent out for the trust-request to appear ingame.
If I'm wrong, then I'm sorry about that - it's been ages since I dabbled with the HTTP-headers, so not sure if CCP still sent the trust-request or not.

Catari Taga
Centre Of Attention
Middle of Nowhere
Posted - 2010.01.06 16:20:00 - [10]
 

Originally by: Mark Galean
Edited by: Mark Galean on 06/01/2010 16:00:10
Originally by: Catari Taga
mine:

function is_igb() {
return isset($_SERVER['HTTP_EVE_TRUSTED']);
}


Wouldn't this be inaccurate, as it means the client would have to preset the page as trusted ingame?

The IGB is always sending the HTTP_EVE_TRUSTED header. Note that I'm not checking the value of the header, just the presence.

Originally by: Mark Galean
If I'm wrong, then I'm sorry about that - it's been ages since I dabbled with the HTTP-headers, so not sure if CCP still sent the trust-request or not.

Trust is now invoked via a javscript method, no longer via a header

Mark Galean
Mercurialis Inc.
RAZOR Alliance
Posted - 2010.01.06 17:16:00 - [11]
 

Edited by: Mark Galean on 06/01/2010 17:20:25
Whoops, isset(), aye. I am blind (must be the lack of sleep, or too much work).
Is there any documentation available from CCP on the changes? Ie. what disappeared from the old methods and what is new?

Catari Taga
Centre Of Attention
Middle of Nowhere
Posted - 2010.01.07 23:14:00 - [12]
 

Originally by: Mark Galean
Is there any documentation available from CCP on the changes? Ie. what disappeared from the old methods and what is new?

EVElopedia is fairly complete on this: http://wiki.eveonline.com/wiki/Category:In-game_Browser

Tonto Auri
Vhero' Multipurpose Corp
Posted - 2010.01.21 02:13:00 - [13]
 

<?php
/** Definitions for the site
*
* $Id$
*/

if(preg_match('#\bEVE\-IGB$#i', $_SERVER['HTTP_USER_AGENT']))
{
define('EVE_IGB', true);
}
else
{
define('EVE_IGB', false);
}


Then just use "if (EVE_IGB) then ..."


 

This thread is older than 90 days and has been locked due to inactivity.


 


The new forums are live

Please adjust your bookmarks to https://forums.eveonline.com

These forums are archived and read-only