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)
 Creating a mod
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Max0005
Junior Member

Italy
294 Posts

Posted - 27 November 2006 :  10:20:32  Show Profile  Visit Max0005's Homepage  Send Max0005 a Yahoo! Message  Reply with Quote
I'm creating a mod to let people put their telephone number in their profile. I added a file in the database, added a string in pop_profile.asp, and then, this is what I think I should add in inc_profile.asp:

else
				Response.Write("http://")
			end if
			Response.Write	"""></font></td>" & vbNewLine & _
					"                    </tr>" & vbNewLine & _
					"                    <tr>" & vbNewLine & _
					"                      <td bgColor=""" & strPopUpTableColor & """ align=""right"" valign=""middle"" nowrap width=""10%""><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """> </font></b></td>" & vbNewLine & _
					"                      <td bgColor=""" & strPopUpTableColor & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><input name=""Link2"" size=""25"" maxLength=""255"" value="""
			if strMode <> "Register" then
				if rs("M_LINK2") <> " " and lcase(rs("M_LINK2")) <> "http://" then Response.Write(ChkString(rs("M_LINK2"), "display")) else Response.Write("http://")
			else
				Response.Write("http://")
			end if
			if strAge = "1" then
		Response.Write	"                    <tr>" & vbNewLine & _
				"                      <td bgColor=""" & strPopUpTableColor & """ align=""right"" valign=""middle"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>Telephone Number:</font></b></td>" & vbNewLine & _
				"                      <td bgColor=""" & strPopUpTableColor & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><input name=""Telephone Number"" size=""5"" maxLength=""20"" value="""
		if strMode <> "Register" then Response.Write(ChkString(rs("M_TELEPHONE"), "display"))
		Response.Write	"""></font></td>" & vbNewLine & _
				"                    </tr>" & vbNewLine
	end if                                Response.Write	"""></font></td>" & vbNewLine & _
					"                    </tr>" & vbNewLine
		end if
	end if
	Response.Write	"                  </table>" & vbNewLine & _
			"                </td>" & vbNewLine & _
			"              </tr>" & vbNewLine & _
			"            </table>" & vbNewLine & _
			"          </td>" & vbNewLine & _
			"        </tr>" & vbNewLine & _


Should I do something different?

PS: The new row in the database, is named
M_TELEPHONE
.

<moved from="Help: General / Current Version (Old)" by="Shaggy" /><

Edited by - Shaggy on 27 November 2006 10:36:48

Etymon
Advanced Member

United States
2385 Posts

Posted - 28 November 2006 :  15:16:08  Show Profile  Visit Etymon's Homepage  Reply with Quote
You've got your code nested within the strAge variable. If you were to turn the Age feature off in admin_config_members.asp, then it would also turn off your telephone feature.

You might want to try something different so that your telephone mod has an equal standing with the other features in the profile. Add the variable strTelephone to config.asp, add the same variable to your CONFIG_NEW table, and then mimic some code (for example, the Homepage code) in admin_config_members.asp. You will then be able to control the mod from the Member Details Configuration panel as to whether or not the feature is available. It also helps with testing. Also, anytime you add a variable to the CONFIG_NEW table it is a good practice to use Check Installation in the Admin Section.

The best way to learn how to create a new MOD like you are doing is to repeat what has already been done in the code for something else. For learning purposes, as mentioned above ... you could use a field like the Homepage field and then follow how it is controlled throughout the membership (during registration and after) process by doing a search for the field name and the variable (for example, M_HOMEPAGE and STRHOMEPAGE) throughout the register.asp, inc_profile.asp, pop_profile.asp, config.asp, and admin_config_members.asp files as well as the CONFIG_NEW table. This will give you a good idea of what is going on in the code.

It's not as easy as copy and paste but it's pretty close once you get a feel for it.

If you want your telephone feature to be a required feature, then take a look at how the Email Address field is coded.
<

Edited by - Etymon on 28 November 2006 15:19:30
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.16 seconds. Powered By: Snitz Forums 2000 Version 3.4.07