Exemplo n.º 1
0
 function onAfterInitialise()
 {
     $db = JFactory::getDbo();
     $app = JFactory::getApplication();
     // We store only front-end visits
     if ($app->getName() !== 'site') {
         return;
     }
     // Extract info from BrowserDetection
     $browser_data = new BrowserDetection();
     if (!empty($browser_data)) {
         $this->browser = $browser_data->getBrowser();
         $this->browser_version = $browser_data->getVersion();
         $this->platform = $browser_data->getPlatform();
         $this->is_mobile = $browser_data->isMobile();
         $this->is_robot = $browser_data->isRobot();
         $this->uri = $_SERVER['REQUEST_URI'];
         $this->ip = $_SERVER['REMOTE_ADDR'];
     } else {
         $this->browser = JText::_('COM_JOOMMARK_UNKNOW');
         $this->browser_version = JText::_('COM_JOOMMARK_UNKNOW');
         $this->platform = JText::_('COM_JOOMMARK_UNKNOW');
     }
     // We need the referer to track where is the user
     if (isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER'] != "") {
         $this->referer = $_SERVER['HTTP_REFERER'];
     } else {
         $this->referer = JText::_('COM_JOOMMARK_UNKNOW');
     }
     // Get the user name
     $user = JFactory::getUser()->name;
     // Update 'joommark_stats' table
     $query = "INSERT INTO #__joommark_stats (ip, nowpage, lastupdate_time,  current_name)" . "VALUES ( '" . $this->ip . "','" . $this->referer . "',NOW(),'" . $user . "') ON DUPLICATE KEY UPDATE nowpage = '" . $this->referer . "', lastupdate_time = NOW(), current_name = '" . $user . "' ";
     $db->setQuery($query);
     try {
         $db->execute();
     } catch (Exception $e) {
         //dump($e->getMessage(),"exception");
     }
     // Update 'joommark_serverstats' table
     $query = "INSERT INTO #__joommark_serverstats (ip, visitdate, visitedpages, browser, os)" . "VALUES ( '" . $this->ip . "', NOW(), '" . $this->referer . "', '" . $this->browser . "', '" . $this->platform . "')";
     $db->setQuery($query);
     try {
         $db->execute();
     } catch (Exception $e) {
         //dump($e->getMessage(),"exception");
     }
 }
 /**
  * onAfterInitialise
  *
  * @return Exception object otherwise boolean true
  *
  * @since   1.0
  */
 public function onAfterInitialise()
 {
     // We store only front-end visits
     if ($this->app->getName() !== 'site') {
         return;
     }
     /*
      * Collecting the data
      * Extract info from BrowserDetection
      */
     $browser_data = new BrowserDetection();
     if (!empty($browser_data)) {
         $this->browser = $browser_data->getBrowser();
         $this->browser_version = $browser_data->getVersion();
         $this->platform = $browser_data->getPlatform();
         $this->is_mobile = $browser_data->isMobile();
         $this->is_robot = $browser_data->isRobot();
         $this->uri = JRequest::getVar('REQUEST_URI', ' ', 'server', 'STRING');
         $this->ip = JRequest::getVar('REMOTE_ADDR', ' ', 'server', 'STRING');
     } else {
         $this->browser = JText::_('COM_JOOMMARK_UNKNOW');
         $this->browser_version = JText::_('COM_JOOMMARK_UNKNOW');
         $this->platform = JText::_('COM_JOOMMARK_UNKNOW');
     }
     // Get the user name
     $this->userName = $this->user->name;
     // Get the user id
     $this->userId = $this->user->id;
     if (!$this->userName) {
         $this->userName = JText::_('COM_JOOMMARK_GUEST_PREFIX') . '_' . $this->generateSuffixFromSessionId($this->session->getId());
         $this->userId = 0;
     }
     // Update
     $this->updateReferer();
     $this->updateServerstats();
     $this->updateStats();
     $this->tidyingup();
 }
Exemplo n.º 3
0
	$('#datos').html("<br/><strong>IP</strong>: "+datos.ip);
	if(datos.country_name.length != 0)$('#datos').append("<br/><br/> <strong>Pais</strong> : "+datos.country_name);
	if(datos.region_name.length != 0)$('#datos').append("<br/> <strong>Region</strong> : "+datos.region_name);
	if(datos.city.length != 0)$('#datos').append("<br/> <strong>Ciudad</strong> : "+datos.city);
	if(datos.zip_code.length != 0)$('#datos').append("<br/><strong>Cod Postal</strong> : "+datos.zip_code);
	
	if(cliente_servidor == 'cliente'){//mostramos más datos del cliente
		<?php 
$browser = new BrowserDetection();
?>
		$('#datos').append("<br/><br/> <strong>Navegador</strong> : "+"<?php 
echo $browser->getBrowser();
?>
");
		$('#datos').append("<br/> <strong>Version</strong> : "+"<?php 
echo $browser->getVersion();
?>
");
		$('#datos').append("<br/> <strong>SO</strong> : "+"<?php 
echo $browser->getPlatform();
?>
");
		
	}
	
	
	$('#datos').append("<br/><br/> <strong>Geolocalización</strong> : ");
	//Aqui debajo ira el mapa
}

}