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 MOD-Group
 MOD Add-On Forum (W/Code)
 Allowed Member List - Alphabetical Order
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Gandiel
Starting Member

21 Posts

Posted - 16 July 2003 :  16:22:41  Show Profile
This is not a MOD persay... but rather an upgrade to some code.

Currently, when you edit a forum and try to edit members in an "Allowed Members" list, those members are shown in the order in which they were added to the list.

Simple JOIN query to the rescue... change the following SQL statement (in RED) and you should be on your way. I've added some surrounding code to better show where this is located. It starts on line 1463 in my post.asp file but will probably differ on yours.

File to edit: post.asp

Change this:

strSql = "SELECT MEMBER_ID "
strSql = strSql & " FROM " & strTablePrefix & "ALLOWED_MEMBERS "
strSql = strSql & " WHERE FORUM_ID = " & strRqForumID


To this:

strSql = "SELECT "& strTablePrefix & "ALLOWED_MEMBERS.MEMBER_ID, "& strTablePrefix &"MEMBERS.M_NAME "
strSql = strSql & " FROM " & strTablePrefix & "ALLOWED_MEMBERS INNER JOIN " & strTablePrefix & "MEMBERS ON " & strTablePrefix & "ALLOWED_MEMBERS.MEMBER_ID = " & strTablePrefix & "MEMBERS.MEMBER_ID "
strSql = strSql & " WHERE (((" & strTablePrefix & "ALLOWED_MEMBERS.FORUM_ID)=" & strRqForumID & ")) "
strSql = strSql & " ORDER BY " & strTablePrefix & "MEMBERS.M_NAME "


Surrounding Code For Reference

if rsMember.EOF then
			recMemberCount = ""
		else
			allMemberData = rsMember.GetRows(adGetRowsRest)
			recMemberCount = UBound(allMemberData,2)
			meMEMBER_ID = 0
			meM_NAME = 1
		end if

		rsMember.close
		set rsMember = nothing

		tmpStrUserList  = ""

		if strRqMethod = "EditForum" or strRqMethod = "EditURL" then		
			strSql = "SELECT "& strTablePrefix & "ALLOWED_MEMBERS.MEMBER_ID, "& strTablePrefix &"MEMBERS.M_NAME "
			strSql = strSql & " FROM " & strTablePrefix & "ALLOWED_MEMBERS INNER JOIN " & strTablePrefix & "MEMBERS ON " & strTablePrefix & "ALLOWED_MEMBERS.MEMBER_ID = " & strTablePrefix & "MEMBERS.MEMBER_ID "
			strSql = strSql & " WHERE (((" & strTablePrefix & "ALLOWED_MEMBERS.FORUM_ID)=" & strRqForumID & ")) "
			strSql = strSql & " ORDER BY " & strTablePrefix & "MEMBERS.M_NAME "
			set rsAllowedMember = Server.CreateObject("ADODB.Recordset")
			rsAllowedMember.open strSql, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText

			if rsAllowedMember.EOF then
				recAllowedMemberCount = ""
			else
				allAllowedMemberData = rsAllowedMember.GetRows(adGetRowsRest)
				recAllowedMemberCount = UBound(allAllowedMemberData,2)
				amMEMBER_ID = 0
			end if



I'm fairly new to the Snitz code.... so use this at your own expense.


Gandiel

Jeff V
Starting Member

23 Posts

Posted - 01 September 2003 :  14:20:57  Show Profile
Didn't seem to change anything when I did this. Is this change for when you press the members linke at the top of the page they are in alpabetical order? This is what I was hoping to see.

Jeff
Go to Top of Page

BogieMan
New Member

USA
88 Posts

Posted - 04 September 2003 :  15:16:05  Show Profile  Visit BogieMan's Homepage
I think this refers to the allowed members list for private forums...
Go to Top of Page

korayem
New Member

Egypt
72 Posts

Posted - 25 September 2003 :  10:12:11  Show Profile
why dont i simply add

strSql = "SELECT MEMBER_ID, M_NAME "
strSql = strSql & " FROM " & strTablePrefix & "ALLOWED_MEMBERS "
strSql = strSql & " WHERE FORUM_ID = " & strRqForumID
strSql = strSql & " ORDER BY M_NAME "



By the time you read this, you've already read it!!
http://HASdot.COM/
Go to Top of Page

muzishun
Senior Member

United States
1079 Posts

Posted - 05 March 2004 :  02:26:23  Show Profile  Visit muzishun's Homepage
Works like a charm, Gandiel. Thanks much!

Bill Parrott
Senior Web Programmer, University of Kansas
Co-Owner and Code Monkey, Eternal Second Designs (www.eternalsecond.com)
Personal Website (www.chimericdream.com)
Go to Top of Page

kwhipp
Junior Member

USA
407 Posts

Posted - 05 March 2004 :  07:30:44  Show Profile  Visit kwhipp's Homepage  Send kwhipp an AOL message  Send kwhipp an ICQ Message  Send kwhipp a Yahoo! Message
quote:
Originally posted by korayem

why dont i simply add

strSql = "SELECT MEMBER_ID, M_NAME "
strSql = strSql & " FROM " & strTablePrefix & "ALLOWED_MEMBERS "
strSql = strSql & " WHERE FORUM_ID = " & strRqForumID
strSql = strSql & " ORDER BY M_NAME "




Because M_NAME is not in the ALLOWED_MEMBERS table. You have to join ALLOWED_MEMBERS with MEMBERS to retrieve M_NAME.

- Kevin
Go to Top of Page

alansmith
Starting Member

USA
5 Posts

Posted - 05 March 2004 :  10:58:32  Show Profile  Visit alansmith's Homepage
Worked for me too. Thanks for the info.

http://www.computingfuture.co.uk/send-flowers.html
http://www.clareflorist.co.uk/partner/jump.asp?idaff=350
http://www.computingfuture.net/
http://www.computingfuture.net/internet/
http://www.computingfuture.net/consultancy/
http://www.computingfuture.net/disaster/
http://www.inc-corporation.co.uk/
http://www.inc-corporation.co.uk/inventions/
Go to Top of Page
  Previous Topic Topic Next Topic  
 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.23 seconds. Powered By: Snitz Forums 2000 Version 3.4.07