hjames82 Posted October 2, 2008 Share Posted October 2, 2008 Hi there everyone (Again) I need a little help replacing a call out to a Language File with an Image. If anyone can help I would be appreciative. I need to replace the $_MT_LANG->RECOMMENT.... with an Image Teaser Code: $html .= '>'.$_MT_LANG->RECOMMEND ."</a>"; Full Code: (The image path is Comment Out at the bottom of the page) <?php /** * MAFiASCRiPTS **/ defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' ); //Base plugin class. global $mosConfig_absolute_path; require_once $mosConfig_absolute_path.'/components/com_mtree/Savant2/Plugin.php'; class Savant2_Plugin_ahrefrecommend extends Savant2_Plugin { function plugin( &$link, $attr=null ) { global $Itemid, $_MT_LANG, $mtconf;//, $mt_show_recommend; # Load Parameters $params =& new mosParameters( $link->attribs ); $params->def( 'show_recommend', $mtconf->get('show_recommend') ); if ( $params->get( 'show_recommend' ) == 1 ) { $html = ''; // $html = '<img src="images/M_images/indent1.png" width="9" height="9" />'; $html .= '<a href="'; $html .= sefRelToAbs("index.php?option=com_mtree&task=recommend&link_id=".$link->link_id."&Itemid=".$Itemid); $html .= '"'; # Insert attributes if (is_array($attr)) { // from array foreach ($attr as $key => $val) { $key = htmlspecialchars($key); $val = htmlspecialchars($val); $html .= " $key=\"$val\""; } } elseif (! is_null($attr)) { // from scalar $html .= " $attr"; } $html .= '>'.$_MT_LANG->RECOMMEND ."</a>"; # Return the recommend link return $html; } } } ?> <!--<<img src="http://gamersspace.net/components/com_mtree/img/email_article.gif">>--> Thanks, James Link to comment https://forums.phpfreaks.com/topic/126751-add-image-inplace-of-language-text/ Share on other sites More sharing options...
laqutus Posted October 2, 2008 Share Posted October 2, 2008 Add an image file there in the code or set a variable pointing to the image file and add the code form the HTML variable into the link for the image. This will display an image file with the recommended hyperlink setup. Link to comment https://forums.phpfreaks.com/topic/126751-add-image-inplace-of-language-text/#findComment-655660 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.