|
Posted by Ashok on 06/28/05 14:06
ok, played with google & the quotes and finally got it.
Now heading to next part of the script.
*cross hands.
Thanks.
Ashok.
"Ashok" <non2@mail.ru> wrote in message news:d9q27c$1hfb$1@gavrilo.mtu.ru...
> Hi,
> yep, the name of pic is there. Double checked the database entries. The
pic
> is in jpg format where as frame pics are in gif.
> Here is the code
> <?php
> require('includes/application_top.php');
> $navigation->remove_current_page();
> $products_query = tep_db_query("select pd.products_name,
p.products_image
> from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . "
> pd on p.products_id = pd.products_id where p.products_status = '1' and
> p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and
> pd.language_id = '" . (int)$languages_id . "'");
> $products = tep_db_fetch_array($products_query);
>
> //define paths to border images
> define("BOT","images/bagetb.gif");
> define("TOP","images/bagett.gif");
> define("LEFT","images/bagetl.gif");
> define("RIGHT","images/bagetr.gif");
> define("TOP_LEFT","images/bagettopleft.gif");
> define("TOP_RIGHT","images/bagettr.gif");
> define("BOT_RIGHT","images/bagetbr.gif");
> define("BOT_LEFT","images/bagetbl.gif");
>
> function ds($image,$dsw,$alt){
> //first check that file exists
> if(file_exists($image)){
> //create an image from the file
> list ($width,$height)= getimagesize($image);
> //print containing <div> using image width plus shadow width
> print "<div style='width:
> ".($dsw+$width+$dsw)."\n'>";
> //print topleftcorner
> print "<img style='float: none;' src='".TOP_LEFT."'
> height='$dsw' width='$dsw'alt=''>";
> //print topline
> print "<img style='float: none;' src='".TOP."' height='$dsw'
> width='".$width."'alt=''>";
> //print toprightcorner
> print "<img style='float: none;' src='".TOP_RIGHT."'
> height='$dsw' width='$dsw'alt=''>";
> //print leftline
> print "<img style='float: none;' src='".LEFT."'
> height='".$height."' width='$dsw'alt=''>";
> //print image
> print "<img style='float: none;' src='$image'
> height='".$height."' width='".$width."'alt='$alt'>";
> //print right shadow using image sizes
> print "<img style='float: none;'
> src='".RIGHT."'height='".$height."'width='$dsw'alt=''>";
> //print bottomleftcorner
> print "<img style='float: none;' src='".BOT_LEFT."'
> height='$dsw' width='$dsw'alt=''>";
> //print bottom shadow using image sizes
> print"<img style='float: none;'
> src='".BOT."'width='".$width."'height='$dsw'alt=''>";
> //print corner shadow using image sizes
> print "<img style='float: none;'
> src='".BOT_RIGHT."'height='$dsw'width='$dsw'alt=''>";
> //print closing </div>
> print "</div>";
> }
> else { echo" no file";}
> }
> ?>
> <head> ....
> <body>
> <?php ds("images/$products['products_image']",100,"big magic") //this is
> line 75
> ?>
>
> </body>
> This gives me error: Parse error: parse error, unexpected
> T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or
T_NUM_STRING
> in W:\www\magicart.npoyuc.ru\frame.php on line 75
>
> so, I change line 75 to
> <?php ds(tep_image(DIR_WS_IMAGES . $products['products_image']),100,"big
> magic") ?>
> <?php echo tep_image(DIR_WS_IMAGES . $products['products_image']) ;?>
> //this is line 76
>
> Now, the result shows line 75 as "no file" echoed and line 76 shows the
pic.
>
> *pulling my hairs all evening.
>
> Ashok.
>
> "Geoff Berrow" <blthecat@ckdog.co.uk> wrote in message
> news:eou0c1laqf7mnmbhotr2kns6r9afhdv5gn@4ax.com...
> > I noticed that Message-ID: <d9pr0h$1ea4$1@gavrilo.mtu.ru> from Ashok
> > contained the following:
> >
> > >So, if I tell
> > ><?php ds("images/testpic.jpg",100,"big magic"); ?>
> > >it works,
> > >but if I tell
> > ><?php ds("images/$pic_id",100,"big magic"); ?>
> > >it doesnt.
> > >Any ideas?
> >
> > Works fine for me. Are you sure $pic_id actually contains the name of
> > the file?
> >
> > --
> > Geoff Berrow 0110001001101100010000000110
> > 001101101011011001000110111101100111001011
> > 100110001101101111001011100111010101101011
>
>
Navigation:
[Reply to this message]
|