Thank you again for the thorough help and insight in this situation. If you do have time later or a few days later, maybe you can send me some links of shoot me some pm concerning how to do it in the htaccess file would be great. Thanks in advance.
Printable View
Here is the latest error message:I think I am going to disabled this mod temporarily until after Christmas season. I want to make sure I can focus on any error that's genuine in the log and this mod is just filling it up. I will definitely continue to monitor the progress on this though. Thanks!Quote:
[22-Nov-2013 03:11:00 America/New_York] PHP Warning: reset() expects parameter 1 to be array, null given in /adminfolder/user_tracking.php on line 301
Please advise, at that point of using UT to look at the history, were there no records returned/shown?
(For those reviewing this thread, that error iappears from the newly added functionality of displaying the number of visits at the beginning of the display of visitors.)
Odd thing to say/think, but almost glad that there is a problem, that way any additional changes can be incorporated with a fix.looking at adding a check for the last character of strings before sending to SQL and other character sequences specifically in the URL info just to prevent additional errors/warnings can add a flag later, then also to address a zero "volume" return on the array of visitors. Hopefully can submit soon.
It is definitely possible that this happened after I disabled the Mod on the Admin side. I did not remove the tracking code in the footer just set it "User Tracking Visitor" to False. I guess I will disable on the Admin as well as remove the tracking code from the footer to avoid any potential issue.
Thanks!
May have been before or after disabling tracking of visitors. I was able to reproduce the error by moving to tomorrow's date. (Obviously no data available for tomorrow.)
So no, it does not just randomly generate that reset warning. It is a missed check on my part. Should not have it try to cycle through the "array" if there is nothing in that array, thus I would not have to reset it. The result will still be zero, but the "array" will not be sent through an operation that could cause a warning. At this time removing the footer code will not prevent that warning from being logged. Not going to the admin/user_tracking.php page when there is no data or to a date that has no data will.
Thanks for the update and clarification. I appreciate all your support.
Wondering if you could add the following code to: yourstore/includes/functions/extra_functions/user_tracking.php ~line 69 (after the assignment of $page_desc = substr($page_desc, 0, 63); but before the $db->execute that inserts the record... Then test accessing the product (assuming that the record still has the same description) and see if still get the same issue... I'll see if I can't reproduce prevent reproduction of the error by forcing a comparison with that final result; however, some of the errors described seem to be "random" or at least it seems to take very specific conditions to cause a problem.Quote:
[16-Nov-2013 08:44:35 America/New_York] PHP Fatal error: 1064:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'OFFICE_IP_TO_HOST_ADDRESS')' at line 1 :: insert into user_tracking (customer_id, full_name, session_id, ip_address, time_entry, time_last_click, last_page_url, referer_url, page_desc, customers_host_address) values ('0', 'Guest', '', '157.55.32.84', '1384609475', '1384609475', '/index.php?main_page=product_reviews&cPath=388_408&products_id=13478', '/index.php?main_page=product_reviews&cPath=388_408&products_id=13478', 'Discovery and Exploration - Educational Insights You\', 'OFFICE_IP_TO_HOST_ADDRESS') in /includes/classes/db/mysql/query_factory.php on line 120
Code:while (strpos(right($page_desc, 1), '\\') !== false) {
$page_desc = substr($page_desc, 0, -1);
}
Submitted version 1.4.3b with the following updates:
1. Corrected a PHP warning that appears if there are no visits tracked for the date being reviewed.
2. Corrected an issue that had the possibility of generating an error log: If a product's description included a character that would be translated by use of an escape character as part of a SQL command, (eg: he's would be changed to he\'s) then, if that escape character landed in just the right position, it would end up as the last character in the string prior to a single quote as part of the SQL statement. This would then cause an error in the execution of the SQL statement and an error log to be generated. Resolution was to remove the last character if that last character is a \. This issue has been resolved for: page description, last page URI, and referrer URI.
3. Updated the button display of spiders, such that if option 3 is chosen in system setup that a message appears.
UPDATING INSTRUCTIONS:
For SQL statemenst: same instructions as applicable from the 11/10/2013 update.
Files updated from 1.4.3 or 1.4.3a are:
YOUR_ADMIN\user_tracking.php
YOUR_ADMIN\includes\lanaguages\english\user_tracking.php
includes\functions\extra_functions\user_tracking.php
For those that would just want the code update, here are basically the changes (functional changes) (compared to version 1.4.3), I am leaving out the additional words portion of the update at this time.
In YOUR_ADMIN/user_tracking.php
find:
replace with (Change in red):Code:$listed = 0;
if ($results)
while (($ut = each($user_tracking)) && !$user_tracking->EOF /*($listed++ < CONFIG_USER_TRACKING_SESSION_LIMIT)*/)
Find:Code:$listed = 0;
if ($results && is_array($user_tracking) == true)
while (($ut = each($user_tracking)) && !$user_tracking->EOF /*($listed++ < CONFIG_USER_TRACKING_SESSION_LIMIT)*/)
replace with (Change in red):Code:reset($user_tracking);
//End of v1.4.3 14 of 15
if ($results)
while (($ut = each($user_tracking)) && ($listed++ < CONFIG_USER_TRACKING_SESSION_LIMIT))
andCode://End of v1.4.3 14 of 15
if ($results && is_array($user_tracking) == true) {
/* Begin v1.4.3b (Moved statement to within test) */
reset($user_tracking);
/* End v1.4.3b */
while (($ut = each($user_tracking)) && ($listed++ < CONFIG_USER_TRACKING_SESSION_LIMIT))
Find:
Replace with (Change in red):Code:// End User Tracking - Spider Mod 6 of 7
}
in \includes\functions\extra_functions\user_tracking.phpCode:// End User Tracking - Spider Mod 6 of 7
}}
at approximately line 70 (after $page_desc asssignment) but before $db->Execute add:
then after $wo_last_page_url assignment and before $db->Execute:Code:/* Start - User tracking v1.4.3b modification*/
while (strpos(substr($page_desc, -1), '\\') !== false) {
$page_desc = substr($page_desc, 0, -1);
}
/* End - User tracking v1.4.3b modification*/
These last two changes need to be before the $db->Execute command.Code:/* Start - User tracking v1.4.3b modification*/
while (strpos(right($wo_last_page_url, 1), '\\') !== false) {
$wo_last_page_url = substr($wo_last_page_url, 0, -1);
}
/* End - User tracking v1.4.3b modification*/
/* Start - User tracking v1.4.3b modification*/
while (strpos(right($referer_url, 1), '\\') !== false) {
$referer_url = substr($referer_url, 0, -1);
}
/* End - User tracking v1.4.3b modification*/
No indicators have been added. This all will simply clean up the data going to be processed via SQL so that it won't generate a warning when no data is present for the data reviewed, and also will prevent SQL injection of creating a \' unintentionally.
Tada done...
No, did not get to next set of features to be added.