Gossamer Forum
Home : Products : DBMan : Customization :

problem with list all

Quote Reply
problem with list all
i am using a mod to list all as just a links rather than full files.

it seems to detect the correct number of entries but it does not display the list

My search results return as follows: Search Results Your search returned 2 matches. | Home | Add | View | Delete | Modify | List All | Admin | Log Off |



|



below is the mod code that displays the records (or lack there of)

sub html_view_success {

# --------------------------------------------------------

# This page displays the results of a successful search.

# You can use the following variables when displaying your

# results:

#

# $numhits - the number of hits in this batch of results.

# $maxhits - the max number of hits displayed.

# $db_total_hits - the total number of hits.

# $db_next_hits - html for displaying the next set of results.

#



my (@hits) = @_;

my ($numhits) = ($#hits+1) / ($#db_cols+1);

my ($maxhits); $in{'mh'} ? ($maxhits = $in{'mh'}) : ($maxhits = $db_max_hits);

$in{'nh'} ? ($nh = $in{'nh'}) : ($nh = 1);



$page_title = "Search Results";

&html_page_top;



# Go through each hit and convert the array to hash and send to

# html_record for printing.

if (($db_total_hits == 1) || ($maxhits == 1)) {

&html_record_long(&array_to_hash(0, @hits));

}



else {

print qq|<p><$font>Your search returned <b>$db_total_hits</b> matches.</font>|;

if ($db_next_hits) { print "<br><$font>Pages: $db_next_hits</font>"; }

$i = 1;

print "<table>";

for (0 .. $numhits - 1) {

print "<tr>";

&html_record (&array_to_hash($_, @hits));

print "</tr>";

++$i;

}

print "</table>";

if ($db_next_hits) { print "<br><$font>Pages: $db_next_hits</font>";}

}

&html_footer;

&html_page_bottom;
Quote Reply
Re: [Mystan] problem with list all In reply to
The coding looks fine .. only question is whether you have the closing } after your

&html_page_bottom;

to close off the sub. You are using the short/long mod correct?

Looking at the source it is showing the links, but not any defined field name for the link. For instance:

<table><tr><TD>
<a href="http://www.clan-eve.org/cgi-bin/db/db.cgi?db=default&uid=default&userID=&name=&email=&other=&title=*&species1=&species2=&species_desc=&age=&height=&weight=&build=&appearance=&tools=&powers1=---&powers2=---&powers3=---&powers4=---&power_desc=&weakness1=---&weakness2=---&weakness_desc=&background=&keyword=&sb=---&so=ascend&view_records=View+Records&nh=1&mh=1"></a>
</TD></tr><tr><TD>
<a href="http://www.clan-eve.org/cgi-bin/db/db.cgi?db=default&uid=default&userID=&name=&email=&other=&title=*&species1=&species2=&species_desc=&age=&height=&weight=&build=&appearance=&tools=&powers1=---&powers2=---&powers3=---&powers4=---&power_desc=&weakness1=---&weakness2=---&weakness_desc=&background=&keyword=&sb=---&so=ascend&view_records=View+Records&nh=2&mh=1"></a>
</TD></tr></table>

If you are using the short/long mod check out your sub html_record and be sure you have it setup correctly to display the short list.

For instance you must have something within this portion:

<a href="$long_url">$rec{'name'}</a>

If that doesn't help perhaps you can either attach a copy of your html.pl file or provide a link to where it can be viewed.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] problem with list all In reply to
Mystan:

I noticed that you got the list all working but are having problems with the display of your records.

May I suggest that you visit JPDeni's website at http://jpdeni.com/dbman/ and as part of her DBMan tutorial she has a configurator which will help you setup the fields for your .cfg file and also provide the html coding for both your sub html_record_form and sub html_record. Then you can just plug in this coding and adjust it for your display needs.

It's a great learning tool and will really help you get started with setting up your database. I would suggest you first make a list of the fields you will be using so the process will go quickly with the configurator.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/