<?php
define('IN_OUN', true);
include_once( "./includes/command.php");
include_once( ROOT_PATH."includes/item_set.php");

/* 产品图片列表 */
$show_img_list = false;
$strMessage = '无对应图库';
if($_GET["prid"])
{
   $_GET["prid"] = $_GET["prid"] + 0;
   $strid = 'prid'.$_GET["prid"];   
   $sql = "SELECT  a.name FROM  ".$pre."producttxt as a
		WHERE  a.states <> 1
		AND a.domain_id='".$_SESSION[$un_domain_id]."' 
	    AND a.prid='".$_GET["prid"]."'";
    $name = $oPub-> getOne($sql);
   if($name)
	{
	   /* 像册列表 */
	   $db_table = $pre.'product_file';
       $sql = "SELECT thumb_url,filename,descs FROM " . $db_table . " WHERE prid = '".$_GET["prid"]."'";
       $row =  $oPub-> select($sql);
	   if($row)
	   {
           $show_img_list = true;
		   $strMessage = $name.' 图片列表';
	   }
	}
}
elseif($_GET["arid"])
{

   $_GET["arid"] = $_GET["arid"] + 0;
   $strid = 'arid'.$_GET["arid"];
   $sql = "SELECT  a.name FROM  ".$pre."artitxt  as a
		WHERE  a.states <> 1
		AND a.domain_id='".$_SESSION[$un_domain_id]."' 
	    AND a.arid='".$_GET["arid"]."'";
    $name = $oPub-> getOne($sql);
   if($name)
	{
	   /* 像册列表 */
	   $db_table = $pre.'arti_file';
       $sql = "SELECT thumb_url,filename,descs FROM " . $db_table . " WHERE type='' and  arid = '".$_GET["arid"]."'";
       $row =  $oPub-> select($sql);
	   if($row)
	   {
           $show_img_list = true;
		   $strMessage = $name.' 图片列表';
	   }
	}
   
}
elseif($_GET["tpid"])
{
   $_GET["tpid"] = $_GET["tpid"] + 0;
   $strid = 'tpid'.$_GET["arid"];
   $sql = "SELECT  a.name FROM  ".$pre."topictxt  as a
		WHERE  a.states <> 1
		AND a.domain_id='".$_SESSION[$un_domain_id]."' 
	    AND a.tpid='".$_GET["tpid"]."'";
    $name = $oPub-> getOne($sql);
   if($name)
	{
	   /* 像册列表 */
	   $db_table = $pre.'topic_file';
       $sql = "SELECT thumb_url,filename,descs FROM " . $db_table . " WHERE tpid = '".$_GET["tpid"]."'";
       $row =  $oPub-> select($sql);
	   if($row)
	   {
           $show_img_list = true;
		   $strMessage = $name.' 图片列表';
	   }
	}
}
else
{
   $strMessage = '对应图库不存在！';
   $show_img_list = false;
}

 

$strCache_id = $_SESSION[$un_domain_id].$_REQUEST[acid].$_REQUEST[page]; 
$cache_id = sprintf('%X', crc32($str_cache_id));
if (!$smarty->is_cached($Aconf["displayFile"], $cache_id)) {
    assign_template($Aconf); 
    $smarty->assign('home', $Ahome ); 
	$smarty->assign('images_list',  $row );
	$smarty->assign('ifshowimg',$show_img_list);
    unset($Ahome);
    /* 页面中的动态内容 */
    assign_dynamic(str_replace('.html','',$str_templates));
}
$smarty->display($Aconf["displayFile"], $cache_id);  
?>
