Нужна помощь по XML и PHP

1 23
S
На сайте с 07.04.2010
Offline
71
#21

Спасибо большое. Последний вариант сработал.

Получилось так


<?php
require_once "./inc/functions.php";

$tmp_type = "php";
$tmp_file = "0.tmp";
?>
<?php
$answer = $GLOBALS["obj"] -> parse_xml($GLOBALS["obj"] -> goods_info($_GET["id"],$GLOBALS["currency"]));
// заголовок страницы, массив контактов
$head["title"] = $answer->product->name;
$GLOBALS["img_size"] = $info_goods["img_size"];
show_other_name_rate();
// функция вывода контента
function show_content(){
$result = "";
?>
<!-- Список товаров -->
<div class="digiseller-productpage">
<?php
if(!isset($_GET["id"]) or empty($_GET["id"])){
$result .= "<meta http-equiv=\"refresh\" content=\"0; url=index.php\" />\n";}
else{
$_GET["id"] = abs((int)$_GET["id"]);
if(empty($_GET["id"])){
$result .= "<meta http-equiv=\"refresh\" content=\"0; url=index.php\" />\n";}
else{
$answer = $GLOBALS["obj"] -> parse_xml($GLOBALS["obj"] -> goods_info($_GET["id"],$GLOBALS["currency"]));
if($answer -> retval != 0){
$result .= "<p>".$GLOBALS["mess"]["service_error"]."</p>\n";}
else{
$cat = $answer -> product -> categories -> category;
$self_url = "http://".$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"];

$product = $answer -> product;
switch($product["icon"]){
case "new":
$html_class_name = "new";
$vitrina_icon = "Новинка!";
break;

case "sale":
$html_class_name = "action";
$vitrina_icon = "Акция!";
break;

case "top":
$html_class_name = "lider";
$vitrina_icon = "Лидер продаж!";
break;

default:
$html_class_name = "Icon";
$vitrina_icon = "&nbsp;";}
?>

<h1><?php echo $answer -> product -> name;?>
<span class="digiseller-label<?php echo $html_class_name;?>"><?php echo $vitrina_icon;?></span>
</h1>
Скачать фильмы HD (http://720rip.ru/)!
1 23

Авторизуйтесь или зарегистрируйтесь, чтобы оставить комментарий