Zen Cart Logo
Forums / General Questions / Please help! php syntax needed to call images!

Please help! php syntax needed to call images!

Locked

Views: 1,025

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
31 Oct 2007, 5:07 PM
#1
vood avatar

vood

New Zenner

Join Date:
Sep 2007
Posts:
59
Plugin Contributions:
0

Please help! php syntax needed to call images!

Can someone please tell me how to get this to work? This should call image from my custom images folder, but I can't seem to get the php part correct. Keep getting errors.

<center> <?php echo'<img src=zen_image(DIR_WS_TEMPLATE.'images/greetings.gif')/> ?> <br/> </center>

also, this looks different on this image that I need to call....

<?php echo'<img class="imagemap" name="productimagemap" src=zen_image(DIR_WS_TEMPLATE.'images/xx.gif') width="650" height="365" border="0" id="productimagemap" usemap="#m_productimagemap" alt="Handmade Luxury" /> ?>

Any help or point to documentation would be greatly appreciated.

Thank you,
Vood

31 Oct 2007, 5:23 PM
#2
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,604
Plugin Contributions:
0

Re: Please help! php syntax needed to call images!

Why are you echoing things? You are making life too complicated. Just use <img src="includes/templates/MY_TEMPLATE/images/MY_IMAGE.gif" /> (if the image is in your custom template directory)

31 Oct 2007, 5:58 PM
#3
vood avatar

vood

New Zenner

Join Date:
Sep 2007
Posts:
59
Plugin Contributions:
0

Re: Please help! php syntax needed to call images!

I was taking a suggestion from another user who posted the following...

If by relative links you mean php links here is the code to pull your image from your template images folder which is where I prefer to code all images that I custom add from.

<?=zen_image(DIR_WS_TEMPLATE.'images/xx.gif')?>

if this is not what you want but instead want to pull from the zen cart images folder you do this as you would any xhtml images link.

<img src="images/xxxx.gif" alt="your_alt_text" border="0">

I have no idea why anything is anything when it comes to php and zencart.

Thanks very much. This will solve my problems.....I hope.

31 Oct 2007, 8:59 PM
#4
poolprorich avatar

poolprorich

Zen Follower

Join Date:
Aug 2007
Location:
Tampa FL.
Posts:
143
Plugin Contributions:
0

Re: Please help! php syntax needed to call images!

Hello,

Is your custom image folder under your template folder as that is where your php statment is looking for it
if you want you can call your file :

<center> <?php echo'<img src=zen_image(DIR_WS_TEMPLATE**.**'images/greetings.gif')/> ?> <br/> </center> <center> <?php echo'<img src=zen_image(DIR_WS_TEMPLATE**,**'images/greetings.gif')/> ?> <br/> </center>

replace the period with a coma
Rich