Gossamer Forum
Home : Products : DBMan : Installation :

Internal Sever Error When Using Mod!

Quote Reply
Internal Sever Error When Using Mod!
Hi,

I have my database installed and working at this url:

http://www.warningtrack.net/cgi-bin/articles/db.cgi

My problem is I'm trying to use JPDeni's Long/Short Record Mod...I save the file in replace of html.pl, and then use the information from her configurator to replace the default.cfg, and the two subroutines in the html.pl file. Is it impossible to use both of these?

Also, I've been taking my time, but seem to get an error message everytime that I try to install a mod...it might be something I'm doing, though.

Thanks!


------------------
Chris - TWT Commish
http://www.warningtrack.net
"Curing the World of Cluless Baseball Fans"
Quote Reply
Re: Internal Sever Error When Using Mod! In reply to
It is definitely not impossible to use the two things together. I do it all the time.

What is the error message that you get?

Please copy your html.pl file to a web-accessible directory (one where you would place .html files) and rename it to html_pl.txt. Then come back and let me know where I can pick it up. I'll check it out for you.


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





Quote Reply
Re: Internal Sever Error When Using Mod! In reply to
JPDeni,

I'm no longer getting an error message, but I still have a problem! Smile

Here's the html.pl text file:

http://www.warningtrack.net/html_pl.txt

The problem is that even though I the "Add Record" form shows up with the fields I want, when the page comes up showing me what I've just submitted, it's a blank record that uses the default field names for the script...ID, Title, Type, Validated, Popular, etc.

Also, is the long/short mod still able to "work" with the user-friendly PL tutorial on your site?

Thanks!




------------------
Chris - TWT Commish
http://www.warningtrack.net
"Curing the World of Cluless Baseball Fans"
Quote Reply
Re: Internal Sever Error When Using Mod! In reply to
The problem you're having is because you have not yet defined the format of sub html_record_long to match your .cfg file.

You need to take a close look at sub html_record and sub html_record_long in the short/long display mod. Look at the structure of the subroutines and follow the pattern to create a database that matches your configuration.

Yes, the tutorial works for the short/long display, but only to a point. There are so many possible permutations of modifications that it is pretty difficult to include all of them in the tutorial.



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





Quote Reply
Re: Internal Sever Error When Using Mod! In reply to
JPDeni,

I copied the appropriate form into the subroutine you mentioned, but some very odd problems have arisen...

I don't have any error messages, but some weird stuff has happened:

- Submitting a record works fine, but when I view them, the clickable email and URL links don't come out right. (same problem when the page loads informing me of the record I've just addded)

- Although everything seems to be working, It still doesnt seem as if the long/short mod is actually functional...I got it to work yesterday, so I really don't know whats wrong. The fact that I havn't gotten any error messages makes it more confusing to me.

You can login and test it for yourself if you like:

http://www.warningtrack.net/cgi-bin/articles/db.cgi

Username is guest, password is guest

By the way, the Configurator is fantastic...how long did it take you to create it?

Thanks!

Oh by the way, I've posted the html.pl and default.cfg files in txt format in case it might help you out...

http://www.warningtrack.net/html_pl.txt http://www.warningtrack.net/default_cfg.txt






------------------
Chris - TWT Commish
http://www.warningtrack.net
"Curing the World of Cluless Baseball Fans"
Quote Reply
Re: Internal Sever Error When Using Mod! In reply to
First, let's work on sub html_record.

What fields do you want to display in the "short" view? From what I've seen of your database, you should use

'Title of Article'

(Let's start with that one and you can add more fields later if you'd like.)

The following is the code straight out of the short/long display mod, with your 'Title of Article' field inserted.

Code:
sub html_record {
# --------------------------------------------------------
# How a record will be displayed. This is used primarily in
# returning search results and how it is formatted. The record to
# be displayed will be in the %rec hash.
# This is the "short display" -- the list of records that are returned
# from a search.

my (%rec) = @_;

# create link to full display
$record_number = ((($nh - 1) * $db_max_hits) + $i);

$long_url = $ENV{'QUERY_STRING'};
$long_url =~ s/\&nh=\d+//;
$long_url =~ s/\&mh=\d+//;

$long_url = "$db_script_url?$long_url&nh=$record_number&mh=1";

print "<TD>"; # do not remove this! It is necessary to make the records display properly

# Below is where you define what you want to appear for each record in the "short" display.
# You can make this whatever you want, and display as many fields as you would like.
# Choose which of the fields you would like for users to click on to reach the full display
# of records and use that field name in place of "Title" below.
#
# Be sure that you use <a href="$long_url"> for the link to your full record display.

# <-- Start of short display formatting -- >

print qq|
<a href="$long_url">$rec{'Title of Article'}</a>
|;

# if you want to display your fields in columns, use the following format:
# print qq|
# $rec{'Field'}</td>
# <td>$rec{'Field'}</td>
# <td>$rec{'Field'}</td>
# <td>$rec{'Field'}|;

# Add or remove columns as needed. Be sure you add the $long_url link to one of your fields

# <-- End of short display formatting -- >

print "</TD>"; # do not remove this! It is necessary to make the records display properly

}

Copy this code and paste it into your html.pl file in place of the current sub html_record.

Test it out. See what you get.

If you want more fields to be displayed, let me know and we'll work them in.

Once the short display is how you want it, we'll work on the long display.


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





Quote Reply
Re: Internal Sever Error When Using Mod! In reply to
I just realized I hadn't answered one of your questions.

First, thanks for the compliments on the Configurator. It has saved me and others a lot of grief in creating new databases.

How long did it take? That's hard to say. I thought about it for a long time (probably several months) before I actually started working on it. I tend to let things "fester" in my brain for quite a while. The actual coding was done probably over about a week or so.


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





Quote Reply
Re: Internal Sever Error When Using Mod! In reply to
JPDeni,

Impressive work with the configurator...when I first found it I couldn't believe my eyes...

I put the sub html_record in there but still got an error message, you can see it simply by accessing the DC:

http://www.warningtrack.net/cgi-bin/articles/db.cgi

...

Also, here's the link to the current html.pl file:

http://www.warningtrack.net/html_pl.txt

Oh and as for the short display, I think I'd like to have the Title of the Article, and right below that, the "Full Name" and then "Current Date" fields...

Finally, I just want to make sure this work won't conflict with some of the mods I intend to use later...the private mailer, the email a friend mod, and especially the validator (can't have people posting articles without reviewing them!) Smile

Thanks so much,




------------------
Chris - TWT Commish
http://www.warningtrack.net
"Curing the World of Cluless Baseball Fans"
Quote Reply
Re: Internal Sever Error When Using Mod! In reply to
Look at the end of sub html_record. It should look exactly like this:

Code:
# Add or remove columns as needed. Be sure you add the $long_url link to one of your fields
# <-- End of short display formatting -- >
print "</TD>"; # do not remove this! It is necessary to make the records display properly
}

You just need to add some linefeeds in your file.

Let's get this working and then we'll add the other fields. Smile


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





Quote Reply
Re: Internal Sever Error When Using Mod! In reply to
JPDeni,

Okay, I made the change, and the DB is now functional. The same problem exists with the email and URL links, as well as the long/short display still not showing up.

Me stupid...what now? Smile

Chris

P.S. Thanks so much for going though all this with me...if you ask me Alex ought to hire you to create one big giant Configurator that can automatically add mods, etc...I think DBMan would be much more attractive if it were easier to setup that way.
Quote Reply
Re: Internal Sever Error When Using Mod! In reply to
I'm really confused here. I think we need to back up. Please reinstall the old (not short/long display) html.pl file. Let's make sure that works correctly before we do anything else.


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





Quote Reply
Re: Internal Sever Error When Using Mod! In reply to
Regarding your "giant Configurator" idea -- there are good and bad points to it. One of the bad points is that the hardest thing to program is the actual printout -- the end result. I get really confused when I'm using "print" statements to print "print" statements. Smile

Another thing is that, no matter how many mods I were to put in, somebody would want me to put in another one. I figured I would just go with the basics and work on other things individually.


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





Quote Reply
Re: Internal Sever Error When Using Mod! In reply to
JPDeni,

Done! I've got the original html.pl file in place...the one I originally downloaded.

Here's the URL again, just in case you need it. Smile

http://www.warningtrack.net/cgi-bin/articles/db.cgi

Chris
Quote Reply
Re: Internal Sever Error When Using Mod! In reply to
Do you have the autogenerate feature turned on? It looks like you do, from the format of the forms and output.

If so, now is the time to put in the code you got from the Configurator and set
$db_auto_generate = 0;
in your .cfg file.

Let's make sure the basic form and display works.



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





Quote Reply
Re: Internal Sever Error When Using Mod! In reply to
Oh. I'm sorry. I told you something wrong.

You can't just copy sub html_record from your old file and use it in your new one.

Start copying your old subroutine with the lines that look like:

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

print qq|
<TABLE WIDTH="475" CELLPADDING=0 CELLSPACING=0 BORDER=1 BGCOLOR="#FFFFCC">

(Yours may be different, but it should look sorta the same.)

Copy all the way down to the end of the subroutine, including the last

}

character.

In the short/long file, sub html_record_long, delete from just after

Code:
# <-- Start of record display -->

to the end, including the

}

character. Then paste in the code from your old file.

Does this make sense?







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





Quote Reply
Re: Internal Sever Error When Using Mod! In reply to
JP,

Sorry, I don't see any line that looks like this:

my $font_color = 'Font face="Verdana, Arial, Helvetica" Size=2 Color=#003399'; my $font = 'Font face="Verdana, Arial, Helvetica" Size=2'; print qq| <TABLE WIDTH="475" CELLPADDING=0 CELLSPACING=0 BORDER=1 BGCOLOR="#FFFFCC">

--------------------------------------------------------------------------------


I've posted my current html.pl file here:

http://www.warningtrack.net/html_pl.txt

I might just be sleepy, but you'd have to go over those instructions again...the first post kind of cofused me...wasn't sure if I was supposed to ignore all of it, or some of it.

Chris
Quote Reply
Re: Internal Sever Error When Using Mod! In reply to
JP,

My bad, I found that line after all, and I copied the part you suggested:

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

$url{'Email Address'} = $rec{'Email Address'};
$url{'Email Address'} =~ s/<\/?B>//g;
$url{'Website URL'} = $rec{'Website URL'};
$url{'Website URL'} =~ s/<\/?B>//g;
$rec{'Article'} =~ s/\n/<BR>/g;

print qq|
<TABLE WIDTH="475" CELLPADDING=0 CELLSPACING=0 BORDER=1 BGCOLOR="#FFFFCC">|;
if ($per_admin) {
print qq|
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="20%"><$font_color>ArticleID:</FONT></TD>
<TD WIDTH="80%"> <$font>$rec{'ArticleID'}</Font></TD></TR>
|;
}
print qq|
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="20%"><$font_color>Author ID:</FONT></TD>
<TD WIDTH="80%"> <$font>$rec{'Author ID'}</Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="20%"><$font_color>Current Date:</FONT></TD>
<TD WIDTH="80%"> <$font>$rec{'Current Date'}</Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="20%"><$font_color>Full Name:</FONT></TD>
<TD WIDTH="80%"> <$font>$rec{'Full Name'}</Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="20%"><$font_color>Email Address:</FONT></TD>
<TD WIDTH="80%"> <$font><a href="mailto:$url{'Email Address'}">$rec{'Email Address'}</a>
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="20%"><$font_color>Title of Article:</FONT></TD>
<TD WIDTH="80%"> <$font>$rec{'Title of Article'}</Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="20%"><$font_color>Website URL:</FONT></TD>
<TD WIDTH="80%"> <$font><a href="$url{'Website URL'}">$rec{'Website URL'}</a>
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="20%"><$font_color>Article:</FONT></TD>
<TD WIDTH="80%"> <$font>$rec{'Article'}</Font></TD></TR>
</TABLE>
|;
}

But what do I paste it over?

Chris
Quote Reply
Re: Internal Sever Error When Using Mod! In reply to
JP,

I'm so stupid! I've got it now! It works great! Alex, hire this woman... Smile

Dang, what a breakthrough, its quite exhilirating. I love this feeling, I've had it a few times with this script in the past...last time was when I stayed up until 4AM and finally really figured out how to customize all the colors and tables, etc.

So, the next step is to include the author's name and the date below the link to the article?

Chris
Quote Reply
Re: Internal Sever Error When Using Mod! In reply to
JP,

Ok, I've used the Congifurator and copied the appropriate code into the html.pl file, and over the default.cfg file.

Just so you know, I set the "Current" date field to BE a date field, rather than a text field like it was before. I changed it to a text field because I'd tried it as a "date" field before (with that &get_date command in there) and it went wacko on me...not sure what I did.

My goodness, though! It's up and running just fine! The email links and URLs are perfectly clickable...

What now? The short-long display mod, right? Smile

Chris
Quote Reply
Re: Internal Sever Error When Using Mod! In reply to
Yep. Now for the short/long mod.

Get a fresh copy of the mod.

Copy sub html_record_form from your old html.pl file into the same subroutine in the short/long display file.

[I deleted this part because it was incorrect. See the next post.]

Now for the tricky part.

Look in the short/long display mod, sub html_record for

Code:
# <-- Start of short display formatting -- >

print qq|
<a href="$long_url">$rec{'Title'}</a>
|;

Change

$rec{'Title'}

in the line above to

$rec{'Title of Article'}

Save the file and upload it over your old html.pl file and see what happens. Smile


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







[This message has been edited by JPDeni (edited April 05, 2000).]
Quote Reply
Re: Internal Sever Error When Using Mod! In reply to
Sorry I wasn't here to answer your questions earlier. But it really is great to find the answers on your own. Smile

Now for the the Author and Date in the short display.

Change

Code:
print qq|
<a href="$long_url">$rec{'Title of Article'}</a>
|;

to

Code:
print qq|
<a href="$long_url">$rec{'Title of Article'}</a><BR>
$rec{'Full Name'}<BR>
$rec{'Current Date'}
|;

(I'm pretty sure I remember the names of your fields. If these don't exactly match the fieldnames from your .cfg file, change them to match.)

And now you have installed and customized the short/long display mod. Smile


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





Quote Reply
Re: Internal Sever Error When Using Mod! In reply to
JP,

Very cool! It's looking fabulous.

I'm going to backup now and try the Private Mailer mod...

...also, I remember seeing an "Email this record to a friend" mod somewhere, can you point me to it?

I'll let you know how these mods go...I've gotten the Private Mailer mod to work before, but not the Email-A-Friend mod yet.

Chris
Quote Reply
Re: Internal Sever Error When Using Mod! In reply to
Yay!! Smile

The "Email This Record" discussion is at http://www.gossamer-threads.com/...m12/HTML/000413.html . (Once again, thanks to Lois for creating an index. Eventually all these are going to be in a database on my site, if I ever get around to entering everything. Smile )


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