Users changing their own title.. - نوشته شده در (1394 Views)
Junior Member
i011877
مطلب: 169
169
Hmm this is not actually a MOD, but kindda.. I have seen this topic before, but are not able to find itblackeye
How do I change the code, so that users can change their own title in their profile?
Anyone..<
 پیش‌فرض مرتب‌سازی برای تاریخ DESC به معنی جدیدترین است  
 تعداد در صفحه 
نوشته شده در
Retired Support Moderator
MarcelG
مطلب: 2625
2625
i011877, search in progress. Its a small change if I'm not mistaking.<
نوشته شده در
Retired Support Moderator
MarcelG
مطلب: 2625
2625
Found it! http://forum.snitz.com/forum/topic.asp?ARCHIVE=true&TOPIC_ID=47643
Old topic though, so be carefull.<
نوشته شده در
Junior Member
i011877
مطلب: 169
169
Thanks mate!
I'll get right to it <
نوشته شده در
Junior Member
Davecl
مطلب: 105
105
I have implemented these changes and they seem to work fine bigsmile
However I was wondering if there is a way to restrict what titles people can use.. e.g they cannot use "moderator" or "admin" or any other that i wish them not to use.
Thanks.<
Dave
نوشته شده در
Junior Member
Davecl
مطلب: 105
105
would this work??
set rs = my_conn.Execute("SELECT M_POSTS FROM " & strMemberTablePrefix & "MEMBERS WHERE M_NAME = '" & ChkString(Request.Form("Name"), "SQLString") & "'")
if rs("M_POSTS") >= intRankLevel5 or mlev > 2 and Request.Form("Title")<> "Moderator" then
strSql = strSql & " M_TITLE = '" & ChkString(Request.Form("Title"),"SQLString") & "', "
end if
rs.Close
set rs = nothing
<
Dave
نوشته شده در
Retired Support Moderator
MarcelG
مطلب: 2625
2625
Yep, I guess that would work. alternatively you could do it like this:
Code:
set rs = my_conn.Execute("SELECT M_POSTS FROM " & strMemberTablePrefix & "MEMBERS WHERE M_NAME = '" & ChkString(Request.Form("Name"), "SQLString") & "'")
if rs("M_POSTS") >= intRankLevel5 or mlev > 2 and (lcase(Request.Form("Title")) <> "moderator" and _
lcase(Request.Form("Title")) <> "admin" and _
lcase(Request.Form("Title")) <> "administrator" and _
lcase(Request.Form("Title")) <> "mod")
then
strSql = strSql & " M_TITLE = '" & ChkString(Request.Form("Title"),"SQLString") & "', "
end if
rs.Close
set rs = nothing
in this way not only 'Moderator' would be disallowed, but also 'moderator' and 'moderAtor'. <
نوشته شده در
Junior Member
Davecl
مطلب: 105
105
Thanks Marcel, that was my next question.. how do I make a list of all titles that can't be used bigsmile I'll get on with that now.<
Dave
نوشته شده در
Junior Member
Davecl
مطلب: 105
105
oh dear

i got a 5 star member to try and change his title but the field is not showing up when he edits his profile, this is the code in inc_profile.asp

if strMode = "goModify" or (strMode = "goEdit" and (rs("M_POSTS") >= intRankLevel5 or rs("M_LEVEL") > 1 )) then
Response.Write " <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""right"" valign=""middle"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>Title: </font></b></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><input name=""Title"" size=""25"" maxLength=""50"" value=""" & CleanCode(rs("M_TITLE")) & """></font></td>" & vbNewLine & _
" </tr>" & vbNewLine
end if


it works fine for me but i am obviously the forum admin, it's just not showing up for 5 star members apparently.<
Dave
نوشته شده در
Retired Support Moderator
MarcelG
مطلب: 2625
2625
Dave, when a normal member edits his profile the mode isn't goEdit, but Edit afaik. So, strMode = "goEdit" should be strMode = "Edit"
sorry, wrong track here.<
نوشته شده در
Support Moderator
Shaggy
مطلب: 6780
6780
Originally posted by MarcelG in this way not only 'Moderator' would be disallowed, but also 'moderator' and 'moderAtor'.
If you're on a Windows machine, VBScript is not case sensitive (don't know about components on other OSes), so no need for the lower case.
Was also going to say that I'd posted the necessary changes for this a while back but I just spotted that that's what ye're working from! wink
<
Search is your friend “I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
شما باید یک متن وارد کنید