Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

PHP In Infobox?


Guest

Recommended Posts

Hi all,

 

I'm trying to add the Latest News add on - http://addons.oscommerce.com/info/8231- to oscommerce 2.3.3. I've got all that working and now i'm trying to display the latest news box on the side bar. I've made the new module and installed it, but the Latest News add on requires you to call

 

<?php include(DIR_WS_MODULES . FILENAME_LATEST_NEWS); ?>

 

To make the latest news appear.

 

Would anyone know how you call php in an infobox.

 

Atm I've got;

 

function execute() {
      global $oscTemplate;

      $data = '<?php include(DIR_WS_MODULES . FILENAME_LATEST_NEWS); ?>' ;

      $oscTemplate->addBlock($data, $this->group);
    }

But it doesn't work

 

Link to comment
Share on other sites

@@adamboustead

 

The installation instructions say:

####[ ADD THIS LINE THERE WHERE YOU LIKE TO SHOW NEWS - usually index.php ]#######################

   <?php include(DIR_WS_MODULES . FILENAME_LATEST_NEWS); ?>

If you want this to be a loadable box module, you'll have to rewrite the code.

 

I have recently converted another 'Latest News' module to be a loadable module box, and it has the 'news' scrolls vertically. Maybe you can get some ideas from this code:

 

http://addons.oscommerce.com/info/9318

 

Malcolm

Link to comment
Share on other sites

Normally the code below is in the information box. All I'm trying to do is remove the <ul> which shows a menu and replace it with the latest news box?

function execute() {
      global $oscTemplate;
		
		
      $data = '<div class="infoBoxWrapper list">' . tep_draw_box_wrapper_top() . 
              '  <div class="infoBoxHeading">' . tep_draw_box_title_top(). '<i class="icon-info-sign"></i>' . MODULE_BOXES_LATEST_NEWS_BOX_TITLE . tep_draw_box_title_bottom() . '</div>' .
              '  <div class="infoBoxContents">' . tep_draw_box_content_top() . 
			  '  <ul class="information">' .
              '    <li>'. tep_draw_box_list_top() . ' <a href="' . tep_href_link(FILENAME_SHIPPING) . '"><i class="icon-ok"></i>' . MODULE_BOXES_LATEST_NEWS_BOX_SHIPPING . '</a>' . tep_draw_box_list_bottom() . '</li>' .
              '    <li>' . tep_draw_box_list_top() . '<a href="' . tep_href_link(FILENAME_PRIVACY) . '"><i class="icon-ok"></i>' . MODULE_BOXES_LATEST_NEWS_BOX_PRIVACY . '</a>' . tep_draw_box_list_bottom() . '</li>' .
              '    <li>' . tep_draw_box_list_top() . '<a href="' . tep_href_link(FILENAME_CONDITIONS) . '"><i class="icon-ok"></i>' . MODULE_BOXES_LATEST_NEWS_BOX_CONDITIONS . '</a>' . tep_draw_box_list_bottom() . '</li>' .
              '    <li>' . tep_draw_box_list_top() . '<a href="' . tep_href_link(FILENAME_CONTACT_US) . '"><i class="icon-ok"></i>' . MODULE_BOXES_LATEST_NEWS_BOX_CONTACT . '</a>' . tep_draw_box_list_bottom() . '</li>'.
			  '  </ul>' .
              '' . tep_draw_box_content_bottom() . '</div>' .
              '' . tep_draw_box_wrapper_bottom() . '</div>';

      $oscTemplate->addBlock($data, $this->group);
    }
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...