IP_ADRESSE = $_SERVER['REMOTE_ADDR']; // Aktualisieren von: // Besuchern $where = 'ip NOT LIKE "%'.$this->IP_ADRESSE.'%" AND gaaccount=14393738 AND stat_type="visits_today";'; $this->update($where); // Besuchern gesamt $where = 'ip NOT LIKE "%'.$this->IP_ADRESSE.'%" AND gaaccount=14393738 AND stat_type="visits_overall";'; $this->update($where); // Klicks $where = 'gaaccount=14393738 AND stat_type="views_today";'; $this->update($where); // Klicks gesamt $where = 'gaaccount=14393738 AND stat_type="views_overall";'; $this->update($where); // Auslesen der Daten $visits_overall = $this->abfrage("visits_overall","gaaccount=14393738 AND stat_type='visits_overall'"); $visits_today = $this->abfrage("visits_today","gaaccount=14393738 AND stat_type='visits_today'"); $pages = $this->abfrage("views_overall","gaaccount=14393738 AND stat_type='views_overall'"); $pages_today = $this->abfrage("views_today","gaaccount=14393738 AND stat_type='views_today'"); $template = ("
Besucher:
bisher: $visits_overall
heute: $visits_today
Seiten-Aufrufe:
bisher: $pages
heute: $pages_today
Letzte Aktualisierung: ".$this->lastChange().".
"); return $template; } function abfrage($as,$where) { $select_fields = 'counter AS '.$as; $from_table = 'df_gstats'; /* Join: */ $where_clause = $where; $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( $select_fields, $from_table, $where_clause, $groupBy, $orderBy, $limit); $var = ""; while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) { return $row[$as]; } $GLOBALS['TYPO3_DB']->sql_free_result($result); } function update($where) { $query = 'UPDATE df_gstats SET counter=counter+1, ip=CONCAT_WS(",","'.$this->IP_ADRESSE.'",ip) WHERE '; $result = $GLOBALS['TYPO3_DB']->sql_query ($query.$where); } function lastChange(){ // Aktualisieren von: $select_fields = 'tstamp'; $from_table = 'tt_news'; /* Join: */ $where_clause = 'deleted=0 AND hidden=0'; $orderBy = 'tstamp DESC'; $limit = '0,1'; $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( $select_fields, $from_table, $where_clause, $groupBy, $orderBy, $limit); while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) { // Den timestamp vom Newsrecord zurückgeben WENN nicht gesetzt dann 15.01.09 return date("d.m.Y",$row['tstamp'] ? $row['tstamp'] : '1231977600'); } $GLOBALS['TYPO3_DB']->sql_free_result($result); } } ?> Pflege ABC - Pflegegeld Sozialhilfe