Quote:
I will create a empty txt file called random.txt in the dbman folderRight.
Quote:
paste the code above into db.cgi right after "Local(%sortby);" in subquery
Right.
Quote:
I will aslo have to add a number field to my database definition, and match the field number to the number "25" above in the code, is that right?
Right. And you will have to add a place for the field to each record. If you add the field at the end of the list of fields in your .cfg file (which is the best way to do it, you'll just have to add an extra delimiter to the end of each record. For example, if your delimiter is the |, and you have a record like:
23|John|Doe|New York|New York|Godzilla|purple
add an extra delimiter so that it looks like
23|John|Doe|New York|New York|Godzilla|purple|
Quote:
Do I have to do anything else to the html.pl and default.cfg file?
In html.pl, sub search options, you might want to remove
Code:
Sort By:
<SELECT NAME="sb">
<OPTION>---
~; for (my $i =0; $i <= $#db_cols; $i++) { print qq~<OPTION VALUE="$i">$db_cols[$i]</OPTION>\n~ if ($db_form_len{$db_cols[$i]} >= 0); } print qq~
</SELECT>
Sort Order:
<SELECT NAME="so">
<OPTION VALUE="ascend">Ascending
<OPTION VALUE="descend">Descending
</SELECT>
and add
Code:
<input type=hidden name="sb" value="25">
Be sure to change 25 to the actual number of your randomizing field.
This will make every search have the random order display.
Also, change
Code:
print qq!| <A HREF="$db_script_link_url&view_records=1&$db_key=*">List All</A> ! if ($per_view);
to
Code:
print qq!| <A HREF="$db_script_link_url&view_records=1&$db_key=*&sb=25">List All</A> ! if ($per_view);
again, changing the 25 to match your field number.
I think that should do it.
JPD
----------------------------------------------------
JPDeni's DBMan-ual
How to ask questions the smart way.