Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Footer has gone for a hike.


luvubeauty

Recommended Posts

Posted

Hello all!

First I would like to thank everyone for all the help! :D

Now, I have an issue with my Footer, it has left the page and I have no idea where it went. I have been investigating both my stylesheet and index page and can not figure out what went wrong...Tell you the truth I didn't even notice it disappeared until now, so I have no idea how long it has been gone. Can someone help? I will post any code that you need!!!

Thanks

Posted

OK, I have gone over and over again my index, english and footer files and have found nothing...does anyone else have any ideas?

my url is a demo shop but you can see at

 

www.luvubeauty.com/wholesalesection

 

any help would be appreciated :)

Posted

Are you using Simple Template System?

 

If not in your /wholesalesection/index.php the code seems to be cut off before the footer section. Try to add this to the end of the file

 

<!-- footer //-->

<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>

<!-- footer_eof //-->

 

If you're using STS then you just need to add the applicable tags

$numrequests

$footer_text The osCommerce copyright information and "Powered By osCommerce" texts.

$banner_only The banner, generally displayed at the bottom of the pages.

Posted

Are you using Simple Template System?

 

If not in your /wholesalesection/index.php the code seems to be cut off before the footer section. Try to add this to the end of the file

 

<!-- footer //-->

<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>

<!-- footer_eof //-->

 

If you're using STS then you just need to add the applicable tags

$numrequests

$footer_text The osCommerce copyright information and "Powered By osCommerce" texts.

$banner_only The banner, generally displayed at the bottom of the pages.

 

I did add the footer code to the file, as suggested, and still no footer. I did notice that the suggested coding is in the twice as well. in different areas, could this be an issue?

Posted

I did add the footer code to the file, as suggested, and still no footer. I did notice that the suggested coding is in the twice as well. in different areas, could this be an issue?

 

I removed all other footer tags and still no change.

Posted

I removed all other footer tags and still no change.

Is the shopping cart infobox the only box in column right? it looked to me like the site was stopping after the infobox.

 

Tim

Posted

Is the shopping cart infobox the only box in column right? it looked to me like the site was stopping after the infobox.

 

Tim

 

Yes, the shopping cart box is the only box on the right. The rest are on the left...for now. All categories will soon be on the top (but I need the footer working to get the dropdowns to work)and the inforomation box links will be located on the footer...if I ever get it working. And then the shopping cart...not too sure if I will leave it there or just leave the link at the top for ppl to go to instead of the box..not too sure yet.

 

I think I have come down to the conclusion it isnt the index.php I put on the stock index and it still didn't change anything.

Posted

oh I lied. The Top 10 sellers are on the right column too. You can't see the titles of the boxes because of the font (another issue I am having), but it is there!

Posted

oh I lied. The Top 10 sellers are on the right column too. You can't see the titles of the boxes because of the font (another issue I am having), but it is there!

This is the last line of code on the 'view source':

<!-- shopping_cart_eof //-->

I do not see any other info box. Try commenting out the boxes after shopping cart and see if the rest of the page loads.

 

Tim

Posted

This is the last line of code on the 'view source':

<!-- shopping_cart_eof //-->

I do not see any other info box. Try commenting out the boxes after shopping cart and see if the rest of the page loads.

 

Tim

 

Hi Tim,

They don't show up until you log in. That is most likely why you can't see them. This is going to be a wholesaler website only, I will be adding other modules too like show prices for logged in users only and a few other ones. But I don't want to go any further until I figure out this footer thing. I have no idea how to get it back.

Posted

Hi Tim,

They don't show up until you log in. That is most likely why you can't see them. This is going to be a wholesaler website only, I will be adding other modules too like show prices for logged in users only and a few other ones. But I don't want to go any further until I figure out this footer thing. I have no idea how to get it back.

I logged in and your page still only loads to the end of the shopping cart box.

Posted

I logged in and your page still only loads to the end of the shopping cart box.

That is really weird because I am looking at it right now and the only thing missing is the footer. It has the info box on the left column, the shopping cart and top ten on the right column and then the featured products in the middle. I have pretty much taken everything else off (all the text that was there ect)

where is it cutting off in the middle? what all do you see?

Posted

That is really weird because I am looking at it right now and the only thing missing is the footer. It has the info box on the left column, the shopping cart and top ten on the right column and then the featured products in the middle. I have pretty much taken everything else off (all the text that was there ect)

where is it cutting off in the middle? what all do you see?

Best sellers box is there now whether I am logged in or not. Something has changed because now the view source ends here:

<!-- best_sellers_eof //-->

 

I do not see and to the right navigation. It is started here:

<!-- right_navigation //-->

 

but does not end. That is why I feel the problem is in column right. But then I could be way off.

 

Tim

Posted

Yes, I changed a few things, but nothing to do with the columns. Not sure what is going on lol

This is my column right code. Is there something off to you?

<?php
/*
 $Id: column_right.php 1739 2007-12-20 00:52:16Z hpdl $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/


//require(DIR_WS_BOXES . 'search.php');
 require(DIR_WS_BOXES . 'shopping_cart.php');
if($wishList->count_wishlist() != '0') {
require(DIR_WS_BOXES . 'wishlist.php');
 }
// if (isset($HTTP_GET_VARS['products_id'])) include(DIR_WS_BOXES . 'manufacturer_info.php');

 if (tep_session_is_registered('customer_id')) include(DIR_WS_BOXES . 'order_history.php');

 if (isset($HTTP_GET_VARS['products_id'])) {
   if (tep_session_is_registered('customer_id')) {
     $check_query = tep_db_query("select count(*) as count from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . (int)$customer_id . "' and global_product_notifications = '1'");
     $check = tep_db_fetch_array($check_query);
     if ($check['count'] > 0) {
       include(DIR_WS_BOXES . 'best_sellers.php');
     } else {
       include(DIR_WS_BOXES . 'product_notifications.php');
     }
   } else {
     include(DIR_WS_BOXES . 'product_notifications.php');
   }
 } else {
   include(DIR_WS_BOXES . 'best_sellers.php');
 }

 if (isset($HTTP_GET_VARS['products_id'])) {
   if (basename($PHP_SELF) != FILENAME_TELL_A_FRIEND) include(DIR_WS_BOXES . 'tell_a_friend.php');
 } else {
   include(DIR_WS_BOXES . 'specials.php');
 }
     //require(DIR_WS_BOXES . 'reviews.php');

 if (substr(basename($PHP_SELF), 0, 8) != 'checkout') {
  // include(DIR_WS_BOXES . 'languages.php');
  // include(DIR_WS_BOXES . 'currencies.php');
 }
if ((USE_CACHE == 'true') && empty($SID)) {
   echo tep_cache_manufacturers_box();
 } else {
 // include(DIR_WS_BOXES . 'manufacturers.php');
}
// added for Contest Mod
require(DIR_WS_BOXES . 'competition.php');
// end contest mod
include(DIR_WS_BOXES . 'gifts.php');

?>

Posted

Best sellers box is there now whether I am logged in or not. Something has changed because now the view source ends here:

<!-- best_sellers_eof //-->

 

I do not see and to the right navigation. It is started here:

<!-- right_navigation //-->

 

but does not end. That is why I feel the problem is in column right. But then I could be way off.

 

Tim

 

 

I keep going over the column right code (posted previous message) and can't find a fricken thing...I think my eyes are now crossed for life ;0

I see what you mean by the source code...not sure what is going on :(

Posted

Best sellers box is there now whether I am logged in or not. Something has changed because now the view source ends here:

<!-- best_sellers_eof //-->

 

I do not see and to the right navigation. It is started here:

<!-- right_navigation //-->

 

but does not end. That is why I feel the problem is in column right. But then I could be way off.

 

Tim

 

 

Ok, so I checked my error log (which I really should of earlier. But you are right. There is an error with the column right. Here it is, but I can't seem to find the error that it is referring to.

 

PHP Fatal error: Call to a member function on a non-object in /website stuff/wholesalesection/includes/column_right.php on line 16

Posted

Ok, so I checked my error log (which I really should of earlier. But you are right. There is an error with the column right. Here it is, but I can't seem to find the error that it is referring to.

 

PHP Fatal error: Call to a member function on a non-object in /website stuff/wholesalesection/includes/column_right.php on line 16

I loaded your file into easy eclipse (which is a free php edit program) and it doesn't show any errors, but this part confuses me:

if ($check['count'] > 0) {
       include(DIR_WS_BOXES . 'best_sellers.php');
     } else {
       include(DIR_WS_BOXES . 'product_notifications.php');
     }
   } else {
     include(DIR_WS_BOXES . 'product_notifications.php');
   }
 } else {
   include(DIR_WS_BOXES . 'best_sellers.php');
 }

One way is to comment out the last part of column right. Keep moving up until the page until the error returns.

Posted

I loaded your file into easy eclipse (which is a free php edit program) and it doesn't show any errors, but this part confuses me:

if ($check['count'] > 0) {
       include(DIR_WS_BOXES . 'best_sellers.php');
     } else {
       include(DIR_WS_BOXES . 'product_notifications.php');
     }
   } else {
     include(DIR_WS_BOXES . 'product_notifications.php');
   }
 } else {
   include(DIR_WS_BOXES . 'best_sellers.php');
 }

One way is to comment out the last part of column right. Keep moving up until the page until the error returns.

 

I am going to start commenting out stuff. But for some reason I think the error might be coming for the applications top file.

 

<?php
/*
 $Id: application_top.php,v 1.280 2003/07/12 09:38:07 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

// start the timer for the page parse time log
 define('PAGE_PARSE_START_TIME', microtime());

// set the level of error reporting
 error_reporting(E_ALL & ~E_NOTICE);

// check if register_globals is enabled.
// since this is a temporary measure this message is hardcoded. The requirement will be removed before 2.2 is finalized.
 if (function_exists('ini_get')) {
   ini_get('register_globals') or exit('Server Requirement Error: register_globals is disabled in your PHP configuration. This can be enabled in your php.ini configuration file or in the .htaccess file in your catalog directory.');
 }

// Set the local configuration parameters - mainly for developers
 if (file_exists('includes/local/configure.php')) include('includes/local/configure.php');

// include server parameters
 require('includes/configure.php');

 if (strlen(DB_SERVER) < 1) {
   if (is_dir('install')) {
     header('Location: install/index.php');
   }
 }

// define the project version
 define('PROJECT_VERSION', 'osCommerce 2.2-MS2');

// set the type of request (secure or not)
 $request_type = (getenv('HTTPS') == 'on') ? 'SSL' : 'NONSSL';

// set php_self in the local scope
 if (!isset($PHP_SELF)) $PHP_SELF = $HTTP_SERVER_VARS['PHP_SELF'];

 if ($request_type == 'NONSSL') {
   define('DIR_WS_CATALOG', DIR_WS_HTTP_CATALOG);
 } else {
   define('DIR_WS_CATALOG', DIR_WS_HTTPS_CATALOG);
 }

// include the list of project filenames
 require(DIR_WS_INCLUDES . 'filenames.php');

// include the list of project database tables
 require(DIR_WS_INCLUDES . 'database_tables.php');

// customization for the design layout
 define('BOX_WIDTH',125); // how wide the boxes should be in pixels (default: 125)

// include the database functions
 require(DIR_WS_FUNCTIONS . 'database.php');

// make a connection to the database... now
 tep_db_connect() or die('Unable to connect to database server!');

// set the application parameters
 $configuration_query = tep_db_query('select configuration_key as cfgKey, configuration_value as cfgValue from ' . TABLE_CONFIGURATION);
 while ($configuration = tep_db_fetch_array($configuration_query)) {
   define($configuration['cfgKey'], $configuration['cfgValue']);
 }

// if gzip_compression is enabled, start to buffer the output
 if ( (GZIP_COMPRESSION == 'true') && ($ext_zlib_loaded = extension_loaded('zlib')) && (PHP_VERSION >= '4') ) {
   if (($ini_zlib_output_compression = (int)ini_get('zlib.output_compression')) < 1) {
     if (PHP_VERSION >= '4.0.4') {
       ob_start('ob_gzhandler');
     } else {
       include(DIR_WS_FUNCTIONS . 'gzip_compression.php');
       ob_start();
       ob_implicit_flush();
     }
   } else {
     ini_set('zlib.output_compression_level', GZIP_LEVEL);
   }
 }

// set the HTTP GET parameters manually if search_engine_friendly_urls is enabled
 if (SEARCH_ENGINE_FRIENDLY_URLS == 'true') {
   if (strlen(getenv('PATH_INFO')) > 1) {
     $GET_array = array();
     $PHP_SELF = str_replace(getenv('PATH_INFO'), '', $PHP_SELF);
     $vars = explode('/', substr(getenv('PATH_INFO'), 1));
     for ($i=0, $n=sizeof($vars); $i<$n; $i++) {
       if (strpos($vars[$i], '[]')) {
         $GET_array[substr($vars[$i], 0, -2)][] = $vars[$i+1];
       } else {
         $HTTP_GET_VARS[$vars[$i]] = $vars[$i+1];
       }
       $i++;
     }

     if (sizeof($GET_array) > 0) {
       while (list($key, $value) = each($GET_array)) {
         $HTTP_GET_VARS[$key] = $value;
       }
     }
   }
 }

// define general functions used application-wide
 require(DIR_WS_FUNCTIONS . 'general.php');
 require(DIR_WS_FUNCTIONS . 'html_output.php');

// set the cookie domain
 $cookie_domain = (($request_type == 'NONSSL') ? HTTP_COOKIE_DOMAIN : HTTPS_COOKIE_DOMAIN);
 $cookie_path = (($request_type == 'NONSSL') ? HTTP_COOKIE_PATH : HTTPS_COOKIE_PATH);

// include cache functions if enabled
 if (USE_CACHE == 'true') include(DIR_WS_FUNCTIONS . 'cache.php');

// include shopping cart class
 require(DIR_WS_CLASSES . 'shopping_cart.php');

// include wishlist class
 require(DIR_WS_CLASSES . 'wishlist.php');

// include navigation history class
 require(DIR_WS_CLASSES . 'navigation_history.php');

// some code to solve compatibility issues
 require(DIR_WS_FUNCTIONS . 'compatibility.php');

// check if sessions are supported, otherwise use the php3 compatible session class
 if (!function_exists('session_start')) {
   define('PHP_SESSION_NAME', 'osCsid');
   define('PHP_SESSION_PATH', $cookie_path);
   define('PHP_SESSION_DOMAIN', $cookie_domain);
   define('PHP_SESSION_SAVE_PATH', SESSION_WRITE_DIRECTORY);

   include(DIR_WS_CLASSES . 'sessions.php');
 }

// define how the session functions will be used
 require(DIR_WS_FUNCTIONS . 'sessions.php');

// set the session name and save path
 tep_session_name('osCsid');
 tep_session_save_path(SESSION_WRITE_DIRECTORY);

// set the session cookie parameters
  if (function_exists('session_set_cookie_params')) {
   session_set_cookie_params(0, $cookie_path, $cookie_domain);
 } elseif (function_exists('ini_set')) {
   ini_set('session.cookie_lifetime', '0');
   ini_set('session.cookie_path', $cookie_path);
   ini_set('session.cookie_domain', $cookie_domain);
 }

// set the session ID if it exists
  if (isset($HTTP_POST_VARS[tep_session_name()])) {
    tep_session_id($HTTP_POST_VARS[tep_session_name()]);
  } elseif ( ($request_type == 'SSL') && isset($HTTP_GET_VARS[tep_session_name()]) ) {
    tep_session_id($HTTP_GET_VARS[tep_session_name()]);
  }

// start the session
 $session_started = false;
 if (SESSION_FORCE_COOKIE_USE == 'True') {
   tep_setcookie('cookie_test', 'please_accept_for_session', time()+60*60*24*30, $cookie_path, $cookie_domain);

   if (isset($HTTP_COOKIE_VARS['cookie_test'])) {
     tep_session_start();
     $session_started = true;
   }
 } elseif (SESSION_BLOCK_SPIDERS == 'True') {
   $user_agent = strtolower(getenv('HTTP_USER_AGENT'));
   $spider_flag = false;

   if (tep_not_null($user_agent)) {
     $spiders = file(DIR_WS_INCLUDES . 'spiders.txt');

     for ($i=0, $n=sizeof($spiders); $i<$n; $i++) {
       if (tep_not_null($spiders[$i])) {
         if (is_integer(strpos($user_agent, trim($spiders[$i])))) {
           $spider_flag = true;
           break;
         }
       }
     }
   }

   if ($spider_flag == false) {
     tep_session_start();
     $session_started = true;
   }
 } else {
   tep_session_start();
   $session_started = true;
 }

// set SID once, even if empty
 $SID = (defined('SID') ? SID : '');

// verify the ssl_session_id if the feature is enabled
 if ( ($request_type == 'SSL') && (SESSION_CHECK_SSL_SESSION_ID == 'True') && (ENABLE_SSL == true) && ($session_started == true) ) {
   $ssl_session_id = getenv('SSL_SESSION_ID');
   if (!tep_session_is_registered('SSL_SESSION_ID')) {
     $SESSION_SSL_ID = $ssl_session_id;
     tep_session_register('SESSION_SSL_ID');
   }

   if ($SESSION_SSL_ID != $ssl_session_id) {
     tep_session_destroy();
     tep_redirect(tep_href_link(FILENAME_SSL_CHECK));
   }
 }

// verify the browser user agent if the feature is enabled
 if (SESSION_CHECK_USER_AGENT == 'True') {
   $http_user_agent = getenv('HTTP_USER_AGENT');
   if (!tep_session_is_registered('SESSION_USER_AGENT')) {
     $SESSION_USER_AGENT = $http_user_agent;
     tep_session_register('SESSION_USER_AGENT');
   }

   if ($SESSION_USER_AGENT != $http_user_agent) {
     tep_session_destroy();
     tep_redirect(tep_href_link(FILENAME_LOGIN));
   }
 }

// verify the IP address if the feature is enabled
 if (SESSION_CHECK_IP_ADDRESS == 'True') {
   $ip_address = tep_get_ip_address();
   if (!tep_session_is_registered('SESSION_IP_ADDRESS')) {
     $SESSION_IP_ADDRESS = $ip_address;
     tep_session_register('SESSION_IP_ADDRESS');
   }

   if ($SESSION_IP_ADDRESS != $ip_address) {
     tep_session_destroy();
     tep_redirect(tep_href_link(FILENAME_LOGIN));
   }
 }

// create the shopping cart & fix the cart if necesary
 if (tep_session_is_registered('cart') && is_object($cart)) {
   if (PHP_VERSION < 4) {
     $broken_cart = $cart;
     $cart = new shoppingCart;
     $cart->unserialize($broken_cart);
   }
 } else {
   tep_session_register('cart');
   $cart = new shoppingCart;
 }

// include currencies class and create an instance
 require(DIR_WS_CLASSES . 'currencies.php');
 $currencies = new currencies();

// include the mail classes
 require(DIR_WS_CLASSES . 'mime.php');
 require(DIR_WS_CLASSES . 'email.php');

// set the language
 if (!tep_session_is_registered('language') || isset($HTTP_GET_VARS['language'])) {
   if (!tep_session_is_registered('language')) {
     tep_session_register('language');
     tep_session_register('languages_id');
   }

   include(DIR_WS_CLASSES . 'language.php');
   $lng = new language();

   if (isset($HTTP_GET_VARS['language']) && tep_not_null($HTTP_GET_VARS['language'])) {
     $lng->set_language($HTTP_GET_VARS['language']);
   } else {
     $lng->get_browser_language();
   }

   $language = $lng->language['directory'];
   $languages_id = $lng->language['id'];
 }

// include the language translations
 require(DIR_WS_LANGUAGES . $language . '.php');

// currency
 if (!tep_session_is_registered('currency') || isset($HTTP_GET_VARS['currency']) || ( (USE_DEFAULT_LANGUAGE_CURRENCY == 'true') && (LANGUAGE_CURRENCY != $currency) ) ) {
   if (!tep_session_is_registered('currency')) tep_session_register('currency');

   if (isset($HTTP_GET_VARS['currency'])) {
     if (!$currency = tep_currency_exists($HTTP_GET_VARS['currency'])) $currency = (USE_DEFAULT_LANGUAGE_CURRENCY == 'true') ? LANGUAGE_CURRENCY : DEFAULT_CURRENCY;
   } else {
     $currency = (USE_DEFAULT_LANGUAGE_CURRENCY == 'true') ? LANGUAGE_CURRENCY : DEFAULT_CURRENCY;
   }
 }

// navigation history
 if (tep_session_is_registered('navigation')) {
   if (PHP_VERSION < 4) {
     $broken_navigation = $navigation;
     $navigation = new navigationHistory;
     $navigation->unserialize($broken_navigation);
   }
 } else {
   tep_session_register('navigation');
   $navigation = new navigationHistory;
 }
 $navigation->add_current_page();

// Shopping cart actions
 if (isset($HTTP_GET_VARS['action'])) {
// wishlist data
 if(!tep_session_is_registered('wishlist')) {
 	tep_session_register('wishlist');
 	$wishlist = new wishlist;
 }

//Wishlist actions (must be before shopping cart actions)
 if(isset($HTTP_POST_VARS['wishlist_x'])) {
if(isset($HTTP_POST_VARS['products_id'])) {
	if(isset($HTTP_POST_VARS['id'])) {
		$attributes_id = $HTTP_POST_VARS['id'];
		tep_session_register('attributes_id');
	}
	$wishlist_id = $HTTP_POST_VARS['products_id'];
	tep_session_register('wishlist_id');
}
tep_redirect(tep_href_link(FILENAME_WISHLIST));
 }

// redirect the customer to a friendly cookie-must-be-enabled page if cookies are disabled
   if ($session_started == false) {
     tep_redirect(tep_href_link(FILENAME_COOKIE_USAGE));
   }

   if (DISPLAY_CART == 'true') {
     $goto =  FILENAME_SHOPPING_CART;
     $parameters = array('action', 'cPath', 'products_id', 'pid');
   } else {
     $goto = basename($PHP_SELF);
     if ($HTTP_GET_VARS['action'] == 'buy_now') {
       $parameters = array('action', 'pid', 'products_id');
     } else {
       $parameters = array('action', 'pid');
     }
   }
   switch ($HTTP_GET_VARS['action']) {
case 'remove_product' : $cart->remove($HTTP_GET_VARS['products_id']);
tep_redirect(tep_href_link($goto));
break;
     // customer wants to update the product quantity in their shopping cart
     case 'update_product' : for ($i=0, $n=sizeof($HTTP_POST_VARS['products_id']); $i<$n; $i++) {
                               if (in_array($HTTP_POST_VARS['products_id'][$i], (is_array($HTTP_POST_VARS['cart_delete']) ? $HTTP_POST_VARS['cart_delete'] : array()))) {
                                 $cart->remove($HTTP_POST_VARS['products_id'][$i]);
// Update Free Gift
 if (isset($HTTP_POST_VARS['freegift_id'])) {
	$cart->set_freegift($HTTP_POST_VARS['freegift_id']);
 }
// End Update
                               } else {
                                 if (PHP_VERSION < 4) {
                                   // if PHP3, make correction for lack of multidimensional array.
                                   reset($HTTP_POST_VARS);
                                   while (list($key, $value) = each($HTTP_POST_VARS)) {
                                     if (is_array($value)) {
                                       while (list($key2, $value2) = each($value)) {
                                         if (ereg ("(.*)\]\[(.*)", $key2, $var)) {
                                           $id2[$var[1]][$var[2]] = $value2;
                                         }
                                       }
                                     }
                                   }
                                   $attributes = ($id2[$HTTP_POST_VARS['products_id'][$i]]) ? $id2[$HTTP_POST_VARS['products_id'][$i]] : '';
                                 } else {
                                   $attributes = ($HTTP_POST_VARS['id'][$HTTP_POST_VARS['products_id'][$i]]) ? $HTTP_POST_VARS['id'][$HTTP_POST_VARS['products_id'][$i]] : '';
                                 }
                                 $cart->add_cart($HTTP_POST_VARS['products_id'][$i], $HTTP_POST_VARS['cart_quantity'][$i], $attributes, false);
                               }
// Update Free Gift
if (isset($HTTP_POST_VARS['freegift_id'])) {
$cart->set_freegift($HTTP_POST_VARS['freegift_id']);
}
// End Update
                             }
                             tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
                             break;
     // customer adds a product from the products page
     case 'add_product' :    if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {
                               $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+$HTTP_POST_VARS['quantity'], $HTTP_POST_VARS['id']);
                             }
                             tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
                             break;
     // performed by the 'buy now' button in product listings and review page
     case 'buy_now' :        if (isset($HTTP_GET_VARS['products_id'])) {
                               if (tep_has_product_attributes($HTTP_GET_VARS['products_id'])) {
                                 tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id']));
                               } else {
                                 $cart->add_cart($HTTP_GET_VARS['products_id'], $cart->get_quantity($HTTP_GET_VARS['products_id'])+1);
                               }
                             }
                             tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
                             break;
     case 'notify' :         if (tep_session_is_registered('customer_id')) {
                               if (isset($HTTP_GET_VARS['products_id'])) {
                                 $notify = $HTTP_GET_VARS['products_id'];
                               } elseif (isset($HTTP_GET_VARS['notify'])) {
                                 $notify = $HTTP_GET_VARS['notify'];
                               } elseif (isset($HTTP_POST_VARS['notify'])) {
                                 $notify = $HTTP_POST_VARS['notify'];
                               } else {
                                 tep_redirect(tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action', 'notify'))));
                               }
                               if (!is_array($notify)) $notify = array($notify);
                               for ($i=0, $n=sizeof($notify); $i<$n; $i++) {
                                 $check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $notify[$i] . "' and customers_id = '" . $customer_id . "'");
                                 $check = tep_db_fetch_array($check_query);
                                 if ($check['count'] < 1) {
                                   tep_db_query("insert into " . TABLE_PRODUCTS_NOTIFICATIONS . " (products_id, customers_id, date_added) values ('" . $notify[$i] . "', '" . $customer_id . "', now())");
                                 }
                               }
                               tep_redirect(tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action', 'notify'))));
                             } else {
                               $navigation->set_snapshot();
                               tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
                             }
                             break;
     case 'notify_remove' :  if (tep_session_is_registered('customer_id') && isset($HTTP_GET_VARS['products_id'])) {
                               $check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $HTTP_GET_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'");
                               $check = tep_db_fetch_array($check_query);
                               if ($check['count'] > 0) {
                                 tep_db_query("delete from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $HTTP_GET_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'");
                               }
                               tep_redirect(tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action'))));
                             } else {
                               $navigation->set_snapshot();
                               tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
                             }
                             break;
     case 'cust_order' :     if (tep_session_is_registered('customer_id') && isset($HTTP_GET_VARS['pid'])) {
                               if (tep_has_product_attributes($HTTP_GET_VARS['pid'])) {
                                 tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['pid']));
                               } else {
                                 $cart->add_cart($HTTP_GET_VARS['pid'], $cart->get_quantity($HTTP_GET_VARS['pid'])+1);
                               }
                             }
                             tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
                             break;
   }
 }
//rmh referral start
// set the referral id
 if (!tep_session_is_registered('referral_id') || isset($HTTP_GET_VARS['ref'])) {
   if (!tep_session_is_registered('referral_id') && !tep_session_is_registered('customer_id')) {
     tep_session_register('referral_id');
   }

   if (isset($HTTP_GET_VARS['ref']) && tep_not_null($HTTP_GET_VARS['ref'])) {
     $referral_id = $HTTP_GET_VARS['ref'];
   } else {
     $referral_id = '';
   }
 }
//rmh referral end

// include the who's online functions
 require(DIR_WS_FUNCTIONS . 'whos_online.php');
 tep_update_whos_online();

// include the password crypto functions
 require(DIR_WS_FUNCTIONS . 'password_funcs.php');

// include validation functions (right now only email address)
 require(DIR_WS_FUNCTIONS . 'validations.php');

// split-page-results
 require(DIR_WS_CLASSES . 'split_page_results.php');

// infobox
 require(DIR_WS_CLASSES . 'boxes.php');
// Points/Rewards Module V2.1rc2a
 require(DIR_WS_FUNCTIONS . 'redemptions.php');

// auto activate and expire banners
 require(DIR_WS_FUNCTIONS . 'banner.php');
 tep_activate_banners();
 tep_expire_banners();

// auto expire special products
 require(DIR_WS_FUNCTIONS . 'specials.php');
 tep_expire_specials();

// calculate category path
 if (isset($HTTP_GET_VARS['cPath'])) {
   $cPath = $HTTP_GET_VARS['cPath'];
 } elseif (isset($HTTP_GET_VARS['products_id']) && !isset($HTTP_GET_VARS['manufacturers_id'])) {
   $cPath = tep_get_product_path($HTTP_GET_VARS['products_id']);
 } else {
   $cPath = '';
 }

 if (tep_not_null($cPath)) {
   $cPath_array = tep_parse_category_path($cPath);
   $cPath = implode('_', $cPath_array);
   $current_category_id = $cPath_array[(sizeof($cPath_array)-1)];
 } else {
   $current_category_id = 0;
 }

// include the breadcrumb class and start the breadcrumb trail
 require(DIR_WS_CLASSES . 'breadcrumb.php');
 $breadcrumb = new breadcrumb;

 $breadcrumb->add(HEADER_TITLE_TOP, HTTP_SERVER);
 $breadcrumb->add(HEADER_TITLE_CATALOG, tep_href_link(FILENAME_DEFAULT));

// add category names or the manufacturer name to the breadcrumb trail
 if (isset($cPath_array)) {
   for ($i=0, $n=sizeof($cPath_array); $i<$n; $i++) {
     $categories_query = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$cPath_array[$i] . "' and language_id = '" . (int)$languages_id . "'");
     if (tep_db_num_rows($categories_query) > 0) {
       $categories = tep_db_fetch_array($categories_query);
       $breadcrumb->add($categories['categories_name'], tep_href_link(FILENAME_DEFAULT, 'cPath=' . implode('_', array_slice($cPath_array, 0, ($i+1)))));
     } else {
       break;
     }
   }
 } elseif (isset($HTTP_GET_VARS['manufacturers_id'])) {
   $manufacturers_query = tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");
   if (tep_db_num_rows($manufacturers_query)) {
     $manufacturers = tep_db_fetch_array($manufacturers_query);
     $breadcrumb->add($manufacturers['manufacturers_name'], tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id']));
   }
 }

// add the products model to the breadcrumb trail
 if (isset($HTTP_GET_VARS['products_id'])) {
   $model_query = tep_db_query("select products_model from " . TABLE_PRODUCTS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");
   if (tep_db_num_rows($model_query)) {
     $model = tep_db_fetch_array($model_query);
     $breadcrumb->add($model['products_model'], tep_href_link(FILENAME_PRODUCT_INFO, 'cPath=' . $cPath . '&products_id=' . $HTTP_GET_VARS['products_id']));
   }
 }

// initialize the message stack for output messages
 require(DIR_WS_CLASSES . 'message_stack.php');
 $messageStack = new messageStack;

// set which precautions should be checked
 define('WARN_INSTALL_EXISTENCE', 'true');
 define('WARN_CONFIG_WRITEABLE', 'true');
 define('WARN_SESSION_DIRECTORY_NOT_WRITEABLE', 'true');
 define('WARN_SESSION_AUTO_START', 'true');
 define('WARN_DOWNLOAD_DIRECTORY_NOT_READABLE', 'true');
 require(DIR_WS_INCLUDES . 'add_ccgvdc_application_top.php');  // CCGV
// Supertracker
 require(DIR_WS_CLASSES . 'supertracker.php');
$tracker = new supertracker;
$tracker->update();

?>

 

From my experience in the past, alot of my php errors like this came form this file. I am still looking this one over too!

Posted

In includes/column_right.php, try changing your existing wishlist code to

if ( isset($wishlist) && is_object($wishlist) && ( $wishlist->count_wishlist() != '0' ) ) {
       require(DIR_WS_BOXES . 'wishlist.php');
 }

Note the new code and the change of L to l to match what you have in includes/application_top.php

Always back up before making changes.

Posted

Now I am getting two other erros grrrrrr

This is the first one in includes/footer

 

PHP Parse error: syntax error, unexpected '='

 

And it is referring to this code, but I can't seem to find the = that isn't suppose to be there.

  td class="headerNavigation"><?php if (tep_session_is_registered('customer_id')) { ?><a href="<?php&osCAdminID=6d7747d29e93d9f5e5fb3c06688cd374 echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_LOGOFF; ?></a>  |  <?php } ?><a href="<?php&osCAdminID=6d7747d29e93d9f5e5fb3c06688cd374 echo tep_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a>  |  <a href="<?php&osCAdminID=6d7747d29e93d9f5e5fb3c06688cd374 echo tep_href_link(FILENAME_SHOPPING_CART); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a>  |  <a href="<?php&osCAdminID=6d7747d29e93d9f5e5fb3c06688cd374 echo tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CHECKOUT; ?></a>   </td>
 </tr>
</table>

 

And the other is:

 

PHP Parse error: syntax error, unexpected $end

 

But it seems to have all the ends and brackets and all that jazz

 

<?php
/*
 $Id: specials.php 1739 2007-12-20 00:52:16Z hpdl $
 adapted for Separate Pricing Per Customer v4 2007/06/22

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

// BOF Separate Pricing Per Customer

//  global variable (session): $sppc_customers_group_id -> local variable $customer_group_id

 if (isset($_SESSION['sppc_customer_group_id']) && $_SESSION['sppc_customer_group_id'] != '0') {
   $customer_group_id = $_SESSION['sppc_customer_group_id'];
 } else {
   $customer_group_id = '0';
 }

 if ($customer_group_id == '0')  {
     $random_product = tep_random_select("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and p.products_id = s.products_id and pd.products_id = s.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' and s.customers_group_id = '0' order by s.specials_date_added desc limit " . MAX_RANDOM_SELECT_SPECIALS);
 } else { // $sppc_customer_group_id is in the session variables, so must be set
if ($random_product = tep_random_select("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_carrot = '0' and p.products_status = '1' and p.products_id = s.products_id and pd.products_id = s.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' order by s.specials_date_added desc limit " . MAX_RANDOM_SELECT_SPECIALS)) {
   }

 if (tep_not_null($random_product)) {
// EOF Separate Pricing Per Customer
?>
<!-- specials //-->
         <tr>
           <td>
<?php
   $info_box_contents = array();
   $info_box_contents[] = array('text' => BOX_HEADING_SPECIALS);
   new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_SPECIALS));

   $info_box_contents = array();
   $info_box_contents[] = array('align' => 'center',
                                'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product["products_id"]) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . $random_product['products_name'] . '</a><br><s>' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</s><br><span class="productSpecialPrice">' . $currencies->display_price($random_product['specials_new_products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</span>');

   new infoBox($info_box_contents);
?>
           </td>
         </tr>
<!-- specials_eof //-->
<?php
 }
?>

 

I also noticed lastnight that when I add products to the wishlist, I get a blank page. I am pretty sure this isn't related so I will carry that conversation onto the wishlist topic. This was before I changed the code of the wishlist to the above.

Posted

I have fixed both errors and restored the footer by installing both stock files. Now onto the wishlist blank page error!

Thanks everyone for steering me in the right direction!

Archived

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

×
×
  • Create New...