Gossamer Forum
Home : Products : DBMan : Customization :

Error : In custom (sub html_record)

Quote Reply
Error : In custom (sub html_record)
Code:
Code:
my (%rec) = @_; # Load any defaults to put in the VALUE field.
($db_auto_generate and print &build_html_record(%rec) and return);

my $font_color = 'Font face="Verdana, Arial, Helvetica" Size=2 Color=#003399';
my $font = 'Font face="Verdana, Arial, Helvetica" Size=2';

$rec{'Notes'} =~ s/\n/<BR>/g;
$url{'Avatar Address'} = $rec{'Avatar Address'};
$url{'Avatar Address'} =~ s/<\/?B>//g;

print qq|
<table BORDER="0" CELLPADDING="2" CELLSPACING="10" WIDTH="100%" ALIGN="CENTER">
<tr>
<$font><td BGCOLOR="#7B78A4" colspan="2"></font><$font>&nbsp;</font><font
face="Verdana,Arial,Helvetica" size="1" color="WHITE"><b>Character Sheet for $rec{'Character Name'}</b></font></td>
</tr>
<tr>
<$font><td width="83"></font>

if ('$rec{'Avatar Address'}) {
print qq|
<img src=$rec{'Avatar Address'}>
|;
}
</td>
<td><div align="center"><center><table border="0" cellpadding="0"
cellspacing="0" width="100%">
<tr>
<td width="22%"><$font>Char. Name:</font></td>
<td width="78%"><$font>$rec{'Character Name'}</font></td>
</tr>
<tr>
<td width="22%"><$font>Player:</font></td>
<td width="78%"><$font>$rec{'Player'}</font></td>
</tr>
<tr>
<td width="22%"><$font>Char. Status:</font></td>
<td width="78%"><$font>$rec{'Character Status'}</font></td>
</tr>
<tr>
<td width="22%"><$font>Char. Type:</font></td>
<td width="78%"><$font>$rec{'Character Type'}</font></td>
</tr>
<tr>
<td width="22%"><$font>Char. Age:</font></td>
<td width="78%"><$font>$rec{'Character Age'}</font></td>
</tr>
<tr>
<td width="22%"><$font>RT Age:</font></td>
<td width="78%"><$font>$rec{'RT Age of Character'}</font></td>
</tr>
<tr>
<td width="22%"><$font>Home:</font></td>
<td width="78%"><$font>$rec{'Home'}</font></td>
</tr>
<tr>
<td width="22%"><$font>Caste:</font></td>
<td width="78%"><$font>$rec{'Caste'}</font></td>
</tr>
<tr>
<td width="22%"><$font>Possessions:</font></td>
<td width="78%"><$font>$rec{'Possessions'}</font></td>
</tr>
<tr>
<td width="22%"><$font>Notes:</font></td>
<td width="78%"><$font>$rec{'Notes'}</font></td>
</tr>
<tr>
<td width="22%"></td>
<td width="78%"><$font><p align="right">Added:
$rec{'Date Added'}</font></td>
</tr>
|;

print qq|
</TABLE>
|;
}

but it gives me an error

also Im trying to do something along the lines of
Code:
if ('$rec{'Avatar Address'}) {
print qq|
<img src=$rec{'Avatar Address'}>
|;
}
if !('$rec{'Avatar Address'}) {
print qq|
<img src=default.jpg alt="No Image Supplied">
|;
}
Im not sure if thats valid, it sure looks like it to me, but another error could be making that not work :( Im at a loss, so I came here to pick a few brains :)
Ive done everything I can think of, maybe someone can catch My screw up

Note : before someone looks over the ODD questions in the form area, this for a roleplay character database

Last edited by:

zeroisgod42: Mar 29, 2003, 9:54 PM
Quote Reply
Re: [zeroisgod42] Error : In custom (sub html_record) In reply to
I do not think you can do the if statements within a print qq block.

just close the print qq with |; before the if

then start a new print qq after the last } of the if.


Also this looks suspect

if ('$rec{'Avatar Address'})

maybe

if ($rec{'Avatar Address'})

is better?
Quote Reply
Re: [joematt] Error : In custom (sub html_record) In reply to
that was it, thank you very much for catching that

the extra ' and a missing |; as well as a missing print qq|
Quote Reply
Re: [zeroisgod42] Error : In custom (sub html_record) In reply to
For future reference, when experiencing errors, the first thing you should do is check your error log. That will give you a great chance of fixing the error. If you still can't fix it then at least you can post the error message here. It helps greatly - more so than "it gives an error".

Last edited by:

Paul: Mar 31, 2003, 10:02 AM
Quote Reply
Re: [Paul] Error : In custom (sub html_record) In reply to
it wasnt giving a 500 error, and even though I have the debug set to 1, it never shows debug info :(
so there is no log to post
Quote Reply
Re: [zeroisgod42] Error : In custom (sub html_record) In reply to
SOmetimes the code is good enough to get past the 500 error, but not good enough for the browser to compose and show the page, note that IE is better than Netscape for this.

If that is the situation, then you need to view source and you will see the error log along with the messed-up html.

Joe
Quote Reply
Re: [joematt] Error : In custom (sub html_record) In reply to
it was just posting the DBMan encountered an error, please turn on debug to see it (paraphrased)
but debug is on, yet no debug info is shown ^_^

but I have it working now, thansk again :)