bigbob2 Posted April 21, 2015 Share Posted April 21, 2015 I am using a Templatemonster template which had the footer only on the index.php page and no other pages. So I added the missing code line <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> on the includes/template_bottom.php file and now I have a footer on all my pages, but I have two footers on the index.php page. I have been through the code on the index.php file and there does not seem to be any mention of the footer there, so I was wondering where else they may have put it to show the footer only on that page? Cheers Kev Link to comment Share on other sites More sharing options...
♥Tsimi Posted April 22, 2015 Share Posted April 22, 2015 Kinda hard to help without looking at the index.php and template_bottom.php file. Hard to guess what modification to the index.php that template of yours has. And a URL to your shop would help too. Link to comment Share on other sites More sharing options...
bigbob2 Posted April 22, 2015 Author Share Posted April 22, 2015 Kinda hard to help without looking at the index.php and template_bottom.php file. Hard to guess what modification to the index.php that template of yours has. And a URL to your shop would help too. Here is the index.php code: <?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2010 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); // the following cPath references come from application_top.php $category_depth = 'top'; if (isset($cPath) && tep_not_null($cPath)) { $categories_products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'"); $categories_products = tep_db_fetch_array($categories_products_query); if ($categories_products['total'] > 0) { $category_depth = 'products'; // display products } else { $category_parent_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$current_category_id . "'"); $category_parent = tep_db_fetch_array($category_parent_query); if ($category_parent['total'] > 0) { $category_depth = 'nested'; // navigate through the categories } else { $category_depth = 'products'; // category has no products, but display the 'no products' message } } } require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT); ?> <?php if ($category_depth == 'nested') { $current_page = FILENAME_CATEGORIES_NESTED; require(DIR_WS_INCLUDES . 'template_top.php'); include(FILENAME_CATEGORIES_NESTED); ?> <?php } elseif ($category_depth == 'products' || isset($HTTP_GET_VARS['manufacturers_id'])) { $current_page = FILENAME_CATEGORIES_LISTING; require(DIR_WS_INCLUDES . 'template_top.php'); include(FILENAME_CATEGORIES_LISTING); ?> <?php } else { // default page $current_page = FILENAME_DEFAULT; require(DIR_WS_INCLUDES . 'template_top.php'); ?> <?php if ( (NEW_PRODUCTS_MODULE_DISPLAY_FIRST_PAGE == 'true') || (NEW_PRODUCTS_MODULE_DISPLAY_FIRST_PAGE == 'true')) { ?> <?php ?> <?php } ?> <div class="none"> <?php echo tep_draw_title_top();?> <h1><?php echo HEADING_TITLE; ?></h1> <?php echo tep_draw_title_bottom();?><br /> </div> <?php if (NEW_PRODUCTS_MODULE_DISPLAY_FIRST_PAGE == 'true') { echo tep_draw_content_top(); include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); echo tep_draw_content_bottom(); } if (FEATURED_MODUL_DISPLAY_FIRST_PAGE == 'true') { echo tep_draw_content_top(); include(DIR_WS_MODULES . FILENAME_FEATURED); echo tep_draw_content_bottom(); } include(DIR_WS_MODULES . FILENAME_UPCOMING_PRODUCTS); ?> <?php if ( (NEW_PRODUCTS_MODULE_DISPLAY_FIRST_PAGE == 'true') || (NEW_PRODUCTS_MODULE_DISPLAY_FIRST_PAGE == 'true')) { ?> <?php ?> <?php } ?> <?php } require(DIR_WS_INCLUDES . 'template_bottom.php'); require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> Here is the template_bottom.php code <?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2010 osCommerce Released under the GNU General Public License */ ?> <?php if (($oscTemplate->hasBlocks('box_bottom_content_set'))) { ?> <?php echo $oscTemplate->getBlocks('box_bottom_content_set'); ?> <?php } ?> </div></div> <!-- bodyContent //--> <?php if (($oscTemplate->hasBlocks('boxes_column_left'))) { ?> <div id="columnLeft" class="grid_<?php echo $oscTemplate->getGridColumnWidth(); ?> <?php echo ($oscTemplate->hasBlocks('boxes_column_left') ? 'pull_' . $oscTemplate->getGridContentWidth() : ''); ?>"> <div><?php echo $oscTemplate->getBlocks('boxes_column_left'); ?></div> </div> <?php } ?> <?php if ($oscTemplate->hasBlocks('boxes_column_right')) { ?> <div id="columnRight" class="grid_<?php echo $oscTemplate->getGridColumnWidth(); ?>"> <div><?php echo $oscTemplate->getBlocks('boxes_column_right'); ?></div> </div> <?php } ?> </div> <div class="container_<?php echo $oscTemplate->getGridContainerWidth(); ?> row_5"> <?php if (($oscTemplate->hasBlocks('boxes_above_footer'))) { ?> <div class="grid_<?php echo $oscTemplate->getGridContainerWidth(); ?>"> <div class="boxes_above_footer"><?php echo $oscTemplate->getBlocks('boxes_above_footer'); ?></div> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> </div> <?php } ?> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> </div> <a class="logo" href="<?php echo tep_href_link(FILENAME_DEFAULT);?>"><?php echo tep_image(DIR_WS_IMAGES.'store_logo.png', STORE_NAME, '', '', '')?></a> <!-- bodyWrapper //--> </div> <?php echo $oscTemplate->getBlocks('footer_scripts'); ?> <!--[if lt IE 9]> <link href="css/ie_style.css" rel="stylesheet" type="text/css" /> <![endif]--> <script type="text/javascript" src="ext/js/imagepreloader.js"></script> <script type="text/javascript"> preloadImages([ // 'images/user_menu.gif', 'images/bg_list.png', 'images/hover_bg.png', 'images/nivo-nav.png', 'images/wrapper_pic.png', 'images/wrapper_pic-act.png']); </script> </body> </html> Thanks Kev Link to comment Share on other sites More sharing options...
♥Tsimi Posted April 22, 2015 Share Posted April 22, 2015 I don't know what $oscTemplate->getBlocks('boxes_above_footer') does but that is not stock osC. So I imagine that this "boxes_above_footer" is some module or many modules that are activated in the admin area and it seems like that they only show on the index.php site and also add the normal footer under it. This code checks if there are "boxes_above_footer" if (($oscTemplate->hasBlocks('boxes_above_footer'))) { If yes, then it will show what ever that is (presumably on the index.php only) and then this code <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> will add the normal footer under it. So if boxes_above_footer is not activated no footer will show on any page not even on index.php. You then added again that same footer code under it. Which is the reason for it to show twice on the index.php So my guess would be to remove the first footer code from the if statement and move your second footer code after that last <div> tag. Something like this maybe <div class="container_<?php echo $oscTemplate->getGridContainerWidth(); ?> row_5"> <?php if (($oscTemplate->hasBlocks('boxes_above_footer'))) { ?> <div class="grid_<?php echo $oscTemplate->getGridContainerWidth(); ?>"> <div class="boxes_above_footer"><?php echo $oscTemplate->getBlocks('boxes_above_footer'); ?></div> </div> <?php } ?> </div> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> or maybe put the footer code above the </div> tag? Kinda hard to tell without looking at the actual site. And besides, support for commercial templates is the job of the template seller. ;) Link to comment Share on other sites More sharing options...
♥14steve14 Posted April 22, 2015 Share Posted April 22, 2015 If you read through the template bottom code you have the footer code in there twice. Just delete the one that is not required. You have <div class="container_<?php echo $oscTemplate->getGridContainerWidth(); ?> row_5"> <?php if (($oscTemplate->hasBlocks('boxes_above_footer'))) { ?> <div class="grid_<?php echo $oscTemplate->getGridContainerWidth(); ?>"> <div class="boxes_above_footer"><?php echo $oscTemplate->getBlocks('boxes_above_footer'); ?></div> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> </div> then a bit further down you have ?> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> </div> I would remove the last one. REMEMBER BACKUP, BACKUP AND BACKUP Link to comment Share on other sites More sharing options...
bigbob2 Posted April 23, 2015 Author Share Posted April 23, 2015 Thank you for the replies. I feel stupid that I did not spot the second footer line, I looked, looked and looked again, but I guess sometimes you can't see the wood for the trees. I removed the first one and moved the second one after the </div> as it was getting strange formatting where it was. Thanks again guys :) Kev Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.