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/O Code)
 Required Mod For Members Info
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

JJenson
Advanced Member

USA
2121 Posts

Posted - 22 January 2007 :  23:10:03  Show Profile  Visit JJenson's Homepage  Reply with Quote
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.


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

Edited by - JJenson on 23 January 2007 01:30:13

MaD2ko0l
Senior Member

United Kingdom
1053 Posts

Posted - 23 January 2007 :  14:26:51  Show Profile  Visit MaD2ko0l's Homepage  Reply with Quote
y not somthing like


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<

© 1999-2010 MaD2ko0l
Go to Top of Page

JJenson
Advanced Member

USA
2121 Posts

Posted - 23 January 2007 :  15:36:09  Show Profile  Visit JJenson's Homepage  Reply with Quote
Great thats what I needed. Thanks will give it a go today.<
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 24 January 2007 :  04:27:05  Show Profile  Reply with Quote
To keep the files size down, I'd do it like this:
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.

<

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.”
Go to Top of Page

JJenson
Advanced Member

USA
2121 Posts

Posted - 24 January 2007 :  10:16:08  Show Profile  Visit JJenson's Homepage  Reply with Quote
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.<
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 24 January 2007 :  10:32:17  Show Profile  Reply with Quote
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.

<

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.”
Go to Top of Page

JJenson
Advanced Member

USA
2121 Posts

Posted - 24 January 2007 :  11:18:25  Show Profile  Visit JJenson's Homepage  Reply with Quote
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.<
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 24 January 2007 :  11:33:42  Show Profile  Reply with Quote
Ay, I'll take a gallop through it tomorrow and post back with a any pointers

<

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.”
Go to Top of Page

JJenson
Advanced Member

USA
2121 Posts

Posted - 24 January 2007 :  11:37:36  Show Profile  Visit JJenson's Homepage  Reply with Quote
Great thanks.

It works but I am sure there are alot better ways that save alot more space in the file. <
Go to Top of Page

JJenson
Advanced Member

USA
2121 Posts

Posted - 25 January 2007 :  15:37:44  Show Profile  Visit JJenson's Homepage  Reply with Quote
Just wondering if you got to take a Gallop yet Shaggy. <
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.18 seconds. Powered By: Snitz Forums 2000 Version 3.4.07