Guest Posted December 12, 2005 Share Posted December 12, 2005 Hello, I'm searching for a way to add code to index.php so that a table appears after column_right but only on the default page. There is an 'if' 'then' statement before column_right that gets text_main, etc. to only show on default page. I can't add table here because it is too wide to fit between columns. Right now, I'm calling the table to appear with no conditions, and it appears on my product pages as well as the default page. Anyone know how to add an 'if' 'then' statement to fit this situation? Any help is always greatly appreciated! NS Link to comment Share on other sites More sharing options...
Jack_mcs Posted December 12, 2005 Share Posted December 12, 2005 This code will do that: if (basename($PHP_SELF) == FILENAME_DEFAULT) { your code goes here } Jack Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
Guest Posted December 12, 2005 Share Posted December 12, 2005 Thanks Jack for your reply! I used the code you were kind enough to offer as follows: <?php if (basename($PHP_SELF) == FILENAME_DEFAULT) { include(DIR_WS_MODULES . 'main.php'); } ?> The result is great on my default page, but the table still appears on product_list pages. You can see it here: http://www.naturalsamba.com Any idea how I can get it only appear on index.php and not category pages? Again, thanks for your time! Rick Link to comment Share on other sites More sharing options...
Jeremy at oddly enough Posted December 12, 2005 Share Posted December 12, 2005 Thanks Jack for your reply! I used the code you were kind enough to offer as follows: <?php if (basename($PHP_SELF) == FILENAME_DEFAULT) { include(DIR_WS_MODULES . 'main.php'); } ?> The result is great on my default page, but the table still appears on product_list pages. You can see it here: http://www.naturalsamba.com Any idea how I can get it only appear on index.php and not category pages? Again, thanks for your time! Rick I could be wrong, but it looks to me like you were supposed to replace FILENAME_DEFAULT with the name of the page you want this to appear on, so in your case with INDEX. Jeremy Link to comment Share on other sites More sharing options...
boxtel Posted December 12, 2005 Share Posted December 12, 2005 I could be wrong, but it looks to me like you were supposed to replace FILENAME_DEFAULT with the name of the page you want this to appear on, so in your case with INDEX.Jeremy <?php if ((basename($PHP_SELF) == FILENAME_DEFAULT) and (!isset($_GET['cPath']))) { include(DIR_WS_MODULES . 'main.php'); } ?> Treasurer MFC Link to comment Share on other sites More sharing options...
Jumping Rabbit Posted December 12, 2005 Share Posted December 12, 2005 This code: if (basename($PHP_SELF) == FILENAME_DEFAULT) {your code goes here } For a standard osc settup this code will let the box only show on the pages controlled by the index.php file ie. front page , category and sub-category pages. If you have modified your shop to use your domain name as default instead of index.php as the default , for info on how to do this see the tread by javaroaster , then this code will let the box be shown only on the front page. Faster Checkout - osCommerce Knowledge Base - Anyone meet offline?, Has anyone of you cyberkids meet offline? For newbees do atleast read this 4 points: Basic info - Search tips and help - Posting tips and help - Basics for Design Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.