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)
 Avatar MOD: Assignment Add-On
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

vesse
New Member

United Kingdom
69 Posts

Posted - 14 April 2002 :  16:04:37  Show Profile  Visit vesse's Homepage  Send vesse an AOL message  Send vesse an ICQ Message
This small MOD adds to the feature that allows users to add avatars that are automatically assigned to them.

It gives normal users the ability to either assign the Avatar to themselves or to give it no assignation (ie. available to all members). This is done through changes to the file pop_add_avatar.asp but the changes also add an extra feature, when a moderator or administrator makes use of pop_add_avatar.asp they can assign an avatar to a specific member, themselves or give it no assignation (ie. available to all members). This is done with some further changes to pop_add_avatar.asp and an extra function added to inc_functions.asp

To get this MOD: http://www.vdesign-studios.com/dodownload.asp?id=6 (This link may not function for about 30 mins after this post was made because I have to go back to my site and add the download entry)

To manually edit the files here's what you need:

In pop_add_avatar.asp:
Replace (about line 69):

strSql = strSql & ", " & getMemberID(strDBNTUserName)

with:

if Request.Form("AvatarMemberID") <> "" or Request.Form("AvatarMemberID") <> " " then
strSql = strSql & ", " & ChkString(Request.Form("AvatarMemberID"),"")
else
strSql = strSql & ", " & 0
end if

And below this code (around lines 110-114):

<tr valign="center">
<td bgColor="<% =strPopUpTableColor %>" align="right"><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><b>Avatar Name:</b> </font></td>
<td bgColor="<% =strPopUpTableColor %>"><input maxLength="50" name="AvatarName" value="<% =Trim(ChkString(TxtName,"display")) %>" size="40"></td>
</tr>

Add this code:

<%'## Start Assignment Modifications by Robert Vesse (http://www.vdesign-studios.com)##%>
<tr valign="center">
<td bgColor="<% =strPopUpTableColor %>" align="right"><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><b>Avatar Assignment:</b> </font></td>
<td bgColor="<% =strPopUpTableColor %>"><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>">
<select name="AvatarMemberID" size="1">
<%
mLev = cint(chkMemLevel(strDBNTUserName))
if (mLev = 4 or mLev = 3 or mLev = 2) then
'## Forum_SQL - Get Members from DB
strSql = "SELECT " & strMemberTablePrefix & "MEMBERS.MEMBER_ID"
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_NAME"
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS "
strSql = strSql & " WHERE " & strMemberTablePrefix & "MEMBERS.M_NAME <> 'n/a' "
strSql = strSql & " ORDER BY " & strMemberTablePrefix & "MEMBERS.M_NAME ASC"

set rs = my_Conn.execute (strSql) %>
<option selected value="0"> None</option>
<% do until rs.EOF '** %>
<option value="<% =rs("MEMBER_ID") %>"> <% =rs("M_NAME") %></option>
<% rs.MoveNext
loop
rs.close
set rs = nothing
else %>
<option value="<%= getMemberID(strDBNTUserName) %>"> Self (Only you can use the Avatar)</option>
<option value="0"> All (All members can use the avatar)</option>
<% end if %>
</select></font></td>
</tr>
<%'## End Assignment Modifications by Robert Vesse (http://www.vdesign-studios.com)##%

In inc_functions.asp:

Below the function named getMemberID(fUserName) (around lines 722-737) add the following:

function chkMemLevel(fUserID)

'## Forum_SQL
strSql = "SELECT " & strMemberTablePrefix & "MEMBERS.M_LEVEL "
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS "
strSql = strSql & " WHERE " & strDBNTSQLName & " = '" & fUserID & "'"

Set rsGetMemberID = Server.CreateObject("ADODB.Recordset")
rsGetMemberID.open strSql, my_Conn

chkMemLevel = rsGetMemberID("M_LEVEL")

rsGetMemberID.close
set rsGetMemberID = nothing

end function

Hope this is useful to someone!


Building Web Systems for a new Generation @ http://www.vdesign-studios.com
webmaster@vdesign-studios.com
rvesse@hotmail.com
rvesse@dhtmlshock.com
  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.2 seconds. Powered By: Snitz Forums 2000 Version 3.4.07