Kellner suggest I put this in the forum. I am trying to make a roster for a gaming site. I found a MOD that puts the title at the top & the contents below in one table:
http://webmagic.hypermart.net/dbman/db/text/dbout.txt
This is almost what I need, but I would also like the individual cells columns/rows to have borders (to separate them). I haven’t found any other mods that list the output horizontally in this way. (i can't make it line up right in this forum but basically it looks like this and works):
NAME RANK EMAIL BARONY JOINED
Fandrall Duke fandrall@home.com All 01-Nov-1995
Bard Count dabard@quik.net All 07-Feb-1997
Raeana Baron dianarae@bellsouth.net Nest 25-Jul-1999
Justice Baron darkjustice@aol.com Rivervale 02-Feb-1999
Pulgrey Knight pulgrey@home.com Nest 01-Sep-2000
Sarm Elite sarmarn@igt.net Nest 03-Aug-2000
Bisl Court bisl@home.com Rivervale 21-Nov-2000
Catsreyn Squire catsreyn@home.com Rivervale 19-Jan-2001
Teala Squire teala@home.com Nest 03-Mar-2001
However, with this mod when you do a “list all” the email links no longer work. I searched & searched and cannot figure out what part is missing to have the links print on this page with this mod.
Also, when I first made this database I had it in the original Dbman format:
NAME: Fandrall
RANK: Duke
EMAIL: fandrall@home.com
BARONY: ALL
JOINED: 01-Nov-1995
When it was in this format Kellner I found notes in this forum to have the results display in rank order by putting a number in front of the rank: 1Duke,2Count,3Baron,4Knight etc. Then Kellner was so kind as to give me a code to delete that first number when the list printed & it worked with the original layout of the above table:
if ($rec{'Rank'} =~ /^(\d)(\w+)$/) { $rec{'Rank'} = $2;}) {
However, now in the MOD shown at the top where the contents print in one table Kellners code to drop the number no longer works and the number stays on when it prints.
I have tried every which way to put this all together and nothing works.
Here is the MOD:
In .cfg set autogenerate to 1
In html.pl
1) Find this code, in any of the subroutines that output results, such as html_view_success, and
# Go through each hit and convert the array to hash and send to
# html_record for printing.
for (0 .. $numhits - 1) {
print "<P>";
&html_record (&array_to_hash($_, @hits));
}
2) delete it, and copy the following in it's place:
# Go through each hit and convert the array to hash and send to
# html_record for printing.
print "<table>";
print "<tr><td>",join('</td><td>',@db_cols),"</td></tr>";
for (0 .. $numhits - 1) {
&html_record_row (&array_to_hash($_, @hits));
}
print "</table>";
3) Add this to your html.pl file
#### This subroutine calls build_html_row, for printing in rows
## Insert this into html.pl
sub html_record_row {
my (%rec) = @_; # Load any defaults to put in the VALUE field.
($db_auto_generate and print &build_html_record_row(%rec) and return);
}
4) Add this to your db.cgi file
# ADD this to db.cgi
# Builds a record based on the config information.
sub build_html_record_row {
my (%rec) = @_;
my ($output, $field);
$output = "<tr>";
foreach $field (@db_cols) {
next if ($db_form_len{$field} == -1);
$output .= qq~
<td align=left><$font>$rec{$field}</font></td>
~;
}
$output .= "</tr>\n";
return $output;
}
As I said this MOD is great & works just as I need it with the header at the top & content below, but the problems remain:
1. This mod puts everything in 1 table & I need the individual rows to have borders to separate them.
2. This mod does not print the email links when they are displayed in “list all”.
3. The code Kellner helped me with to remove the number in front of the rank name when printed in this MOD.
Those are the only 3 things I cannot get working with this mod. If anyone has any clue as to what I might do to get these things working I would appreciate it greatly.
Diana Rae
http://webmagic.hypermart.net/dbman/db/text/dbout.txt
This is almost what I need, but I would also like the individual cells columns/rows to have borders (to separate them). I haven’t found any other mods that list the output horizontally in this way. (i can't make it line up right in this forum but basically it looks like this and works):
NAME RANK EMAIL BARONY JOINED
Fandrall Duke fandrall@home.com All 01-Nov-1995
Bard Count dabard@quik.net All 07-Feb-1997
Raeana Baron dianarae@bellsouth.net Nest 25-Jul-1999
Justice Baron darkjustice@aol.com Rivervale 02-Feb-1999
Pulgrey Knight pulgrey@home.com Nest 01-Sep-2000
Sarm Elite sarmarn@igt.net Nest 03-Aug-2000
Bisl Court bisl@home.com Rivervale 21-Nov-2000
Catsreyn Squire catsreyn@home.com Rivervale 19-Jan-2001
Teala Squire teala@home.com Nest 03-Mar-2001
However, with this mod when you do a “list all” the email links no longer work. I searched & searched and cannot figure out what part is missing to have the links print on this page with this mod.
Also, when I first made this database I had it in the original Dbman format:
NAME: Fandrall
RANK: Duke
EMAIL: fandrall@home.com
BARONY: ALL
JOINED: 01-Nov-1995
When it was in this format Kellner I found notes in this forum to have the results display in rank order by putting a number in front of the rank: 1Duke,2Count,3Baron,4Knight etc. Then Kellner was so kind as to give me a code to delete that first number when the list printed & it worked with the original layout of the above table:
if ($rec{'Rank'} =~ /^(\d)(\w+)$/) { $rec{'Rank'} = $2;}) {
However, now in the MOD shown at the top where the contents print in one table Kellners code to drop the number no longer works and the number stays on when it prints.
I have tried every which way to put this all together and nothing works.
Here is the MOD:
In .cfg set autogenerate to 1
In html.pl
1) Find this code, in any of the subroutines that output results, such as html_view_success, and
# Go through each hit and convert the array to hash and send to
# html_record for printing.
for (0 .. $numhits - 1) {
print "<P>";
&html_record (&array_to_hash($_, @hits));
}
2) delete it, and copy the following in it's place:
# Go through each hit and convert the array to hash and send to
# html_record for printing.
print "<table>";
print "<tr><td>",join('</td><td>',@db_cols),"</td></tr>";
for (0 .. $numhits - 1) {
&html_record_row (&array_to_hash($_, @hits));
}
print "</table>";
3) Add this to your html.pl file
#### This subroutine calls build_html_row, for printing in rows
## Insert this into html.pl
sub html_record_row {
my (%rec) = @_; # Load any defaults to put in the VALUE field.
($db_auto_generate and print &build_html_record_row(%rec) and return);
}
4) Add this to your db.cgi file
# ADD this to db.cgi
# Builds a record based on the config information.
sub build_html_record_row {
my (%rec) = @_;
my ($output, $field);
$output = "<tr>";
foreach $field (@db_cols) {
next if ($db_form_len{$field} == -1);
$output .= qq~
<td align=left><$font>$rec{$field}</font></td>
~;
}
$output .= "</tr>\n";
return $output;
}
As I said this MOD is great & works just as I need it with the header at the top & content below, but the problems remain:
1. This mod puts everything in 1 table & I need the individual rows to have borders to separate them.
2. This mod does not print the email links when they are displayed in “list all”.
3. The code Kellner helped me with to remove the number in front of the rank name when printed in this MOD.
Those are the only 3 things I cannot get working with this mod. If anyone has any clue as to what I might do to get these things working I would appreciate it greatly.
Diana Rae