collector1 Posted June 7, 2011 Share Posted June 7, 2011 HI, I have added a new box to the main page and I've put an image in that box. I would like to add a hyperlink to the image. Can any one please advise? bm_hoarderscollectables function bm_hoarderscollectables() { $this->title = MODULE_BOXES_HOARDERSCOLLECTABLES_TITLE; $this->description = MODULE_BOXES_HOARDERSCOLLECTABLES_DESCRIPTION; if ( defined('MODULE_BOXES_HOARDERSCOLLECTABLES_STATUS') ) { $this->sort_order = MODULE_BOXES_HOARDERSCOLLECTABLES_SORT_ORDER; $this->enabled = (MODULE_BOXES_HOARDERSCOLLECTABLES_STATUS == 'True'); $this->group = ((MODULE_BOXES_HOARDERSCOLLECTABLES_CONTENT_PLACEMENT == 'Left Column') ? 'boxes_column_left' : 'boxes_column_right'); } } function execute() { global $oscTemplate; $data = '<div class="ui-widget infoBoxContainer">' . ' <div class="ui-widget-header infoBoxHeading">' . MODULE_BOXES_HOARDERSCOLLECTABLES_BOX_TITLE . '</div>' . ' <div class="ui-widget-content infoBoxContents">' . ' <div class="img"><center>' . tep_image( DIR_WS_IMAGES . 'ebaylogo.jpg', 'hoarderscollectables', '133', '48' ) . '</center></div>' . ' </div>' . '</div>'; $oscTemplate->addBlock($data, $this->group); } function isEnabled() { return $this->enabled; } function check() { return defined('MODULE_BOXES_HOARDERSCOLLECTABLES_STATUS'); } Many Thanks. Link to comment Share on other sites More sharing options...
multimixer Posted June 7, 2011 Share Posted June 7, 2011 Replace this ' <div class="img"><center>' . tep_image( DIR_WS_IMAGES . 'ebaylogo.jpg', 'hoarderscollectables', '133', '48' ) . '</center></div>' . by this ' <div class="img" style="text-align:center;">' . ' <a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'ebaylogo.jpg', 'hoarderscollectables', '133', '48' ) . '</a>' . '</div>' . You can replace FILENAME_DEFAULT by any file you want to link to. My community profile | Template system for osCommerce - New: Responsive | Feedback channel Link to comment Share on other sites More sharing options...
collector1 Posted June 7, 2011 Author Share Posted June 7, 2011 Thanks for that, but I would like to add this external link <a href="http://search.ebay.co.uk/_W0QQfrppZ200QQfsooZ1QQfsopZ1QQrdZ0QQsassZhoarderscollectables?refid=store" TARGET="NEW"> Do I copy it to replace FILENAME_DEFAULT ? Link to comment Share on other sites More sharing options...
multimixer Posted June 7, 2011 Share Posted June 7, 2011 would be like this ' <a href="http://multimixer.gr">' My community profile | Template system for osCommerce - New: Responsive | Feedback channel Link to comment Share on other sites More sharing options...
collector1 Posted June 7, 2011 Author Share Posted June 7, 2011 would be like this ' <a href="http://multimixer.gr">' I changed and got this error line 13 being class bm-hoarderscollectables ( Fatal error: Cannot redeclare class bm_hoarderscollectables in /home/hoar3157/public_html/www.hoarderscollectables.co.uk/includes/modules/boxes/bm_hoarderscollectables.php on line 13 class bm_hoarderscollectables { var $code = 'bm_hoarderscollectables'; var $group = 'boxes'; var $title; var $description; var $sort_order; var $enabled = false; function bm_hoarderscollectables() { $this->title = MODULE_BOXES_HOARDERSCOLLECTABLES_TITLE; $this->description = MODULE_BOXES_HOARDERSCOLLECTABLES_DESCRIPTION; if ( defined('MODULE_BOXES_HOARDERSCOLLECTABLES_STATUS') ) { $this->sort_order = MODULE_BOXES_HOARDERSCOLLECTABLES_SORT_ORDER; $this->enabled = (MODULE_BOXES_HOARDERSCOLLECTABLES_STATUS == 'True'); $this->group = ((MODULE_BOXES_HOARDERSCOLLECTABLES_CONTENT_PLACEMENT == 'Left Column') ? 'boxes_column_left' : 'boxes_column_right'); } } function execute() { global $oscTemplate; $data = '<div class="ui-widget infoBoxContainer">' . ' <div class="ui-widget-header infoBoxHeading">' . MODULE_BOXES_HOARDERSCOLLECTABLES_BOX_TITLE . '</div>' . ' <div class="ui-widget-content infoBoxContents">' . ' <div class="img" style="text-align:center;">' . ' <a href="http://multimixer.gr">' . tep_image(DIR_WS_IMAGES . 'ebaylogo.jpg', 'hoarderscollectables', '133', '48' ) . '</a>' . '</div>' . ' </div>' . '</div>'; Link to comment Share on other sites More sharing options...
multimixer Posted June 7, 2011 Share Posted June 7, 2011 This has nothing to do with the link Delete the copy of the file you have on the server and start keeping backups offline on your computer My community profile | Template system for osCommerce - New: Responsive | Feedback channel Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.