Vortex script radio buttons exclude certain directories

Post Reply
thesteve
Posts: 54
Joined: Wed Jan 24, 2001 8:17 pm

Vortex script radio buttons exclude certain directories

Post by thesteve »

Hi!

I have used your product for 2 years now and am convinced it is the best there is!

I have a question: In the Vortex script, I have modified the script so I have radio buttons.

you can see it at:
http://www.bible.ca/cgi-bin/texis/webinator/search/

I use a single data base and have not problem restricting searches to lower directory trees:

bible.ca/history
bible.ca/eo

But at the present time my search brings up everything:
bible.ca
bible.ca/history
bible.ca/eo

and I want to have a radio button that restricts the search to all but excludes these directories:

bible.ca/history
bible.ca/eo

Here is the current script:

<input type=radio name=uq value="" checked> <FONT FACE="Arial" SIZE=3>Search ALL of
www.Bible.ca</FONT><br>
<input type=radio name=uq value="www.bible.ca/eo%"> <FONT FACE="Arial" SIZE=3>Search
Executable Sermon Oulines only</FONT><br>
<input type=radio name=uq value="www.bible.ca/trinity%"> <FONT FACE="Arial" SIZE=3>Search
Biblical Trinity only</FONT><br>
<input type=radio name=uq value="www.bible.ca/tracks%"> <FONT FACE="Arial" SIZE=3>Search
Evolution Debunked only</FONT><br>
<input type=radio name=uq value="www.bible.ca/history%"> <FONT FACE="Arial" SIZE=3>Search
History & Early Christian Fathers only</FONT><br>

<INPUT TYPE=submit name=submit VALUE="Search"> <input type=submit name=cmd
value="Options">

============
So here is a single new radio button that exludes the history and eo directory.

<input type=radio name=uq value="www.bible.ca/%"> <FONT FACE="Arial" SIZE=3>Search everything EXCEPT history and eo</FONT><br>

Could you copy this single radio button above in your reply and give me the required syntax?

Thanks!

Steve
User avatar
Kai
Site Admin
Posts: 1271
Joined: Tue Apr 25, 2000 1:27 pm

Vortex script radio buttons exclude certain directories

Post by Kai »

You would need to edit the script and check for this value, setting another clause in the search Something like this:

<$uex1 = ><$uex2 = >
<IF $uq eq "www.bible.ca/%">
<$uex1 = "bible.ca/history/%">
<$uex2 = "bible.ca/eo/%">
</IF>

Then in the <SQL> search statement change the clause `... and Url matches $uq' to `... and Url matches $uq and Url not matches $uex1 and Url not matches $uex2'.
thesteve
Posts: 54
Joined: Wed Jan 24, 2001 8:17 pm

Vortex script radio buttons exclude certain directories

Post by thesteve »

Sorry to trouble you again.

I do understand the syntax of the above and how it works. However, should I embedd this on the actual search page or in the vortex script.

If on the search page where the radio buttons are, where

If in the vortex script, exactly where would I place this!

Thanks!

Steve
User avatar
Kai
Site Admin
Posts: 1271
Joined: Tue Apr 25, 2000 1:27 pm

Vortex script radio buttons exclude certain directories

Post by Kai »

It's Vortex code, so it goes in the script; in the <a name=fpar> function would be a good place. You'll also have to edit the SQL in the search or results function to add the clause I mentioned.
thesteve
Posts: 54
Joined: Wed Jan 24, 2001 8:17 pm

Vortex script radio buttons exclude certain directories

Post by thesteve »

Hi Kai! Thanks for your help, but I am still having trouble.

I added the clause to the script in this location and here is a snip from the script where I placed it:


<!-------------------------------------------------------------------------
Parse the settings from the form
-------------------------------------------------------------------------->

<A NAME=fpar>
<$uex1 = ><$uex2 = >
<IF $uq eq "www.bible.ca/%">
<$uex1 = "bible.ca/history/%">
<$uex2 = "bible.ca/eo/%">
</IF>
<switch $suffixproc>
<case min><$sufs=1>
<case max><$sufs=2>
</switch>

----end copy----

This did not exclude the history and eo documents from the search results. In fact there was not change at all in the search results.

But you also asked me to replace in the SQL section.

Replace this:

`... and Url matches $uq'

with this

'... and Url matches $uq and Url not matches $uex1 and Url not matches $uex2'

PROBLEM:
I do not know where to find the text: [`... and Url matches $uq']

I could not find it in the script anywhere. Exactly where do I find the text to replace?

I believe I have done the first section correctly. Could specifically identify what to replace and where to replace it?

Thanks!

Steve
User avatar
mark
Site Admin
Posts: 5513
Joined: Tue Apr 25, 2000 6:56 pm

Vortex script radio buttons exclude certain directories

Post by mark »

thesteve
Posts: 54
Joined: Wed Jan 24, 2001 8:17 pm

Vortex script radio buttons exclude certain directories

Post by thesteve »

Mark, I appreciate your help. the script I am using is a stock script from the site listed above (the alta vista example) with the modification of radio buttons and the modification I am attempting right now.

I added the two changes you asked.
First the missing "www" which I copied from Kai in his first reply.

Then I modified the script to add the changes you asked.

<IF $loop eq 0> <!-- If this is the first hit -->
<IF $count eq 1>
<$savenext = $next>
<SQL "select count(*) ic from html
where Title\Meta\Body likep $q
and Title like $tq
and Url matches $uq
and Url not matches $uex1
and Url not matches $uex2'
and Depth <= $dq
">
</SQL>

=============

The script still gives me results for everything without excluding the specific subdirectories of "eo" and "history"

Please help!

Thanks
steve
User avatar
mark
Site Admin
Posts: 5513
Joined: Tue Apr 25, 2000 6:56 pm

Vortex script radio buttons exclude certain directories

Post by mark »

The "<IF $loop eq 0> <IF $count eq 1>" bit does not occur in the stock alta vista example script. A script (like the default search script) that has that probably has the SQL query in 2 places. You need to modify them both. You're modifying the one that "counts" not the one that actually searches.
thesteve
Posts: 54
Joined: Wed Jan 24, 2001 8:17 pm

Vortex script radio buttons exclude certain directories

Post by thesteve »

Thanks Mark it is working now.

I had modified both before I wrote you but it gave not results, so I only modified the second one in the counts section.

However, I noticed my error:

see the ['] at the end?

and Url not matches $uex2'

it should have been:
and Url not matches $uex2
without the ' at the end!

Thanks I love your product!

Have a great day!

Steve
Post Reply