Results 1 to 4 of 4

Hybrid View

  1. #1
    Join Date
    Sep 2007
    Posts
    60
    Plugin Contributions
    0

    Default 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

  2. #2
    Join Date
    Jun 2003
    Posts
    33,721
    Plugin Contributions
    0

    Default 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)
    Please do not PM for support issues: a private solution doesn't benefit the community.

    Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

  3. #3
    Join Date
    Sep 2007
    Posts
    60
    Plugin Contributions
    0

    Default 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.

  4. #4
    Join Date
    Aug 2007
    Location
    Tampa FL.
    Posts
    142
    Plugin Contributions
    0

    Default 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

 

 

Similar Threads

  1. sql syntax error 1064 - HELP NEEDED - Master Password
    By mydesignerstudio in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 20 Jul 2009, 04:22 PM
  2. Help with PHP syntax please?
    By sunflowertami in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 17 Jun 2008, 11:48 AM
  3. Easy PHP syntax question -- help please?
    By magicpants in forum General Questions
    Replies: 2
    Last Post: 17 Jan 2007, 02:31 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg