Jump to content
FWR Media

ULTIMATE Seo Urls 5 - by FWR Media

Recommended Posts

It's nothing to do with USU5 and nothing to do with osCommerce those errors seem to be caused by some mod. Perhaps in adding the USU5 code you forgot to check if the existing code was modified from standard.

 

Hi Robert, I did not mean to imply that is was your code. I knew is was something I did or in the base code itself of the template. I have installed it to many times to know it was not your code. I found the error in the products_listing.php. The code to replace had two instance of it. I deleted one of them in the correct place and all is well. I would like to take a look at your professional version. i may want to purchase it if you will supply the url so I can take a look.

 

Thanks for all

Bo

Share this post


Link to post
Share on other sites

Hi Robert, I did not mean to imply that is was your code. I knew is was something I did or in the base code itself of the template. I have installed it to many times to know it was not your code. I found the error in the products_listing.php. The code to replace had two instance of it. I deleted one of them in the correct place and all is well. I would like to take a look at your professional version. i may want to purchase it if you will supply the url so I can take a look.

 

Thanks for all

Bo

 

It's not a version you have to pay for .. it's just that it is in development and needs further beta testing.

 

http://forums.oscommerce.com/topic/349814-ultimate-seo-urls-5-pro/

Share this post


Link to post
Share on other sites

Hi,

 

We ran into more issue's. where the server has been replaced by ...

 

When running product feeds xml we got below shown error, is this something on our side of is this something in the script?

 

Warning: USU5 could not find a valid base filename, please inform the developer. in /home/..../domains/..../public_html/includes/application_top.php on line 68

 

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/gameorder/domains/gameorder.nl/public_html/includes/application_top.php:68) in /home/.../domains/..../public_html/includes/functions/sessions.php on line 102

 

Warning: USU5 could not find a valid base filename, please inform the developer. in /home/.../domains/.../public_html/includes/application_top.php on line 68

Share this post


Link to post
Share on other sites

Hi,

 

We ran into more issue's. where the server has been replaced by ...

 

When running product feeds xml we got below shown error, is this something on our side of is this something in the script?

 

Warning: USU5 could not find a valid base filename, please inform the developer. in /home/..../domains/..../public_html/includes/application_top.php on line 68

 

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/gameorder/domains/gameorder.nl/public_html/includes/application_top.php:68) in /home/.../domains/..../public_html/includes/functions/sessions.php on line 102

 

Warning: USU5 could not find a valid base filename, please inform the developer. in /home/.../domains/.../public_html/includes/application_top.php on line 68

 

This means that USU5 could not find a valid filename, usually this is because a contribution has a file that is named incorrectly, an example of this is all products seo which names its file all-products.php.

 

osCommerce filenames are written like file_name.php or filename.php hyphenated filenames are not used.

Share this post


Link to post
Share on other sites

This means that USU5 could not find a valid filename, usually this is because a contribution has a file that is named incorrectly, an example of this is all products seo which names its file all-products.php.

 

osCommerce filenames are written like file_name.php or filename.php hyphenated filenames are not used.

Ok checked this the contrib doenst have incorrect file names.

 

Line 68 of aplication top

==

// set application wide 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']);

}

==

Line 88 / 114 of includes/sessions

==

} elseif (isset($HTTP_COOKIE_VARS[tep_session_name()])) {

if (preg_match('/^[a-zA-Z0-9]+$/', $HTTP_COOKIE_VARS[tep_session_name()]) == false) {

$session_data = session_get_cookie_params();

 

setcookie(tep_session_name(), '', time()-42000, $session_data['path'], $session_data['domain']);

 

$sane_session_id = false;

}

}

 

if ($sane_session_id == false) {

tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false));

}

 

return session_start();

}

 

function tep_session_register($variable) {

if (PHP_VERSION < 4.3) {

return session_register($variable);

} else {

if (isset($GLOBALS[$variable])) {

$_SESSION[$variable] =& $GLOBALS[$variable];

} else {

$_SESSION[$variable] = null;

}

}

==

 

Do you see something wrong there?

 

We've used the feeds for "koopjespakker" and the feed tool "feedmachine"

Share this post


Link to post
Share on other sites

Ok checked this the contrib doenst have incorrect file names.

 

Line 68 of aplication top

==

// set application wide 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']);

}

==

Line 88 / 114 of includes/sessions

==

} elseif (isset($HTTP_COOKIE_VARS[tep_session_name()])) {

if (preg_match('/^[a-zA-Z0-9]+$/', $HTTP_COOKIE_VARS[tep_session_name()]) == false) {

$session_data = session_get_cookie_params();

 

setcookie(tep_session_name(), '', time()-42000, $session_data['path'], $session_data['domain']);

 

$sane_session_id = false;

}

}

 

if ($sane_session_id == false) {

tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false));

}

 

return session_start();

}

 

function tep_session_register($variable) {

if (PHP_VERSION < 4.3) {

return session_register($variable);

} else {

if (isset($GLOBALS[$variable])) {

$_SESSION[$variable] =& $GLOBALS[$variable];

} else {

$_SESSION[$variable] = null;

}

}

==

 

Do you see something wrong there?

 

We've used the feeds for "koopjespakker" and the feed tool "feedmachine"

 

No that is not the correct part of includes/application_top.php.

 

The correct part is the function ..

function usu5_base_filename() {

 

Find that function and comment out ..

//trigger_error( 'USU5 could not find a valid base filename, please inform the developer.', E_USER_WARNING );

 

I don't know what is passing in an invalid filename but something certainly is.

Share this post


Link to post
Share on other sites

hmmm, strange this function comes with the basic oscommerce.

 

please see our aplication top:

==

<?php

/*

$Id: application_top.php 1833 2008-01-30 22:03:30Z hpdl $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2008 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 support for register_globals

if (function_exists('ini_get') && (ini_get('register_globals') == false) && (PHP_VERSION < 4.3) ) {

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. Please use PHP 4.3+ if register_globals cannot be enabled on the server.');

}

 

// 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 Online Merchant v2.2 RC2a');

 

// some code to solve compatibility issues

require(DIR_WS_FUNCTIONS . 'compatibility.php');

 

// set the type of request (secure or not)

$request_type = (getenv('HTTPS') == 'on') ? 'SSL' : 'NONSSL';

 

/**

* USU5 function to return the base filename

*/

function usu5_base_filename() {

// Probably won't get past SCRIPT_NAME unless this is reporting cgi location

$base = new ArrayIterator( array( 'SCRIPT_NAME', 'PHP_SELF', 'REQUEST_URI', 'ORIG_PATH_INFO', 'HTTP_X_ORIGINAL_URL', 'HTTP_X_REWRITE_URL' ) );

while ( $base->valid() ) {

if ( array_key_exists( $base->current(), $_SERVER ) && !empty( $_SERVER[$base->current()] ) ) {

if ( false !== strpos( $_SERVER[$base->current()], '.php' ) ) {

preg_match( '@[a-z0-9_]+\.php@i', $_SERVER[$base->current()], $matches );

if ( is_array( $matches ) && ( array_key_exists( 0, $matches ) )

&& ( substr( $matches[0], -4, 4 ) == '.php' )

&& ( is_readable( $matches[0] ) || ( false !== strpos( $_SERVER[$base->current()], 'ext/modules/' ) ) ) ) {

return $matches[0];

}

}

}

$base->next();

}

// Some odd server set ups return / for SCRIPT_NAME and PHP_SELF when accessed as mysite.com (no index.php) where they usually return /index.php

if ( ( $_SERVER['SCRIPT_NAME'] == '/' ) || ( $_SERVER['PHP_SELF'] == '/' ) ) {

return 'index.php';

}

trigger_error( 'USU5 could not find a valid base filename, please inform the developer.', E_USER_WARNING );

} // End function

// set php_self in the local scope

$PHP_SELF = usu5_base_filename();

 

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');

 

// SEF BEGIN

// require(DIR_WS_CLASSES . 'url_rewrite.php');

// $url_rewrite = new url_rewrite;

// $url_rewrite->request_url();

// SEF END

 

// include shopping cart class

require(DIR_WS_CLASSES . 'shopping_cart.php');

 

// include navigation history class

require(DIR_WS_CLASSES . 'navigation_history.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;

}

 

if ( ($session_started == true) && (PHP_VERSION >= 4.3) && function_exists('ini_get') && (ini_get('register_globals') == false) ) {

extract($_SESSION, EXTR_OVERWRITE+EXTR_REFS);

}

 

// 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');

 

// ULTIMATE Seo Urls 5 by FWR Media

if ( !isset($seo_urls) || !is_object($seo_urls) ){

include_once DIR_WS_MODULES . 'ultimate_seo_urls5' . DIRECTORY_SEPARATOR . 'classes' . DIRECTORY_SEPARATOR . 'usu.php';

$seo_urls = new usu($languages_id, $request_type, $session_started, $SID);

}

$seo_urls->initiate($SID, $languages_id, $language);

 

// 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']) && $currencies->is_set($HTTP_GET_VARS['currency'])) {

$currency = $HTTP_GET_VARS['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'])) {

// 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']) {

// 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]);

} 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);

}

}

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']))+1, $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;

}

}

 

// 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');

 

// 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 page path

if (isset($HTTP_GET_VARS['pPath'])) {

$pPath = $HTTP_GET_VARS['pPath'];

} else {

$pPath = '';

}

 

if (tep_not_null($pPath)) {

$pPath_array = tep_parse_page_path($pPath);

$pPath = implode('_', $pPath_array);

$current_page_id = $pPath_array[(sizeof($pPath_array)-1)];

} else {

$current_page_id = 0;

}

 

// 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 page names to the breadcrumb trail

if (isset($pPath_array)) {

for ($i=0, $n=sizeof($pPath_array); $i<$n; $i++) {

$pages_query = tep_db_query("select pages_name from " . TABLE_PAGES_DESCRIPTION . " where pages_id = '" . (int)$pPath_array[$i] . "' and language_id = '" . (int)$languages_id . "'");

if (tep_db_num_rows($pages_query) > 0) {

$pages = tep_db_fetch_array($pages_query);

$breadcrumb->add($pages['pages_name'], tep_href_link(FILENAME_DEFAULT, 'pPath=' . implode('_', array_slice($pPath_array, 0, ($i+1)))));

} else {

break;

}

}

}

 

// 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 name to the breadcrumb trail

if (isset($HTTP_GET_VARS['products_id'])) {

$crumb_query = tep_db_query("select products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . $languages_id . "'");

if (tep_db_num_rows($crumb_query)) {

$crumb = tep_db_fetch_array($crumb_query);

$breadcrumb->add($crumb['products_name'], 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');

// Supertracker

require(DIR_WS_CLASSES . 'supertracker.php');

$tracker = new supertracker;

$tracker->update();

 

?>

Share this post


Link to post
Share on other sites

hmmm, strange this function comes with the basic oscommerce.

 

please see our aplication top:

 

Please don't post complete files it makes the thread impossible to read for others.

 

I told you what to change in application_top.php and where.

Edited by FWR Media

Share this post


Link to post
Share on other sites

hi robert,

 

i have Google XML sitemap (http://addons.oscommerce.com/info/3439) installed. the urls in this sitemaps are listed like:

 

../catalog/product_info.php?products_id=596

 

is this a problem? i mean wouldn't it be better to submit the urls to google like they are generated by USU5?

 

which sitemap contrib do you suggest? which one fits to USU5?

 

thanks

Share this post


Link to post
Share on other sites

hi robert,

 

i have Google XML sitemap (http://addons.oscommerce.com/info/3439) installed. the urls in this sitemaps are listed like:

 

../catalog/product_info.php?products_id=596

 

is this a problem? i mean wouldn't it be better to submit the urls to google like they are generated by USU5?

 

which sitemap contrib do you suggest? which one fits to USU5?

 

thanks

 

Have a look in the extras folder of the USU5 download .. there are some files there that you can use so that Google XML Sitemap SEO will work correctly.

Share this post


Link to post
Share on other sites

I understand, was more a hands in my hair action.

 

I've commented out the trigger and now it seems to work just fine, strange, but still means there is an error but just don't displayed.

Share this post


Link to post
Share on other sites

I've tried everything I could think of to find a solution to repair my redirects to no avail.

 

So, in the hopes that eventually a more "automated" way of doing redirects will be available... I've tried the code Robert posted a few posts back... however, I can't make it work. It probably is that I did something wrong or there is something I don't understand so if anyone can help, I would appreciate it a lot.

 

This here is the code I entered just before the USU5 code in catalog/includes/application_top.php

 

// set redirects here before USU5 takes over 
$intercept = array( 'product_info.php?products_id=OLD' => HTTP_SERVER . DIR_WS_HTTP_CATALOG . 'product_info.php?products_id=NEW' );

 foreach ( $intercept as $old_uri => $new_url ) {    
 	if ( false !== stripos( $_SERVER['REQUEST_URI'], $old_uri ) ) {     
 // Redirect to $new_url here    
 }  }

 

I also tried to enter the new USU generated url instead of the product_info one but it doesn't work either.

 

TIA

Edited by mariemeh

Share this post


Link to post
Share on other sites

Having issue getting rid of canoe-trip-sculpture-p-147.html?osCsid=e075a5b45bc9b6355618d599b42d1427

 

In admin I have add cpath to product urls set to False. However the mentioned osCsid=e075a5b45bc9b6355618d599b42d1427 still appears.

 

 

Also I have the catalog in my root folder, is this still good for seo crawls from google or is it better or does it matter at all where I have it?

 

Thank you.

Share this post


Link to post
Share on other sites

yes i did :)

 

I don't believe there's anything wrong with these USU5 files but need your opinion anyway. They are cited as possibly hacked when I run the Sitemonitor:

 

includes/modules/ultimate_seo_urls5/classes/Usu_Cache_Database.php

includes/modules/ultimate_seo_urls5/classes/Usu_Cache_Memcached.php

 

In case I must have missed something, this is one of the files:

 

<?php

/**

*

* ULTIMATE Seo Urls 5

*

*

* @package Ultimate Seo Urls 5

* @license http://www.opensource.org/licenses/gpl-2.0.php GNU Public License

* @link http://www.fwrmedia.co.uk

* @copyright Copyright 2008-2009 FWR Media

* @copyright Portions Copyright 2005 Bobby Easland

* @author Robert Fisher, FWR Media, http://www.fwrmedia.co.uk

* @lastdev $Author:: Rob $: Author of last commit

* @lastmod $Date:: 2009-11-29 13:12:25 +0000 (Sun, 29 Nov 2009) $: Date of last commit

* @version $Rev:: 107 $: Revision of last commit

* @Id $Id:: Usu_Cache_Database.php 107 2009-11-29 13:12:25Z Rob $: Full Details

*/

 

final class Usu_Cache_Database implements Interface_Cache {

 

private $cachename, $md5check;

private $extract_query = "SELECT * FROM `usu_cache` WHERE cache_name = ':cache_name'";

private $gc_query = "DELETE FROM `usu_cache` WHERE cache_name = ':cache_name'";

private $insert_query = "INSERT INTO `usu_cache` (cache_name, cache_data, cache_date) VALUES (':cache_name', ':cache_data', ':cache_date')";

private $update_query = "UPDATE `usu_cache` SET cache_data = ':cache_data', cache_date = ':cache_date' WHERE cache_name = ':cache_name'";

private $retrieved = false;

 

public function __construct( $cachename, $cachepath = false ) {

$this->cachename = $cachename;

}

 

public function __destruct() {

}

 

public function store() {

if ( SEO_URLS_ENABLED != 'false' ) {

$data = serialize( usu::$registry );

$rawdata = base64_encode( gzdeflate( $data ) );

$md5check = md5( $rawdata );

// If the cache is unchanged we do not insert nor update

if ( $this->md5check !== $md5check ) {

$targets = array( ':cache_name', ':cache_data', ':cache_date' );

$values = array( tep_db_input( $this->cachename ), tep_db_input( $rawdata ), date( "Y-m-d H:i:s" ) );

$query = str_replace( $targets, $values, $this->update_query );

usu::query( $query );

if ( ( mysql_affected_rows() == 0 ) && ( false === $this->retrieved ) ) {

$query = str_replace( $targets, $values, $this->insert_query );

usu::query( $query );

}

}

}

}

 

public function retrieve() {

if ( SEO_URLS_ENABLED != 'false' ) {

$query = str_replace( ':cache_name', $this->cachename, $this->extract_query );

$result = usu::query( $query );

$row = tep_db_fetch_array( $result );

tep_db_free_result( $result );

if ( !empty( $row ) ) {

$cache_seconds = ( usu::$cachedays * 24 * 60 * 60 );

if ( time() > (strtotime( $row['cache_date']) + $cache_seconds ) ) {

$this->gc();

} else {

usu::$cachefile_size = number_format( strlen( $row['cache_data'] ) / 1024, 2 ) . ' kb';

usu::$performance['time'] = microtime( true );

$this->md5check = md5( $row['cache_data'] );

$rawdata = gzinflate( base64_decode( $row['cache_data'] ) );

usu::$registry = unserialize( $rawdata );

usu::$performance['time'] = round( ( microtime( true ) - usu::$performance['time']),4);

$this->retrieved = true;

return true;

}

}

}

usu::$registry = Usu_Registry::getInstance();

}

 

public function gc(){

$query = str_replace( ':cache_name', $this->cachename, $this->gc_query );

usu::query( $query );

$this->retrieved = false;

}

}

?>

 

 

Thanks in advance

 

Felix

Share this post


Link to post
Share on other sites

hmmm, strange this function comes with the basic oscommerce.

 

please see our aplication top:

==

<?php

/*

$Id: application_top.php 1833 2008-01-30 22:03:30Z hpdl $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2008 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 support for register_globals

if (function_exists('ini_get') && (ini_get('register_globals') == false) && (PHP_VERSION < 4.3) ) {

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. Please use PHP 4.3+ if register_globals cannot be enabled on the server.');

}

 

// 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 Online Merchant v2.2 RC2a');

 

// some code to solve compatibility issues

require(DIR_WS_FUNCTIONS . 'compatibility.php');

 

// set the type of request (secure or not)

$request_type = (getenv('HTTPS') == 'on') ? 'SSL' : 'NONSSL';

 

/**

* USU5 function to return the base filename

*/

function usu5_base_filename() {

// Probably won't get past SCRIPT_NAME unless this is reporting cgi location

$base = new ArrayIterator( array( 'SCRIPT_NAME', 'PHP_SELF', 'REQUEST_URI', 'ORIG_PATH_INFO', 'HTTP_X_ORIGINAL_URL', 'HTTP_X_REWRITE_URL' ) );

while ( $base->valid() ) {

if ( array_key_exists( $base->current(), $_SERVER ) && !empty( $_SERVER[$base->current()] ) ) {

if ( false !== strpos( $_SERVER[$base->current()], '.php' ) ) {

preg_match( '@[a-z0-9_]+\.php@i', $_SERVER[$base->current()], $matches );

if ( is_array( $matches ) && ( array_key_exists( 0, $matches ) )

&& ( substr( $matches[0], -4, 4 ) == '.php' )

&& ( is_readable( $matches[0] ) || ( false !== strpos( $_SERVER[$base->current()], 'ext/modules/' ) ) ) ) {

return $matches[0];

}

}

}

$base->next();

}

// Some odd server set ups return / for SCRIPT_NAME and PHP_SELF when accessed as mysite.com (no index.php) where they usually return /index.php

if ( ( $_SERVER['SCRIPT_NAME'] == '/' ) || ( $_SERVER['PHP_SELF'] == '/' ) ) {

return 'index.php';

}

trigger_error( 'USU5 could not find a valid base filename, please inform the developer.', E_USER_WARNING );

} // End function

// set php_self in the local scope

$PHP_SELF = usu5_base_filename();

 

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');

 

// SEF BEGIN

// require(DIR_WS_CLASSES . 'url_rewrite.php');

// $url_rewrite = new url_rewrite;

// $url_rewrite->request_url();

// SEF END

 

// include shopping cart class

require(DIR_WS_CLASSES . 'shopping_cart.php');

 

// include navigation history class

require(DIR_WS_CLASSES . 'navigation_history.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;

}

 

if ( ($session_started == true) && (PHP_VERSION >= 4.3) && function_exists('ini_get') && (ini_get('register_globals') == false) ) {

extract($_SESSION, EXTR_OVERWRITE+EXTR_REFS);

}

 

// 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');

 

// ULTIMATE Seo Urls 5 by FWR Media

if ( !isset($seo_urls) || !is_object($seo_urls) ){

include_once DIR_WS_MODULES . 'ultimate_seo_urls5' . DIRECTORY_SEPARATOR . 'classes' . DIRECTORY_SEPARATOR . 'usu.php';

$seo_urls = new usu($languages_id, $request_type, $session_started, $SID);

}

$seo_urls->initiate($SID, $languages_id, $language);

 

// 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']) && $currencies->is_set($HTTP_GET_VARS['currency'])) {

$currency = $HTTP_GET_VARS['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'])) {

// 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']) {

// 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]);

} 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);

}

}

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']))+1, $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;

}

}

 

// 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');

 

// 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 page path

if (isset($HTTP_GET_VARS['pPath'])) {

$pPath = $HTTP_GET_VARS['pPath'];

} else {

$pPath = '';

}

 

if (tep_not_null($pPath)) {

$pPath_array = tep_parse_page_path($pPath);

$pPath = implode('_', $pPath_array);

$current_page_id = $pPath_array[(sizeof($pPath_array)-1)];

} else {

$current_page_id = 0;

}

 

// 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 page names to the breadcrumb trail

if (isset($pPath_array)) {

for ($i=0, $n=sizeof($pPath_array); $i<$n; $i++) {

$pages_query = tep_db_query("select pages_name from " . TABLE_PAGES_DESCRIPTION . " where pages_id = '" . (int)$pPath_array[$i] . "' and language_id = '" . (int)$languages_id . "'");

if (tep_db_num_rows($pages_query) > 0) {

$pages = tep_db_fetch_array($pages_query);

$breadcrumb->add($pages['pages_name'], tep_href_link(FILENAME_DEFAULT, 'pPath=' . implode('_', array_slice($pPath_array, 0, ($i+1)))));

} else {

break;

}

}

}

 

// 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 name to the breadcrumb trail

if (isset($HTTP_GET_VARS['products_id'])) {

$crumb_query = tep_db_query("select products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . $languages_id . "'");

if (tep_db_num_rows($crumb_query)) {

$crumb = tep_db_fetch_array($crumb_query);

$breadcrumb->add($crumb['products_name'], 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');

// Supertracker

require(DIR_WS_CLASSES . 'supertracker.php');

$tracker = new supertracker;

$tracker->update();

 

?>

 

You missed a step in the application_top.php. You did not replace it you added it before

 

Find:

// set php_self in the local scope

if (!isset($PHP_SELF)) $PHP_SELF = $HTTP_SERVER_VARS['PHP_SELF'];

replace with:

/**

* USU5 function to return the base filename

*/

function usu5_base_filename() {

// Probably won't get past SCRIPT_NAME && ( substr( $matches[0], -4, 4 ) == '.php' )

&& ( is_readable( $matches[0] ) || ( false !== strpos( $_SERVER[$base->current()], 'ext/modules/' ) ) ) ) {

return $matches[0];

}

}

}

$base->next();

}

// Some odd server set ups return / for SCRIPT_NAME and PHP_SELF when accessed as mysite.com (no index.php) where they usually return /index.php

if ( ( $_SERVER['SCRIPT_NA && ( substr( $matches[0], -4, 4 ) == '.php' )

&& ( is_readable( $matches[0] ) || ( false !== strpos( $_SERVER[$base->current()], 'ext/modules/' ) ) ) ) {

return $matches[0];

}

}

}

$base->next();

}

// Some odd server set ups return / for SCRIPT_NAME and PHP_SELF when accessed as mysite.com (no index.php) where they usually return /index.php

if ( ( $_SERVER['SCRIPT_NAME'] == '/' ) || ( $_SERVER['PHP_SELF'] == '/' ) ) {

return 'index.php';

}

trigger_error( 'USU5 could not find a valid base filename, please inform the developer.', E_USER_WARNING );

} // End function

// set php_self in the local scope

$PHP_SELF = usu5_base_filename();

Bo

Edited by badbo

Share this post


Link to post
Share on other sites

Having issue getting rid of canoe-trip-sculpture-p-147.html?osCsid=e075a5b45bc9b6355618d599b42d1427

 

In admin I have add cpath to product urls set to False. However the mentioned osCsid=e075a5b45bc9b6355618d599b42d1427 still appears.

 

 

Also I have the catalog in my root folder, is this still good for seo crawls from google or is it better or does it matter at all where I have it?

 

Thank you.

 

Anyone have an idea as to this issue above?

Share this post


Link to post
Share on other sites

Having issue getting rid of canoe-trip-sculpture-p-147.html?osCsid=e075a5b45bc9b6355618d599b42d1427

 

In admin I have add cpath to product urls set to False. However the mentioned osCsid=e075a5b45bc9b6355618d599b42d1427 still appears.

 

 

Also I have the catalog in my root folder, is this still good for seo crawls from google or is it better or does it matter at all where I have it?

 

Thank you.

 

Persistent osCsid ( session id ) is nothing to do with USU5 it means that your configuration files are incorrect.

Share this post


Link to post
Share on other sites

I don't believe there's anything wrong with these USU5 files but need your opinion anyway. They are cited as possibly hacked when I run the Sitemonitor:

 

includes/modules/ultimate_seo_urls5/classes/Usu_Cache_Database.php

includes/modules/ultimate_seo_urls5/classes/Usu_Cache_Memcached.php

 

In case I must have missed something, this is one of the files:

 

 

Thanks in advance

 

Felix

 

there's nothing wrong with USU5 files .. sitemonitor probably doesn't understand modern php.

Share this post


Link to post
Share on other sites

Persistent osCsid ( session id ) is nothing to do with USU5 it means that your configuration files are incorrect.

 

Do you mean in here? If so what do I change. If not can you please direct me to how to get rid of it? Note: I took out private data for upload.

<?php
 define('HTTP_SERVER', 'http://www.mysite.com');
 define('HTTPS_SERVER', 'http://www.mysite.com');
 define('ENABLE_SSL', false);
 define('HTTP_COOKIE_DOMAIN', 'http://www.mysite.com');
 define('HTTPS_COOKIE_DOMAIN', 'http://www.mysite.com');
 define('HTTP_COOKIE_PATH', '/');
 define('HTTPS_COOKIE_PATH', '/');
 define('DIR_WS_HTTP_CATALOG', '/');
 define('DIR_WS_HTTPS_CATALOG', '/');
 define('DIR_WS_IMAGES', 'images/');
 define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
 define('DIR_WS_INCLUDES', 'includes/');
 define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');
 define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
 define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
 define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
 define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');

 define('DIR_WS_DOWNLOAD_PUBLIC', 'pub/');
 define('DIR_FS_CATALOG', '/home/site/public_html/mysite.com/');
 define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
 define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');

 define('DB_SERVER', 'localhost');
 define('DB_SERVER_USERNAME', '');
 define('DB_SERVER_PASSWORD', '');
 define('DB_DATABASE', '');
 define('USE_PCONNECT', 'false');
 define('STORE_SESSIONS', 'mysql');
?>

Edited by fan4chevy

Share this post


Link to post
Share on other sites

Do you mean in here? If so what do I change. If not can you please direct me to how to get rid of it? Note: I took out private data for upload.

<?php
 define('HTTP_SERVER', 'http://www.mysite.com');
 define('HTTPS_SERVER', 'http://www.mysite.com');
 define('ENABLE_SSL', false);
 define('HTTP_COOKIE_DOMAIN', 'http://www.mysite.com');
 define('HTTPS_COOKIE_DOMAIN', 'http://www.mysite.com');
 define('HTTP_COOKIE_PATH', '/');
 define('HTTPS_COOKIE_PATH', '/');
 define('DIR_WS_HTTP_CATALOG', '/');
 define('DIR_WS_HTTPS_CATALOG', '/');
 define('DIR_WS_IMAGES', 'images/');
 define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
 define('DIR_WS_INCLUDES', 'includes/');
 define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');
 define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
 define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
 define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
 define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');

 define('DIR_WS_DOWNLOAD_PUBLIC', 'pub/');
 define('DIR_FS_CATALOG', '/home/site/public_html/mysite.com/');
 define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
 define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');

 define('DB_SERVER', 'localhost');
 define('DB_SERVER_USERNAME', '');
 define('DB_SERVER_PASSWORD', '');
 define('DB_DATABASE', '');
 define('USE_PCONNECT', 'false');
 define('STORE_SESSIONS', 'mysql');
?>

 

  define('HTTP_COOKIE_DOMAIN', 'www.mysite.com');
 define('HTTPS_COOKIE_DOMAIN', 'www.mysite.com');

 

But this is a support forum for USU5 for general support please use the general forums.

Edited by FWR Media

Share this post


Link to post
Share on other sites

You missed a step in the application_top.php. You did not replace it you added it before

 

Find:

// set php_self in the local scope

if (!isset($PHP_SELF)) $PHP_SELF = $HTTP_SERVER_VARS['PHP_SELF'];

replace with:

/**

* USU5 function to return the base filename

*/

function usu5_base_filename() {

// Probably won't get past SCRIPT_NAME && ( substr( $matches[0], -4, 4 ) == '.php' )

&& ( is_readable( $matches[0] ) || ( false !== strpos( $_SERVER[$base->current()], 'ext/modules/' ) ) ) ) {

return $matches[0];

}

}

}

$base->next();

}

// Some odd server set ups return / for SCRIPT_NAME and PHP_SELF when accessed as mysite.com (no index.php) where they usually return /index.php

if ( ( $_SERVER['SCRIPT_NA && ( substr( $matches[0], -4, 4 ) == '.php' )

&& ( is_readable( $matches[0] ) || ( false !== strpos( $_SERVER[$base->current()], 'ext/modules/' ) ) ) ) {

return $matches[0];

}

}

}

$base->next();

}

// Some odd server set ups return / for SCRIPT_NAME and PHP_SELF when accessed as mysite.com (no index.php) where they usually return /index.php

if ( ( $_SERVER['SCRIPT_NAME'] == '/' ) || ( $_SERVER['PHP_SELF'] == '/' ) ) {

return 'index.php';

}

trigger_error( 'USU5 could not find a valid base filename, please inform the developer.', E_USER_WARNING );

} // End function

// set php_self in the local scope

$PHP_SELF = usu5_base_filename();

Bo

Hi bo,

 

Would love to use this piece of code, only its not a correct PHP string, somewhere down the line you break it.

Share this post


Link to post
Share on other sites

Hi bo,

 

Would love to use this piece of code, only its not a correct PHP string, somewhere down the line you break it.

 

Go back to the install instructions and add the code as suggested.

Share this post


Link to post
Share on other sites

Hi bo,

 

Would love to use this piece of code, only its not a correct PHP string, somewhere down the line you break it.

 

 

That is not my code it is what you posted here on this site. I was only telling you you miss one of the

steps in the application_top.php . instead of replacing

// set php_self in the local scope

if (!isset($PHP_SELF)) $PHP_SELF = $HTTP_SERVER_VARS['PHP_SELF'];

you added it before,

// set php_self in the local scope this one is still on the file you posted here!!!!!!!!!!!!!!!

if (!isset($PHP_SELF)) $PHP_SELF = $HTTP_SERVER_VARS['PHP_SELF'];

 

replace it with

/**

* USU5 function to return the base filename

*/

function usu5_base_filename() {

// Probably won't get past SCRIPT_NAME unless this is reporting cgi location

$base = new ArrayIterator( array( 'SCRIPT_NAME', 'PHP_SELF', 'REQUEST_URI', 'ORIG_PATH_INFO', 'HTTP_X_ORIGINAL_URL', 'HTTP_X_REWRITE_URL' ) );

while ( $base->valid() ) {

if ( array_key_exists( $base->current(), $_SERVER ) && !empty( $_SERVER[$base->current()] ) ) {

if ( false !== strpos( $_SERVER[$base->current()], '.php' ) ) {

preg_match( '@[a-z0-9_]+\.php@i', $_SERVER[$base->current()], $matches );

if ( is_array( $matches ) && ( array_key_exists( 0, $matches ) )

&& ( substr( $matches[0], -4, 4 ) == '.php' )

&& ( is_readable( $matches[0] ) || ( false !== strpos( $_SERVER[$base->current()], 'ext/modules/' ) ) ) ) {

return $matches[0];

}

}

}

$base->next();

}

// Some odd server set ups return / for SCRIPT_NAME and PHP_SELF when accessed as mysite.com (no index.php) where they usually return /index.php

if ( ( $_SERVER['SCRIPT_NAME'] == '/' ) || ( $_SERVER['PHP_SELF'] == '/' ) ) {

return 'index.php';

}

trigger_error( 'USU5 could not find a valid base filename, please inform the developer.', E_USER_WARNING );

} // End function

// set php_self in the local scope

$PHP_SELF = usu5_base_filename();

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×