Author |
Topic |
GauravBhabu
Advanced Member
4288 Posts |
Posted - 25 July 2001 : 13:52:06
|
I installed a few days back and was getting same sequence of errors: I found thatv it was due to the quotes (') around string values. I changed how the quotes were put around the string values and got it to work. Here is the related code:
<% 'Rem User Field Code ####################################### if (intUserFields > 0) then Response.write "<tr>" &_ "<td align=center bgcolor=""" & strCategoryCellColor & """ & colspan=""2""><b>" &_ "<font face=""" & strDefaultFontFace & """ & size=""" & strDefaultFontSize & """ & color=""" & strHeadFontColor & """>Extra Info..</font></b></td>" &_ "</tr><tr><td></td></tr>" set Conn = Server.CreateObject("ADODB.Connection") Conn.Open strConnString set rs2 = Conn.Execute("SELECT * FROM " & strMemberTablePrefix & "USERFIELDS ORDER BY USR_FIELD_ID") do until rs2.EOF fieldValue = getUserFieldValue(rs2("USR_FIELD_ID"),RS("MEMBER_ID")) Response.Write ("<tr><td valign=""top"" align=""right"" bgColor=""" & strPopUpTableColor & """><b><font face=""" & strDefaultFontFace & """ & size=""" & strDefaultFontSize & """>" & rs2("USR_LABEL") & ":</font></b></td>") if rs2("USR_FIELDTYPE") = "T" then Response.Write "<td valign=""top"" bgColor=""" & strPopUpTableColor & """><textarea maxLength=""255"" name=" & rs2("USR_SHORTNAME") &_ " cols=""20"" rows=3>" & getUserFieldValue(rs2("USR_FIELD_ID"),RS("MEMBER_ID")) & "</textarea></td>" Else if rs2("USR_FIELDTYPE") = "S" then Response.write "<td valign=""top"" bgColor=""" & strPopUpTableColor & """><font face=""" & strDefaultFontFace & """ & size=""" & strDefaultFontSize & """>" &_ "<INPUT name=""" & rs2("USR_SHORTNAME") & """ size=""20"" value=""" & getUserFieldValue(rs2("USR_FIELD_ID"),RS("MEMBER_ID")) & """></font></td>" Else Response.write "<td valign=""top"" bgColor=""" & strPopUpTableColor & """><font face=""" & strDefaultFontFace & """ & size=""" & strDefaultFontSize & """>" &_ "<INPUT name=""" & rs2("USR_SHORTNAME") & """ type=""checkbox"" value=""1"" " If fieldValue = "1" then Response.write "checked" Response.write "></font></td>" End If End If response.write "</tr>" rs2.MoveNext loop rs2.Close Conn.close set Conn = Nothing end if 'Rem User Field Code ####################################### %>
Checkout forumSquare
gauravbhabu
There is only one miracle...That is LIFE! |
|
|
Astralis
Senior Member
USA
1218 Posts |
Posted - 25 July 2001 : 14:10:52
|
GauravBhabu or Huwr,
Thanks. I used that and it works now. But, I'm having a few problems about implementing the user fields function. When I click the box to set the user fields function in the admin_user_fields page, the page reloads and shows that it isn't set anymore. In other words, I can't get it to set.
Also, will the output show up if a user tries to edit his/her profile? I guess it needs to be set correct? How can I set it if it reloads and says that it isn't set?
|
|
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 25 July 2001 : 14:19:33
|
what is the exact message you are getting. Is it an error or coded message from the file
Checkout forumSquare
gauravbhabu
There is only one miracle...That is LIFE! |
|
|
Astralis
Senior Member
USA
1218 Posts |
Posted - 25 July 2001 : 14:38:09
|
I'm not receiving anything. It just reloads back into the admin_user_fields page and shows that the checkbox isn't filled in saying it isn't enabled.
|
|
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 25 July 2001 : 14:59:49
|
Have you tried to create a field. Check the value for UserFields in Forum_Mods table. Is it 1 or 0.
Checkout forumSquare
gauravbhabu
There is only one miracle...That is LIFE! |
|
|
Astralis
Senior Member
USA
1218 Posts |
Posted - 25 July 2001 : 15:31:59
|
I checked and it's a 1.
|
|
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 25 July 2001 : 16:04:12
|
1 means it is enabled.
<% if intUserFields <> 1 then %> <input type="checkbox" name="intUserFields" value="1" <% if intUserFields = 1 then response.write "checked" end if %> > User Fields are NOT enabled, check the box and press SET to enable <% Else %> <input type="checkbox" name="intUserFields" value="1" <% if intUserFields = 1 then response.write "checked" end if %> > User Fields are enabled, uncheck the box and press SET to disable <% End If %>
if i am correct the line in red will always be false.
Anyhow this will not give an error.
Check the statements in your file are similar. In your case database is getting updated but the form is not showing that.
Checkout forumSquare
gauravbhabu
There is only one miracle...That is LIFE!
Edited by - gauravbhabu on 25 July 2001 16:05:26 |
|
|
Astralis
Senior Member
USA
1218 Posts |
Posted - 25 July 2001 : 16:47:13
|
This is what I've got:
<% if intUserFields <> 1 then %> <input type="checkbox" name="intUserFields" value="1" <% if intUserFields = 1 then response.write "checked" end if %> > User Fields are NOT enabled, check the box and press SET to enable <% Else %> <input type="checkbox" name="intUserFields" value="1" <% if intUserFields = 1 then response.write "checked" end if %> > User Fields are enabled, uncheck the box and press SET to disable <% End If %>
|
|
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 25 July 2001 : 17:58:27
|
Have you tried adding a field. can you post the text version of your admin_user_fields.
Share A Square at forumSquare
gauravbhabu
There is only one miracle...That is LIFE! |
|
|
Astralis
Senior Member
USA
1218 Posts |
Posted - 26 July 2001 : 18:23:03
|
Yes, I did try adding a field. This is my admin_user_fields file:
<!--#INCLUDE FILE="config.asp" --> <% If Session(strCookieURL & "Approval") = "15916941253" Then %> <!--#INCLUDE file="inc_functions.asp" --> <!--#INCLUDE file="inc_top.asp" --> <table border="0" width="100%"> <tr> <td width="33%" align="left" nowrap><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"> <img src="<%=strImageURL %>icon_folder_open.gif" height=15 width=15 border="0"> <a href="default.asp">All Forums</a><br> <img src="<%=strImageURL %>icon_bar.gif" height=15 width=15 border="0"><img src="<%=strImageURL %>icon_folder_open.gif" height=15 width=15 border="0"> <a href="admin_home.asp">Admin Section</a><br> <img src="<%=strImageURL %>icon_blank.gif" height=15 width=15 border="0"><img src="<%=strImageURL %>icon_bar.gif" height=15 width=15 border="0"><img src="<%=strImageURL %>icon_folder_open_topic.gif" height=15 width=15 border="0"> User Fields Configuration<br> </font></td> </tr> </table> <%
if intUserFields = "" then intUserFields = 0 if Request.Form("Method_Type") = "Write_Configuration" then Err_Msg = "" if Err_Msg = "" then
'## Forum_SQL if cInt(Request.Form("intUserFields")) <> 1 then intUserFields = 0 else intUserFields = 1 end if strSql = "UPDATE " & strTablePrefix & "MODS " strSql = strSql & " SET M_VALUE ='" & intUserFields & "'" strSQL = strSql & " WHERE M_NAME = 'HModEnable' AND M_CODE = 'UserFields' "
my_Conn.Execute (strSql)
Application(strCookieURL & "ConfigLoaded") = ""
%> <p align="center"><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>">Congratulations!</font></p> <p align="center"><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>">Configuration Posted!</font></p> <p align="center"><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><a href="admin_user_fields.asp">Back To User Fields Admin</font></a></p> <meta http-equiv="Refresh" content="2; URL=admin_user_fields.asp"> <% else %> <p align=center><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>">There Was A Problem With Your Details</font></p>
<table align=center border=0> <tr> <td><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"> <ul> <% =Err_Msg %> </ul> </font></td> </tr> </table>
<p align=center><font face="<% =strDefaultFontFace %>" size=<% =strDefaultFontSize %>><a href="JavaScript:history.go(-1)">Go Back To Enter Data</a></font></p> <% end if else %> <br> <table width="75%" align="center" border=0 cellspacing=1 cellpadding=2 bgcolor = "<% =strHeadCellColor %>"> <tr><td bgcolor="<% =strHeadCellColor %>"><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strHeadFontColor %>"><b>User Fields Configuration</b></font></td></tr><tr><td align="center" bgcolor="<% =strForumCellColor %>" > <table width="90%" height="80%" align="center"> <tr> <td align="left"><font face="<% =strDefaultFontFace %>" size=<% =strDefaultFontSize %>> <form action="admin_user_fields.asp" method="post" name="Addform"> <input type="hidden" name="Method_Type" value="Write_Configuration"> <% if intUserFields <> 1 then %> <input type="checkbox" name="intUserFields" value="1" <% if intUserFields = 1 then response.write "checked" end if %> > User Fields are NOT enabled, check the box and press SET to enable <% Else %> <input type="checkbox" name="intUserFields" value="1" <% if intUserFields = 1 then response.write "checked" end if %> > User Fields are enabled, uncheck the box and press SET to disable <% End If %> <input type="submit" name="AddField" value=" Set " style="font-weight: bold; font-size: x-small; color: White; background-color: <% =strPopUpTableColor %>;"> </form></font> </td> </tr> <tr> <td align="left" valign=top> <font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>">
<% Set rs2 = Server.CreateObject("ADODB.Recordset") rs2.cachesize = 20 sSQL = "SELECT * FROM " & strMemberTablePrefix & "USERFIELDS" rs2.Open sSQL, my_Conn, 3 rs2.cachesize = 5 rs2.PageSize = 5 strPageSize = 5 lRecs = rs2.RecordCount lFields = rs2.Fields.count iPage = CLng(request("iPage"))
iPageCount = cInt(rs2.PageCount)
if iPage < 1 then iPage = 1 end if if not rs2.BOF or not rs2.EOF then rs2.AbsolutePage = iPage end if
%> <table align="left" border=0 cellspacing=1 cellpadding=2 bgcolor = "<% =strHeadCellColor %>" width=80%> <tr> <td bgcolor="<% =strHeadCellColor %>" colspan="4"><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strHeadFontColor %>">Fields [<%=lRecs%>] <% if iPage > 1 then response.write "<a href=""admin_user_fields.asp?uTable=FORUM_USERFIELDS&iPage=" & iPage - 1 & """ alt=""previous page"">" response.write "« prev</a> | " else response.write "« prev | " end if if iPage < iPageCount then response.write "<a href=""admin_user_fields.asp?uTable=FORUM_USERFIELDS&iPage=" & iPage + 1 & """ alt=""next page"">" response.write "next »</a>" else response.write "next »" end if response.write " [Page:" & iPage & "/" if iPageCount = 0 then iPageCount = 1 end if response.write iPageCount & "]" %> </td> </tr> <tr> <td bgcolor="<% =strPopUpTableColor %>" ></td> <td bgcolor="<% =strPopUpTableColor %>" ><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" ><b>LABEL</b></font></td> <td bgcolor="<% =strPopUpTableColor %>" ><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" ><b>TYPE</b></font></td> <td bgcolor="<% =strPopUpTableColor %>" ><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" ><b>SHORTNAME</b></font></td> </tr> <% rec = 1 do until rs2.eof or rec = (strPageSize +1) set fld = rs2.fields(0) iFieldCount = 0 response.write "<tr><td bgcolor=" & strPopUpTableColor & "><font face=" & strDefaultFontFace & " size="& strDefaultFontSize & ">" response.write "<a href=""javascript:openWindow2('pop_admin_table.asp?uTable=FORUM_USERFIELDS&" & fld.name & "=" & rs2(fld.name) & "&iPage=" & iPage & "&preview=preDel')"" >delete</a> " response.write "<a href=""javascript:openWindow2('pop_admin_record.asp?uTable=FORUM_USERFIELDS&" & fld.name & "=" & rs2(fld.name) & "&iPage=" & iPage & "')"" >edit</a>" response.write "</td>" for each fld in rs2.fields iFieldCount = iFieldCount + 1 if iFieldCount <> 1 then response.write "<td bgcolor=" & strPopUpTableColor & "><font face=" & strDefaultFontFace & " size="& strDefaultFontSize & ">" response.write rs2(fld.name) end if response.write "</font></td>" next response.write "</tr>" rec = rec + 1 rs2.movenext loop response.write "</table>" rs2.close set rs2 = nothing
%> </TD></TR> <tr><td> <form action="javascript:openWindow2('pop_admin_table.asp?preview=preNew')" method="post" name="Addform"> <input type="submit" name="AddField" value=" New " style="font-weight: bold; font-size: x-small; color: White; background-color: <% =strPopUpTableColor %>;"> <input type="hidden" name="Method_Type" value=""> </form> </td></tr> <tr><td> <font face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize %>" > <b>Delete</b> Click on this link to Delete the Current User Field<br> <b>New</b> Press this button to Add a New User Field<br> <font face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize %>" > <b>ID</b> Click on the ID link to Edit the Current User Field<br><br> </font> </td></tr></table> </td></tr></table> <br> <div align="center"><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><a href="admin_home.asp">Back to Admin</A></font></div> <br> <% End If %> <!--#include file="inc_footer.asp"--> <% Else scriptname = split(request.servervariables("SCRIPT_NAME"),"/") Response.Redirect "admin_login.asp?target=scriptname" End IF %>
|
|
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 26 July 2001 : 19:22:48
|
Are you still getting errors. It is difficult to look at each line. I can set up my file for you to download from my site. Let me know.
Share A Square at forumSquare
gauravbhabu
There is only one miracle...That is LIFE! |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 26 July 2001 : 20:46:39
|
try cahnging this if intUserFields <> 1
to this if intUserFields <> "1"
|
|
|
Astralis
Senior Member
USA
1218 Posts |
Posted - 26 July 2001 : 21:10:43
|
Huwr,
No luck yet. Thanks for your help.
GauravBhabu,
Could you put up your file so I could download it? Thanks for your help.
I'm no longer receiving errors. The problem is that even though I added a field, it does not show up. Also, when I try to enable it by checking the box in admin_user_fields, it reloads and shows that I haven't set it so it's just an endless cycle.
|
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 26 July 2001 : 22:05:19
|
Astralis,
go to admin home, and select the link for forum variable info.
There should be a large section which lists the Application variables, check the value of the intUserFields variable
|
|
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 27 July 2001 : 00:37:29
|
Me and Astralis went through all the files and intUserFields in the include file was commented out.
Share A Square at forumSquare
gauravbhabu
There is only one miracle...That is LIFE! |
|
|
Topic |
|