Jump to content
Sign in to follow this  
Druide

User Tracking with Admin 1.31 Released

Recommended Posts

...

 

I have modified my install so that the store does a reverse dns the first time the user visits the store, stores this info in the database, and then sets a session variable so that this lookup doesnt occur again. This has speeded up the script operation for me tremendously, and the page loads in about 3 secs with 700-1000 users' information.

 

Hopefully other will find this information useful, and again good job to the author of User Tracking for an awesome contribution. I think it is probably the coolest contribution I have seen, and is always my first stop when i log into my admin :) :)

 

 

Can you share this hack???? :D Please :)

Share this post


Link to post
Share on other sites

I would also be interested in this mod to the code :D

 

 

I have also been working on doing a rollup report so that you can see at a glance the number of sessions with page totals, and also one that show that sessions by country break down. I am doing this for so AD tracking reasons

 

I have the SQL correct but am haveing a hard time getting the temp table to work. I get "1044 - Access denied for user: '@localhost' to database 'test-pro'"

here is the code so far

 

<?php

 require('includes/application_top.php');



 require(DIR_WS_CLASSES . 'currencies.php');

 $currencies = new currencies();



 require(DIR_WS_INCLUDES . 'geoip.inc');

 $gi = geoip_open(DIR_WS_INCLUDES . 'GeoIP.dat',GEOIP_STANDARD);



 

?>

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

<html <?php echo HTML_PARAMS; ?>>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">

<title><?php echo TITLE; ?></title>

<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">

</head>

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">

<!-- header //-->

<?php require(DIR_WS_INCLUDES . 'header.php'); ?>

<!-- header_eof //-->



<!-- body //-->

<table border="0" width="100%" cellspacing="2" cellpadding="2">

 <tr>

   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">

<!-- left_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>

<!-- left_navigation_eof //-->

   </table></td>

<!-- body_text //-->

   <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">

     <tr>

       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">

         <tr>

           <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>

           <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

         </tr>

       </table></td>

     </tr>

     <tr>

       <td class="smallText"> </td>



<?php



 $whos_online_query = tep_db_query("select ip_address , count( distinct session_id ) as sessions, count( page_desc ) as pages from user_tracking group by ip_address order by sessions desc , pages desc");

$temptable = ("create temporary table temp1 ( ip_address varchar(15), country varchar(15), sessions int(11), pages int(11) )");

 tep_db_query ($temptable);

 while ($whos_online = tep_db_fetch_array($whos_online_query)) {

  $pages = $whos_online['pages'];

  $sessions = $whos_online['sessions'];

  $countrry = geoip_country_name_by_addr($gi, $whos_online['ip_address']);

   }

$insert_query = ("insert into tempory table temp1 values ip_address, country, sessions, pages ) values ('" . $ipaddress . "', '" . $country . "', '" . $sessions . "',  '" . $pages . "')");

tep_db_query($insert_query);







$rollup_query = tep_db_query("select country, count ( ip_address ), sum ( sessions ) as sess_count, sum ( pages ) as pg_count from temp1 group by country; " );





while ($rollup = tep_db_fetch_array($rollup_query)) {

  $page_cnt = $rollup['pg_count'];

  $sess_cnt = $rollup['sess_count'];

  $country_name = $rollup['country'];

   };



?>







               <td class="dataTableContent"><?php echo $conutry_name; ?></td>



               <td class="dataTableContent"><?php echo $sess_cnt; ?></td>

               <td class="dataTableContent" align="center"><?php echo $page_cnt; ?></td>

          

             </tr>



      

     </table></td> 

<!-- body_text_eof //--> 

</tr> 

</table> 

<!-- body_eof //--> 



<!-- footer //--> 

<?php require(DIR_WS_INCLUDES . 'footer.php'); ?> 

<!-- footer_eof //--> 

<br> 

</body> 

</html> 

<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

If I can get this to work I will add it as an extra contribution for reporting

Share this post


Link to post
Share on other sites
Quote:  

I also have frequent  

Quote:  

 

Fatal error: error traversing database - perhaps it is corrupt? in /home/farmex/public_html/osc/includes/geoip.inc on line 220  

 

 

appearing immediately after the "Country" entry on a listing, for which I cannot find a reason.  

 

Is anyone else experiencing these anomolies, or do you think I ought to try to re-install the database tables associated with this mod?  

 

 

I got sick of seeing this error come up so I just commented out line 220 in geoip.inc.  

 

/* trigger_error("error traversing database - perhaps it is corrupt?", E_USER_ERROR); */  

 

This appears to have worked! No more errors... Too easy?

I ended up grabbing a new copy of the .dat file a week or so ago and it seemed to clear up not only the above error, but also the incorrect countries being assigned to sessions.

 

Thanks, that cleared my problem up as well.

Share this post


Link to post
Share on other sites

I'm using version 1.34 with a more recent snapshot - from may 5, 2003, and I'm also getting this error in the same place where everyone else is getting it:

 

Fatal error: Call to undefined function: tep_parse_category_path() in /path/to/admin/includes/functions/user_tracking.php on line 47

 

then I implemented the fix found here:

 

http://forums.oscommerce.com/viewtopic.php...p=131691#131691

 

and now I get this error instead

 

Warning: array_map() [function.array-map]: The first argument, 'tep_string_to_int', should be either NULL or a valid callback in /home2/dmg/public_html/sales/admin/includes/functions/general.php on line 1313

 

I'm also not getting anything for the 'originating url' - I tried implementing the fix as described here on this page:

http://forums.oscommerce.com/viewtopic.php...r=asc&start=200

but that doesn't work either.

 

Any ideas?


-D. M. 8)

Share this post


Link to post
Share on other sites

Would you be willing to share your mod to this great contribution? I'm having overall speed problems with my host, so any efficiency gains would be most appreciated.

 

Thanks!

I have modified my install so that the store does a reverse dns the first time the user visits the store, stores this info in the database, and then sets a session variable so that this lookup doesnt occur again. This has speeded up the script operation for me tremendously, and the page loads in about 3 secs with 700-1000 users' information.

 

Hopefully other will find this information useful, and again good job to the author of User Tracking for an awesome contribution. I think it is probably the coolest contribution I have seen, and is always my first stop when i log into my admin :) :)

Share this post


Link to post
Share on other sites

Hi

 

Sorry if this has been looked at before but im stuck with this error in Admin:

 

Fatal error: Cannot redeclare tep_db_connect() (previously declared in /usr/virtual/1/angelbud/facepaintshop.co.uk/home/www-docs/catalog/catalog/admin/includes/functions/database.php:13) in /usr/virtual/1/angelbud/facepaintshop.co.uk/home/www-docs/catalog/catalog/admin/includes/functions/database.php on line 13

 

Thanks for any help.

 

Carl

Share this post


Link to post
Share on other sites

I think it varies depending on what snapshot you've got. My application top is: v 1.272 2003/03/31 17:25:36 - and has four instances of tep_session_start()

 

after playing a little 'cut and paste battleship' I was able to get mine to work, of course the originating URL gets removed when the session expires (a little bit annoying but hey, that's the way this thing works for now)

 

To get mine to work I inserted the code

if (!$referer_url) { 

   $referer_url = $HTTP_SERVER_VARS['HTTP_REFERER']; 

       if ($referer_url) { 

           tep_session_register('referer_url'); 

       } 

   }  

right above

// Shopping cart actions

and that did the trick. Of course, I've still got the problems of the recorded time sometimes being wildly inaccurate (besides the +2 hours for my server) and 12 hour idle times and stuff like that but now it basically works.


-D. M. 8)

Share this post


Link to post
Share on other sites

I've noticed over the last couple of weeks that I'm getting a LOT of single-page hits from specifically two bots - inktomi & google. There are tons and tons of these single-page hits and I'm not sure what's happening or why they're only managing to hit one page before leaving and then coming right back.

 

Any thoughts? Or am I just out of my mind?

 

Laura :?

http://www.bowlzilla.com


All the best,

Laura

 

 

**********

Just Sing!!!

Share this post


Link to post
Share on other sites

I have intalled the cont. and I am having several problems. When I click on the admin->user tracking config.. all I get is this error

 

"Fatal error: Call to undefined function: tep_array_merge() in .../admin/user_tracking_config.php on line 93"

 

Also The shopping cart session is always expired. I have tried to go to my website and place items in shopping cart, but I can't see anything from the admin section. Is this the way it is suppose to be?

 

Please help

Thanks

Share this post


Link to post
Share on other sites

Another problem, besides the one mentioned above, the cont. is keeping track of the user from the admin section. Meaning, that when I click on backup tools or payment module in the admin section, the vistor stat is updated with what I did in the admin. I double checked to make sure that I didn't place any of the codes that I were suppose to put in the catalog in the admin. Please help...

 

Thanks

Moneer

Share this post


Link to post
Share on other sites

Hi,

 

I upgraded to MS2 and reapplied "User Tracking w/Admin" but now I'm getting the exact same error.

 

I have intalled the cont. and I am having several problems. When I click on the admin->user tracking config.. all I get is this error  

 

"Fatal error: Call to undefined function: tep_array_merge() in .../admin/user_tracking_config.php on line 93"  

 

How can we fix this?

 

Thanks,

 

Joseph

Share this post


Link to post
Share on other sites

Ok, got it to work. When I upgraded to MS2 I changed

 

require (includes/application_top.php');

to

require ('includes/filesnames.php');

 

So, I added application_top back and it's working again.

 

Joseph

Share this post


Link to post
Share on other sites

osCommerce 2.2-MS2 with

User Tracking with Admin 1.34 incl German

 

hello,

i've got the following problem:

the mod works fine. the def-language of the admin area is "german". But when i navigate inside the "User Tracking" (user_tracking.php) in the admin tool, the hole admin-section switches to english language after the second click (second time the user_tracking.php is parsed).

 

maybe someone can help me.

 

many thanx to all coders for this mod!!!

 

Reinhard Koch

Share this post


Link to post
Share on other sites

MySQL experts,

 

Anyway to speed this amazing contrib up with sql indexes?

 

Seems like it would be useful to index *something*, for when you hit view session. Hmm.

Share this post


Link to post
Share on other sites

With phpMyAdmin I added a simple index to session_id, and it didn't seem to speed anything up when viewing a particular user's session. That seems very odd to me, actually. That would seem to be the key field to index.

 

Also tried user_ip, in the off chance the script tried to sort by that, but that didn't help either, but that was predicted.

Share this post


Link to post
Share on other sites

What's vastly stranger than the indexes not working, is that originally I had about 50mb of data from the old user tracking contrib. I then purged past 72 hours, and optimized and repaired my sql database. It's now down to 1.6mb. Then I went to view tracking details for particular users... and it was barely faster. A little faster, but not siginificantly so compared to having a 50mb user_tracking db.

 

*This* is very strange, indeed. Hahaha. Anyone know why this would happen?

Share this post


Link to post
Share on other sites

Hi everyone.

 

I seem to be getting this error in the user tracking admin section (version 1.34) when visitors begin viewing my site.

 

Country:  

Fatal error: error traversing database - perhaps it is corrupt? in /homepages/22/d84533940/htdocs/admin/includes/geoip.inc on line 220

 

Had a quick look through geoip.inc but couldn't see anything. I am not sure how to tell if the database is corrupt or not either. Everything else is working.

 

I am using MS1.

 

Any help would be greatly appreciated.

 

Thanks

Share this post


Link to post
Share on other sites

***Attention***

 

Anyone who is receiving the following error in admin/user_tracking_config.php:

 

Fatal error: Call to undefined function: tep_array_merge() in .../admin/user_tracking_config.php on line 93

 

Look in /admin/user_tracking_config.php for:

 

      $cInfo_array = tep_array_merge($configuration, $cfg_extra);

 

And Change it to:

 

      $cInfo_array = array_merge($configuration, $cfg_extra);

 

This function recently was changed

Share this post


Link to post
Share on other sites

Hi there,

 

Just downloaded the last update to this User Tracking.. But sadly enough to say.. It doesn't say all what modifications were made or changes.. I really don't feel like searching each and every page to find what changes are made. And if there is changes to a database.. Shouldn't the database read "Overwrite if this table already exists?" or something like that? But it doesn't.. It would appear that this upgrade is a fresh install and not an update.. Someone please point out the particulars for me? Thank you so much..

 

Christine


If it ain't broke, don't fix it! :)

Share this post


Link to post
Share on other sites
Hi there,

 

     Just downloaded the last update to this User Tracking.. But sadly enough to say.. It doesn't say all what modifications were made or changes.. I really don't feel like searching each and every page to find what changes are made. And if there is changes to a database.. Shouldn't the database read "Overwrite if this table already exists?" or something like that? But it doesn't.. It would appear that this upgrade is a fresh install and not an update.. Someone please point out the particulars for me? Thank you so much..

 

 Christine

 

If you'll notice, in my description here, you'll see that it says:

 

Updated install instructions for MS2. Only other file changed was /admin/user_tracking_config.php

 

tep_array_merge is now just array_merge

 

This was the only change, to make it compatible for MS2.

 

Regards,

 

Jason

Share this post


Link to post
Share on other sites

Thankyou very much for your response. I already figured out the tep_array_merge thing on my own.. And eliminated the tep.. being that it's no longer used in the more recent version of the Oscommerce carts.. :)

 

Just the thing you said about excluding this IP etc.. For yourself for example etc.. Is that what's been updated in the user_tracking_config.php file? Other than that, the install instructions look identical to the last install instructions.. So there is no difference really.. lol

 

thanks so much for your time.. :)

 

Christine


If it ain't broke, don't fix it! :)

Share this post


Link to post
Share on other sites
Thankyou very much for your response.  I already figured out the tep_array_merge thing on my own.. And eliminated the tep.. being that it's no longer used in the more recent version of the Oscommerce carts..  :)

 

 Just the thing you said about excluding this IP etc.. For yourself for example etc..  Is that what's been updated in the user_tracking_config.php file?  Other than that, the install instructions look identical to the last install instructions.. So there is no difference really.. lol

 

 thanks so much for your time..  :)

 

Christine

 

Other than updating tep_array_merge to array_merge, i re-did the install instructions to make them more 'user friendly' for MS2 installations.

 

;)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×