Changeset 17758 for extensions/EStat/estat_ajax.php
- Timestamp:
- Sep 5, 2012, 4:15:54 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/EStat/estat_ajax.php
r17737 r17758 475 475 476 476 $gStatFile=new StatDBGlobal($this->fileStatDir, self::FILE_GLOBAL); 477 $gStatFile->setIpCountryFile( ESTAT_PATH.'data/ipCountry.db');477 $gStatFile->setIpCountryFile($this->fileStatDir.'/'.self::FILE_COUNTRY.'.db', true); 478 478 $gStatFile->open(ASDF_OPEN_WRITE); 479 479 if($gStatFile->getInfoProperty('log', 'startImport')==null) … … 575 575 576 576 // prepare an EStat_IdList to buid a list of unique Id 577 $idList=new EStat_IdList(array('catId', 'imageId', 'tagsId', 'userId' , 'IPadress'));577 $idList=new EStat_IdList(array('catId', 'imageId', 'tagsId', 'userId')); 578 578 // $idAssoc will get the label associated to the id 579 579 $idAssoc=array( … … 581 581 'imageId'=>array(), 582 582 'tagsId'=>array(), 583 'userId'=>array(), 584 'IPadress'=>array() 583 'userId'=>array() 585 584 ); 586 585 … … 612 611 $this->prepareIdList($idAssoc, 'userId', "SELECT id, username AS name FROM ".USERS_TABLE." WHERE id IN (".implode(',', $idList->getItems('userId')).") ORDER BY id;"); 613 612 614 // for reverse DNS615 if($this->config['logs.ipCountry']=='y')616 $this->getIpInfos($idAssoc, $idList->getItems('IPadress'));617 618 613 // complete the data 619 614 foreach($returned['rows'] as $key=>$row) … … 636 631 'date' => date('Y-m-d H:i:s', $row['date']), 637 632 'IpUserId' => ($row['userId']==2)?$row['IPadress']:$this->getId($idAssoc, 'userId', $row['userId'], $row['IPadress'], 'name'), 638 //'country' => $row['country'],633 'country' => $row['country'], 639 634 'catId' => GPCCore::getUserLanguageDesc($this->getId($idAssoc, 'catId', $row['catId'], ($row['catId']==0)?'-':'?')), 640 635 'imageId' => $this->getId($idAssoc, 'imageId', $row['imageId'], ($row['imageId']==0)?'-':'?', 'name'), … … 702 697 if($row['userId']==2) 703 698 { 704 $ipInfo=$this->getId($idAssoc, 'IPadress', $tmp['IpUserId'], '?');705 699 if($this->config['logs.reverseDNS']=='y') 706 700 {/* … … 716 710 } 717 711 718 if($ ipInfo['country']!='--' and $ipInfo['country']!='XA')712 if($row['country']!='--' and $row['country']!='XA') 719 713 { 720 $tmp['IpUserId'].='<span class="geoip">[<a href="http://www.geoiptool.com/fr/?IP='.$tmp['IpUserId'].'">'.$ ipInfo['country'].'</a>]</span>';714 $tmp['IpUserId'].='<span class="geoip">[<a href="http://www.geoiptool.com/fr/?IP='.$tmp['IpUserId'].'">'.$row['country'].'</a>]</span>'; 721 715 } 722 716 else
Note: See TracChangeset
for help on using the changeset viewer.