[phpOpenTracker-devel] [Bug #3122] mod_usertrack.php

[email protected] Sun, 30 Jan 2005 10:25:53 +0100 (CET)
Newsgroups gmane.comp.web.phpopentracker.devel
Message-ID <[email protected]>
Bug #3122, was updated on 2005-Jan-25 21:47
Here is a current snapshot of the bug.

Project: phpOpenTracker
Category: None
Status: Open
Resolution: None
Bug Group: None
Priority: 5
Submitted by: none
Assigned to : none
Summary: mod_usertrack.php

Details: I was having some issues with mod_usertrack.php.

I never did get it to work correctly - it didn't populate the pot_accesslog table.

Here is a totiouseSVN patch of what I did to make mod_usertrack.php to work.

In short, PHP Version 4.3.10 didn't like how the INSERT statements where quoted, there was a misspelled table name and a bad array index.

Sorry for posting this here, but I couldn't find an email address.

mcreuzer
at
r-world.com



Index: mod_usertrack.php
===================================================================
--- mod_usertrack.php	(revision 38)
+++ mod_usertrack.php	(working copy)
@@ -1,5 +1,7 @@
 #!/usr/local/bin/php -Cq
 <?php
+	ini_set(max_execution_time, 600); // 2 minute run-time
+	ini_set(memory_limit, 268435456); // 2 minute run-time
 //
 // phpOpenTracker - The Website Traffic and Visitor Analysis Solution
 //
@@ -157,18 +159,18 @@
   $cache['host_id']             = isset($cache['host_id'][$visitor['host']])                         ? $cache['host_id'][$visitor['host']]             : $db->storeIntoDataTable($config['hostnames_table'], $visitor['host']);
   $cache['referer_id']          = isset($cache['referer_id'][$visitor['referer']])                   ? $cache['referer_id'][$visitor['referer']]       : $db->storeIntoDataTable($config['referers_table'], $visitor['referer']);
   $cache['operating_system_id'] = isset($cache['operating_system_id'][$visitor['operating_system']]) ? $cache['operating_system_id'][$visitor['host']] : $db->storeIntoDataTable($config['operating_systems_table'], $visitor['operating_system']);
-  $cache['user_agent_id']       = isset($cache['user_agent_id'][$visitor['user_agent']])             ? $cache['user_agent_id'][$visitor['user_agent']] : $db->storeIntoDataTable($config['user_agent_table'], $visitor['user_agent']);
+  $cache['user_agent_id']       = isset($cache['user_agent_id'][$visitor['user_agent']])             ? $cache['user_agent_id'][$visitor['user_agent']] : $db->storeIntoDataTable($config['user_agents_table'], $visitor['user_agent']);
 
   $db->query(
     sprintf(
-      'INSERT
+      "INSERT
          INTO %s
               (client_id,           accesslog_id,  visitor_id,
                operating_system_id, user_agent_id, host_id,
                referer_id,          timestamp,     returning_visitor)
        VALUES ('%d', '%d', '%d',
                '%d', '%d', '%d',
-               '%d', '%d', '%d')',
+               '%d', '%d', '%d')",
 
       $config['visitors_table'],
       $client_id,
@@ -178,7 +180,7 @@
       $cache['user_agent_id'],
       $cache['host_id'],
       $cache['referer_id'],
-      $visitor['timestamps'][0],
+      $visitor['timestamps'],
       0
     )
   );
@@ -186,11 +188,11 @@
   for ($i = 0; $i < sizeof($visitor['documents']); $i++) {
     $db->query(
       sprintf(
-        'INSERT
+        "INSERT
            INTO %s
                 (accesslog_id, timestamp,
                  document_id,  entry_document)
-         VALUES ('%d', '%d', '%d', '%d')',
+         VALUES ('%d', '%d', '%d', '%d')",
 
         $config['accesslog_table'],
         $visitor['accesslog_id'],


Follow-Ups:

Date: 2005-Jan-30 10:25
By: s_bergmann

Comment:
The mod_usertrack version in SVN is incomplete and known to be not working.

Does mod_usertrack-1.0.0 work for you?
-------------------------------------------------------

For detailed info, follow this link:
http://developer.berlios.de/bugs/?func=detailbug&bug_id=3122&group_id=2025