Required Mod For Members Info

Snitz™ Forums 2000
https://forum.snitz.com/forumTopic/Posts/63820?pagenum=1
05 November 2025, 10:13

Topic


JJenson
Required Mod For Members Info
22 January 2007, 23:10


A quick question I have been working on the mod I asked shaggy about. I think I have all the changes made I need to in the admin_config_members.asp, and I also think I have gotten everything I need to insert into config.asp and also the new DBS inserts.
This mod and the code changes below are once someone sets in the admin options that a certain field is required that then the * shows up and that the user has to fill in that information.

My question though would be how do I handle the changes in the inc_profile.asp and in pop_profile.asp and om register.asp files.
This is just a test code and I believe this is a way to do it but I am sure there would be a better way so its less coding for when people do this themselves.
Code:

if strAIM = "1" then
Response.Write " <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""right"" valign=""middle"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>AIM: </font></b></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><input name=""AIM"" size=""25"" maxLength=""50"" value="""
if strMode <> "Register" then Response.Write(ChkString(rs("M_AIM"), "display"))
Response.Write """></font></td>" & vbNewLine & _
" </tr>" & vbNewLine
else
if strReqAIM = "1" then
Response.Write " <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""right"" valign=""middle"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><font color=""" & strHiLiteFontColor & """>*</font> AIM: </font></b></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><input name=""AIM"" size=""25"" maxLength=""50"" value="""
if strMode <> "Register" then Response.Write(ChkString(rs("M_AIM"), "display"))
Response.Write """></font></td>" & vbNewLine & _
" </tr>" & vbNewLine
end if

Now I believe there is a better way to word or write it in one paragraph to people just have to overwrite certain lines instead of add so much code but I am unsure what a better structure would be?
Thanks to anyone who would give some Direction.smile<

 

Replies ...


MaD2ko0l
23 January 2007, 14:26


y not somthing like

Code:

if strAIM = "1" then
Response.Write " <tr>" & vbNewLine
if strReqAIM = "1" then
Response.Write " <td bgColor=""" & strPopUpTableColor & """ align=""right"" valign=""middle"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><font color=""" & strHiLiteFontColor & """>*</font> AIM: </font></b></td>" & vbNewLine
else
Response.Write " <td bgColor=""" & strPopUpTableColor & """ align=""right"" valign=""middle"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>AIM: </font></b></td>" & vbNewLine
end if
Response.Write " <td bgColor=""" & strPopUpTableColor & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><input name=""AIM"" size=""25"" maxLength=""50"" value="""
if strMode <> "Register" then Response.Write(ChkString(rs("M_AIM"), "display"))
Response.Write """></font></td>" & vbNewLine & _
" </tr>" & vbNewLine
end if

by doing it this way u are only changing the 1 line and that is the line with the word "Aim"...if strReqAim = 1 then it ass a astericks (*).
seems a little easier and less code<
JJenson
23 January 2007, 15:36


Great thats what I needed. Thanks will give it a go today.<
Shaggy
24 January 2007, 04:27


To keep the files size down, I'd do it like this:
Code:
if strAIM = "1" then
Response.Write " <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""right"" valign=""middle"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>"
if strReqAIM = "1" then Response.Write "<font color=""" & strHiLiteFontColor & """>*</font> " AIM:&nbsp;</font></b></td>" & vbNewLine&_
Response.Write " <td bgColor=""" & strPopUpTableColor & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><input name=""AIM"" size=""25"" maxLength=""50"" value="""
if strMode <> "Register" then Response.Write(ChkString(rs("M_AIM"), "display"))
Response.Write """></font></td>" & vbNewLine & _
" </tr>" & vbNewLine
end if
But, that's just me.
<
JJenson
24 January 2007, 10:16


I like that shaggy maybe I will go back and change my inc_profile.asp page. I couldn't figure out how to do it simpler but. On the fullname part and like the links and then the birthdat drop down menu and country drop down menu would you do it the same way?
This would make it much simpler for anyone adding the mod. Right now I have just given them bog bulk changes to make it a little easier. It works perfect just makes the file much larger.<
Shaggy
24 January 2007, 10:32


Another alternative, seeing as you have multiple fields which may be mandatory, would be to create a sub that would write the asterix if the variable passed through it was equal to 1. The added advantage of doing it that way would be that, should you ever wish to change the style, etc. of the asterix, you'd only need to make one edit.
<
JJenson
24 January 2007, 11:18


How would I go about doing that? I am not sure if you have taken a look at the mod I did or not yet. But wondering if you did if you could give some pointers on a better way to write it?
All I did for the db was put a Req in the str before the name of the field.<
Shaggy
24 January 2007, 11:33


Ay, I'll take a gallop through it tomorrow and post back with a any pointers smile
<
JJenson
24 January 2007, 11:37


Great thanks.
It works but I am sure there are alot better ways that save alot more space in the file. smile<
JJenson
25 January 2007, 15:37


Just wondering if you got to take a Gallop yet Shaggy. wink<
© 2000-2021 Snitz™ Communications