Author |
Topic |
DavidRhodes
Senior Member
United Kingdom
1222 Posts |
Posted - 07 January 2004 : 17:42:24
|
Not quite, I now get the error
ADODB.Field (0x800A0BCD) Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
function OldisAllowedMember(fForum_ID,fMemberID)
OldisAllowedMember = 0
if isDeniedMember(fForum_ID, fMemberID) then exit function
strSql = "SELECT MEMBER_ID, FORUM_ID FROM " & strTablePrefix & "ALLOWED_MEMBERS "
strSql = strSql & " WHERE FORUM_ID = " & cLng(fForum_ID)
strSql = strSql & " AND MEMBER_ID = " & cLng(fMemberID)
Set rsAllowedMember = Server.CreateObject("ADODB.Recordset")
rsAllowedMember.open strSql, my_Conn
blnAM = 0
if not rsAllowedMember.bof and not rsAllowedMember.eof then blnAM = 1
rsAllowedMember.close
set rsAllowedMember = nothing
'## if the member exists as an allowed member for the forum then return value 1
if blnAm = 1 then
OldisAllowedMember = 1
else
'## check for usergroup membership
strGroupsForUser = getGroupMembership(fMemberID,1)
if strGroupsForUser <> "" then
'## check to see if the user's groups are a part of this forum
strSql = "SELECT USERGROUP_ID FROM " & strTablePrefix & "ALLOWED_USERGROUPS "
strSql = strSql & "WHERE FORUM_ID = " & fForum_ID
strSql = strSql & " AND PERMS = 0"
set rsAllowedUserGroups = my_Conn.execute(strSql)
blnAllowed = 0
Do While Not rsAllowedUserGroups.eof Or OldisAllowedMember = 1
intUserGroupID = rsAllowedUserGroups("USERGROUP_ID")
if InStr("," & strGroupsForUser & ",", "," & intUserGroupID & ",") then OldisAllowedMember = 1
rsAllowedUserGroups.movenext
Loop
rsAllowedUserGroups.close
set rsAllowedUserGroups = nothing
end if
end if
end function |
The UK MkIVs Forum |
|
|
gDewar
Starting Member
USA
17 Posts |
Posted - 08 January 2004 : 01:41:05
|
David, no mix and match...
I said you could use
Do Until rsAllowedUserGroups.eof Or OldisAllowedMember = 1
- OR -
Do While Not rsAllowedUserGroups.eof And OldisAllowedMember <> 1
You have: Do While Not rsAllowedUserGroups.eof Or OldisAllowedMember = 1
If you want to use While Not, you have to use an "AND" operator and compare OldisAllowedMember <> 1
I still say While Not is an extra Op... |
|
|
DavidRhodes
Senior Member
United Kingdom
1222 Posts |
Posted - 08 January 2004 : 04:30:14
|
Thanks, I changed it to
Do Until rsAllowedUserGroups.eof Or OldisAllowedMember = 1 |
The UK MkIVs Forum |
|
|
Reinsnitz
Snitz Forums Admin
USA
3545 Posts |
Posted - 14 January 2004 : 15:45:09
|
quote: Originally posted by gDewar
David,
I come from VB6 land... so maybe this is a dumb question...
In VB, True is = -1, Not 1. I know this is also the case in script because
Response.Write Int(True)
Returns -1
Shouldn't you guys use -1, not 1? Also, why aren't you guys using the True and False keywords to begin with?
This would seem especially important in this lawless land where there are no data types to force the correct values.
Maybe I'm just being a code fascist, I don't know... Just starting to get into this asp stuff so not sure I feel confident enough yet to root out the problem, but I may be more helpful soon - I've been using the forums in Interdev to teach myself this stuff.
Glenn
Nothing wrong with being a finatic :)
Easy question to answer :) The forums are written to be cross database compatible. Access, MySQL, MSSQL, MSDN, Sybase, Oracle, FoxPro, etc... is all possible with this product, not just SQL Server or Access or MySQL... these were all planned from the beginning :) |
Reinsnitz (Mike) |
|
|
Reinsnitz
Snitz Forums Admin
USA
3545 Posts |
Posted - 14 January 2004 : 15:46:53
|
oh... and there are versions out there running all these right now... the problem is the last few didn't share their code with the community to allow us to also make it part of the baseline :) |
Reinsnitz (Mike) |
|
|
DavidRhodes
Senior Member
United Kingdom
1222 Posts |
Posted - 14 January 2004 : 17:05:59
|
Reinsnitz, your going off topic Nikkol, did you get that fix above, it looks to have been correct fingers crossed |
The UK MkIVs Forum |
|
|
gDewar
Starting Member
USA
17 Posts |
Posted - 24 January 2004 : 02:19:32
|
quote: Originally posted by Reinsnitz
Nothing wrong with being a finatic :)
Easy question to answer :) The forums are written to be cross database compatible. Access, MySQL, MSSQL, MSDN, Sybase, Oracle, FoxPro, etc... is all possible with this product, not just SQL Server or Access or MySQL... these were all planned from the beginning :)
Mike,
I am honored that you took notice of my question.
On the DB question, I can see the importance of that. In fact, I love the adapations that have been made so that code can be easily written to work with all the different databases.
But many of the instances where I see 1 being used as a boolean True value, are not related to Boolean fields in a database.
Another question: Is there a set of coding conventions for Snitz that MOD developers are asked to follow?
Lastly, I'm not sure I'm asking these questions in the right forum... David seemed to suggest we unwittingly went off topic... Is there a section of the forum for discussing preferred code methodology for Snitz? |
Edited by - gDewar on 24 January 2004 14:23:53 |
|
|
davemaxwell
Access 2000 Support Moderator
USA
3020 Posts |
Posted - 24 January 2004 : 16:18:05
|
quote: Originally posted by gDewar
But many of the instances where I see 1 being used as a boolean True value, are not related to Boolean fields in a database.
Another question: Is there a set of coding conventions for Snitz that MOD developers are asked to follow?
Their is nothing wrong with using 1 or 0 as a boolean true as long as it's consistent. And since some DBMS return 1 as true and others -1 as true, using a numeric value in a boolean context allows for the cross-DBMS use.
quote: Originally posted by gDewar
Lastly, I'm not sure I'm asking these questions in the right forum... David seemed to suggest we unwittingly went off topic... Is there a section of the forum for discussing preferred code methodology for Snitz?
A better forum would be this one: http://forum.snitz.com/forum/forum.asp?FORUM_ID=17
But most of all a new topic is always preferrable to asking a non-related question in an existing topic. It's much more likely to get a response in a new topic. |
Dave Maxwell Barbershop Harmony Freak |
|
|
Ferragi
Starting Member
Brazil
4 Posts |
Posted - 31 January 2004 : 09:41:25
|
Hi,
Where can I find the UserGroupMOD required for this update?
I tried many places on this forum and some MOD sites but could not find it... |
Fabio Ferragi IVAO Assitant Network Admin |
Edited by - Ferragi on 02 February 2004 13:14:36 |
|
|
Ferragi
Starting Member
Brazil
4 Posts |
Posted - 02 February 2004 : 13:14:54
|
Does anyone still follow this topic? |
Fabio Ferragi IVAO Assitant Network Admin |
|
|
Nikkol
Forum Moderator
USA
6907 Posts |
Posted - 02 February 2004 : 18:55:21
|
yes, just have been way too busy in my real life. Not sure what you are asking in your previous post. the MOD is still available via the link in this topic. |
Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~ |
|
|
Ferragi
Starting Member
Brazil
4 Posts |
Posted - 03 February 2004 : 11:37:57
|
Ohhh nevermind.... I must have read something wrong, sorry :\ |
Fabio Ferragi IVAO Assitant Network Admin |
|
|
ajhvdb
Junior Member
Netherlands
392 Posts |
Posted - 04 February 2004 : 20:10:38
|
Can I apply this to 3.4.04 ? It looks like some standard 3.4.04 functions regarding user rights have changed, |
|
|
Nikkol
Forum Moderator
USA
6907 Posts |
|
ajhvdb
Junior Member
Netherlands
392 Posts |
Posted - 10 February 2004 : 10:49:39
|
In 3.4.04 the active.asp and search.asp pages have changed. Instead of calling a function "chkDisplayForum" a function "chkForumAccessNew" is called.
Your mod modified a bit of "chkDisplayForum" so my logic is, "chkForumAccessNew" needs to be modified to.
I think the other Usergroup Mod changes are ok in 3.4.04
|
|
|
Topic |
|