Users changing their own title..

Snitz™ Forums 2000
https://forum.snitz.com/forumTopic/Posts/61958?pagenum=1
05 November 2025, 07:06

Topic


i011877
Users changing their own title..
23 May 2006, 08:57


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..<

 

Replies ...


MarcelG
23 May 2006, 10:47


i011877, search in progress. Its a small change if I'm not mistaking.<
MarcelG
23 May 2006, 10:49


Found it! http://forum.snitz.com/forum/topic.asp?ARCHIVE=true&TOPIC_ID=47643
Old topic though, so be carefull.<
i011877
23 May 2006, 12:30


Thanks mate!
I'll get right to it <
Davecl
24 May 2006, 10:24


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.<
Davecl
25 May 2006, 01:30


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
<
MarcelG
25 May 2006, 07:59


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'. <
Davecl
25 May 2006, 10:00


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.<
Davecl
26 May 2006, 08:51


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.<
MarcelG
26 May 2006, 09:35


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.<
Shaggy
26 May 2006, 09:49


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
<
Davecl
27 May 2006, 01:06


Shaggy, I know you posted this method originally, here

http://forum.snitz.com/forum/topic.asp?ARCHIVE=true&TOPIC_ID=47643&whichpage=1

and I wonder if you have any ideas as to why it will let me (Admin) change my title but not my 5 star members??
Thanks<
Davecl
29 May 2006, 03:13


bumpbigsmile<
Davecl
03 June 2006, 03:19


still struggling with this sad<
Davecl
06 June 2006, 06:43


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??<
Davecl
06 June 2006, 07:29


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<
Davecl
06 June 2006, 08:01


think I've done it

intRankLevel5 should be CInt(intRankLevel5)
just got to get a 5 star member to check it out now<
i011877
07 July 2006, 16:55


Ehrrmmm! Could someone please sum this up?
I want to have all my users being able to change their title.<
CalloftheHauntedMaster
07 July 2006, 17:03


And while they're at it, can they explain how to create a post count level before users can change their own levels?<
Davecl
08 July 2006, 01:04


Originally posted by i011877
Ehrrmmm! Could someone please sum this up?
I want to have all my users being able to change their title.

Got this working.
in inc_profile.asp find (approx line 260)

if strMode = "goModify" 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

add the code in green

if strMode = "goModify" or (strMode = "goEdit" and (rs("M_POSTS") >= CInt(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

you can change CInt(intRankLevel5) to any level you want so that different ranks of members can alter their titles.
in pop_profile.asp beginning at line 1158 find the following:

strSql = "UPDATE " & strMemberTablePrefix & "MEMBERS "
if trim(Request.Form("Password")) <> "" then
strPassword = sha256("" & Request.Form("Password"))
strSql = strSql & " SET M_PASSWORD = '" & ChkString(strPassword,"SQLString") & "', "
else
strSql = strSql & " SET"
end if
strSql = strSql & " M_COUNTRY = '" & ChkString(Request.Form("Country"),"SQLString") & "', "

And add the following code immediately after it:

set rs = my_conn.Execute("SELECT M_POSTS FROM " & strMemberTablePrefix & "MEMBERS WHERE M_NAME = '" & ChkString(Request.Form("Name"), "SQLString") & "'")
if rs("M_POSTS") >= CInt(intRankLevel5) or mlev > 2
then
strSql = strSql & " M_TITLE = '" & ChkString(Request.Form("Title"),"SQLString") & "', "
end if
rs.Close
set rs = nothing

this works fine for me, hope that's summed it up ok for you bigsmile<
i011877
09 July 2006, 09:12


Ngggh! Did not work sad
Could you have a look?
Included inc_profile.asp & pop_profile.asp
www.myforum.dk/profile.rar<
Davecl
10 July 2006, 04:09


Try these

changes made at line 224 in inc_profile.asp
1204 in pop_profile.asp

www.parrotlinks.com/profile.rar
let me know when you got it then i can take it down<
i011877
10 July 2006, 05:37


Nope did not work, ****! Can not even show the profile, when I click a member.
Thanks for giving it a shot anyway bigsmile<
Davecl
11 July 2006, 04:15


mmm maybe some conflicting mods or something.. sorry i couldn't helpsad<
i011877
27 July 2006, 15:56


inc_profile:
Code:
if strMode = "goModify" or (strMode = "goEdit" and (rs("M_POSTS") >= CInt(intRankLevel1) or rs("M_LEVEL") > 1 ))then
Response.Write " <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""right"" valign=""middle"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>Titel:</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
pop_profile.asp:
Code:
set rs = my_conn.Execute("SELECT M_POSTS FROM " & strMemberTablePrefix & "MEMBERS WHERE M_NAME = '" & ChkString(Request.Form("Name"), "SQLString") & "'")
if rs("M_POSTS") >= CInt(intRankLevel1) then
strSql = strSql & " M_TITLE = '" & ChkString(Request.Form("Title"),"SQLString") & "', "
end if
rs.Close
set rs = nothing
WORKED!
Is there a problem with this solution?<
Davecl
28 July 2006, 02:13


can't see why this works yet it didn't before when all you've changed is the mlev check in pop_profile.asp which allowed mods & admins to change peoples titles.
can't see any problem with it though. <
© 2000-2021 Snitz™ Communications