Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

Could never get Ultimate_SEO_URLs_v2-2.2e to work correctly I decided to remove the installation.

 

I now get this error when trying to open the Admin:

 

Fatal error: Call to undefined function tep_get_languages() in /var/www/catalog/admin/login.php on line 79

 

I disabled other languages from the Admin beforehand (don't know if that has anything to do with it or not)

 

Here is the process I've gone through to uninstall Ultimate SEO:

 

Deleted catalog/includes/classes/seo.class.php

Deleted catalog/admin/includes/reset_seo_cache.php

Removed from catalog/includes/application_top.php

// Ultimate SEO URLs v2.1
 if ((!defined(SEO_ENABLED)) || (SEO_ENABLED == 'true')) {
   include_once(DIR_WS_CLASSES . 'seo.class.php');
   if ( !is_object($seo_urls) ){
     $seo_urls = new SEO_URL($languages_id);
   }
 }

Replaced in catalog/includes/functions/html_output.php

////
// The HTML href link wrapper function
 function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true) {
   global $request_type, $session_started, $SID;

   if (!tep_not_null($page)) {
     die('<br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine the page link!<br><br>');
   }

   if ($connection == 'NONSSL') {
     $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;
   } elseif ($connection == 'SSL') {
     if (ENABLE_SSL == true) {
       $link = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG;
     } else {
       $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;
     }
   } else {
     die('<br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine connection method on a link!<br><br>Known methods: NONSSL SSL</b><br><br>');
   }

   if (tep_not_null($parameters)) {
     $link .= $page . '?' . tep_output_string($parameters);
     $separator = '&';
   } else {
     $link .= $page;
     $separator = '?';
   }

   while ( (substr($link, -1) == '&') || (substr($link, -1) == '?') ) $link = substr($link, 0, -1);

// Add the session ID when moving from different HTTP and HTTPS servers, or when SID is defined
   if ( ($add_session_id == true) && ($session_started == true) && (SESSION_FORCE_COOKIE_USE == 'False') ) {
     if (tep_not_null($SID)) {
       $_sid = $SID;
     } elseif ( ( ($request_type == 'NONSSL') && ($connection == 'SSL') && (ENABLE_SSL == true) ) || ( ($request_type == 'SSL') && ($connection == 'NONSSL') ) ) {
       if (HTTP_COOKIE_DOMAIN != HTTPS_COOKIE_DOMAIN) {
         $_sid = tep_session_name() . '=' . tep_session_id();
       }
     }
   }

   if ( (SEARCH_ENGINE_FRIENDLY_URLS == 'true') && ($search_engine_safe == true) ) {
     while (strstr($link, '&&')) $link = str_replace('&&', '&', $link);

     $link = str_replace('?', '/', $link);
     $link = str_replace('&', '/', $link);
     $link = str_replace('=', '/', $link);

     $separator = '?';
   }

   if (isset($_sid)) {
     $link .= $separator . $_sid;
   }

   return $link;
 }

Removed this from in catalog/includes/functions/html_output.php:

////
// Ultimate SEO URLs v2.1
// The HTML href link wrapper function
if (SEO_ENABLED == 'true') { //run chemo's code
 function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true) {
       global $seo_urls;
               if ( !is_object($seo_urls) ){
                       if ( !class_exists('SEO_URL') ){
                               include_once(DIR_WS_CLASSES . 'seo.class.php');
                       }
                       global $languages_id;
                       $seo_urls = new SEO_URL($languages_id);
               }
       return preg_replace('/&/','&',$seo_urls->href_link($page, $parameters, $connection, $add_session_id));
 }
} else { //run original code
// The HTML href link wrapper function
 function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true) {
   global $request_type, $session_started, $SID;

   if (!tep_not_null($page)) {
     die('<br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine the page link!<br><br>');
   }

   if ($connection == 'NONSSL') {
     $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;
   } elseif ($connection == 'SSL') {
     if (ENABLE_SSL == true) {
       $link = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG;
     } else {
       $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;
     }
   } else {
     die('<br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine connection method on a link!<br><br>Known methods: NONSSL SSL</b><br><br>');
   }

   if (tep_not_null($parameters)) {
     $link .= $page . '?' . tep_output_string($parameters);
     $separator = '&';
   } else {
     $link .= $page;
     $separator = '?';
   }

   while ( (substr($link, -1) == '&') || (substr($link, -1) == '?') ) $link = substr($link, 0, -1);

// Add the session ID when moving from different HTTP and HTTPS servers, or when SID is defined
   if ( ($add_session_id == true) && ($session_started == true) && (SESSION_FORCE_COOKIE_USE == 'False') ) {
     if (tep_not_null($SID)) {
       $_sid = $SID;
     } elseif ( ( ($request_type == 'NONSSL') && ($connection == 'SSL') && (ENABLE_SSL == true) ) || ( ($request_type == 'SSL') && ($connection == 'NONSSL') ) ) {
       if (HTTP_COOKIE_DOMAIN != HTTPS_COOKIE_DOMAIN) {
         $_sid = tep_session_name() . '=' . tep_session_id();
       }
     }
   }

   if ( (SEARCH_ENGINE_FRIENDLY_URLS == 'true') && ($search_engine_safe == true) ) {
     while (strstr($link, '&&')) $link = str_replace('&&', '&', $link);

     $link = str_replace('?', '/', $link);
     $link = str_replace('&', '/', $link);
     $link = str_replace('=', '/', $link);

     $separator = '?';
   }

   if (isset($_sid)) {
     $link .= $separator . $_sid;
   }

   return $link;
 }
}

Removed from catalog/admin/categories.php

// Ultimate SEO URLs v2.1
// If the action will affect the cache entries
   if ( eregi("(insert|update|setflag)", $action) ) include_once('includes/reset_seo_cache.php');

Removed from catalog/admin/includes/functions/general.php

// Function to reset SEO URLs database cache entries 
// Ultimate SEO URLs v2.1
function tep_reset_cache_data_seo_urls($action){	
switch ($action){
	case 'reset':
		tep_db_query("DELETE FROM cache WHERE cache_name LIKE '%seo_urls%'");
		tep_db_query("UPDATE configuration SET configuration_value='false' WHERE configuration_key='SEO_URLS_CACHE_RESET'");
		break;
	default:
		break;
}
# The return value is used to set the value upon viewing
# It's NOT returining a false to indicate failure!!
return 'false';
}

removed from catalog/.htaccess file 

Options +FollowSymLinks
RewriteEngine On 
RewriteBase /catalog/

RewriteRule ^(.*)-p-(.*).html$ product_info.php?products_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-c-(.*).html$ index.php?cPath=$2&%{QUERY_STRING}
RewriteRule ^(.*)-m-(.*).html$ index.php?manufacturers_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-pi-(.*).html$ popup_image.php?pID=$2&%{QUERY_STRING}
RewriteRule ^(.*)-t-(.*).html$ articles.php?tPath=$2&%{QUERY_STRING}
RewriteRule ^(.*)-a-(.*).html$ article_info.php?articles_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-pr-(.*).html$ product_reviews.php?products_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-pri-(.*).html$ product_reviews_info.php?products_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-i-(.*).html$ information.php?info_id=$2&%{QUERY_STRING}


 

Here is /catalog/admin/login.php

 

<?php
/*
 $Id: $

 osCommerce, Open Source E-Commerce Solutions
 [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url]

 Copyright © 2007 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');
 require('includes/functions/password_funcs.php');

 $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');

 if (tep_not_null($action)) {
   switch ($action) {
     case 'process':
       $username = tep_db_prepare_input($HTTP_POST_VARS['username']);
       $password = tep_db_prepare_input($HTTP_POST_VARS['password']);

       $check_query = tep_db_query("select id, user_name, user_password from " . TABLE_ADMINISTRATORS . " where user_name = '" . tep_db_input($username) . "'");

       if (tep_db_num_rows($check_query) == 1) {
         $check = tep_db_fetch_array($check_query);

         if (tep_validate_password($password, $check['user_password'])) {
           tep_session_register('admin');

           $admin = array('id' => $check['id'],
                          'username' => $check['user_name']);

           if (tep_session_is_registered('redirect_origin')) {
             $page = $redirect_origin['page'];
             $get_string = '';

             if (function_exists('http_build_query')) {
               $get_string = http_build_query($redirect_origin['get']);
             }

             tep_session_unregister('redirect_origin');

             tep_redirect(tep_href_link($page, $get_string));
           } else {
             tep_redirect(tep_href_link(FILENAME_DEFAULT));
           }
         }
       }

       $messageStack->add(ERROR_INVALID_ADMINISTRATOR, 'error');

       break;

     case 'logoff':
       tep_session_unregister('selected_box');
       tep_session_unregister('admin');
       tep_redirect(tep_href_link(FILENAME_DEFAULT));

       break;

     case 'create':
       $check_query = tep_db_query("select id from " . TABLE_ADMINISTRATORS . " limit 1");

       if (tep_db_num_rows($check_query) == 0) {
         $username = tep_db_prepare_input($HTTP_POST_VARS['username']);
         $password = tep_db_prepare_input($HTTP_POST_VARS['password']);

         tep_db_query('insert into ' . TABLE_ADMINISTRATORS . ' (user_name, user_password) values ("' . $username . '", "' . tep_encrypt_password($password) . '")');
       }

       tep_redirect(tep_href_link(FILENAME_LOGIN));

       break;
   }
 }

 $languages = tep_get_languages();
 $languages_array = array();
 $languages_selected = DEFAULT_LANGUAGE;
 for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
   $languages_array[] = array('id' => $languages[$i]['code'],
                              'text' => $languages[$i]['name']);
   if ($languages[$i]['directory'] == $language) {
     $languages_selected = $languages[$i]['code'];
   }
 }

 $admins_check_query = tep_db_query("select id from " . TABLE_ADMINISTRATORS . " limit 1");
 if (tep_db_num_rows($admins_check_query) < 1) {
   $messageStack->add(TEXT_CREATE_FIRST_ADMINISTRATOR, 'warning');
 }
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<meta name="robots" content="noindex,nofollow">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<script language="javascript" src="includes/general.js"></script>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onLoad="SetFocus();">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
 <tr>
   <td><table border="0" width="100%" cellspacing="0" cellpadding="0" height="40">
     <tr>
       <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
       <td class="pageHeading" align="right"><?php echo tep_draw_form('adminlanguage', FILENAME_DEFAULT, '', 'get') . tep_draw_pull_down_menu('language', $languages_array, $languages_selected, 'onChange="this.form.submit();"') . tep_hide_session_id() . '</form>'; ?></td>
     </tr>
   </table></td>
 </tr>
 <tr>
   <td>

<?php
 $heading = array();
 $contents = array();

 if (tep_db_num_rows($admins_check_query) > 0) {
   $heading[] = array('text' => '<b>' . HEADING_TITLE . '</b>');

   $contents = array('form' => tep_draw_form('login', FILENAME_LOGIN, 'action=process'));
   $contents[] = array('text' => TEXT_USERNAME . '<br>' . tep_draw_input_field('username'));
   $contents[] = array('text' => '<br>' . TEXT_PASSWORD . '<br>' . tep_draw_password_field('password'));
   $contents[] = array('align' => 'center', 'text' => '<br><input type="submit" value="' . BUTTON_LOGIN . '" />');
 } else {
   $heading[] = array('text' => '<b>' . HEADING_TITLE . '</b>');

   $contents = array('form' => tep_draw_form('login', FILENAME_LOGIN, 'action=create'));
   $contents[] = array('text' => TEXT_CREATE_FIRST_ADMINISTRATOR);
   $contents[] = array('text' => '<br>' . TEXT_USERNAME . '<br>' . tep_draw_input_field('username'));
   $contents[] = array('text' => '<br>' . TEXT_PASSWORD . '<br>' . tep_draw_password_field('password'));
   $contents[] = array('align' => 'center', 'text' => '<br><input type="submit" value="' . BUTTON_CREATE_ADMINISTRATOR . '" />');
 }

 $box = new box;
 echo $box->infoBox($heading, $contents);
?>

   </td>
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

Thank You any help is greatly appreciated

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...