Flotec Posted December 16, 2005 Share Posted December 16, 2005 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. Quote Link to comment Share on other sites More sharing options...
Flotec Posted December 18, 2005 Author Share Posted December 18, 2005 Can someone please help me. Did I maybe post this in the wrong category? Quote Link to comment Share on other sites More sharing options...
wheeloftime Posted December 18, 2005 Share Posted December 18, 2005 Can someone please help me. Did I maybe post this in the wrong category? No, I suppose this is alright but it would help if you post your column_right.php here to see if there is an if in the way for this. Quote Link to comment Share on other sites More sharing options...
Flotec Posted December 18, 2005 Author Share Posted December 18, 2005 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. Quote Link to comment Share on other sites More sharing options...
wheeloftime Posted December 19, 2005 Share Posted December 19, 2005 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.