Code: Select all
The extended visitor�s statistic feature has collected data since .
Nr of vistors
Nr of vistors today: 0
Total nr of vistors: 0
Latest Visitors
Top Referrers
No referrers has yet been registered.
Code: Select all
The extended visitor�s statistic feature has collected data since .
Nr of vistors
Nr of vistors today: 0
Total nr of vistors: 0
Latest Visitors
Top Referrers
No referrers has yet been registered.
Code: Select all
$sessionChecker = serendipity_db_query("SELECT count(sessID) FROM {$serendipity['dbPrefix']}visitors WHERE '".serendipity_db_escape_string(session_id())."' = sessID GROUP BY sessID", true);
Code: Select all
die("The result of the query:<br />SELECT count(sessID) FROM {$serendipity['dbPrefix']}visitors WHERE '".serendipity_db_escape_string(session_id())."' = sessID GROUP BY sessID<br/>is:<br /><pre>" . print_r($sessionChecker, true) . "</pre><br />");
Code: Select all
The result of the query:
SELECT count(sessID) FROM serendipity_visitors WHERE '4ae182f31c3fbb32ef187e5a9cd66f1f' = sessID GROUP BY sessID
is:Code: Select all
// avoiding banned browsers
$banned_bots = $this->get_config('banned_bots');
$tmp_array = explode('|', $banned_bots);
$found = 'no';
for ($i=0; $i<count($tmp_array); $i++) {
if (trim($tmp_array[$i]) == trim($_SERVER['HTTP_USER_AGENT'])){
$found = 'yes';
}
}
if ($found == 'no'){
$this->countVisitor();
}
Code: Select all
// avoiding banned browsers
$banned_bots = $this->get_config('banned_bots');
$die_string = "Got banned bots: [$banned_bots]\n";
$tmp_array = explode('|', $banned_bots);
$found = 'no';
for ($i=0; $i<count($tmp_array); $i++) {
$die_string .= "Checking #$i, {$tmp_array[$i]} against HTTP User Agent [{$_SERVER['HTTP_USER_AGENT']}]\n";
if (trim($tmp_array[$i]) == trim($_SERVER['HTTP_USER_AGENT'])){
$die_string .= "Matched a bot. Not tracking visitor!\n";
$found = 'yes';
}
}
if ($found == 'no'){
$die_string .= "Not matched a bot. Tracking visitor!\n";
$this->countVisitor();
}
die($die_string);
Code: Select all
if ((is_array($sessionChecker)) && ($sessionChecker[0] == 0)) {
Code: Select all
1, 1Code: Select all
Got banned bots: [] Checking #0, against HTTP User Agent [Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8) Gecko/20051201 Firefox/1.5] Not matched a bot. Tracking visitor!Code: Select all
print_r($sessionChecker)