Gossamer Forum
Home : Products : DBMan : Customization :

html_view_success customisation

Quote Reply
html_view_success customisation
I've got DBMan up and running fine but whenever I change the html_view_success sub routine to the code below I get the following error

DBMan encountered an internal error. Please enable debugging to view.

If I enable debugging, I still get the same error. Can someone take a look at the code and tell me where I'm going wrong. I've chmod the file to the correct permission after I've uploaded it so I know that's not the problem.

Here's the sub routine code...

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);

&html_print_headers;
print qq|
<html>
<head>
<title>$html_title: Search Results.</title>
</head>

<body bgcolor="#ffffff">

<table width="760" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="1" bgcolor="#B7B6B6"><img src="images/shim.gif" width="1" height="325"></td>
<td><table width="758" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="3"><img src="images/shim.gif" width="3" height="325"></td>
<td width="163" valign="top"><img src="images/shim.gif" width="163" height="5"><br>
<img src="images/title_news.gif" width="165" height="16"> <span class="maintext"><img src="images/shim.gif" width="165" height="3"><br>
dfhdljfhfkljahdsfasLorem ipsum dolor sit amet, consectetuer
adipiscing elit, sed diam nonummy nibh euismod tincidunt ut
laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad
minim veniam, quis nostrud exerci tation ullamcorper suscipit
lobortis nisl ut aliquip ex ea commodo consequat. Duis autem
vel eum iriure d<a href="javascript:;" onFocus="if(this.blur)this.blur()"></a><br>
<br>
</span> </td>
<td width="5"><img src="images/shim.gif" width="5" height="325"></td>
<td width="1" valign="middle"><img src="images/divide.gif" width="1" height="315"></td>
<td width="5"><img src="images/shim.gif" width="5" height="325"></td>
<td width="400" align="center" valign="top"><img src="images/shim.gif" width="400" height="5"><BR>
<img src="images/shim.gif" width="575" height="5"><br>
<p><$font>
Your search returned <b>$db_total_hits</b> matches.</font>
|;
if ($db_next_hits) {
print "<br><$font>Pages: $db_next_hits</font>";
}

# 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));
}
if ($db_next_hits) {
print "<br><$font>Pages: $db_next_hits</font>";
}

print qq|
<p>
<table border=0 bgcolor="#DDDDDD" cellpadding=5 cellspacing=3 width=500 valign=top>
<tr><td>|; &html_footer; print qq|</td></tr>
</table>
</td>
<td width="3"><img src="images/shim.gif" width="3" height="325"></td>
</tr>
</table></td>
<td width="1" bgcolor="#B7B6B6"><img src="images/shim.gif" width="1" height="325"></td>
</tr>
<tr>
<td colspan="3"><img src="http://file:/...es/bar_companies.gif" width="760" height="20"></td>
</tr>
</table>
</body>
</html>
|;
}

----------------------------------
http://www.andrew-banks.co.uk
Quote Reply
Re: [c0052372] html_view_success customisation In reply to
Try taking out this:

<img src="http://file:/...es/bar_companies.gif">

The pipe in your file path is probably terminating the print qq| command. Why do you have a path to a c drive anyway? If you need to use the pipe, you will have to use another symbol for printing, like print qq~ whatever you want to print ~;
Quote Reply
Re: [sigrid] html_view_success customisation In reply to
doesn't make a difference

I've had things working with DBMan before where I've included file:// links to images.

Can anyone else offer any help on this? It's getting quite urgent

----------------------------------
http://www.andrew-banks.co.uk
Quote Reply
Re: [c0052372] html_view_success customisation In reply to
Probably not an instant answer... but try this. Do a search or check LoisC's FAQ and look for the term "obtain useful error message" or debug message. Just recently there was a discussion about moving the debug line up in the .cfg file which would give you more than just "internal error" it would actually say something like "problem in line 3" or so. I don't remember off of the top of my head where/when I've seen it, but it was within the past couple of months.

It will at least give you a starting place to begin troubleshooting with.