[1.4.7] Shop springt bei jedem Klick auf Startseite zurück

MyOOS hat einen Fehler, oder tut nicht das, was Ihr erwartet? Derartige "Unanehmlichkeiten" bitte hier.
muegginils
Beiträge: 8
Registriert: 13.02.2009, 10:10
Kontaktdaten:

Beitrag von muegginils »

Hallo,

Seit einiger Zeit springt der Shop sobald ich einen artikel oder eine kategorie anklicke wieder zurück auf die startseite! Dachte zunächst es läge vielleicht damit zusammen ob man nun angemeldet ist oder nicht, aber dies ist nciht so...
kann mir vielleicht jemand trotz der spärlichen erklärung weiterhelfen?
r23
Beiträge: 2696
Registriert: 18.09.2008, 05:56
Wohnort: Hagen
Kontaktdaten:

Beitrag von r23 »

Hallo,

evtl. liegt es an den suchmaschinen freundlichen links in verbindung mit php 5.x?

cu

ralf
muegginils
Beiträge: 8
Registriert: 13.02.2009, 10:10
Kontaktdaten:

Beitrag von muegginils »

ja und wie bekomme ich die raus?
in den link manager oder link catgories ist ncihts eingetragen..
r23
Beiträge: 2696
Registriert: 18.09.2008, 05:56
Wohnort: Hagen
Kontaktdaten:

Beitrag von r23 »

Hallo,

zuerst einmal

sind suchmaschinen freundliche links aktiv?
und wurde ein update auf php 5 durchgeführt?

Ich lade gerade 1.4.17 von BerliOS runter und sehe mir mal
die Quellen an.... Die habe ich schon Jahre nicht
mehr gesehen :blink:

cu

ralf
muegginils
Beiträge: 8
Registriert: 13.02.2009, 10:10
Kontaktdaten:

Beitrag von muegginils »

vielen dank schon mal...
also ein update auf php5 wurde schon mal nicht durchgeführt... und der shop lief bis vor kurzem noch einwandfrei... imr ist nicht bekannt dss die links eingeschaltet sind
r23
Beiträge: 2696
Registriert: 18.09.2008, 05:56
Wohnort: Hagen
Kontaktdaten:

Beitrag von r23 »

Hallo,

Was steht in den Log Files vom WebServer?
Was steht in den LogFiles vom Shop?

Wenn in der URL nach dem klick auf ein Produkt ein
mp=main steht

Können Daten evtl. helfen.

<!--c1--><div class='codetop'>QUELLTEXT[/align]<div class='codemain'><!--ec1--> echo '<pre>';
print_r($_SESSION);
echo '
';
print_r($_GET);
echo '
';
print_r($_POST);
echo '
';
echo '</pre>';

exit;<!--c2-->[/align]<!--ec2-->

einfach am Anfgang der Funktion
function oosRedirect($url) {

in
~/shop/includes/funtions/function_kernel.php

schreiben.

Und alles was kommt. hier posten.
muegginils
Beiträge: 8
Registriert: 13.02.2009, 10:10
Kontaktdaten:

Beitrag von muegginils »

also zu erst wo finde ich die log dateien ?
dann habe ich den quelltext in die funktion eingefügt aber nichts passiert!
Und in der url nach klicken steht auch nichts von mp=main...

:-'(
r23
Beiträge: 2696
Registriert: 18.09.2008, 05:56
Wohnort: Hagen
Kontaktdaten:

Beitrag von r23 »

also zu erst wo finde ich die log dateien ?
Vom Shop

~/oos_temp/logs/*.*

Vom WebServer den Provider fragen.

Darf ich mir mal den installieren Shop ansehen?

Seit einiger Zeit springt der Shop sobald ich einen artikel oder eine kategorie anklicke wieder zurück auf die startseite!
bitte auch einmal die geänderte function oosRedirect($url) {
zeigen.
muegginils
Beiträge: 8
Registriert: 13.02.2009, 10:10
Kontaktdaten:

Beitrag von muegginils »

also der shop liegt auf fussprodukte/test/shop/

in den logs steht nur ein eintrag von 2007 mit too many connections der mysql

die dati nach dem ändern

<!--c1--><div class='codetop'>QUELLTEXT[/align]<div class='codemain'><!--ec1--><?php
/* ----------------------------------------------------------------------
$Id: function_kernel.php,v 1.15 2006/10/11 00:32:30 r23 Exp $

OOS [OSIS Online Shop]
http://www.oos-shop.de/


Copyright (c) 2003 - 2006 by the OOS Development Team.
----------------------------------------------------------------------
Based on:

File: general.php,v 1.231 2003/07/09 01:15:48 hpdl
general.php,v 1.212 2003/02/17 07:55:54 hpdl
----------------------------------------------------------------------
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com

Copyright (c) 2003 osCommerce
----------------------------------------------------------------------
Released under the GNU General Public License
---------------------------------------------------------------------- */

/** ensure this file is being included by a parent file */
defined( 'OOS_VALID_MOD' ) or die( 'Direct Access to this location is not allowed.' );

/**
* kernel
*
* @package kernel
* @copyright (C) 2005 by the OOS Development Team.
* @license GPL <http://www.gnu.org/licenses/gpl.html>
* @link http://www.oos-shop.de/
*/


/**
* Stop from parsing any further PHP code
*/
function oosExit() {
oosSessionClose();
exit();
}


/**
* Redirect to another page or site
*
* @param $url
* @return string
*/
function oosRedirect($url) { echo '<pre>';
print_r($_SESSION);
echo '
';
print_r($_GET);
echo '
';
print_r($_POST);
echo '
';
echo '</pre>';

exit;
if (ENABLE_SSL == 'true'){
if (strtolower(oosServerGetVar('HTTPS')) == 'on' || oosServerHasVar('SSL_PROTOCOL')) { // We are loading an SSL page
if (substr($url, 0, strlen(OOS_HTTP_SERVER)) == OOS_HTTP_SERVER) { // NONSSL url
$url = OOS_HTTPS_SERVER . substr($url, strlen(OOS_HTTP_SERVER)); // Change it to SSL
}
}
}
// clean URL
while (strstr($url, '&')) $url = str_replace('&', '&', $url);
while (strstr($url, '&&')) $url = str_replace('&&', '&', $url);

header('Location: ' . $url);
oosExit();
}


/**
* Update WhosOnline
*/
function oosUpdateWhosOnline() {

$db =& oosDBGetConn();
$oosDBTable = oosDBGetTables();

if (isset($_SESSION['customer_id])) {
$wo_customer_id = $_SESSION['customer_id];
$wo_full_name = addslashes($_SESSION['customer_first_name] . ' ' . $_SESSION['customer_lastname]);
} else {
$wo_customer_id = '';
$wo_full_name = 'Guest';
}

$wo_session_id = oosSessionID();
$wo_ip_address = oosServerGetRemote();
$wo_last_page_url = addslashes(oosServerGetVar('REQUEST_URI'));

$current_time = time();
$xx_mins_ago = ($current_time - 900);

// remove entries that have expired
$db->Execute("DELETE FROM " . $oosDBTable['whos_online] . " WHERE time_last_click < '" . oosDBInput($xx_mins_ago) . "'");

$sql = "SELECT COUNT(*) AS total
FROM " . $oosDBTable['whos_online] . "
WHERE session_id = '" . oosDBInput($wo_session_id) . "'";
$stored_customer = $db->Execute($sql);
if ($stored_customer->fields['total] > 0) {
$db->Execute("UPDATE " . $oosDBTable['whos_online] . "
SET customer_id = '" . oosDBInput($wo_customer_id) . "',
full_name = '" . oosDBInput($wo_full_name) . "',
ip_address = '" . oosDBInput($wo_ip_address) . "',
time_last_click = '" . oosDBInput($current_time) . "',
last_page_url = '" . oosDBInput($wo_last_page_url) . "'
WHERE session_id = '" . oosDBInput($wo_session_id) . "'");
} else {
$db->Execute("INSERT INTO " . $oosDBTable['whos_online] . "
(customer_id,
full_name,
session_id,
ip_address,
time_entry,
time_last_click,
last_page_url) VALUES ('" . oosDBInput($wo_customer_id) . "',
'" . oosDBInput($wo_full_name) . "',
'" . oosDBInput($wo_session_id) . "',
'" . oosDBInput($wo_ip_address) . "',
'" . oosDBInput($current_time) . "',
'" . oosDBInput($current_time) . "',
'" . oosDBInput($wo_last_page_url) . "')");
}
}


/**
* Sets the status of a special product
*
* @param $specials_id
* @param $status
*/
function oosSetSpecialsStatus($specials_id, $status) {

$db =& oosDBGetConn();
$oosDBTable = oosDBGetTables();

return $db->Execute("UPDATE " . $oosDBTable['specials] . "
SET status = '" . oosDBInput($status) . "',
date_status_change = now()
WHERE specials_id = '" . intval($specials_id) . "'");
}


/**
* Auto expire products on special
*/
function oosExpireSpezials() {

$db =& oosDBGetConn();
$oosDBTable = oosDBGetTables();

$sql = "SELECT specials_id
FROM " . $oosDBTable['specials] . "
WHERE status = '1'
AND now() >= expires_date
AND expires_date > 0";
if (USE_DB_CACHE == 'true') {
$specials_result = $db->CacheExecute(3600, $sql);
} else {
$specials_result = $db->Execute($sql);
}
if (!$specials_result) {return;}

if ($specials_result->RecordCount() > 0) {
while ($specials = $specials_result->fields) {
oosSetSpecialsStatus($specials['specials_id], '0');
$specials_result->MoveNext();
}
}
}


/**
* Return a random row from a database query
*
* @param $query
* @param $limit
* @return string
*/
function oosRandomSelect($query, $limit = '') {

$db =& oosDBGetConn();
$random_product = '';
$oosDBTable = oosDBGetTables();
if (oosNotNull($limit)) {
if (USE_DB_CACHE == 'true') {
$random_result = $db->CacheSelectLimit(15, $query, $limit);
} else {
$random_result = $db->SelectLimit($query, $limit);
}
} else {
if (USE_DB_CACHE == 'true') {
$random_result = $db->CacheExecute(15, $query);
} else {
$random_result = $db->Execute($query);
}
}
$num_rows = $random_result->RecordCount();
if ($num_rows > 0) {
$random_row = oosRand(0, ($num_rows - 1));
$random_result->Move($random_row);
$random_product = $random_result->fields;
}

return $random_product;
}

function oosPrepareInput($string) {
if (get_magic_quotes_gpc()) {
$string =& stripslashes($string);
}
$string =& strip_tags($string);
$string =& trim($string);

return $string;
}


/**
* clean user input
*

* Gets a global variable, cleaning it up to try to ensure that
* hack attacks don't work
* @author PostNuke Content Management System
* @copyright Copyright (C) 2001 by the Post-Nuke Development Team.
* @version $Revision: 2.0 - changed by Author: r23 on Date: 2004/01/12 06:02:08
* @param var name of variable to get
* @param ...
* @returns string/array
* @return prepared variable if only one variable passed
* in, otherwise an array of prepared variables
*/
function oosVarCleanFromInput() {
$search = array('|</?\s*SCRIPT.*?>|si',
'|</?\s*FRAME.*?>|si',
'|</?\s*OBJECT.*?>|si',
'|</?\s*META.*?>|si',
'|</?\s*APPLET.*?>|si',
'|</?\s*LINK.*?>|si',
'|</?\s*IFRAME.*?>|si',
'|STYLE\s*=\s*"[^"]*"|si');

$replace = array('');

$resarray = array();
foreach (func_get_args() as $var) {
// Get var
global $$var;
if (empty($var)) {
return;
}
$ourvar = $$var;

if (!isset($ourvar)) {
array_push($resarray, NULL);
continue;
}
if (empty($ourvar)) {
array_push($resarray, $ourvar);
continue;
}

// Clean var
if (get_magic_quotes_gpc()) {
oosStripslashes($ourvar);
}

// Add to result array
array_push($resarray, $ourvar);
}

// Return vars
if (func_num_args() == 1) {
return $resarray[0];
} else {
return $resarray;
}
}


/**
* strip slashes
*
* stripslashes on multidimensional arrays.
* Used in conjunction with pnVarCleanFromInput
* @author PostNuke Content Management System
* @copyright Copyright (C) 2001 by the Post-Nuke Development Team.
* @version Revision: 2.0 - changed by Author: r23 on Date: 2004/01/12 06:02:08
* @access private
* @param any variables or arrays to be stripslashed
*/
function oosStripslashes (&$value) {
if (!is_array($value)) {
$value = stripslashes($value);
} else {
array_walk($value,'oosStripslashes');
}
}


/**
* ready operating system output
*

* Gets a variable, cleaning it up such that any attempts
* to access files outside of the scope of the PostNuke
* system is not allowed
* @author PostNuke Content Management System
* @copyright Copyright (C) 2001 by the Post-Nuke Development Team.
* @version Revision: 2.0 - changed by Author: r23 on Date: 2004/01/12 06:02:08
* @access private
* @param var variable to prepare
* @param ...
* @returns string/array
* @return prepared variable if only one variable passed
* in, otherwise an array of prepared variables
*/
function oosVarPrepForOS() {
static $search = array('!\.\./!si', // .. (directory traversal)
'!^.*://!si', // .*:// (start of URL)
'!/!si', // Forward slash (directory traversal)
'!\\\\!si'); // Backslash (directory traversal)

static $replace = array('',
'',
'_',
'_');

$resarray = array();
foreach (func_get_args() as $ourvar) {
// Parse out bad things
$ourvar = preg_replace($search, $replace, $ourvar);

// Prepare var
if (!get_magic_quotes_runtime()) {
$ourvar = addslashes($ourvar);
}

// Add to array
array_push($resarray, $ourvar);
}

// Return vars
if (func_num_args() == 1) {
return $resarray[0];
} else {
return $resarray;
}
}


/**
* Return Product's Name
*
* @param $product_id
* @return string
*/
function oosGetProductsName($product_id) {

$db =& oosDBGetConn();
$oosDBTable = oosDBGetTables();
$language = oosVarPrepForOS($_SESSION['language]);


$product = $db->Execute("SELECT products_name FROM " . $oosDBTable['products_description] . " WHERE products_id = '" . intval($product_id) . "' AND products_language = '" . oosDBInput($language) . "'");

return $product->fields['products_name];
}


/**
* Return News Author Name
*
* @param $news_author_id
* @return string
*/
function oosGetNewsAuthorName($news_author_id) {

$db =& oosDBGetConn();
$oosDBTable = oosDBGetTables();

$author = $db->Execute("SELECT admin_firstname, admin_lastname FROM " . $oosDBTable['admin] . " WHERE admin_id = '" . intval($news_author_id) . "'");

return $author->fields['admin_firstname] . ' ' . $author->fields['admin_lastname];
}


/**
* Return News Average Rating
*
* @param $news_id
* @return string
*/
function oosGetNewsReviews($news_id) {

$db =& oosDBGetConn();
$oosDBTable = oosDBGetTables();

$reviews = $db->Execute("SELECT (avg(news_reviews_rating ) / 5 * 100) AS average_rating FROM " . $oosDBTable['news_reviews] . " WHERE news_id = '" . intval($news_id) . "'");

return $reviews->fields['average_rating];
}


/**
* Return Wishlist Customer Name
*
* @param $wlid
* @return string
*/
function oosGetWishlistName($wlid) {

$db =& oosDBGetConn();
$oosDBTable = oosDBGetTables();

$customer = $db->Execute("SELECT customers_firstname, customers_lastname FROM " . $oosDBTable['customers] . " WHERE customers_wishlist_link_id = '" . oosDBInput($wlid) . "'");

return $customer->fields['customers_firstname] . ' ' . $customer->fields['customers_lastname];
}


/**
* Return Products Special Price
*
* @param $product_id
* @return string
*/
function oosGetProductsSpecialPrice($product_id) {

$db =& oosDBGetConn();
$oosDBTable = oosDBGetTables();
$product = $db->Execute("SELECT specials_new_products_price FROM " . $oosDBTable['specials] . " WHERE products_id = '" . intval($product_id) . "' AND status");

return $product->fields['specials_new_products_price];
}


/**
* Return Products Quantity
*
* @param $product_id
* @return string
*/
function oosGetProductsStock($products_id) {

$products_id = oosGetPrid($products_id);

$db =& oosDBGetConn();
$oosDBTable = oosDBGetTables();

$stock = $db->Execute("SELECT products_quantity FROM " . $oosDBTable['products] . " WHERE products_id = '" . intval($products_id) . "'");

return $stock->fields['products_quantity];
}


/**
* Check if the required stock is available
* If insufficent stock is available return an out of stock message
*
* @param $products_id
* @param $products_quantity
* @return string
*/
function oosCheckStock($products_id, $products_quantity) {
global $lang;

$stock_left = oosGetProductsStock($products_id) - $products_quantity;
$out_of_stock = '';

if ($stock_left < 0) {
$out_of_stock = '<span class="oos-MarkProductOutOfStock">' . STOCK_MARK_PRODUCT_OUT_OF_STOCK . '</span>';
}

return $out_of_stock;
}


/**
* Return all GET variables, except those passed as a parameter
*
* @param $exclude_array
* @return string
*/
function oosGetAllGetParams($exclude_array = '') {

if (!is_array($exclude_array)) $exclude_array = array();

$get_url = '';
if (is_array($_GET) && (sizeof($_GET) > 0)) {
reset($_GET);
while (list($key, $value) = each($_GET)) {
if ( ($key != oosSessionName()) && ($key != 'error') && ($key != 'p') && ($key != 'index.php') && ($key != 'rewrite') && ($key != 'c') && ($key != 'm') && ($key != 'mp') && ($key != 'file') && ($key != 'history_back') && (!in_array($key, $exclude_array)) && ($key != 'x') && ($key != 'y') ) {
if (!empty($value)) {
$get_url .= $key . '=' . rawurlencode(stripslashes($value)) . '&';
}
}
}
}

while (strstr($get_url, '&')) $get_url = str_replace('&', '&', $get_url);
while (strstr($get_url, '&&')) $get_url = str_replace('&&', '&', $get_url);

return $get_url;
}


/**
* Returns an array with countries
*
* @param $countries_id
* @param $with_iso_codes
* @return array
*/
function oosGetCountries($countries_id = '', $with_iso_codes = false) {

$db =& oosDBGetConn();
$oosDBTable = oosDBGetTables();

$countries_array = array();
if (oosNotNull($countries_id)) {
if ($with_iso_codes == true) {
$countries = $db->Execute("SELECT countries_name, countries_iso_code_2, countries_iso_code_3 FROM " . $oosDBTable['countries] . " WHERE countries_id = '" . intval($countries_id) . "' ORDER BY countries_name");
$countries_values = $countries->fields;
$countries_array = array('countries_name' => $countries_values['countries_name],
'countries_iso_code_2' => $countries_values['countries_iso_code_2],
'countries_iso_code_3' => $countries_values['countries_iso_code_3]);
} else {
$countries = $db->Execute("SELECT countries_name FROM " . $oosDBTable['countries] . " WHERE countries_id = '" . intval($countries_id) . "'");
$countries_values = $countries->fields;
$countries_array = array('countries_name' => $countries_values['countries_name]);
}
} else {
$countries = $db->Execute("SELECT countries_id, countries_name FROM " . $oosDBTable['countries] . " ORDER BY countries_name");
while ($countries_values = $countries->fields) {
$countries_array[] = array('countries_id' => $countries_values['countries_id],
'countries_name' => $countries_values['countries_name]);
$countries->MoveNext();
}
}

return $countries_array;
}


/**
* Alias function to oosGetCountries
*
* @param $country_id
* @return string
*/
function oosGetCountryName($country_id) {
$country_array = oosGetCountries($country_id);

return $country_array['countries_name];
}


/**
* Returns the zone (State/Province) name
*
* @param $country_id
* @param $zone_id
* @param $default_zone
* @return string
*/
function oosGetZoneName($country_id, $zone_id, $default_zone) {

$db =& oosDBGetConn();
$oosDBTable = oosDBGetTables();

$zone = $db->Execute("SELECT zone_name FROM " . $oosDBTable['zones] . " WHERE zone_country_id = '" . intval($country_id) . "' AND zone_id = '" . intval($zone_id) . "'");
if ($zone->RecordCount() > 0) {
return $zone->fields['zone_name];
} else {
return $default_zone;
}
}


/**
* Returns the tax rate for a zone / class
*
* @param $class_id
* @param $country_id
* @param $zone_id
*/
function oosGetTaxRate($class_id, $country_id = -1, $zone_id = -1) {

$db =& oosDBGetConn();
if ( ($country_id == -1) && ($zone_id == -1) ) {
if (!isset($_SESSION['customer_id])) {
$country_id = STORE_COUNTRY;
$zone_id = STORE_ZONE;
} else {
$country_id = $_SESSION['customer_country_id];
$zone_id = $_SESSION['customer_zone_id];
}
}
$oosDBTable = oosDBGetTables();
$sql = "SELECT
SUM(tax_rate) AS tax_rate
FROM
" . $oosDBTable['tax_rates] . " tr LEFT JOIN
" . $oosDBTable['zones_to_geo_zones] . " za
ON (tr.tax_zone_id = za.geo_zone_id) LEFT JOIN
" . $oosDBTable['geo_zones] . " tz
ON (tz.geo_zone_id = tr.tax_zone_id)
WHERE
(za.zone_country_id is null or za.zone_country_id = '0' or
za.zone_country_id = '" . intval($country_id) . "') AND
(za.zone_id is null or za.zone_id = '0' or za.zone_id = '" . intval($zone_id) . "') AND
tr.tax_class_id = '" . intval($class_id) . "'
GROUP BY
tr.tax_priority";
if (USE_DB_CACHE_LEVEL_HIGH == 'true') {
$tax_result = $db->CacheExecute(30, $sql);
} else {
$tax_result = $db->Execute($sql);
}
if (!$tax_result) {return 0;}

if ($tax_result->RecordCount() > 0) {
$tax_multiplier = 0;
while ($tax = $tax_result->fields) {
$tax_multiplier += $tax['tax_rate];
$tax_result->MoveNext();
}
return $tax_multiplier;
} else {
return 0;
}
}



/**
* Add tax to a products price
*
* @param $class_id
* @param $country_id
* @param $zone_id
*/
function oosGetTaxDescription($class_id, $country_id, $zone_id) {
global $lang;

$db =& oosDBGetConn();
$oosDBTable = oosDBGetTables();

$sql = "SELECT
tax_description
FROM
" . $oosDBTable['tax_rates] . " tr LEFT JOIN
" . $oosDBTable['zones_to_geo_zones] . " za
ON (tr.tax_zone_id = za.geo_zone_id) LEFT JOIN
" . $oosDBTable['geo_zones] . " tz
ON (tz.geo_zone_id = tr.tax_zone_id)
WHERE
(za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '" . intval($country_id) . "') AND
(za.zone_id is null or za.zone_id = '0' or za.zone_id = '" . intval($zone_id) . "') AND
tr.tax_class_id = '" . intval($class_id) . "'
ORDER BY
tr.tax_priority";
$tax_result = $db->Execute($sql);

if ($tax_result->RecordCount() > 0) {
$tax_description = '';
while ($tax = $tax_result->fields) {
$tax_description .= $tax['tax_description] . ' + ';
$tax_result->MoveNext();
}
$tax_description = substr($tax_description, 0, -3);

return $tax_description;
} else {
return $lang['text_unknown_tax_rate];
}
}


/**
* Add tax to a products price
*
* @param $price
* @param $tax
*/
function oosAddTax($price, $tax) {
// global $currencies;

if( ($_SESSION['member]->group['show_price_tax] == 1) && ($tax > 0) ) {
// return round($price, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places]) + oosCalculateTax($price, $tax);
return $price + oosCalculateTax($price, $tax);
} else {
// return round($price, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places]);
return $price;
}
}


/**
* Calculates Tax rounding the result
*
* @param $price
* @param $tax
*/
function oosCalculateTax($price, $tax) {
// global $currencies;

if ($tax > 0) {
// return round($price * $tax / 100, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places]);
return $price * $tax / 100;
} else {
return 0;
}

}


function oosGetCategories($categories_array = '', $parent_id = '0', $indent = '') {

$parent_id = oosDBPrepareInput($parent_id);

if (!is_array($categories_array)) $categories_array = array();
if (!defined('HIDE_A_CATEGORY_ON')) define('HIDE_A_CATEGORY_ON', 'false');

$db =& oosDBGetConn();
$oosDBTable = oosDBGetTables();
$language = oosVarPrepForOS($_SESSION['language]);

if (HIDE_A_CATEGORY_ON == 'true') {
$categories_result = $db->Execute("SELECT c.categories_id, c.categories_status, cd.categories_name FROM " . $oosDBTable['categories] . " c, " . $oosDBTable['categories_description] . " cd WHERE c.categories_status = '1' AND c.parent_id = '" . oosDBInput($parent_id) . "' AND c.categories_id = cd.categories_id AND cd.categories_language = '" . oosDBInput($language) . "' AND c.categories_id != '" . HIDE_A_CATEGORY . "' ORDER BY sort_order, cd.categories_name");
} else {
$categories_result = $db->Execute("SELECT c.categories_id, c.categories_status, cd.categories_name FROM " . $oosDBTable['categories] . " c, " . $oosDBTable['categories_description] . " cd WHERE c.categories_status = '1' AND c.parent_id = '" . oosDBInput($parent_id) . "' AND c.categories_id = cd.categories_id AND cd.categories_language = '" . oosDBInput($language) . "' ORDER BY sort_order, cd.categories_name");
}
while ($categories = $categories_result->fields) {
$categories_array[] = array('id' => $categories['categories_id],
'text' => $indent . $categories['categories_name]);

if ($categories['categories_id] != $parent_id) {
$categories_array = oosGetCategories($categories_array, $categories['categories_id], $indent . '  ');
}
$categories_result->MoveNext();
}

return $categories_array;
}


/**
* Output a raw date string in the selected locale date format
* $raw_date needs to be in this format: YYYY-MM-DD HH:MM:SS
*
* @param $raw_date
* @return string
*/
function oosDateLong($raw_date) {
if ( ($raw_date == '0000-00-00 00:00:00') || ($raw_date == '') ) return false;

$year = intval(substr($raw_date, 0, 4));
$month = intval(substr($raw_date, 5, 2));
$day = intval(substr($raw_date, 8, 2));
$hour = intval(substr($raw_date, 11, 2));
$minute = intval(substr($raw_date, 14, 2));
$second = intval(substr($raw_date, 17, 2));

return strftime(DATE_FORMAT_LONG, mktime($hour,$minute,$second,$month,$day,$year));
}


/**
* Output a raw date string in the selected locale date format
* $raw_date needs to be in this format: YYYY-MM-DD HH:MM:SS
*
* @param $raw_date
* @return string
*/
function oosDateShort($raw_date) {
if ( ($raw_date == '0000-00-00 00:00:00') || ($raw_date == '') ) return false;

$year = substr($raw_date, 0, 4);
$month = intval(substr($raw_date, 5, 2));
$day = intval(substr($raw_date, 8, 2));
$hour = intval(substr($raw_date, 11, 2));
$minute = intval(substr($raw_date, 14, 2));
$second = intval(substr($raw_date, 17, 2));

if (@date('Y', mktime($hour, $minute, $second, $month, $day, $year)) == $year) {
return date(DATE_FORMAT, mktime($hour, $minute, $second, $month, $day, $year));
} else {
return ereg_replace('2037' . '$', $year, date(DATE_FORMAT, mktime($hour, $minute, $second, $month, $day, 2037)));
}
}


/**
* Return time-based greeting
* Good morning, Good afternoon, Good evening
*
* @return string
*/
function oosTimeBasedGreeting() {
global $lang;

if(date('G') >= 12 && date('G') <= 18) {
$time_based_greeting = $lang['good_afternoon];
} elseif (date('a') == 'am') {
$time_based_greeting = $lang['good_morning];
} else {
$time_based_greeting = $lang['good_evening];
}
return $time_based_greeting;
}


/**
* Recursively go through the categories and retreive all parent categories IDs
*
* @param $categories
* @param $categories_id
*/
function oosGetParentCategories(&$categories, $categories_id) {

$db =& oosDBGetConn();
$oosDBTable = oosDBGetTables();

$parent_categories_result = $db->Execute("SELECT parent_id FROM " . $oosDBTable['categories] . " WHERE categories_id = '" . intval($categories_id) . "'");
while ($parent_categories = $parent_categories_result->fields) {
if ($parent_categories['parent_id] == 0) return true;
$categories[sizeof($categories)] = $parent_categories['parent_id];
if ($parent_categories['parent_id] != $categories_id) {
oosGetParentCategories($categories, $parent_categories['parent_id]);
}
$parent_categories_result->MoveNext();
}
}


/**
* Construct a category path to the product
*
* @param $products_id
* @return string
*/
function oosGetProductPath($products_id) {

$cPath = '';

$db =& oosDBGetConn();
$oosDBTable = oosDBGetTables();

$cat_count_data = $db->Execute("SELECT COUNT(*) AS total FROM " . $oosDBTable['products_to_categories] . " WHERE products_id = '" . intval($products_id) . "'");

if ($cat_count_data->fields['total] == 1) {
$categories = array();

$cat_id_sql = $db->Execute("SELECT categories_id FROM " . $oosDBTable['products_to_categories] . " WHERE products_id = '" . intval($products_id) . "'");
$cat_id_data = $cat_id_sql->fields;
oosGetParentCategories($categories, $cat_id_data['categories_id]);

$size = sizeof($categories)-1;
for ($i = $size; $i >= 0; $i--) {
if ($cPath != '') $cPath .= '_';
$cPath .= $categories[$i];
}
if ($cPath != '') $cPath .= '_';
$cPath .= $cat_id_data['categories_id];
}

return $cPath;
}


/**
* Return a local directory path (without trailing slash)
*
* @param $path
* @return string
*/
function oosGetLocalPath($path) {
if (substr($path, -1) == '/') $path = substr($path, 0, -1);

return $path;
}

/**
* Return string (without trailing & &)
*
* @param $parameters
* @return string
*/
function oosRemoveTrailing($parameters) {
if (substr($parameters, -5) == '&') $parameters = substr($parameters, 0, -5);
if (substr($parameters, -1) == '&') $parameters = substr($parameters, 0, -1);

return $parameters;
}


/**
* Return a product ID with attributes
*
* @param $prid
* @param $params
* @return string
*/
function oosGetUprid($prid, $parameters) {
if (is_numeric($prid)) {
$uprid = $prid;

if (is_array($parameters) && (sizeof($parameters) > 0)) {
$attributes_check = true;
$attributes_ids = '';

reset($parameters);
while (list($option, $value) = each($parameters)) {
if (is_numeric($option) && is_numeric($value)) {
$attributes_ids .= '{' . intval($option) . '}' . intval($value);
} else {
$attributes_check = false;
break;
}
}

if ($attributes_check == true) {
$uprid .= $attributes_ids;
}
}
} else {
$uprid = oosGetPrid($prid);

if (is_numeric($uprid)) {
if (strpos($prid, '{') !== false) {
$attributes_check = true;
$attributes_ids = '';

// strpos()+1 to remove up to and including the first { which would create an empty array element in explode()
$attributes = explode('{', substr($prid, strpos($prid, '{')+1));

for ($i=0, $n=sizeof($attributes); $i<$n; $i++) {
$pair = explode('}', $attributes[$i]);

if (is_numeric($pair[0]) && is_numeric($pair[1])) {
$attributes_ids .= '{' . intval($pair[0]) . '}' . intval($pair[1]);
} else {
$attributes_check = false;
break;
}
}

if ($attributes_check == true) {
$uprid .= $attributes_ids;
}
}
} else {
return false;
}
}

return $uprid;
}


/**
* Return a product ID from a product ID with attributes
*
* @param $uprid
* @return string
*/
function oosGetPrid($uprid) {
$pieces = explode('{', $uprid);

if (is_numeric($pieces[0])) {
return $pieces[0];
} else {
return false;
}
}


function oosMail($to_name, $to_email_address, $email_subject, $email_text, $from_email_name, $from_email_address, $priority = '3') {
if (SEND_EMAILS != 'true') return false;

if ((strstr($to_name, "\n") != false) || (strstr($to_name, "\r") != false)) {
return false;
}

if ((strstr($to_email_address, "\n") != false) || (strstr($to_email_address, "\r") != false)) {
return false;
}

if ((strstr($email_subject, "\n") != false) || (strstr($email_subject, "\r") != false)) {
return false;
}

if ((strstr($from_email_name, "\n") != false) || (strstr($from_email_name, "\r") != false)) {
return false;
}

if ((strstr($from_email_address, "\n") != false) || (strstr($from_email_address, "\r") != false)) {
return false;
}

// Instantiate a new mail object
$mail = new PHPMailer();

if (EMAIL_TRANSPORT == 'smtp') {
$mail->IsSMTP(); // set mailer to use SMTP
// $mail->Host = "smtp.host.com"; // specify main and backup server
// $mail->SMTPAuth = true // turn on SMTP authentication
// $mail->Username = "jswan" // SMTP username
// $mail->Password = "secret" // SMTP password
}

$mail->Priority = $priority;
$mail->AddAddress($to_email_address, $to_name);
$mail->Subject = $email_subject;
$mail->From = $from_email_address;
$mail->FromName = $from_email_name;
// Build the text version
$text = strip_tags($email_text);
if (EMAIL_USE_HTML == 'true') {
$mail->Body = $email_text;
$mail->AltBody = $text;
} else {
$mail->Body = $text;
}

// Send message
$mail->Send();
}


/**
* send error reporting email to admin
*
* @author PostNuke Content Management System
* @copyright Copyright (C) 2001 by the Post-Nuke Development Team.
* @version Revision: 2.0 - changed by Author: r23 on Date: 2004/03/09 06:02:08
* @access private
*/
function oosErrorReportingMail() {
global $lang;

$server = oosServerGetHost();
$protocol = oosServerGetProtocol();
$uri = oosServerGetVar('REQUEST_URI');
$remote = oosServerGetRemote();


$email_text = '';
$email_text .= $lang['error404_email_header] . "\n\n" .
$lang['error404_email_text] . ' ' .
$remote . ' ' .
$lang['error404_email_date] . ' ' . strftime(DATE_TIME_FORMAT) . "\n\n";

$email_text .= $lang['error404_email_uri] . "\n" .
trim($protocol . $server . $uri) . "\n\n";

$email_text .= $lang['error404_email_ref] . "\n" .
oosServerGetVar('HTTP_REFERER') . "\n\n";

# Send the mail message. This assumes mail() will work on your system!
oosMail(WEBMASTER_NAME, WEBMASTER_EMAIL_ADDRESS, $lang['error404_email_subject], nl2br($email_text), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, '1');
}


/**
* Check if product has attributes
*
* @param $products_id
* @return boolean
*/
function oosHasProductAttributes($products_id) {

$db =& oosDBGetConn();
$oosDBTable = oosDBGetTables();

$attributes = $db->Execute("SELECT COUNT(*) AS total FROM " . $oosDBTable['products_attributes] . " WHERE products_id = '" . intval($products_id) . "'");
if ($attributes->fields['total] > 0) {
return true;
} else {
return false;
}
}


function oosCountModules($modules = '') {
$count = 0;

if (empty($modules)) return $count;

$modules_array = split(';', $modules);

for ($i=0, $n=sizeof($modules_array); $i<$n; $i++) {
$class = substr($modules_array[$i], 0, strrpos($modules_array[$i], '.'));

if (is_object($GLOBALS[$class])) {
if ($GLOBALS[$class]->enabled) {
$count++;
}
}
}

return $count;
}

function oosCountPaymentModules() {
return oosCountModules($_SESSION['member]->group['payment]);
}

function oosCountShippingModules() {
return oosCountModules(MODULE_SHIPPING_INSTALLED);
}

function oosCreateRandomValue($length, $type = 'mixed') {
if ( ($type != 'mixed') && ($type != 'chars') && ($type != 'digits')) return false;

$rand_value = '';
while (strlen($rand_value) < $length) {
if ($type == 'digits') {
$char = oosRand(0,9);
} else {
$char = chr(oosRand(0,255));
}
if ($type == 'mixed') {
if (preg_match('!^[a-z0-9]$!', $char)) $rand_value .= $char;
} elseif ($type == 'chars') {
if (preg_match('!^[a-z]$!', $char)) $rand_value .= $char;
} elseif ($type == 'digits') {
if (preg_match('!^[0-9]$!', $char)) $rand_value .= $char;
}
}

return $rand_value;
}


function oosOutputStringProtected($string) {
return oosOutputString($string, false, true);
}

function oosOutputString($string, $translate = false, $protected = true) {
if ($protected == true) {
return htmlspecialchars($string);
} else {
if ($translate == false) {
return oosParseInputFieldData($string, array('"' => '"'));
} else {
return oosParseInputFieldData($string, $translate);
}
}
}

/**
* Parse the data used in the html tags to ensure the tags will not break
*
* @param $data
* @param $parse
* @return string
*/
function oosParseInputFieldData($data, $parse) {
return strtr(trim($data), $parse);
}


/**
* Strip forbidden tags
*
* @param string
* @return string
*/
function oosRemoveTags($source) {

$allowedTags = '<h1><a>
  • <pre><hr><br><blockquote>';
    $source = strip_tags($source, $allowedTags);

    return $source;
    }



    function oosArrayToString($array, $exclude = '', $equals = '=', $separator = '&') {
    if (!is_array($exclude)) $exclude = array();

    $get_string = '';
    if (sizeof($array) > 0) {
    while (list($key, $value) = each($array)) {
    if ( (!in_array($key, $exclude)) && ($key != 'x') && ($key != 'y') ) {
    $get_string .= $key . $equals . $value . $separator;
    }
    }
    $remove_chars = strlen($separator);
    $get_string = substr($get_string, 0, -$remove_chars);
    }

    return $get_string;
    }

    function oosNotNull($value) {
    if (is_array($value)) {
    if (sizeof($value) > 0) {
    return true;
    } else {
    return false;
    }
    } else {
    if (($value != '') && ($value != 'NULL') && (strlen(trim($value)) > 0)) {
    return true;
    } else {
    return false;
    }
    }
    }


    /**
    * Checks to see if the currency code exists as a currency
    */
    function oosCurrencyExits($code) {

    $db =& oosDBGetConn();
    $oosDBTable = oosDBGetTables();

    $currency_code = $db->Execute("SELECT currencies_id FROM " . $oosDBTable['currencies] . " WHERE code = '" . oosDBInput($code) . "'");
    if ($currency_code->RecordCount() > 0) {
    return $code;
    } else {
    return false;
    }
    }


    /**
    * Return secure string
    *
    * @param $string
    * @return string
    */
    function oosStringToInt($string) {
    return intval($string);
    }


    /**
    * Return $oosFilename
    */
    function oosGetFilename() {
    GLOBAL $oosFilename;

    return $oosFilename;
    }


    /**
    * Return $oosModules
    */
    function oosGetModules() {
    GLOBAL $oosModules;

    return $oosModules;
    }



    /**
    * Parse and secure the cPath parameter values
    *
    * @param $cPath
    * @return array
    */
    function oosParseCategoryPath($cPath) {
    // make sure the category IDs are integers
    $cPath_array = array_map('oosStringToInt', explode('_', $cPath));

    // make sure no duplicate category IDs exist which could lock the server in a loop
    $tmp_array = array();
    $n = sizeof($cPath_array);
    for ($i=0; $i<$n; $i++) {
    if (!in_array($cPath_array[$i], $tmp_array)) {
    $tmp_array[] = $cPath_array[$i];
    }
    }

    return $tmp_array;
    }


    /**
    * Return a random value
    *
    * @param $min
    * @param $max
    * @return string
    */
    function oosRand($min = null, $max = null) {
    static $seeded;

    if (!isset($seeded)) {
    mt_srand((double)microtime()*1000000);
    $seeded = true;
    }

    if (isset($min) && isset($max)) {
    if ($min >= $max) {
    return $min;
    } else {
    return mt_rand($min, $max);
    }
    } else {
    return mt_rand();
    }
    }


    /**
    * Return File Extension
    *
    * @param $filename
    * @return string
    */
    function oosGetExtension($filename) {
    $filename = strtolower($filename);
    $extension = split("[/\\.]", $filename);
    $n = count($extension)-1;
    $extension = $extension[$n];

    return $extension;
    }


    /**
    * Decode string encoded with htmlspecialchars()
    *
    * @param $string
    * @return string
    */
    function oosDecodeSpecialChars($string){
    $string = str_replace('>', '>', $string);
    $string = str_replace('<', '<', $string);
    $string = str_replace(''', "'", $string);
    $string = str_replace('"', "\"", $string);
    $string = str_replace('&', '&', $string);

    return $string;
    }


    /**
    * string encoded
    *
    * @param $string
    * @return string
    */
    function oosMakeFilename($string) {

    static $aFrom = array(
    ' ',

    'Ä',
    'ä',

    'Ö',
    'ö',

    'Ü',
    'ü',

    'ß',

    'é',
    'è',
    'ê',

    'í',
    'ì',
    'î',

    'á',
    'à',
    'â',
    'å',

    'ó',
    'ò',
    'ô',
    'õ',

    'ú',
    'ù',
    'û',

    'ç',
    'Ç',

    'ñ',

    'ý');

    static $aTo = array(
    '-',

    'AE',
    'ae',

    'OE',
    'oe',

    'UE',
    'ue',

    'ss',

    'e',
    'e',
    'e',

    'i',
    'i',
    'i',

    'a',
    'a',
    'a',
    'a',

    'o',
    'o',
    'o',
    'o',

    'u',
    'u',
    'u',

    'c',
    'C',

    'n',

    'y');
    // Replace international chars not detected by every locale
    $string = str_replace($aFrom, $aTo, $string);

    //strip html tags from text
    $string = strip_tags($string);

    // Nuke chars not allowed in our URI
    $string = preg_replace('#[^0-9a-z\.\_!;,\+\-]#i', '', $string);

    // Recover delimiters as spaces
    $string = str_replace("\x01", " ", $string);

    // Remove excess separators
    $string = trim($string, '_');

    return $string;
    }

    function oosReplacehars ($string) {
    return oosMakeFilename($string);
    }

    ?><!--c2-->[/align]<!--ec2-->
r23
Beiträge: 2696
Registriert: 18.09.2008, 05:56
Wohnort: Hagen
Kontaktdaten:

Beitrag von r23 »

Hallo,

PHP Version ist 4.4.9 update erfolgte am 22. August 2008
Suchmaschinen freundliche Links sind aktiv.
ein mp=main steht nicht in der URL.

Shopversion ist 1.4.10
http://www.fussprodukte.de/test/shop/


Wenn ich nach einer Funktion Frage - meine wirklich nur die Funktion.:lol:
Die Änderung kann gelöscht werden. da dies keine "wieder zurück zur startseite ist"
sondern der Shop erkennt schlicht und einfach nicht wo er hin muss.

Vorschlag:
Suchmaschinen freundliche Links einmal ausschalten.

cu

ralf
muegginils
Beiträge: 8
Registriert: 13.02.2009, 10:10
Kontaktdaten:

Beitrag von muegginils »

hehe kenne mich demnach also noch weniger aus als ich dachte ;-)
r23
Beiträge: 2696
Registriert: 18.09.2008, 05:56
Wohnort: Hagen
Kontaktdaten:

Beitrag von r23 »

Hallo,

evtl. recht es aus, wenn man aus der oos 1.4.17
die oos_main.php verwendet.

und als .htaccess

~/test/shop/

<!--c1--><div class='codetop'>QUELLTEXT[/align]<div class='codemain'><!--ec1--># BEGIN OOS
DirectoryIndex index.php

<IfModule mod_rewrite.c>
RewriteEngine On

# you have ERROR 403 try this...
# Options +FollowSymlinks

# Spambots

RewriteCond %{HTTP_USER_AGENT} ^libwww [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^lwp
RewriteRule ^.* - [F]


# Uncomment following line if your webserver's URL
# is not directly related to physival file paths.
# Update YourShopDirectory (just / for root)

RewriteBase /test/shop/

#
# Rules
#

RewriteRule ^(.*)-p-(.*).html$ index.php?mp=products&file=info&products_id=$2&rewrite=true& [L,NC,QSA]
RewriteRule ^(.*)-c-(.*).html$ index.php?mp=main&file=shop&cPath=$2&rewrite=true& [L,NC,QSA]
RewriteRule ^(.*)-m-(.*).html$ index.php?mp=main&file=shop&manufacturers_id=$2&rewrite=true& [L,NC,QSA]
</IfModule>


# Customizable error response
#
ErrorDocument 404 /error.php

# END OOS<!--c2-->[/align]<!--ec2-->

vermutlich fehlt diese Datei auch nur?

cu

ralf
muegginils
Beiträge: 8
Registriert: 13.02.2009, 10:10
Kontaktdaten:

Beitrag von muegginils »

sry...aber wo muss ich das machen? finde in der admin leider keine funktion :-(
muegginils
Beiträge: 8
Registriert: 13.02.2009, 10:10
Kontaktdaten:

Beitrag von muegginils »

SUPER!!! Vielen dank für dein bemühen!!! es funktioniert wieder alles :-)

Nun noch aber eine abschliessende frage! Kann ich eine neuere version des OOS einfach per update aufspielen?
r23
Beiträge: 2696
Registriert: 18.09.2008, 05:56
Wohnort: Hagen
Kontaktdaten:

Beitrag von r23 »

Hallo,

es ist eine Datei, die man in das Shop Verzeichnis kopiert

http://www.oos-shop.de/service/htaccess.txt

Die Datei speichern als.htaccess der Punkt in dem Namen ist wichtig.

cu

ralf
Antworten