Gossamer Forum
Home : Products : DBMan : Customization :

Can't get Short/Long to work

Quote Reply
Can't get Short/Long to work
Sorry for the flood of posts.

Using JP's Configurator I can get DBMan to work just fine. Using the same results and pasting into the S/L mod I get :
"DBMan encountered an internal error. Please enable debugging to view." I have debugging but still get the error.

I have the file at:

http://www.nmcontractors.com/slhtmlpl.txt

Guess I haven't reached flood control yet [:o(

L.

Quote Reply
Re: Can't get Short/Long to work In reply to
In your sub html_record you have for the short display the field:

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

I don't see this as being a field defined in your database. Not sure if this is what is causing the problem, but it should be defined.

In the FAQ noted below under "Troubleshooting" there is a great little snippet of code called "Debugging - How To Obtain Useful Error Messages". Adding this to your script really helps to find errors.

I didn't spot anything else when I briefly looked at your file.

Unoffical DBMan FAQ
http://webmagic.hypermart.net/dbman/
Quote Reply
Re: Can't get Short/Long to work In reply to
Thanks very much Lois.

I did see that FAQ. Is this the correct syntax?

>>BEGIN {
open (STDERR, ">/www.nmcontractors.com/error.txt");
}<<

Anywhere in html.pl and default.cfg

Also, is this the correct syntax for short display with multiple fields? And does "Title" refer to a "Field" or something else?

print qq| <a href="$long_url">$rec{'Bid Date'}</a>
<a href="$long_url">$rec{'Project'</a> <a href="$long_url">$rec{'Location'}</a>
|;

A finally <ducking> to display in "columns" is "Field" a field in a record? And what would the syntax be in reference to...
>> Add or remove columns as needed. Be sure you add the $long_url link to one of your fields<<

L.

Quote Reply
Re: Can't get Short/Long to work In reply to
BEGIN {
open (STDERR, ">/www.nmcontractors.com/error.txt");
}

The correct syntax for the above would be the absolute path .. not the URL. Please see the example in the instructions again.

Anywhere in html.pl and default.cfg

You would add this at the top of your files right under the path to perl (i.e. #!/usr/local/bin/perl) in your db.cgi file.

Also, is this the correct syntax for short display with multiple fields? And does "Title" refer to a "Field" or
something else?

Title would refer to the field name in your database.

To get columns you could use:

print qq| $rec{'Bid Date'}</TD><TD><a href="$long_url">$rec{'Project'}</a></TD><TD><a href="$long_url">$rec{'Location'}</a> |;

Note the beginning <TD> and ending </TD> tags are already in that portion of the script.


Unoffical DBMan FAQ
http://webmagic.hypermart.net/dbman/
Quote Reply
Re: Can't get Short/Long to work In reply to
Well I think its either the S/L mod is missing an auth section or I have my authorizations bolexed up.
The script is installed at www.nmcontractors.com/cgi-bin/biddbman and now shows an error in db.cgi, I think.

The files can be viewed at www.nmcontractors.com/dbcgi.txt
www.nmcontractors.com/newhtmlpl.txt and
www.nmcontractors.com/defaultcfg.txt


TIA - Lance


Quote Reply
Re: Can't get Short/Long to work In reply to
You may want to add a userid field to be able to identify each record with it's owner (even though you are not allowing them to modify at this time)

Then set in your .cfg file:

$auth_user_field = -1; to the field for the user.

The reason you are not seeing the short display is due to only having one record in your database. Try adding 2 or 3 more records and then see if it works correctly. If you only have one record it will default to showing the long display for that record.

There is a modification you can make to force it to display the short view if there is only one record. I think it can be found in the FAQ noted below under "Viewing".

And as stated above for the short display you will want to change the section to display your chosen fields for the short display.

Unoffical DBMan FAQ
http://webmagic.hypermart.net/dbman/