Author |
Topic |
|
work mule
Senior Member
USA
1358 Posts |
Posted - 15 March 2001 : 09:42:40
|
Line 120 & 121 are duplicates
if Request.Form("AllRead") = "Y" then Session(strCookieURL & "last_here_date") = ReadLastHereDate(strDBNTUserName) Session(strCookieURL & "last_here_date") = ReadLastHereDate(strDBNTUserName) lastDate = Session(strCookieURL & "last_here_date") ActiveSince = "" end if
|
|
gor
Retired Admin
Netherlands
5511 Posts |
Posted - 15 March 2001 : 10:01:37
|
This is NO bug but intentionally !!
If you like, try what happens if you remove one and click on the icon to mark all topics as read (in-active). It won't work, because the first call only causes the Last Here Date in the database to be updated, and returns the Last Here Date that was in the database before. The second call re-reads the changed Last Here Date from the database.
Pierre |
|
|
work mule
Senior Member
USA
1358 Posts |
Posted - 15 March 2001 : 10:24:32
|
Okay, I see what you're saying. I apologize for not looking at it further, all I saw was two exact lines and assumed duplicates. I didn't realize what was occurring.
Could you in this case, set the value (the function returns) to the same value that is being used in the Update SQL vs the TempLastHereDate variable? Seeing as this function is used 9 different times in 3 files, maybe it would be better served by it's own function? But then again, the number of times that this would be used is probably not worth the trouble.
Thanks!
|
|
|
Reinsnitz
Snitz Forums Admin
USA
3545 Posts |
Posted - 15 March 2001 : 10:25:10
|
Then we need to document this in the code... with Gor's comments... this could confuse someone who doesn't understand the concept
Reinsnitz (Mike) ><)))'> Need a Mod? "Therefore go and make disciples of all nations,..." Matthew 28:19a |
|
|
Kat
Advanced Member
United Kingdom
3065 Posts |
Posted - 15 March 2001 : 10:26:41
|
erm I thought it was a mistake and i removed it from mine SR2 - I haven't even seen the icon to mark all as read in active.asp. I was wondering why but I didn't get around to sorting it!
KatsKorner
|
|
|
gor
Retired Admin
Netherlands
5511 Posts |
Posted - 15 March 2001 : 13:32:30
|
quote:
Okay, I see what you're saying. I apologize for not looking at it further, all I saw was two exact lines and assumed duplicates. I didn't realize what was occurring.
no problem, I read your post about the include files just before I read this one, so I knew how you probably found this.
quote:
Could you in this case, set the value (the function returns) to the same value that is being used in the Update SQL vs the TempLastHereDate variable? Seeing as this function is used 9 different times in 3 files, maybe it would be better served by it's own function? But then again, the number of times that this would be used is probably not worth the trouble.
But this is the only file were the function is called twice. The function normally only gets called once and just needs to retrieve the old value from the database first and then set the value in the database to the current date and time.
I could have written a new function just for active.asp. If I had written a function that writes the current date/time to the Last Here Date field in the database and returns that current date/time, I would only have needed one call to that function. Since the "mark all read" function isn't used that much I didn't bother. (lazy ? don't know)
Pierre |
|
|
gor
Retired Admin
Netherlands
5511 Posts |
Posted - 15 March 2001 : 14:23:39
|
Who moved us back into the BUG forum ? Was this just because I said I might have been lazy ?
Pierre |
|
|
Reinsnitz
Snitz Forums Admin
USA
3545 Posts |
Posted - 15 March 2001 : 14:33:17
|
I did... caus your a bug! just kidding
No... it's here to remind us to document the code... where the double entry is not a bug... the lack of documentation in the code could bring this question up again in the future... or caus someone unfamiliar with the code to "Break" their forum unknowingly
Reinsnitz (Mike) ><)))'> Need a Mod? "Therefore go and make disciples of all nations,..." Matthew 28:19a |
|
|
gor
Retired Admin
Netherlands
5511 Posts |
Posted - 15 March 2001 : 14:51:31
|
ok
Pierre |
|
|
frankie
Junior Member
Vatican City
304 Posts |
Posted - 16 March 2001 : 02:47:38
|
This is not related to the original code. If anyone has the PM mod there is a feature that lets you mark your read messages as new in the inbox page (quite the opposit of the mark as read feature here) but you have to click the link several time before the new message file icon appears. It bothered the heck of me. My question is do we have to do the same with the code here by calling the same line twice or more?
|
|
|
work mule
Senior Member
USA
1358 Posts |
Posted - 17 March 2001 : 19:17:36
|
I would at least include the comments. This is one very minor thing in the grand scheme of things. What's there works.
Now on the other hand, it's generated a tiny bit of discussion. You could throw in the comments, but then when it's explained in the comments, people may understand why it's done that way and question it. To ward of future discussion, maybe it could have it's own (modified) function.
I wouldn't say it's being lazy. With all the other code that's being written and developed, this was such a minor thing. The solution was simple, didn't require additional code and (more importantly) worked.
|
|
|
RichardKinser
Snitz Forums Admin
USA
16655 Posts |
Posted - 29 January 2002 : 11:01:48
|
code has been documented.
fixed in v3.4 |
|
|
|
Topic |
|