<?php
#
# file: JZOsig.php
# author: AnimAlf
#
# This lines are under the GNU General Public License.
# http://www.gnu.org/copyleft/gpl.html
#
# cph.keldenauto.com
#
header( "Content-type: image/PNG" );
function RealIPget() {
if ( $_SERVER[ 'HTTP_X_FORWARDED_FOR' ] != '' ) {
$client_ip =
( !empty( $_SERVER['REMOTE_ADDR' ]) ) ?
$_SERVER[ 'REMOTE_ADDR' ]
:
( ( !empty($_ENV[ 'REMOTE_ADDR' ]) ) ?
$_ENV[ 'REMOTE_ADDR' ]
:
"unknown" );
// los proxys van añadiendo al final de esta cabecera
// las direcciones ip que van "ocultando". Para localizar la ip real
// del usuario se comienza a mirar por el principio hasta encontrar
// una dirección ip que no sea del rango privado. En caso de no
// encontrarse ninguna se toma como valor el REMOTE_ADDR
$entries = split( '[, ]' , $_SERVER [ 'HTTP_X_FORWARDED_FOR' ] );
while ( list( , $entry ) = each( $entries ) ) {
if ( preg_match( "/^([0-9]+.[0-9]+.[0-9]+.[0-9]+)/", $entry, $ip_list ) ) {
// http://www.faqs.org/rfcs/rfc1918.html
'/^0./',
'/^127.0.0.1/',
'/^192.168..*/',
'/^172.((1[6-9])|(2[0-9])|(3[0-1]))..*/',
'/^10..*/');
$found_ip = preg_replace ( $private_ip, $client_ip, $ip_list [ 1 ] );
if ( $client_ip != $found_ip )
{
$client_ip = $found_ip;
break;
}
}
}
}
else
{
$client_ip =
( !empty ( $_SERVER [ 'REMOTE_ADDR' ] ) ) ?
$_SERVER [ 'REMOTE_ADDR' ]
:
( ( !empty ( $_ENV [ 'REMOTE_ADDR' ] ) ) ?
$_ENV [ 'REMOTE_ADDR' ]
:
"unknown" );
}
return $client_ip;
}
function DetectOs () {
if(eregi( "linux",$_SERVER [ 'HTTP_USER_AGENT' ])){ $rtnStr = "[GNU/Linux] Saludos a oOOoo TuXeR oOOoo";
} elseif ( eregi ( "win32", $_SERVER [ 'HTTP_USER_AGENT' ] ) || eregi ( "Win 9x 4.90", $_SERVER [ 'HTTP_USER_AGENT' ] ) || eregi ( "windows 2000",$_SERVER ['HTTP_USER_AGENT' ] ) || eregi ( "(windows nt)( ){0,1}(5.0)", $_SERVER [ 'HTTP_USER_AGENT' ] ) || eregi ( "(windows nt)( ){0,1}(5.1)", $_SERVER [ 'HTTP_USER_AGENT' ] ) || eregi ( "(win)([0-9]{2})", $_SERVER [ 'HTTP_USER_AGENT' ], $regs ) || eregi ( "(windows) ([0-9]{2})", $_SERVER [ 'HTTP_USER_AGENT' ], $regs ) || eregi ( "(winnt)([0-9]{1,2}.[0-9]{1,2}){0,1}", $_SERVER [ 'HTTP_USER_AGENT' ], $regs ) || eregi ( "(windows nt)( ){0,1}([0-9]{1,2}.[0-9]{1,2}){0,1}", $_SERVER [ 'HTTP_USER_AGENT' ], $regs ) ) { $rtnStr = "Un Microsoftista por estos lares :))";
} elseif ( eregi ( "mac", $_SERVER [ 'HTTP_USER_AGENT' ] ) ) { $rtnStr = "(¯`·._.·-oOOoo-<[ Macintosh ]>-oOOoo-·._.·´¯)";
} else {
if ( eregi ( "(sunos) ([0-9]{1,2}.[0-9]{1,2}){0,1}",$_SERVER ['HTTP_USER_AGENT'],$regs ) ) { $rtnStr = "SunOS $regs[2]";
} elseif ( eregi ( "(beos) r([0-9]{1,2}.[0-9]{1,2}){0,1}", $_SERVER [ 'HTTP_USER_AGENT' ], $regs ) ) { $rtnStr = "BeOS $regs[2]";
} elseif ( eregi ( "freebsd", $_SERVER [ 'HTTP_USER_AGENT' ] ) ) { $rtnStr = "FreeBSD";
} elseif ( eregi ( "openbsd", $_SERVER [ 'HTTP_USER_AGENT' ] ) ) { $rtnStr = "OpenBSD";
} elseif ( eregi ( "irix", $_SERVER [ 'HTTP_USER_AGENT' ] ) ) { $rtnStr = "IRIX";
} elseif ( eregi ( "os/2", $_SERVER [ 'HTTP_USER_AGENT' ] ) ) { $rtnStr = "OS/2";
} elseif ( eregi ( "plan9", $_SERVER [ 'HTTP_USER_AGENT' ] ) ) { $rtnStr = "Plan9";
} elseif ( eregi ( "unix", $_SERVER [ 'HTTP_USER_AGENT' ] ) || eregi ( "hp-ux", $_SERVER [ 'HTTP_USER_AGENT' ] ) || eregi ( "X11", $_SERVER [ 'HTTP_USER_AGENT' ] ) ) { $rtnStr = "Unix";
} elseif(eregi ( "osf", $_SERVER [ 'HTTP_USER_AGENT' ] ) ) { $rtnStr = "OSF";
} else{$rtnStr = "TuMáquinA";
$rtnStr = "CyberSurfeando con $rtnStr";
}
}
return $rtnStr;
}
$tmpInt = 1;
$tmpInt++;
$linea [ $tmpInt ] = DetectOs ();
$ancho = 0; $alto = 0;
for ( $a=1; $a<=$tmpInt; $a++ ) {
$tmpBox= imagettfbbox ( 13,0, "./files/trebucit.ttf", $linea [ $a ] ); if ( $tmpBox [ 2 ] - $tmpBox [ 0 ] > $ancho )
$ancho = $tmpBox [ 2 ] - $tmpBox [ 0 ];
if ( $tmpBox [ 3 ] - $tmpBox [ 5 ] > $alto )
$alto = $tmpBox [ 3 ] - $tmpBox[ 5 ];
}
$altoTotal = $alto * $tmpInt;
imagecopy ( $im, $im_tmp, $fondo_w - $tux_w - 25, $fondo_h - $tux_h + 30, 0, 0, $tux_w, $tux_h );
imagecopy ( $im, $im_tmp, $fondo_w/2 - $mac_w + 16 , $fondo_h - $mac_h, 0, 0, $mac_w, $mac_h );
imagecopy ( $im, $im_tmp, $fondo_w - $tux_w, $fondo_h - $tux_h, 0, 0, $tux_w, $tux_h );
imagecopy ( $im, $im_tmp, 0, $fondo_h - $tux_h, 0, 0, $tux_w, $tux_h );
$b=0;
for ( $a=1; $a<=$tmpInt; $a++ ) {
$b=!$b;
if ($b) {
imagettftext ( $im, 13, 0, 4, $alto*$a, $fontColor, "./files/trebucit.ttf", $linea [ $a ] ); } else {
imagettftext ( $im, 12, 0, 4, $alto*$a, $fontColor, "./files/trebucit.ttf", $linea [ $a ] ); }
}
imagettftext ( $im, 13, 12, 63, $alto*$a + 24, $fontColor, "./files/trebucit.ttf", RealIPget
() );
//Mostramos el grafico en pantalla
//Liberamos memoria
?>