Gossamer Forum
Home : Products : DBMan : Installation :

Serch Result

Quote Reply
Serch Result
How can i modify Search success to
display in two columns ?
Quote Reply
Re: Serch Result In reply to
Which way do you want the columns?

Code:
Record1 Record2
Record3 Record4

or

Code:
Record 1 Record3
Record 2 Record4

The first one's easier, but both can be done.

------------------
JPD





Quote Reply
Re: Serch Result In reply to
it dows not matter the first is good
Quote Reply
Re: Serch Result In reply to
Okay. The first one it is.

You'll probably want to make your columns a separate subroutine from html_record, or your delete form and modify form will be messed up. It's a lot easier to make the record display into columns than it is the delete form and modify form, since they have an extra checkbox or radio button.

Create a new subroutine

Code:
sub html_record_columns {

my (%rec) = @_;

unless ($i % 2) { print "<TR>"; }

print "<TD> [your record display] </TD>";

if ($i % 2) { print "</TR>";

}

In html_view success, instead of

Code:
for (0 .. $numhits - 1) {
print "<P>";
&html_record (&array_to_hash($_, @hits));
}

use

Code:
$i=0;
print "<table>";
for (0 .. $numhits - 1) {
&html_record_columns (&array_to_hash($_, @hits));
++$i;
}
if ($i % 2) { print "<TD>& n b s p; </TD></TR>"; }
print "</table>";

(I had to put spaces in the & n b s p; so it would print out. It's just there for a space holder in case you have an odd number of records.)


If you should want to change it to three columns, you can't just change the 2 to a 3. You can make three (or four or 73), but the process is a little different.


------------------
JPD







[This message has been edited by JPDeni (edited May 16, 1999).]
Quote Reply
Re: Serch Result In reply to
Ok two things after the second replacement
HTML_VIEW_SUcess after replacing that line
it was a problem so inserted } and it worked fine
but diplayed [your record display] which
is what is in subrutine how can i changfe it
to display the record that was searched for
Quote Reply
Re: Serch Result In reply to
Since I don't know what fields you want to display, I'm not sure.

It would be something like

Code:
sub html_record_columns {
my (%rec) = @_;
$rec{$db_key} =~ s/<.?B>//g;
unless ($i % 2) { print "<TR>"; }
print "<TD>
<a href="$db_script_link_url&ww=on&$db_key=$rec{$db_key}&view_records=1">
$rec{'Name'}</a>
</TD>";
if ($i % 2) { print "</TR>";
}

Change Name to the name of the field you want to use.


------------------
JPD





Quote Reply
Re: Serch Result In reply to
OK but i want to display all fields the way difault search is.
Sorry for the misunderstanding
here is how i want it:

Whole record1 Whole record2
Whole record3 Whole record4
Quote Reply
Re: Serch Result In reply to
Have you made a display in html_record that gives the whole records in a list? If not, do that first.

Forget everything else I wrote. Here's what you do.

In html_view_success, instead of

for (0 .. $numhits - 1) {
print "<P>";
&html_record (&array_to_hash($_, @hits));
}

use

Code:
print "<table>";
for (0 .. $numhits - 1) {
$i = $_;
unless ($i % 2) {
print "<tr>";
}
print "<td>";
&html_record (&array_to_hash($_, @hits));
print "</td>";
if ($i % 2) {
print "</tr>";
}
}
if ($numhits % 2) {
print "<td>& nbsp;</td></tr>";
}
print "</table>";

Take out the space between & and nbsp; above.


------------------
JPD





Quote Reply
Re: Serch Result In reply to
100% wright.Exactly how i wanted !
Thanks a lot!
I know you'v helped me a lot
and soon i'll probably start to pay you for the advices.

OK OK Here is another one

I use webadverts (advertising Program)
but i cant use ssi (.SHtml extenntion )
is there a way to create subrutne in dbman
that will call the cgi.script from search resoults (and/or) add menu without typing
the raw source all the time?
Thank again for the Help!
Quote Reply
Re: Serch Result In reply to
I accept tips! Smile

I'm afraid I can't help you with SSI. I don't know anything about that at all, primarily since my server doesn't allow SSI. I haven't had any opportunity to play with it.

I know other people have had banners, though, so there must be a way. Try doing a search for the word "banner" in this forum and see if you come up with something.




------------------
JPD