Ray
In my search I was just doing a <cfdump var="#custom2#">. However when
I removed this the search was returning no results? When it should have
?
Here is the code for the search results page, can you find anything that
may be causing this problem??
As I said before, if I remove
and CF_CUSTOM2 <IN> ""#session.groupname#""" from the CFSearch, it
returns matched results ??
----------------------------------------------
<html>
<head>
<title>Search Results</title>
<CFIF IsDefined("Session.username") AND IsDefined("Session.Password")
AND IsDefined("Session.ID")>
<cfquery name="UserGroups" datasource="intranetv8">
SELECT * FROM usergroupmembership, groups WHERE UserID = #Session.ID#
AND
usergroupmembership.groupid = groups.groupid
</cfquery>
<cfset session.groupname = QuotedValueList(UserGroups.groupname)>
</head>
<body>
<CFSET SearchCollection = "idocs">
<CFSET UseURLPath = "YES">
<!--- retrieve requested files --->
<CFSEARCH
name = "GetResults"
collection = "idocs"
type = "simple"
criteria = "#Form.Criteria# and CF_CUSTOM2 <IN>
""#session.groupname#"""
maxRows = "#Evaluate(Form.MaxRows + Form.StartRow)#"
startRow = "#Form.StartRow#"
>
<CFSEARCH
name = "GetAllResults"
collection = "idocs"
type = "simple"
criteria = "#HTMLEditFormat(Form.Criteria)#"
>
<!--- no files found for specified criteria? --->
<CFIF GetResults.RecordCount is 0>
<p><b>No files found in your search</b></p>
<!--- ... else at least one file found --->
<CFELSE>
<cfif sgn(Evaluate(GetResults.RecordCount - Form.MaxRows))
-1>
<p>
<CFOUTPUT>
Your search for <b>"#Form.Criteria#"</b>
found <b>#GetAllResults.RecordCount#</b> matches.<br>
Viewing #Form.StartRow# to #Evaluate(GetResults.RecordCount
+ Form.StartRow -1)# of #GetAllResults.RecordCount# results
found.
</cfoutput>
<cfelse>
<p>
<CFOUTPUT>
Your search for <b>"#Form.Criteria#"</b>
found <b>#GetAllResults.RecordCount#</b> matches.<br>
Viewing #Form.StartRow# to #Evaluate(GetResults.RecordCount
+ Form.StartRow -2)# of #GetAllResults.RecordCount# results
found.
</cfoutput>
</cfif>
<p>
<table border="0" width="100%" cellpadding="4">
<CFOUTPUT query="GetResults" maxRows="#Form.MaxRows#">
<tr bgcolor="#IIf(CurrentRow Mod 2, DE('FFFFFF'),
DE('FFFFFF'))#">
<td width="2%">#Evaluate(Form.StartRow
+ CurrentRow - 1)#</td>
<td width="98%">
<CFIF UseURLPath> <!--- URL parameter from
cfsearch contains URL path info --->
<CFSET href = Replace(URL, " ", "%20",
"ALL")>
<CFELSE> <!--- ... else
use OpenFile to return the file --->
<CFSET href =
"MyApplication_VOpenFile.cfm?serverFilePath=#URLEncodedFormat(Key)#">
</CFIF>
<!--- Links to files found are different if files in a database --->
<a
href="itdocuments/documents/#custom1#"
class="links">#title#</a></strong></span>
</td>
</tr>
<tr>
<td width="2%" valign="top"><span
class="black10"></span></td>
<td width="98%" valign="top"><p>#summary#</p></td>
</tr>
<tr>
<cfif IsNumeric(#Score#)>
<td width="2%"><span class="black10"></span></td>
<td width="98%"><i><span class="black10">#NumberFormat(
Round ( Score * 100) )#%</i></span></td>
</tr>
<cfelse>
<tr>
<td width="2%"><span class="black10">Score</span></td>
<td width="98%"><i><span
class="black10">100%</i></span></td>
</cfif>
<tr>
<td width="2%"></td>
<td width="98%"></td>
</tr>
</CFOUTPUT>
</table>
<CFIF GetResults.RecordCount gt Form.MaxRows>
<form
action="http://intranet.neath-porttalbot.gov.uk/searches/itsearchresults
..cfm" method="post">
<CFOUTPUT>
<input type="hidden" name="Criteria"
value="#Replace(Form.Criteria, " """, "'", "all")#"><input type="hidden"
name="MaxRows" value="#Form.MaxRows#"><input type="hidden" name="search"
value="#Form.search#"><input type="hidden" name="StartRow"
value="#Evaluate(Form.StartRow + Form.MaxRows)#"><input type="submit"
value=" More Results ... ">
</CFOUTPUT>
</form>
</CFIF>
</CFIF>
-----Original Message-----
From: Raymond Camden [mailto:[EMAIL PROTECTED]
Sent: 19 May 2005 19:14
To: CF-Talk
Subject: Re: Verity and Security
Are you inside a cfloop query=your search result, or cfoutput
query=yoursearchresult? custom2 is one of the columns returned in the
query result.
On 5/19/05, Ian Vaughan <[EMAIL PROTECTED]> wrote:
> Ray / Jerry
>
> That seems to have solved that problem, but it is stating that the
> custom2 variable is undefined
>
> Error Occurred While Processing Request Variable CUSTOM2 is undefined.
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble
Ticket application
http://www.houseoffusion.com/banners/view.cfm?bannerid=48
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:207243
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54