Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
MarkAllRead
MarkAllRead
0
Comments
$sql->AddWhere('c', 'Deleted', '',0, '=');
because otherwise you will get CheckRead() returning 0 for discussions where the lum_userdiscussionwatch number is higher than the number of undeleted comments, which leads to the extensions trying to insert a record where one already exists (which of course leads to a fatal error).Perhaps also replace the last line of CheckRead() with
if ($rows == $rows2['CountComments'] || $rows2['CountComments'] > $rows) return 2;
to catch those discussions which already have a too high number.And finally, the error it gave when trying to insert the duplicate records was "An error occurred while logging your IP address.", perhaps that could be changed to "An error occurred while trying to insert data." or something along those lines, because it doesn't really log any IP addresses.
$sql->AddWhere('c', 'Deleted', '',0, '=');
after line 47, that's it. That and a slightly incresed version number for update checks of course.If you want the extension to mark a bigger range as read, you can change the $Configuration["MARKALLREAD_LIMIT"] value to something bigger.
I do appreciate the reply
On this forum to mark every single discussion read it would need to insert approximately 36,914,966 new rows...that's a lot. And even based on a query time of 0.0001 seconds, which is pretty darn quick, would still take over an hour to complete. By which time you'd probably have got bored. And your server would have crashed.
Affected Elements
Insert.MakeRead();
The error occurred on or near: Duplicate entry '1-475' for key 1
I'm getting the same error as you, and looking at my LUM_iphistory table in the DB, I've noticed a lot of duplicate entries. I'm thinking this might be somehow related? If I start deleting duplicate entries, will this cause other things to break?
if ($rows == $rows2['CountComments'] || $rows2['CountComments'] > $rows) return 2;
Edit: The error doesn't have anything to do with IP history, it's that it's trying to insert records into the database for discussions where records already exist. And in that case it should update the records, not insert.
if ($rows == $rows2['CountComments']) return 2;
It works for me