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 Discussions (General)
 active.asp - Statement repeating
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

GauravBhabu
Advanced Member

4288 Posts

Posted - 13 September 2002 :  20:28:15  Show Profile
Active.asp

Lines 126-132

Statement in red may be removed.

if Request.Form("AllRead") = "Y" then
	Session(strCookieURL & "last_here_date") = Request.Form("BuildTime")
	Session(strCookieURL & "last_here_date") = Request.Form("BuildTime")
	lastDate = Session(strCookieURL & "last_here_date")
	UpdateLastHereDate Request.Form("BuildTime"),strDBNTUserName
	ActiveSince = ""
end if

CSS and HTML4.01 Compilant Snitz Forum . ForumSquare . Rakesh Jain

It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying.

Prayer Of Forgiveness
"I forgive all living beings. May all living beings forgive me!
I cherish the friendliness towards all and harbour enmity towards none." -- Aavashyaka Sutra(Translated)

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 13 September 2002 :  20:39:20  Show Profile
no it may not

Things in the code are there for a reason. Please at least investigate things before coming out and saying "This may be removed".
Go to Top of Page

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 13 September 2002 :  20:43:54  Show Profile
Why do you need it twice?

Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 13 September 2002 :  20:54:49  Show Profile
for the same reason that we need this twice:

Session(strCookieURL & "AllowedForums" & MemberID) = isAllowedMember2
Session(strCookieURL & "AllowedForums" & MemberID) = isAllowedMember2

in the isAllowedMember function, if it's not set twice like this, then when you try to read the value back from the Session Cookie, it doesn't work. Remember the bug we had on this forum for a little while where normal users could see topics that they shouldn't see on the active.asp page? setting this twice, like shown above, is what fixed it.
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 13 September 2002 :  20:55:52  Show Profile
see here also:

http://forum.snitz.com/forum/topic.asp?ARCHIVE=true&TOPIC_ID=6417

(although the code has been changed a little bit)
Go to Top of Page

Doug G
Support Moderator

USA
6493 Posts

Posted - 13 September 2002 :  21:10:04  Show Profile
May I suggest a small code modification. I probably would have deleted the extra line without thinking twice about it.

if Request.Form("AllRead") = "Y" then
	'The redundant line below is necessary, don't delete it.
	Session(strCookieURL & "last_here_date") = Request.Form("BuildTime")
	Session(strCookieURL & "last_here_date") = Request.Form("BuildTime")
	lastDate = Session(strCookieURL & "last_here_date")
	UpdateLastHereDate Request.Form("BuildTime"),strDBNTUserName
	ActiveSince = ""
end if

Never mind, I read the link Richard posted above and saw there are comments in the code.

======
Doug G
======
Computer history and help at www.dougscode.com

Edited by - Doug G on 13 September 2002 21:12:08
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 13 September 2002 :  21:11:13  Show Profile
I can do that, it used to be in there, but that section was modified and the comment got deleted along with it.
Go to Top of Page

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 13 September 2002 :  21:11:22  Show Profile
hmm.... interesting ... thanks for the info!

Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~
Go to Top of Page

Doug G
Support Moderator

USA
6493 Posts

Posted - 13 September 2002 :  21:12:56  Show Profile
Richard you are too fast

======
Doug G
======
Computer history and help at www.dougscode.com
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 13 September 2002 :  21:27:35  Show Profile
from beta 5 of v3.4:

if Request.Form("AllRead") = "Y" then
	'## the following 2 lines are duplicated on purpose
	Session(strCookieURL & "last_here_date") = ReadLastHereDate(strDBNTUserName)
	Session(strCookieURL & "last_here_date") = ReadLastHereDate(strDBNTUserName)
	lastDate = Session(strCookieURL & "last_here_date")
	ActiveSince = ""
end if


beta 11 is where it was first changed:

if Request.Form("AllRead") = "Y" then
	Session(strCookieURL & "last_here_date") = Request.Form("BuildTime")
	lastDate = Session(strCookieURL & "last_here_date")
	ActiveSince = ""
end if


between rc2 and v3.4 Final it was changed to this:

if Request.Form("AllRead") = "Y" then
	Session(strCookieURL & "last_here_date") = Request.Form("BuildTime")
	Session(strCookieURL & "last_here_date") = Request.Form("BuildTime")
	lastDate = Session(strCookieURL & "last_here_date")
	UpdateLastHereDate Request.Form("BuildTime"),strDBNTUserName
	ActiveSince = ""
end if


because it wasn't working as expected with just the single line.
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 13 September 2002 :  22:11:30  Show Profile
When the session variable was populated by call to function ReadLastHereDate there was a reason to do it twice as mentioned in the post by gor at the link you posted:

quote:
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
.


But in the current version the values are coming from the same Form field and values in the form field are not changing. As the dev team tested prior to release, the single statement did not work as expected. Why? (I am sure the question must have come up in the dev team discussions.) Seems to be another unresolved application behavior.

However, I have seen this behavior while getting syatem dates using API functions, where we need to populate the variable with empty spaces (to make sufficient room in the buffer to receive the date string) before the variable can be passed to the API function to be populated with the values. I have not found anything about this behavior in relation to session variables though.

I posted because, I did not see the discussion about this. The one which is there, is in a different context, though having the same effect. If it annoys or is not taken well then what about, "We are all here to learn."

CSS and HTML4.01 Compilant Snitz Forum . ForumSquare . Rakesh Jain

It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying.

Prayer Of Forgiveness
"I forgive all living beings. May all living beings forgive me!
I cherish the friendliness towards all and harbour enmity towards none." -- Aavashyaka Sutra(Translated)
Go to Top of Page

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 14 September 2002 :  04:04:18  Show Profile
You're right GB. We appreciate your postings on suggesting these modifications, to make the code better.

Support Snitz Forums
Go to Top of Page

Deleted
deleted

4116 Posts

Posted - 14 September 2002 :  13:43:58  Show Profile
quote:
Originally posted by Davio

You're right GB. We appreciate your postings on suggesting these modifications, to make the code better.


Yeah, sure .

Stop the WAR!
Go to Top of Page

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 14 September 2002 :  14:05:32  Show Profile
quote:
Originally posted by bozden


Yeah, sure .

Is there a hint of sarcasm I detect in that?

Support Snitz Forums
Go to Top of Page

Deleted
deleted

4116 Posts

Posted - 14 September 2002 :  14:24:00  Show Profile
quote:
Originally posted by Davio

quote:
Originally posted by bozden


Yeah, sure .

Is there a hint of sarcasm I detect in that?


Just in the contrary, I tried to emphesize that I have the same opinion!

I always appreciate people posting here with well phrased ideas, additions and corrections - whether they are small or large, whether they are positive or negative.

Maybe, it is my lack of language proficiency... Sorry if it sounded different ...

Stop the WAR!
Go to Top of Page

Doug G
Support Moderator

USA
6493 Posts

Posted - 14 September 2002 :  16:06:43  Show Profile
Hi Bozden, when you come over here to visit, and overhear a conversation where some guy in a pub is telling his friend "Hey, I just won the $100 million dollar lottery" and his friend says "Yeah, sure" you'll know its a sarcastic reply you're hearing.

Semantics is a great subject. I am not even bilingual, but I can imagine how difficult it is to try to get all the subtle nuances of a 2nd language down pat!

quote:
Maybe, it is my lack of language proficiency... Sorry if it sounded different ...

My opinion is you have an excellent command of English.

======
Doug G
======
Computer history and help at www.dougscode.com
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Next Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.35 seconds. Powered By: Snitz Forums 2000 Version 3.4.07