stevemills Posted September 20, 2008 Share Posted September 20, 2008 My customers online page is tweaked to show me the last 24 hours, not just 15 minutes. Doing this provides a better picture of what's really going on, but the pages are filled with useless bot visits, all lasting less than one second (0.00 duration). Is there any way to either eliminate showing these hits, or to aggregate them as to how many are Google bots and how many Yahoo crawl? It takes a lot of scrolling to actually see what you are looking for, which is human activity. Quote Link to comment Share on other sites More sharing options...
stevemills Posted September 20, 2008 Author Share Posted September 20, 2008 The file in question would be /cubecart/admin/sources/stats/online.inc.php */ $timeLimit = time() - 86400; $query = "SELECT * FROM ".$glob['dbprefix']."CubeCart_sessions LEFT JOIN ".$glob['dbprefix']."CubeCart_customer ON ".$glob['dbprefix']."CubeCart_sessions.customer_id = ".$glob['dbprefix']."CubeCart_customer.customer_id WHERE timeLast>".$timeLimit." ORDER BY timeLast DESC"; // query database $results = $db->select($query, $rowsPerPage, $page); $numrows = $db->numrows($query); ?> <p class='pageTitle'><?php echo $lang['admin']['stats_cust_online'];?></p> <p class="copyText"><?php echo $lang['admin']['stats_cust_active'];?></p> <table width="100%" border="0" cellpadding="3" cellspacing="1" class="mainTable"> <tr> <td nowrap="nowrap" class="tdTitle"><?php echo $lang['admin']['stats_hash'];?></td> <td nowrap="nowrap" class="tdTitle"><?php echo $lang['admin']['stats_customer'];?></td> <td nowrap="nowrap" class="tdTitle"><?php echo $lang['admin']['stats_location'];?></td> <td nowrap="nowrap" class="tdTitle"><?php echo $lang['admin']['stats_sess_start_time'];?></td> <td nowrap="nowrap" class="tdTitle"><?php echo $lang['admin']['stats_last_click_time'];?></td> <td nowrap="nowrap" class="tdTitle"><?php echo $lang['admin']['stats_last_ip_address'];?></td> <td nowrap="nowrap" class="tdTitle"><?php echo $lang['admin']['stats_sess_length'];?></td> </tr> <?php if($results==TRUE) { for ($i=0; $i<count($results); $i++) { $rank = ($page * $rowsPerPage) + ($i + 1); $cellColor = cellColor($i); ?> <tr> <td class="<?php echo $cellColor; ?>" width="15"><span class="copyText"><?php echo $rank; ?>.</span></td> <td class="<?php echo $cellColor; ?>" width="100" nowrap='nowrap'> <span class="copyText"> <?php if($results[$i]['customer_id']==0){ echo $lang['admin']['stats_geust']; } else { echo $results[$i]['title']." ".$results[$i]['firstName']." ".$results[$i]['lastName']; } ?> </span></td> <td class="<?php echo $cellColor; ?>" width="100" nowrap='nowrap'><a href="<?php echo $results[$i]['location']; ?>" class="txtLink"><?php echo $results[$i]['location']; ?></a></td> <td class="<?php echo $cellColor; ?>" nowrap='nowrap'><span class="copyText"><?php echo formatTime($results[$i]['timeStart']); ?></span></td> <td class="<?php echo $cellColor; ?>" nowrap='nowrap'><span class="copyText"><?php echo formatTime($results[$i]['timeLast']); ?></span></td> <td class="<?php echo $cellColor; ?>" nowrap='nowrap'><a href="java script:;" class="txtLink" onclick="openPopUp('<?php echo $glob['adminFile']; ?>?_g=misc/lookupip&ip=<?php echo $results[$i]['ip']; ?>','misc',300,120,'yes,resizable=yes')"><?php echo $results[$i]['ip']; ?></a></td> <td class="<?php echo $cellColor; ?>" nowrap='nowrap'><span class="copyText"><?php echo sprintf("%.2f",($results[$i]['timeLast']-$results[$i]['timeStart'])/60); ?> <?php echo $lang['admin']['stats_mins'];?></span></td> </tr> <?php } } else { ?> <tr> <td colspan="3"><span class="copyText"><?php echo $lang['admin']['stats_sorry_no_data'];?></span></td> </tr> <?php } ?> </table> As you can tell, I have edited my time limit to span 24 hours of visits. Can't this php script be given a command to ignore any visits of less than one second? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.