Gossamer Forum
Home : Products : DBMan : Customization :

Would Really Appreciate Help

Quote Reply
Would Really Appreciate Help
Getting kind of frustrated. I have dug and dug and tried numerous avenues to remedy my problem but to no avail. I love this script but I am going to be forced elsewhere if I can't solve this one little problem.

I have a problem getting a field to be viewed correctly. What actually comes up is a RED X simulating a broken graphic. You can find the DB below for an example.

<A HREF="http://www.fishbonemedia.net/cgi-bin/dbman/db.cgi" target="_new">http://www.fishbonemedia.net/cgi-bin/dbman/db.cgi</A>

I did find an example of a similar problem at the post linked below, but it has not worked for me.

<A HREF="http://webmagic.hypermart.net/dbman/syntax1.txt" target="_new">http://webmagic.hypermart.net/dbman/syntax1.txt</A>

The field includes a variable and partial html to find images in a separate database. The field is listed below and needs to be exactly like this when uploaded.

FIELD: <b><IMG SRC="%%URLofImages%%/0001.jpg" BORDER=0></b>

It is obvious that the second set of double quotes are causing the problem. I just don't know how to fix it.

Any help here would be GREATLY appreciated.

As always thanks for all the help.


Doug Hoyer
Fishbone Media - Creative Business Solutions
http://www.fishbonemedia.net
Quote Reply
Re: Would Really Appreciate Help In reply to
I am rather confused on why URLofImages and the rest of the coding needs to be entered into the field. It would seem like you would only need the image name and extension written to the database and then use the rest of the code along with the $rec{'imageFieldName'} as part of the path. Something like this:

FIELD: <b><IMG SRC="%%URLofImages%%/$rec{'imageFieldName'}" BORDER=0></b>




Quote Reply
Re: Would Really Appreciate Help In reply to
Karen,

Thank you for responding to my question!! As to why I need to have all of it input into the database. That is what the MySQL shopping cart system calls. It makes pages on the fly from a template which has in it different variables.

The %%UrlofImages%% is what the template page (below) uses to show the images folder location variable.

$URLofImages = "http://www.xxxx.net/shopping/images";

CALLS TEMPLATE VARIABLES for DYNAMIC PAGES:

$dbh = DBI->connect("dbi:mysql:$sc_mysql_database_name:$sc_mysql_server_name","$sc_mysql_user_name","$sc_mysql_password") || die("Couldn't connect to database!\n");
my($query) = "SELECT * FROM product";
my($sth) = $dbh->prepare($query);
$sth->execute || die("Couldn't exec sth!");
while(@row = $sth->fetchrow)
{
open(TEMPLATE,"./template.htm");
$new_doc = "";
while ($line = <TEMPLATE>)
{
$image = $row[4];
$image =~ s/%%URLofImages%%/$URLofImages\/product/g;
$line =~ s/%%id%%/$row[0]/g;
$line =~ s/%%category%%/$row[1]/g;
$line =~ s/%%price%%/$row[2]/g;
$line =~ s/%%name%%/$row[3]/g;
$line =~ s/%%image%%/$image/g;
$line =~ s/%%description%%/$row[5]/g;
$line =~ s/%%weight%%/$row[6]/g;
$line =~ s/%%color%%/$row[7]/g;
$line =~ s/%%bloom%%/$row[8]/g;
$line =~ s/%%height%%/$row[9]/g;
$line =~ s/%%lpcode%%/$row[10]/g;
$line =~ s/%%userfive%%/$row[11]/g;
$line =~ s/%%options%%/$row[12]/g;
$line =~ s/%%sc_main_script_url%%/$sc_main_script_url/g;
$new_doc .= $line;
}
close(TEMPLATE);

Basically, I was following their example database. It works great and it would be really easy for my clients to update using DBMan.

I have thought about trying a couple of things to remedy the problem.

1. I noticed the people talked about combining feilds. I have thought about combining making the first part a hidden field. Allowing the image part to be typed. Then making the third part a hidden field. Then combining them all together. For obvious reasons this is really a last resort.

2. I have tried to get some response in this forum regarding hiding the first part and last part of the field and only allowing the user to enter the image name. But alas, no one has risen to the chalenge. I don't think it is possible.

So there lies my dilema. I just don't have the skills to work it out for myself yet.

If you have any ideas please let me hear them. Even if it includes some Super Glue and a large hammer Crazy
Appreciate the help!!

Doug Hoyer


Doug Hoyer
Fishbone Media - Creative Business Solutions
http://www.fishbonemedia.net

Doug Hoyer
Fishbone Media - Creative Business Solutions
http://www.fishbonemedia.net