Answer the question
In order to leave comments, you need to log in
Requests intersect, how to solve?
The code:
$id = $_REQUEST['id'];
if( $id )
{
$result = $db->query( "SELECT * FROM ".PREFIX."_shop_post WHERE `alt_name`='{$id}' LIMIT 1" );
$Allow = ( $db->num_rows( $result ) > 0 ) ? true : false;
if( $Allow === true )
{
$row = $db->get_row( $result );
$approve = intval( $row['approve'] );
if( $approve != 1 )
{
$Allow = false;
$errorAllow = "Товара нет";
}
}
if( $Allow === true )
{
$id = $row['id'];
$ids = $row['id'];
$title = htmlspecialchars( stripslashes( $row['title'] ), ENT_QUOTES, $config['charset'] );
//--------------------------------------------------=-=-=-=-=
// Тут делаем запрос на вывод привязанных вип товаров
//--------------------------------------------------=-=-=-=-=
$Listing = array(
"template" => "shop/shop_vip_short.tpl",
"tpl_compiles" => "shop_vip_content",
"sql_count" => "SELECT COUNT(*) as count FROM ".PREFIX."_shop_vip_post WHERE shop_vip_topvar='{$ids}'",
"sql_query" => "SELECT * FROM ".PREFIX."_shop_vip_post WHERE shop_vip_topvar='{$ids}'",
"no_news_error" => "Не обнаружено.",
);
require( DLEPlugins::Check(ENGINE_DIR."/modules/shop/vip.post.php") );
$List = $tpl->result['shop_vip_content'];
//--------------------------------------------------=-=-=-=-=
// Выводим сам товар
//--------------------------------------------------=-=-=-=-=
$tpl->Load_Template( "shop/shop_full.tpl" );
$tpl->set( "{id}", $id );
$tpl->set( "{title}", $title );
$tpl->set( "{list}", $List );
$tpl->copy_template = $Shop->ParsePhotos( $tpl->copy_template, $row['photos'] );
if( $Shop->Field !== false ) $tpl->copy_template = $Shop->Field->ParseTags( $tpl->copy_template, $row['xfields'] );
$tpl->compile( "shop_content" );
$tpl->clear();
}
else
{
$tpl->Load_Template( "info.tpl" );
$tpl->set( "{title}", "Ошибка" );
$tpl->set( "{error}", $errorAllow );
$tpl->compile( "shop_content" );
$tpl->clear();
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question