开发者

Problem with call to img in Joomla!

to whomever it is that can help me thank you in advance. Can anybody tell me how to call an image within this piece of code or what I'm doing wrong?

In the header of a default.php file within a module I have

$iseta = $params->get ('iseta');

Then several lines down I have

<img src="<?php echo $path; ?>modules/mod_chat/Set_<?php echo'.$iseta.'?>.gif" alt="Chat Now" title="Chat Now" height="127" width="200" style="margin-right:6px;"/>

Note that all images in the image folder are titled Set_Aon.开发者_StackOverflow中文版gif and Set_Aoff.gif etc. The values in the parameter are value="Aon" value="Aoff".

<param name="iseta" type="list" default="Aon" label="Online Image" description="The online chat icon that will be displayed on the front. A online = A offline">

                <option value="Aon">Blue</option>

                <option value="Bon">White</option>
</param>

The variable $params calls a parameter in Joomla where 'iseta' is the parameter name. Within this parameter I have created a type="list" for the front-end of the module. Each item in the list being a different image for 'iseta'. Maybe I'm missing a call to 'iseta' from the .xml document that it is located in? I'm not sure if I'm setting this up wrong, but some suggestions would be greatly appreciated.

Respectfully,

David


<?php echo'.$iseta.'?> 

Single-quoted strings in PHP do not interpolate variables within them. This will generate HTML that looks something like

<img src="blah/blah/Set_.$iseta..gif" alt="Chat Now" title="etc..." />

Note that the variable's name and the two periods have been inserted literally. Most likely what you'd want is

<?php echo $iseta ?>

instead.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜