country_name)) {
$country_name=$record->country_name;
} else {
$country_name="";
}
if(!empty($record->country_code)) {
$country_code=$record->country_code;
} else {
$country_code="";
}
if(!empty($record->city)) {
$city_name=$record->city;
} else {
$city_name="";
}
if(!empty($record->country_code) && !empty($record->region)) {
$GEOIP_REGION_NAME[$record->country_code][$record->region]=isset($GEOIP_REGION_NAME[$record->country_code][$record->region]) ? $GEOIP_REGION_NAME[$record->country_code][$record->region] : NULL;
$state_name=$GEOIP_REGION_NAME[$record->country_code][$record->region];
}
if(!empty($record->region)) {
$state_code=$record->region;
} else {
$state_code="";
}
if(!empty($record->latitude)) {
$latitude=$record->latitude;
} else {
$latitude="";
}
if(!empty($record->longitude)) {
$longitude=$record->longitude;
} else {
$longitude="";
}
geoip_close($gi);
$_SESSION['CTimer']=time()+60;
$_SERVER['REMOTE_ADDR']=isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : NULL;
$vienede=isset($_GET['referer']) ? $_GET['referer'] : NULL;
$pagina=isset($_GET['http']) ? $_GET['http'] : NULL;
$externo=isset($externo) ? $externo : NULL;
$bots=isset($bots) ? $bots : NULL;
$ultotal=isset($ultotal) ? $ultotal: NULL;
$time_last_click=time()+(3600*2);
$_SERVER['HTTP_USER_AGENT']= isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : NULL;
if(preg_match("/bot/i",$_SERVER['HTTP_USER_AGENT'])) {
$bots=$_SERVER['HTTP_USER_AGENT'];
} else {
$bots='Guest';
}
if(!preg_match("/amanteanime.net/i",$vienede) or !preg_match("/seinagi.org.es/i",$vienede)) {
$externo=$vienede;
}
$connectblog = mysql_connect("localhost","c2seinagi_blog","jUmgmc2_RYY5")
or die('No pudo conectarse al servidor MySQL de la Web...');
mysql_select_db("c2_seinagi_blog")
or die('No pudo seleccionarse la base de dato de la Web...');
$ultotal = mysql_query("SELECT session_id FROM `wp_visitor_maps_wo` WHERE ip_address='".$_SERVER['REMOTE_ADDR']."'",$connectblog);
while ($ulalltotal = mysql_fetch_array($ultotal)) {
mysql_query("UPDATE `wp_visitor_maps_wo` SET `country_name` = '".$country_name."', `country_code` = '".$country_code."', `city_name` = '".$city_name."', `state_name` = '".$state_name."', `state_code` = '".$state_code."', `latitude` = '".$latitude."', `longitude` = '".$longitude."', `last_page_url` = '".$pagina."', `http_referer` = '".$externo."', `user_agent` = '".$_SERVER['HTTP_USER_AGENT']."', `time_last_click` = '".$time_last_click."', `num_visits`=num_visits+1 WHERE `wp_visitor_maps_wo`.`session_id` = '".$_SERVER['REMOTE_ADDR']."'",$connectblog);
$update='1';
}
mysql_free_result($ultotal); //Liberamos la consulta
$update=isset($update) ? $update : NULL;
if(!$update) {
$sqlreg = "INSERT INTO `wp_visitor_maps_wo` (`session_id` ,`ip_address` ,`user_id` ,`name` ,`nickname` ,`country_name` ,`country_code` ,`city_name` ,`state_name` ,`state_code` ,`latitude` ,`longitude` ,`last_page_url` ,`http_referer` ,`user_agent` ,`hostname` ,`provider` ,`time_entry` ,`time_last_click` ,`num_visits`)";
$sqlreg=isset($sqlreg) ? $sqlreg : NULL;
$sqlreg.= "VALUES ('".$_SERVER['REMOTE_ADDR']."', '".$_SERVER['REMOTE_ADDR']."', '0', '".$bots."', NULL, '".$country_name."', '".$country_code."', '".$city_name."', '".$state_name."', '".$state_code."', '".$latitude."', '".$longitude."', '".$pagina."', '".$externo."', '".$_SERVER['HTTP_USER_AGENT']."', NULL , NULL , '".$time_last_click."', '".$time_last_click."', '1')";
mysql_query($sqlreg,$connectblog);
}
mysql_close($connectblog);
}*/
?>