Author |
Topic |
|
davidsheehan
Starting Member
3 Posts |
Posted - 09 April 2002 : 11:01:03
|
Hi there,
Love Snitz, but I have a need to not make the email address mandatory. I assume this takes place via the access table design, but which table/s do I need to modify?
Thanks,
Dave Sheehan
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 09 April 2002 : 11:06:19
|
why do you not want to make it mandatory ? alowing peope to not have an email address will cause you problems unless you turn 'email mode' off
|
|
|
davidsheehan
Starting Member
3 Posts |
Posted - 09 April 2002 : 11:10:27
|
quote:
why do you not want to make it mandatory ? alowing peope to not have an email address will cause you problems unless you turn 'email mode' off
Hi there - Jeeez that was a quick reply . OK, I have a bunch of people using our forums coming from another part of the world (im based in Australia), and some of them on the group list dont have email addresses, but I am generating username/passwords for them (headache) and cannot process them all bec. some dont have an email address.
Where do I find 'email mode'?
Thanks again for the quick response.
Dave
|
|
|
Roland
Advanced Member
Netherlands
9335 Posts |
Posted - 09 April 2002 : 11:13:31
|
You can remove the e-mail checking parts of code in pop_profile.asp and register.asp
pop_profile.asp lines 841+
if Request.Form("Email") = "" then Err_Msg = Err_Msg & "<li>You Must give an email address</li>" end if if EmailField(Request.Form("Email")) = 0 then Err_Msg = Err_Msg & "<li>You Must enter a valid email address</li>" end if
and lines 1029+
if Request.Form("Email") = "" then Err_Msg = Err_Msg & "<li>You Must set an email address</li>" end if if EmailField(Request.Form("Email")) = 0 then Err_Msg = Err_Msg & "<li>You Must enter a valid email address</li>" end if
register.asp lines 118+
If strAutoLogon <> 1 then if Request.Form("Email") = "" then Err_Msg = Err_Msg & "<li>You Must give an email address</li>" end if if EmailField(Request.Form("Email")) = 0 then Err_Msg = Err_Msg & "<li>You Must enter a valid email address</li>" end if end if
You'll also have to make a change to line 306:
strRecipients = Request.Form("Email")
Make it like this:
if (Request.Form("Email") <> "") And (EmailField(Request.Form("Email")) <> 0) then strRecipients = Request.Form("Email") else strRecipients = strSender end if
This little extra code will send the registration confirmation e-mail to the forums' administrator if the newly registered user hasn't entered his/her e-mail address.
This should work just fine, but as I don't have time to test it right now I do urge you to keep a backup of your current files just in case I've missed something important.
http://www.frutzle.com
Snitz Exchange | Do's and Dont's |
|
|
Roland
Advanced Member
Netherlands
9335 Posts |
Posted - 09 April 2002 : 11:16:05
|
By the way, or actually on second thought, don't remove the lines but comment them out by placing a ' at the beginning of the lines I showed. That'll do the trick and will be easier to change back.
http://www.frutzle.com
Snitz Exchange | Do's and Dont's |
|
|
davidsheehan
Starting Member
3 Posts |
Posted - 09 April 2002 : 11:20:12
|
Hi and thanks for your tip! I'II get into the code asap (and backup). You will be assiting your fellow countrymen -->> the new members I'm signing up for our forums are from The Netherlands (and Germany)!!! (I noticed your handle).
Thanks again,
Dave Sheehan
quote:
You can remove the e-mail checking parts of code in pop_profile.asp and register.asp
pop_profile.asp lines 841+
if Request.Form("Email") = "" then Err_Msg = Err_Msg & "<li>You Must give an email address</li>" end if if EmailField(Request.Form("Email")) = 0 then Err_Msg = Err_Msg & "<li>You Must enter a valid email address</li>" end if
and lines 1029+
if Request.Form("Email") = "" then Err_Msg = Err_Msg & "<li>You Must set an email address</li>" end if if EmailField(Request.Form("Email")) = 0 then Err_Msg = Err_Msg & "<li>You Must enter a valid email address</li>" end if
register.asp lines 118+
If strAutoLogon <> 1 then if Request.Form("Email") = "" then Err_Msg = Err_Msg & "<li>You Must give an email address</li>" end if if EmailField(Request.Form("Email")) = 0 then Err_Msg = Err_Msg & "<li>You Must enter a valid email address</li>" end if end if
You'll also have to make a change to line 306:
strRecipients = Request.Form("Email")
Make it like this:
if (Request.Form("Email") <> "") And (EmailField(Request.Form("Email")) <> 0) then strRecipients = Request.Form("Email") else strRecipients = strSender end if
This little extra code will send the registration confirmation e-mail to the forums' administrator if the newly registered user hasn't entered his/her e-mail address.
This should work just fine, but as I don't have time to test it right now I do urge you to keep a backup of your current files just in case I've missed something important.
http://www.frutzle.com
Snitz Exchange | Do's and Dont's
|
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 09 April 2002 : 11:21:43
|
quote:
Where do I find 'email mode'?
in admin options under email config
simply removing the code from registerring will not prevent errors unless you turn email off, there are many other parts of the forum which rely oon the fact that it will be given a valid email address.
|
|
|
ainkurn
Starting Member
5 Posts |
Posted - 02 May 2002 : 08:07:44
|
I also need to make it so that the email field is optional as we are using snitz internally on our intranet. I have followed the instructions and it is working perfectly, my only problem now is that when registering the form that comes up still has an asterix next to the email field marking it as a required field.
Any ideas where i can get rid of the star?
|
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
Posted - 02 May 2002 : 09:04:20
|
In inc_profile.asp, around line 61, remove the code in red:
<td bgColor=<% =strPopUpTableColor %> align=right width="10%"" nowrap><b><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><FONT color=#ff0000>*</FONT>Email Address: </font></b></td> <td bgColor=<% =strPopUpTableColor %>><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><INPUT name="Email" size="25" value="<% =RS("M_EMAIL") %>">
------------------------------------------------- Installation Guide | Do's and Dont's | MODs |
|
|
DrisSelt_
Starting Member
15 Posts |
Posted - 11 May 2002 : 13:55:05
|
This code is working but there is a problem.
In topic window, always show "Email Poster" button... I want to hide this button if member do not enter a mail adress. How??
Edited by - DrisSelt_ on 11 May 2002 13:56:24 |
|
|
DrisSelt_
Starting Member
15 Posts |
Posted - 11 May 2002 : 21:25:16
|
PLEASE.. HELP anyone...
How i can hide "Email Poster" button if user do not enter email adress??
|
|
|
_barbara
Junior Member
Germany
123 Posts |
Posted - 12 May 2002 : 07:53:52
|
Try the following.
In you topic.asp, change the code for displaying the email icon in replies (around line 408) by adding the lines marked in red:
<% '***** hide email icon *************** set rsMemberEmail = Server.CreateObject("ADODB.RecordSet")
strSql = "SELECT M.M_EMAIL, M.M_NAME FROM " & strMemberTablePrefix & "MEMBERS M" strSql = strSql & " WHERE M.MEMBER_ID = " & rsReplies("MEMBER_ID")
rsMemberEmail = my_Conn.Execute (strSql) if rsMemberEmail("M_EMAIL") <> " " then '***** end hide email icon *********** %>
<% if (lcase(strEmail) = "1") then if (mlev <> 0) or (mlev = 0 and strLogonForMail <> "1") then %> <a href="JavaScript:openWindow('pop_mail.asp?id=<% =rsReplies("MEMBER_ID") %>')"> <img src="icon_email.gif" height=15 width=15 alt="Email Poster" border="0" align="absmiddle" hspace="6"></a> <% end if else %> <a href="JavaScript:openWindow('pop_mail.asp?id=<% =rsReplies("MEMBER_ID") %>')"> <img src="icon_email.gif" height=15 width=15 alt="Email Poster" border="0" align="absmiddle" hspace="6"></a> <% end if %>
<% '***** hide email icon *************** end if set rsMemberEmail = nothing '***** end hide email icon *********** %>
Then, add the lines marked in red to the code which displays the email icon in topic postings (around line 569):
'***** hide email icon *************** set rsMemberEmail = Server.CreateObject("ADODB.RecordSet")
strSql = "SELECT M.M_EMAIL, M.M_NAME FROM " & strMemberTablePrefix & "MEMBERS M" strSql = strSql & " WHERE M.MEMBER_ID = " & rsTopic("MEMBER_ID")
rsMemberEmail = my_Conn.Execute (strSql) if rsMemberEmail("M_EMAIL") <> " " then '***** end hide email icon ***********
if (lcase(strEmail) = "1") then if (mlev <> 0) or (mlev = 0 and strLogonForMail <> "1") then %> <a href="JavaScript:openWindow('pop_mail.asp?id=<% =rsTopic("MEMBER_ID") %>')"> <img src="icon_email.gif" height=15 width=15 alt="Email Poster" border="0" align="absmiddle" hspace="6"></a> <% end if else %> <a href="JavaScript:openWindow('pop_mail.asp?id=<% =rsTopic("MEMBER_ID") %>')"> <img src="icon_email.gif" height=15 width=15 alt="Email Poster" border="0" align="absmiddle" hspace="6"></a> <% end if %>
<% '***** hide email icon *************** end if set rsMemberEmail = nothing '***** end hide email icon *********** %>
Make sure to backup you file before you change anything. Good luck,
Barbara
|
|
|
DrisSelt_
Starting Member
15 Posts |
Posted - 12 May 2002 : 16:54:58
|
thanks...
|
|
|
|
Topic |
|