Gossamer Forum
Home : Products : DBMan : Installation :

Short and long display

Quote Reply
Short and long display
Hi, First, I have to say that your forum is a great service and I am enjoying it very much and learning a lot of new things.. keep up the good work...
Now...I have read on your forum other postings related to this issue including http://www.drizzle.com/~hall/dbmod/short.html, which is great however, as I understand it, you can have only one line per record which when you click on takes you to the more detailed listing

I am trying to set up a matchmaker site where the database is very detailed & consists of 45 fields per record - what I would like to achieve(that's if it is all possible) to have a short display say of approx 4-5 fields per record.. which would give the essential information about a person for a viewer to decide whether he/she would like to know more about that person or skip to the next one - In my case a one line only would not be enough of information to decide to explore the record further or not .. Is there a way, I can do this, i.e. have a short form of 3-4 fields per record, when you click on a field there, it takes you to the 45 field record for that person...
If that can be done.. would you be able to give me the code.. I sure hope it would.. thank you very much for all your help
Quote Reply
Re: Short and long display In reply to
Yes there is a way.

Modify this line to get the desired results:

<a href="$db_script_link_url&ww=on&$db_key=$rec{$db_key}&view_records=1">$rec{'field name'}"</a><BR>

Just add more fields to that line like this:

<a href="$db_script_link_url&ww=on&$db_key=$rec{$db_key}&view_records=1">$rec{'field name'}"</a> - $rec{'Age'} - $rec{'Gender'} - $rec{'Location'}<BR>
Quote Reply
Re: Short and long display In reply to
Thanks a lot.. this seems to work fine
Quote Reply
Re: Short and long display In reply to
Hi Katana Man,
I read your posting but am a complete beginner... can you pls explain where this code should be? Somewhere in the html.pl file? or in the cgi file itself...

Thanks
Quote Reply
Re: Short and long display In reply to
chrisjb,

If you have installed the mod found at http://www.drizzle.com/~hall/dbmod/short.html , then you will end up with this line in the html.pl under sub html_record {

<a href="$db_script_link_url&ww=on&$db_key=$rec{$db_key}&view_records=1">$rec{'field name'}"</a><BR>

This is the key line that shows the short displays with links to the full display. You can add more things to it by modifying it into something like this:

<a href="$db_script_link_url&ww=on&$db_key=$rec{$db_key}&view_records=1">$rec{'field name'}"</a> - $rec{'Age'} - $rec{'Gender'} - $rec{'Location'}<BR>
Quote Reply
Re: Short and long display In reply to
Thanks again Katana Man, I managed to get it to work...
I would now like to add to the search results a number.. i.e. if there are 5 matches, each result would be
1) record one result
2) record two result
etc, etc

I'm sure its a small snippet of code... any ideas??

Quote Reply
Re: Short and long display In reply to
In html_view_success, there's a section that starts with

for (0 .. $numhits - 1) {

If you want to number your results, add a couple of lines as follows:

$i = 0;
for (0 .. $numhits - 1) {
++$i;

Then, in your short display, use the $i variable to print out the number of the record (this would be in the subroutine for your short display):

$i) [the rest of your display]

I haven't tried it, but I don't know why it wouldn't work.



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