Author |
Topic |
i011877
Junior Member
Denmark
169 Posts |
Posted - 23 May 2006 : 08:57:20
|
Hmm this is not actually a MOD, but kindda.. I have seen this topic before, but are not able to find it
How do I change the code, so that users can change their own title in their profile?
Anyone..< |
|
|
MarcelG
Retired Support Moderator
Netherlands
2625 Posts |
|
MarcelG
Retired Support Moderator
Netherlands
2625 Posts |
|
i011877
Junior Member
Denmark
169 Posts |
Posted - 23 May 2006 : 12:30:27
|
Thanks mate!
I'll get right to it < |
|
|
|
Davecl
Junior Member
United Kingdom
105 Posts |
Posted - 24 May 2006 : 10:24:09
|
I have implemented these changes and they seem to work fine
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 |
|
|
Davecl
Junior Member
United Kingdom
105 Posts |
Posted - 25 May 2006 : 01:30:48
|
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 |
Edited by - Davecl on 25 May 2006 01:31:19 |
|
|
MarcelG
Retired Support Moderator
Netherlands
2625 Posts |
Posted - 25 May 2006 : 07:59:13
|
Yep, I guess that would work. alternatively you could do it like this:
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'. < |
portfolio - linkshrinker - oxle - twitter |
Edited by - MarcelG on 25 May 2006 08:01:50 |
|
|
Davecl
Junior Member
United Kingdom
105 Posts |
Posted - 25 May 2006 : 10:00:22
|
Thanks Marcel, that was my next question.. how do I make a list of all titles that can't be used I'll get on with that now.< |
Dave |
|
|
Davecl
Junior Member
United Kingdom
105 Posts |
Posted - 26 May 2006 : 08:51:54
|
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 |
|
|
MarcelG
Retired Support Moderator
Netherlands
2625 Posts |
Posted - 26 May 2006 : 09:35:31
|
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.< |
portfolio - linkshrinker - oxle - twitter |
Edited by - MarcelG on 26 May 2006 09:36:21 |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 26 May 2006 : 09:49:49
|
quote: 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!
< |
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.” |
|
|
Davecl
Junior Member
United Kingdom
105 Posts |
|
Davecl
Junior Member
United Kingdom
105 Posts |
Posted - 29 May 2006 : 03:13:42
|
bump< |
Dave |
|
|
Davecl
Junior Member
United Kingdom
105 Posts |
Posted - 03 June 2006 : 03:19:10
|
still struggling with this < |
Dave |
Edited by - Davecl on 03 June 2006 03:19:35 |
|
|
Davecl
Junior Member
United Kingdom
105 Posts |
Posted - 06 June 2006 : 06:43:51
|
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
could it be because rs("M_TITLE") doesn't actually contain a value until their title has been edited??< |
Dave |
|
|
Davecl
Junior Member
United Kingdom
105 Posts |
Posted - 06 June 2006 : 07:29:00
|
nope, checked that out.
this is really annoying now.. i have changed intRankLevel5 to 0 so in theory anybody can change their title but the "Title" field still doesn't show up. If I remove the intRankLevel check it works fine< |
Dave |
|
|
Topic |
|