[1.6.12] Preissuchmaschine shopboy

MyOOS hat einen Fehler, oder tut nicht das, was Ihr erwartet? Derartige "Unanehmlichkeiten" bitte hier.
Antworten
cenzo
Beiträge: 10
Registriert: 26.09.2008, 22:43
Kontaktdaten:

Beitrag von cenzo »

Hallo Ralf,
meine Zweite Frage war nicht für Elmar modul sonder für eine ordner Extra das ich zusamme mit dem software Myoos eruntegeladen habe.
In dieses ordner sind hier ein Bild
ich versuche meine product in verschiedene suchmaschine bekannte zumachen aber musse ich eine code mit eine logo von diese preisvergleich seite in meine seite einbinden,dann wird eine php datei in der ordner shop in meine server wie dieses<div class='codetop'>CODE[/align]<div class='codemain' style='height:200px;white-space:pre;overflow:auto'><?php

################################################################################
##########
# In order to be able to use this script you need to join the merchant program depending on the country where your store is selling the products
#
# AUSTRALIA - http://shopmania.com.au/ (only supporting AUD, NZD datafeeds)
# ARGENTINA - http://www.shop-mania.com.ar/ (only supporting ARS, EUR, USD) *NEW
# BRASIL - http://www.shopmania.com.br/ (only supporting BRL, USD)
# BULGARY - http://www.shopmania.bg/ (only supporting BGN, EUR, USD)
# CHILE - http://www.shopmania.cl/ (only supporting CLP, USD, EUR) *NEW
# CHINA - http://www.shopmania.cn/ (only supporting CNY, USD)
# DEUTSCHLAND - http://www.shopmania.de/ (only supporting EUR, USD)
# FRANCE - http://www.shopmania.fr/ (only supporting EUR, USD datafeeds)
# HOLLAND - http://www.shopmania.nl/ (only supporting EUR datafeeds) *NEW
# HUNGARY - http://www.shopmania.hu/ (only supporting HUF, EUR, USD datafeeds)
# INDIA - http://www.shopmania.in/ (only supporting INR, USD datafeeds)
# ITALY - http://www.shopmania.it/ (only supporting EUR, USD datafeeds)
# JAPAN - http://www.shopmania.jp/ (only supporting JPY, USD datafeeds)
# MEXICO - http://www.shopmania.com.mx/ (only supporting MXN (Mexican peso), USD, EUR datafeeds)
# POLSKA - http://www.shopmania.pl/ (only supporting PLN, EUR, USD)
# PORTUGAL - http://www.shopmania.pt/ (only supporting EUR, USD)
# ROMANIA - http://www.shopmania.ro/ (only supporting RON, EUR, USD datafeeds)
# RUSSIA - http://www.shopmania.ru/ (only supporting RUB, EUR, USD)
# SOUTH AFRICA - http://www.shopmania.co.za/ (only supporting ZAR, USD, EUR) *NEW
# SPAIN - http://www.shopmania.es/ (only supporting EUR datafeeds)
# SWEDEN - http://www.shopmania.se/ (only supporting SEK, EUR, USD datafeeds) *NEW
# TURKEY - http://www.shopmania.com.tr/ (only supporting TRY, EUR, USD)
# UK - http://www.shopmania.co.uk/ (only supporting GBP, EUR, USD datafeeds)
# US - http://www.shopmania.com/ (only supporting USD, CAD datafeeds)
#
# Once you join the program and your application is approved you need to place the file on your server and set up the path to the file on the Merchant Interface
# Files will be retrieved daily from your server having the products listed automatically on ShopMania
#
# oscommerce price options - taxes = on,off (default = on); special = on,off (default = on)
# datafeed_shopmania_oscommerce.php?taxes=off
# datafeed_shopmania_oscommerce.php?special=off
# datafeed_shopmania_oscommerce.php?taxes=off&special=off
# datafeed_shopmania_oscommerce.php?add_vat=on
#
# General options
# description = on,off
# image = on,off
#
################################################################################
##########

error_reporting(E_ALL ^ E_NOTICE);

# If you use a default configuration you need to do place this file in your /catalog/ directory.
# Otherwise if you place this file in another directory please modify the line below with the path to the catalog directory.

$path_catalog = "./";

// Define VAT value
$vat_value = 1.19; // 19%

# Once all is set up you need to check the result and make sure the output is correct
# Point the browser to http://www.example.com/path_to_datafeed ... tafeed.php and look into the source code of the out put
# What you need to see is something like this
# Category | Manufacturer | Part Number | Merchant Code | Product Name | Product Description | Product URL | Product Image URL | Product Price | Currency

##### Avoid any modifications below this line #####

// Datafeed specific settings
$datafeed_separator = "|"; // Possible options are \t or |

// Taxes options - possible values on, off
$applytaxes = ($_GET['taxes] == "off") ? "off" : "on";
// Special price options - possible values on, off
$applyspecial = ($_GET['special] == "off") ? "off" : "on";

// Add VAT to prices
$add_vat = ($_GET['add_vat] == "on") ? "on" : "off";

// Description options - possible values on, off
$show_description = ($_GET['description] == "off") ? "off" : "on";
// Image options - possible values on, off
$show_image = ($_GET['image] == "off") ? "off" : "on";

// Include required files
if(file_exists($path_catalog . "includes/shared.inc.php")) {
require($path_catalog . "includes/shared.inc.php");
}

if(!file_exists($path_catalog . "includes/application_top.php")) {
exit('<HTML><HEAD><TITLE>404 Not Found</TITLE></HEAD><BODY><H1>Not Found</H1>Please ensure that datafeed_shopmania_oscommerce.php is in the catalog directory, or make sure the path to the catalog directory is defined corectly above in $catalog_path variable</BODY></HTML>');
}
else {
require($path_catalog . "includes/application_top.php");
}

$already_sent = array();

// Detect default currency
$query_currency = tep_db_query("SELECT configuration_value FROM " . TABLE_CONFIGURATION . " WHERE configuration_key = 'DEFAULT_CURRENCY'");
$row_currency = tep_db_fetch_array( $query_currency );

// Get default currency value
$query_currency_rate = tep_db_query("SELECT value FROM " . TABLE_CURRENCIES . " WHERE code = '" . addslashes($row_currency['configuration_value]) . "'");
$row_currency_rate = tep_db_fetch_array( $query_currency_rate );

// Detect default language code
$query_language_code = tep_db_query("SELECT configuration_value FROM " . TABLE_CONFIGURATION . " WHERE configuration_key = 'DEFAULT_LANGUAGE'");
$row_language_code = tep_db_fetch_array( $query_language_code );

// Detect default language ID
$query_language_id = tep_db_query("SELECT languages_id FROM " . TABLE_LANGUAGES . " WHERE code = '" . $row_language_code['configuration_value] . "'");
$row_language_id = tep_db_fetch_array( $query_language_id );

// Get all categories
$categories_query = tep_db_query("SELECT *
FROM (" . TABLE_CATEGORIES . ")
LEFT JOIN " . TABLE_CATEGORIES_DESCRIPTION . " ON ( " . TABLE_CATEGORIES_DESCRIPTION . ".categories_id = " . TABLE_CATEGORIES . ".categories_id AND " . TABLE_CATEGORIES_DESCRIPTION . ".language_id = '" . $row_language_id['languages_id] . "')"
);

while( $row_cat = tep_db_fetch_array( $categories_query ) ) {
foreach ($row_cat as $i=>$v) {
$CAT_ARR[$row_cat['categories_id]][$i] = $v;
}
}

// Grab the products
$image_field = ($show_image == "on") ? "prd.products_image" : "''";
$description_field = ($show_description == "on") ? "prdsc.products_description" : "''";

$products_query = tep_db_query("SELECT
manuf.manufacturers_name AS manufacturer,
prd.products_id AS id,
prd.products_id AS mpc,
prd.products_model AS mpn,
prdsc.products_name AS name,
" . $description_field . " AS description,
prd.products_price AS price,
prd.products_tax_class_id,
" . $image_field . " AS products_image,
prdtocat.categories_id

FROM (" . TABLE_PRODUCTS . " prd,
" . TABLE_PRODUCTS_DESCRIPTION . " AS prdsc,
" . TABLE_PRODUCTS_TO_CATEGORIES . " AS prdtocat)
LEFT JOIN " . TABLE_MANUFACTURERS . " AS manuf ON ( manuf.manufacturers_id = prd.manufacturers_id )
WHERE
( prd.products_id = prdsc.products_id AND prdsc.language_id = '" . $row_language_id['languages_id] . "' )
AND prd.products_id = prdtocat.products_id
AND prd.products_status = 1
ORDER BY prdtocat.categories_id DESC
LIMIT 10000");

// Check for any applicable specials for the corresponding products_id
$specials_query = tep_db_query("SELECT
" . TABLE_SPECIALS . ".products_id AS idS,
" . TABLE_SPECIALS . ".specials_new_products_price AS priceS
FROM
" . TABLE_SPECIALS . ",
" . TABLE_PRODUCTS . "
WHERE
" . TABLE_SPECIALS . ".products_id = " . TABLE_PRODUCTS . ".products_id
AND " . TABLE_SPECIALS . ".status = 1
AND " . TABLE_PRODUCTS . ".products_status = 1");

while( $row_s = tep_db_fetch_array( $specials_query ) )
{
foreach ($row_s as $i=>$v) {
$SPECIALS[$row_s['idS]][$i] = $v;
}
}

// Print the products
while( $row = tep_db_fetch_array( $products_query ) )
{
// If we've sent this one, skip the rest - this is to ensure that we do not get duplicate products
if ($already_sent[$row['mpc]] == 1) continue;

// Clean description
$row['description] = clean_description($row['description]);

$row['product_url] = tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $row['id], 'NONSSL', false);

if($row['products_image] != "") {

if (preg_match("/http\:\/\//", $row['products_image])) {
$row['image_url] = $row['products_image];
}
elseif (preg_match("/http\:\/\//", DIR_WS_IMAGES)) {
$row['image_url] = DIR_WS_IMAGES . $row['products_image];
}
elseif (preg_match("/http\:\/\//", DIR_WS_CATALOG)) {
$row['image_url] = DIR_WS_CATALOG . DIR_WS_IMAGES . $row['products_image];
}
else {
$row['image_url] = HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . $row['products_image];
}
}
else {
$row['image_url] = "";
}

// Reset the products price to our special price if there is one for this product
if( $applyspecial == "on" && $SPECIALS[$row['id]]['idS] ){
$row['price] = $SPECIALS[$row['id]]['priceS];
}

// Include tax - if this is not working corectly simply comment the following lines and you will have the prices without the tax included
if ( $applytaxes == "on" && (DISPLAY_PRICE_WITH_TAX == "true") && ($row['products_tax_class_id] > 0) ) {
$row['price] = $row['price] + ( ( $row['price] * tep_get_tax_rate($row['products_tax_class_id]) ) / 100 );
}

// $row['price] = tep_add_tax($row['price], tep_get_tax_rate($row['products_tax_class_id])); // Slower method for tax calculation

// Clean product name (new lines)
$row['name] = str_replace("\n", " ", strip_tags($row['name]));
$row['name] = str_replace("\r", "", strip_tags($row['name]));
$row['name] = str_replace("\t", " ", strip_tags($row['name]));

// Clean product description (Replace new line with <BR>). In order to make sure the code does not contains other HTML code it might be a good ideea to strip_tags()
$row['description] = str_replace("\n", "<BR>", $row['description]);
$row['description] = str_replace("\r", "", $row['description]);
$row['description] = str_replace("\t", " ", $row['description]);

// Clean product names and descriptions (separators)
if ($datafeed_separator == "\t") {
// Continue... tabs were already removed
}
elseif ($datafeed_separator == "|") {
$row['name] = str_replace("|", " ", strip_tags($row['name]));
$row['description] = str_replace("|", " ", $row['description]);
}
else {
print "Incorrect columns separator.";
exit;
}

// Get category name
$category_name = get_full_cat($row['categories_id], $CAT_ARR);

// Add VAT to prices
if ($add_vat == "on") {
$row['price] = $row['price] * $vat_value;
}

// Apply currency exchange rates
$row['price] = number_format($row_currency_rate['value] * $row['price], 2);

// Output the datafeed content
// Category, Manufacturer, Model, ProdCode, ProdName, ProdDescription, ProdURL, ImageURL, Price, Currency
print
$category_name . $datafeed_separator .
$row['manufacturer] . $datafeed_separator .
$row['mpn] . $datafeed_separator .
$row['mpc] . $datafeed_separator .
$row['name] . $datafeed_separator .
$row['description] . $datafeed_separator .
$row['product_url] . $datafeed_separator .
$row['image_url] . $datafeed_separator .
$row['price] . $datafeed_separator .
$row_currency['configuration_value] . "\n";

$already_sent[$row['mpc]] = 1;
}

// Function to get category with full path
function get_full_cat($cat_id, $CATEGORY_ARR) {

$item_arr = $CATEGORY_ARR[$cat_id];
$cat_name = $item_arr['categories_name];

while (sizeof($CATEGORY_ARR[$item_arr['parent_id]]) > 0 && is_array($CATEGORY_ARR[$item_arr['parent_id]]) ) {

$cat_name = $CATEGORY_ARR[$item_arr['parent_id]]['categories_name] . " > " . $cat_name;
$item_arr = $CATEGORY_ARR[$item_arr['parent_id]];
}

// Strip html from category name
$cat_name = html_to_text($cat_name);

return $cat_name;
}

function html_to_text($string){

$search = array (
"'<script[^>]*?>.*?</script>'si", // Strip out javascript
"'<[\/\!]*?[^<>]*?>'si", // Strip out html tags
"'([\r\n])[\s]+'", // Strip out white space
"'&(quot|#34);'i", // Replace html entities
"'&(amp|#38);'i",
"'&(lt|#60);'i",
"'&(gt|#62);'i",
"'&(nbsp|#160);'i",
"'&(iexcl|#161);'i",
"'&(cent|#162);'i",
"'&(pound|#163);'i",
"'&(copy|#169);'i",
"'&(reg|#174);'i",
"'™'i",
"'?'i",
"'?'i",
"'&#(\d+);'e"
); // evaluate as php

$replace = array (
" ",
" ",
"\\1",
"\"",
"&",
"<",
">",
" ",
"¡",
"¢",
"£",
"©",
"®",
"[sup]<small>TM</small>[/sup]",
"•",
"-",
"uchr(\\1)"
);

$text = preg_replace ($search, $replace, $string);
return $text;

}

function clean_description($string){

$search = array (
"'<html>'i",
"'</html>'i",
"'<body>'i",
"'</body>'i",
"'<head>.*?</head>'si",
"'<!DOCTYPE[^>]*?>'si"
);

$replace = array (
"",
"",
"",
"",
"",
""
);

$text = preg_replace ($search, $replace, $string);
return $text;

}

exit;

?>[/align]
und diese<div class='codetop'>CODE[/align]<div class='codemain' style='height:200px;white-space:pre;overflow:auto'><?php
/* ----------------------------------------------------------------------
$Id: shopboy.php,v 1.1 2007/06/07 16:09:43 r23 Exp $

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

Copyright © 2003 - 2006 by the OOS Development Team.
----------------------------------------------------------------------
Based on:

http://www.shopboy.de

Copyright © 2004 ShopBoy.de Export 2.0
Alexander Kaiser - alex@pooliestudios.com
----------------------------------------------------------------------
Released under the GNU General Public License
---------------------------------------------------------------------- */

/*
error_reporting(E_ALL & ~E_NOTICE);
ini_set('display_errors',1);
*/

// Hier bitte Anpassungen vornehmen:
$nLanguageID = "1"; // Lang Id deu =

define('OOS_VALID_MOD', 'yes');

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

// include the list of project filenames
require(OOS_INCLUDES . 'oos_filename.php');
require(OOS_INCLUDES . 'oos_modules.php');

// include the list of project database tables
require(OOS_INCLUDES . 'oos_tables.php');

// define general functions used application-wide
require(OOS_FUNCTIONS . 'function_kernel.php');
require(OOS_FUNCTIONS . 'function_server.php');

// include the database functions
include OOS_ADODB . 'adodb-errorhandler.inc.php';
include OOS_ADODB . 'adodb.inc.php';
include OOS_FUNCTIONS . 'function_db.php';

// make a connection to the database... now
if (!oosDBInit()) {
die('Unable to connect to database server!');
}

$db =& oosDBGetConn();


// Pfadparameter
$imagepath = OOS_HTTP_SERVER . OOS_SHOP . OOS_IMAGES;
$detailpage = OOS_HTTP_SERVER . OOS_SHOP . 'index.php?mp=' . $aModules['products] . '&file=' . $aFilename['product_info] . '&products_id=';

echo "Bestellnummer|Produktbezeichnung|Produktbeschreibung|Preis inkl. Mwst.|URL|Produktfoto"."\n";

$limit = 0;
$limit_step = 1000;

do {
$sql = "SELECT p.products_id, p.products_model, p.products_image, p.products_price,
p.products_tax_class_id, pd.products_name, pd.products_description
FROM " . $oosDBTable['products] . " p,
" . $oosDBTable['products_description] . " pd
WHERE p.products_status > 0
AND p.products_id = pd.products_id
AND pd.products_languages_id = '" . intval($nLanguageID) . "'";

$shopboy_result = $db->SelectLimit($sql, $limit_step, $limit);
$count = $shopboy_result->RecordCount();

if ($count > 0) {
while ($pr_products = $shopboy_result->fields) {
$name = $pr_products['products_name];
$name = str_replace('|',' ',$name); // | entfernen
$name = strip_tags($name);
if ($specialprice = oos_get_products_special_price($pr_products['products_id])){
$price = $specialprice;
} else {
$price = $pr_products['products_price];
}
$tax = (100+oos_get_tax_rate($pr_products['products_tax_class_id]))/100;
$price = number_format($price*$tax,2,".","");

$description = $pr_products['products_description];
$description = str_replace("\n"," ",$description);
$description = str_replace("\r","",$description);
$description = strip_tags($description);
$description = str_replace('|',' ',$description);

echo $pr_products['products_id]."|".$name."|".((strlen($description) < 1000 )?($description." "):(substr($description,0,1000)." ... "))."|".$price."|".$detailpage.$pr_products['products_id]."|".(($pr_products['products_image] <> "")?$imagepath.$pr_products['products_image]:" ")."\n";

$shopboy_result->MoveNext();
}
}
$limit += $limit_step;
flush();
sleep(2);
} while ($count > 0);

?>
[/align]
viele suchen eine datei
application_top.php
aber in Myoos shop ist keine Datei so genannt.
was kann ich tun?
ich Danke in voraus
PS.sorry wenn schriftlich fehler gibt es ich lernen gerade denn sprache.
r23
Beiträge: 2623
Registriert: 18.09.2008, 05:56
Wohnort: Hagen
Kontaktdaten:

Beitrag von r23 »

Hallo,

Support für die 1.7.8 gibt es nach der Veröffentlichung der 1.7.11 hier nicht mehr.

Wenn du kein Update von uns erhalten hast, wende dich mit deiner Kunden-Nr an
mich.

bye

ralf
Antworten