Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 DEV-Group
 DEV Bug Reports (Closed)
 BUG+FIX (3.2a6): Active.asp - duplicate line
 Forum Locked  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

work mule
Senior Member

USA
1358 Posts

Posted - 15 March 2001 :  09:42:40  Show Profile
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  Show Profile  Visit gor's Homepage
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
Go to Top of Page

work mule
Senior Member

USA
1358 Posts

Posted - 15 March 2001 :  10:24:32  Show Profile
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!

Go to Top of Page

Reinsnitz
Snitz Forums Admin

USA
3545 Posts

Posted - 15 March 2001 :  10:25:10  Show Profile  Visit Reinsnitz's Homepage  Send Reinsnitz an AOL message  Send Reinsnitz an ICQ Message  Send Reinsnitz a Yahoo! Message
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
Go to Top of Page

Kat
Advanced Member

United Kingdom
3065 Posts

Posted - 15 March 2001 :  10:26:41  Show Profile  Visit Kat's Homepage
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
Go to Top of Page

gor
Retired Admin

Netherlands
5511 Posts

Posted - 15 March 2001 :  13:32:30  Show Profile  Visit gor's Homepage
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
Go to Top of Page

gor
Retired Admin

Netherlands
5511 Posts

Posted - 15 March 2001 :  14:23:39  Show Profile  Visit gor's Homepage
Who moved us back into the BUG forum ? Was this just because I said I might have been lazy ?

Pierre
Go to Top of Page

Reinsnitz
Snitz Forums Admin

USA
3545 Posts

Posted - 15 March 2001 :  14:33:17  Show Profile  Visit Reinsnitz's Homepage  Send Reinsnitz an AOL message  Send Reinsnitz an ICQ Message  Send Reinsnitz a Yahoo! Message
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
Go to Top of Page

gor
Retired Admin

Netherlands
5511 Posts

Posted - 15 March 2001 :  14:51:31  Show Profile  Visit gor's Homepage
ok

Pierre
Go to Top of Page

frankie
Junior Member

Vatican City
304 Posts

Posted - 16 March 2001 :  02:47:38  Show Profile  Visit frankie's Homepage  Send frankie an AOL message  Send frankie an ICQ Message  Send frankie a Yahoo! Message
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?

Go to Top of Page

work mule
Senior Member

USA
1358 Posts

Posted - 17 March 2001 :  19:17:36  Show Profile
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.

Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 29 January 2002 :  11:01:48  Show Profile
code has been documented.

fixed in v3.4
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.15 seconds. Powered By: Snitz Forums 2000 Version 3.4.07