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)
 Mod : Private Messaging : Limiting to Mods & Admin
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

swatijain
Starting Member

48 Posts

Posted - 04 May 2001 :  19:10:56  Show Profile
Alright, this code is not the best coding you find here but I have no idea what the all the variables are for moderating the forums. This code has only been tested on SQL Server 7.0...and well I don't think its that reliable, but it works.

All this code does is limit your normal users to send messages to only moderators and administrators. Members can also send message to all the moderators of a specific forum. You can use this in conjuction with the private messaging feature of emailing all users or replace it with this.

You need the Private Messaging Mod and the the Mod which allows you to send a message to multiple users.


Approximate Line # 119



Msg = ""


moderatorlevel = 2

'## Get a List of all the Moderators & Administrators
strSQL = "SELECT m_name, m_level, member_id "
strSQL = strSQL & " FROM Forum_Members "
strSQL = strSQL & " WHERE m_level = " & moderatorlevel
set aus = my_conn.Execute (strSQL)


if Request.Querystring("method") = "ReplyQuote" or Request.Querystring("method") = "Forward" then




Approximate Line # 232


Replace

<input name="sendto" value="<% =Request.Querystring("mname") %>" size="50">


with:




<%if (mLev = 4 or mLev = 3) then %>

<input name="sendto" value="<% =Request.Querystring("mname") %>" size="50">


<% else %>


<select size="1" name="sendto">
<% 'CODING FOR SENDING TO MODS AND ADMINS %>
<option value="admin">Administrator</option>

<% '## Select Moderators


'select distinct forums
strSQL = "SELECT forum_id, f_subject FROM forum_forum "
set fmd = my_conn.Execute (strSQL)

do until fmd.Eof

f_subject = fmd("f_subject")
forum_subject = "All Moderators : " & f_subject

'select moderators of each forum
strSQL = "SELECT mod_id, forum_id, member_id FROM forum_moderator WHERE forum_id =" &fmd("forum_id")
set smod = my_conn.Execute (strSQL)

modvalue = "admin,tyles"

do until smod.Eof

'select username of the moderator of each forum
strSQL = "SELECT m_name, member_id FROM Forum_Members WHERE member_id =" & smod("member_id")
set smod2 = my_conn.Execute(strSQL)
mod_name = smod2("m_name")

modvalue = modvalue & "," & mod_name

smod.MoveNext
Loop

if modvalue <> "admin" then

response.write "<option value='" & modvalue & "'>" & forum_subject & "</option>"

end if

fmd.MoveNext
Loop

modvalue = "admin"
%>
<% do until aus.Eof
%>
<option <% if request.querystring("mname") = aus("m_name") then response.write " selected" %>>Moderator : <% =aus("m_name") %></option>


<%
aus.moveNext
Loop
'DONE
%>
</select>

<% end if %>





As you can see the code is not that impressive. I have not used the strMemberTablePrefix or anything like that (mostly because I don't know what it stands for). The code works fine if you haven't renamed any of the tables or changed the table prefix from Forum_ to something else.

Please keep in mind that you do need the multiple users mod (allows you to send messages to multiple users).

Please let me know how it works out. If anyone can improve this good, then it would be wonderful! (I'd use that too...)

I am sorry if this mod doesn't meet your expectations or is not reliable. I am a beginner with ASP and just learning.



Edited by - swatijain on 04 May 2001 19:12:50

Edited by - swatijain on 04 May 2001 19:13:51

Edited by - swatijain on 04 May 2001 19:14:43
  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.14 seconds. Powered By: Snitz Forums 2000 Version 3.4.07