Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Latest news v1.1.4


Flotec

Recommended Posts

I have just installed the Latest news 1.1.4 contribution and it works fine. For some strange reason it does however not show up on all pages. For example in all pages under information there is no latest news showing up.

I have only included it in the column_right.php file. In the code there is an if statement. It must be this one that prevents the latest news to show up in all pages. Can I delete the if statement? I suppose the purpose of this is that if no news is written in admin the box should not come up, but for some reason it prevents the box to show up on some pages. Can someone please help me.

Link to comment
Share on other sites

Here is the code I inserted at the top of column_left.php:

// BEGIN latest news

if (basename($PHP_SELF) == FILENAME_DEFAULT) {

include(DIR_WS_BOXES . 'latest_news.php');

}

// END latest news

 

I thought from the beginning that the "if" is used so that when there is no news the box should not show. But for some strange reason it prevents the box to show up in some pages.

I cannot understand the code myself, but maybe someone can explain it.

Link to comment
Share on other sites

Here is the code I inserted at the top of column_left.php:

// BEGIN latest news

if (basename($PHP_SELF) == FILENAME_DEFAULT) {

   include(DIR_WS_BOXES . 'latest_news.php');

}

// END latest news

 

I thought from the beginning that the "if" is used so that when there is no news the box should not show. But for some strange reason it prevents the box to show up in some pages.

I cannot understand the code myself, but maybe someone can explain it.

 

$PHP_SELF is a PHP internal translating to 'I Myself' and FILENAME_DEFAULT translates to index.php for MS 2.2. So this IF tells that if you are on your main page, index.php, THEN show the lastest news which also means that if you are not on the main page then the latest news box should not be shown.

 

You were correct in your assumption that the IF construction prevented the latest news box to show up in some places and the informative pages are an example because they all have a different name as index.php

I suppose it is for a reason the author choose to only show the latest news when a customer is on the main page but if you like it elsewise you can remove the IF-construction and just have

   include(DIR_WS_BOXES . 'latest_news.php');

somewhere in your column_left.php or column_right.php

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...