Gossamer Forum
Home : Products : DBMan : Installation :

Display Picture/Take away log on

Quote Reply
Display Picture/Take away log on
I have been asked to create a website for an automobile dealership and they want to post their inventory on the internet. I am sort of new to Gossamer Threads DBMan as well as CGI/Perl. I'd like one car per page, and possibly a restuls form that would only list the car type, color, price, and year and then by clicking on that, the person would be transported to the main entry.

Does anyone have ideas on how I could congiure DBMan to allow fields such as name, year, model, make, etc. AND INCLUDE A PICTURE?

Also, can I take the log on screen off and allow all visitors to have the option of searching instead of logging on? If I do that, how can the administrator add, delete, modify entries?

I am desiging the page, and trying to keep costs low to offset the cost to the dealership because it is one in a small town, opposed to a large one that could have a commercial design hired to make one. I am pretty knowledgeable in HTML, but through creating my first DBMan database last week, I learned the very basics of CGI/Perl. However, if they like my design, they will be registering DBMan.

Thanks. Any help would be appreciated.

[This message has been edited by CMY (edited March 25, 2000).]
Quote Reply
Re: Display Picture/Take away log on In reply to
You've got a lot going on here. Smile

There is a modification you can install that will do what you want.

Code:
...db.cgi?db=default&uid=default&view_search=1

For admins to log in to alter the database, use

Code:
...db.cgi

(This assumes that there is only one database at the site and that it is named "default.")

Another thing you might try is going to my tutorial at http://www.jpdeni.com/dbman . There are a lot of things there that will answer your questions. And there is a script called "the Configurator" which you can use to generate your .cfg file and much of the html.pl file.


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





Quote Reply
Re: Display Picture/Take away log on In reply to
THANK YOU SO MUCH FOR YOUR REPLY! When I made my first dbman database about a week ago, I found your site more than helpful!

However, I still have one question. How can I get a picture (of the vehicle) to appear in the record?

Thanks!
Quote Reply
Re: Display Picture/Take away log on In reply to
A lot depends on how you have your database set up.

You can have a field that includes the name of the file -- for our purposes, we'll call it "Picture." Put all of your graphic files in one directory.

Then, when you print out your records using html_record, use

Code:
<IMG SRC="http://url/to/graphic/directory/$rec{'Picture'}">

(Make sure this is within a print qq| ... |; statement.)

Another way is to have the pictures named to match the $db_key field value for each record. (This works easiest if the graphics are all the same format.)

For example, if you have a record whose $db_key value is 435, name the graphic

435.gif

and then use a similar syntax as above to print out the graphic:

Code:
<IMG SRC="http://url/to/graphic/directory/$rec{$db_key}.gif">

You could also try to use the file upload mod, but folks have had mixed success with it.


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





Quote Reply
Re: Display Picture/Take away log on In reply to
JPDeni,
I took a look at your book (excuse my rhyming by accident!) site and it is exactly what I am looking for, except I'd just want to change the fields to have car orientated.

So, do you have your database saved on a file like Gossamer Threads offers and I could adjust the HTML and some of the fields? Or, do you have a place I could find exact directions do do this?

I'd REALLY REALLY appreciate this!
You are so helpful!
Thanks!
Quote Reply
Re: Display Picture/Take away log on In reply to
CMY:

The mod that JPDeni referred to:

For this, you can use the "short/long" display mod, at

http://www.jpdeni.com/dbman/Mods/short_html_pl.txt

Does contain instructions for it's use Smile

You may have also noticed the configurator available on her site. This will help you to setup your fields in both your .cfg file and also provide you with the HTML codes to match your specified fields in your page layouts.

You can then just modify the HTML coding to match the look and feel of the site.

If you are looking for a ready made script, there is a list of installers in the resource center that could put this all together for you. The forum is a great place to get help if you get stuck.
Quote Reply
Re: Display Picture/Take away log on In reply to
I think there's probably a lot of stuff in my "bookstore" db that you don't need. (The reviews, for one thing take a lot.)

It really isn't hard to work it out. As Lois said, if you use the Configurator and the short/long display mod, most of the work will be done for you. If you need any help with anything, just holler.


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





Quote Reply
Re: Display Picture/Take away log on In reply to
Ok, I have a basic design of my page, but inorder to get the pictures lined up (its like the background of the page, but I cut the pictures up and positioned them using borders) and it look somewhat like this:
(The lines are the basic structure of the table/border)
__________________
|pic at top |
___________________
|grapx| open |
| | space |
| | for the |
| | body--I |
| | want the |
| | database |
| | table to |
| | be here |
___________________
So, using the short/long mod where should I put my HTML coding? I am so lost! I need major help! Thanks to all that have and will help! I appreciate it!

Oh, and can I use HTML codes for the fonts or do I have to use the $font form, etc.?
Quote Reply
Re: Display Picture/Take away log on In reply to
Look for this line in sub html_record {

# Below is where you define what you want to appear for each record in the "short" display.

If you want to display some fields in columns use the example provided in the script which would be something like this:

print qq|

<$font><a href="$long_url">$rec{'Name'}</A></font></td><TD> </TD><td><$font>$rec{'Title'}</font></td> |;

You do not need the beginning <TD> for the first field or ending </TD> for the last field.

You can insert your own font codes within your table tags or use those defined in your .cfg file ... it doesn't matter.

Can't wait to see your final database Smile
Quote Reply
Re: Display Picture/Take away log on In reply to
What I would suggest, CMY, is that you create an html page in an html editor with dummy data so that it looks exactly the way you want it to look. Use a photo of a car and any graphics you want to use. Then you can use the code for that html file in your sub html_record_long. All you have to do is replace the data with the $rec{'FieldName'} variables.




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





Quote Reply
Re: Display Picture/Take away log on In reply to
I think I am going to cry =(
This database is driving me crazy. Can someone please take a look at it

http://www.theyoungspot.com/cgi-bin/putnam/db.cgi

I get this error message:
CGI ERROR
==========================================
Error Message : Error loading required libraries.
Check that they exist, permissions are set correctly and that they compile.
Reason: syntax error at ./html.pl line 145, near "

I uploaded this file to www.theyoungspot.com/html.pl and it is viewable from there.

Like I said, I have made one database before with no modifications, only configurations. And this is my second, and it is definately more advanced!

Thanks to all those who read! Help would be greatly appreciated!

[This message has been edited by CMY (edited March 29, 2000).]
Quote Reply
Re: Display Picture/Take away log on In reply to
CMY:

Don't go crazy ... you're so close to having your database together Smile

In sub html_page_bottom {


<tr><td align=left><$font>Copyright 1998 <A HREF="http://www.gossamer-threads.com">Gossamer Threads Inc.</A></font></td>
<td align=right><a href="http://www.gossamer-threads.com/scripts/dbman/"><img src="http://www.gossamer-threads.com/images/powered.gif" border=0 width=100 height=31 alt="Database Powered by Gossamer Threads Inc."></a></td></tr>

You just need to add a \ prior to your ". Can think of the correct terms for doing this but here's how it should appear.

<a href=\"http://www.gossamer-threads.com/scripts/dbman/\"><img src=\"http://www.gossamer-threads.com/images/powered.gif\" border=0 width=100 height=31 alt=\"Database Powered by Gossamer Threads Inc.\">

Also since you asked about the short display i also noticed some changes necessary in that area.

Rather then having:

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

print qq|
<table border="0">
<tr><td> <$font>$rec{'Year'}
<a href="$long_url"><$font>$rec{'Make and Model'}</a> </td><td><font color="#000000" size="3"> <$font>$rec{'Price'}</font></td></tr></table> |;

This table actually starts in the sub view_success.

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


So you only need to add this for your short display formatting:

<$font>$rec{'Year'} <a href="$long_url">$rec{'Make and Model'}</a> </td><td><font color="#000000" size="3"> $rec{'Price'}</font>

Notice I also took out some extra font tags. You should always close one font tag prior to opening another.

This line in the script closes the final </TD>

# <-- End of short display formatting -- >
print "</TD>"; # do not remove this! It is necessary to make the records display properly.

Those changes should clear up your errors Smile
Quote Reply
Re: Display Picture/Take away log on In reply to
I keep getting the same message with those adjustments. However, I did find that the website is trying to pull the graphic from my site .. it is using my address http://www.theyoungspot.com/followed by the Gossamer Threads Source.

I once again uploaded my html.pl file to http://www.theyoungspot.com/html.pl

Thanks SO MUCH for your help!
Quote Reply
Re: Display Picture/Take away log on In reply to
Just wanted to let you know I'm checking your file again. The copy you uploaded again doesn't seem to have those changes made ?

It is a good idea to load Alex's graphic to your server so it doesn't delay the loading of your pages Smile

I'll let you know if I find anything else .. in a little while.


[This message has been edited by LoisC (edited March 30, 2000).]
Quote Reply
Re: Display Picture/Take away log on In reply to
It's really not necessary to escape the quotation marks (put the \ before the "). It won't hurt that you did, but it's unnecessary.

I found the error.

Code:
$html_title = 'Putnam's Pre-Owned Inventory Manager';

It's in the apostrophe in Putnam's. You can use an apostrophe, but then you have to use double quotes:

Code:
$html_title = "Putnam's Pre-Owned Inventory Manager";

Perl thinks the apostrophe is an ending single quote and the rest of the formatting gets all messed up. Using double quotes will work just fine.



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





Quote Reply
Re: Display Picture/Take away log on In reply to
Okay when I viewed the source of the document it provided the errors happening:

Reason: syntax error at ./html.pl line 145, near "<td align=right><a href=\"http://www.gossamer-threads.com/scripts/dbman\"><img src=\"http://www.gossamer-threads.com/images/powered.gif\" border=0 width=100 height=31 alt=\"Database Po"
(Might be a runaway multi-line PP string starting on line 73)
Unmatched right bracket at ./html.pl line 182, at end of line
syntax error at ./html.pl line 182, near "}"


Line 73:

$html_title = 'Putnam's Pre-Owned Inventory Manager';

Try changing this to:

$html_title = "Putnam's Pre-Owned Inventory Manager";

Line 182 is your page footer, but I can't find the unmatched bracket in this area or above it?


Carol: You must have found that error before I could post that I found it. I still can't figure out the missing bracket at line 182 though?
Quote Reply
Re: Display Picture/Take away log on In reply to
After I changed the quotation marks, I didn't get any other error. (I downloaded the file and compiled it on my computer.) With quotation errors, you can get a lot of other strange error messages that are really correct.

However, if you still get errors, CMY, please let us know.


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