";
$sql_lang=" and lang like '%global%' ";
$list_q="select * from ".$db_prefix."banner where 1 ".$sql_lang." and data_type='圖片' and status='Y' order by order_num limit 5";
$list_r=db_q($list_q);
while($rs=get_data($list_r))
{
$title=$rs[title];
$sub_title=$rs[sub_title];
$content=$rs[content];
$chk_q="select sn from ".$db_prefix."banner_local_status where 1 and lang='".$_SESSION[web][lang]."' and status='Y' and info_sn='".$rs[sn]."' ";
$chk_r=db_q($chk_q);
if(r_size($chk_r))
{
if($_SESSION[web][lang]!="global")
{
$sel_q="select title,content,sub_title from ".$db_prefix."banner_lang where 1 and info_sn='".$rs[sn]."' and lang='".$_SESSION[web][lang]."'";
$sel_r=db_q($sel_q);
if($rs1=get_data($sel_r))
{
$title=$rs1[title];
$sub_title=$rs1[sub_title];
$content=$rs1[content];
}
}
$pass=1;
}
elseif($_SESSION[web][lang]=="global")
{
$pass=1;
}
else{
$pass=0;
}
if($rs[block_style]=="左文右圖" and $pass)
{
print "
";
}
elseif($rs[block_style]=="上文下圖" and $pass)
{
print "
";
}
elseif($rs[block_style]=="上圖下文" and $pass)
{
print "
";
}
elseif($rs[block_style]=="左圖右文" and $pass)
{
print "
";
}
elseif($pass)
{
print "
";
}
}//while
print "
".$title."
".$sub_title."
".$content."
".$title."
".$sub_title."
".$content."
".$title."
".$sub_title."
".$content."
".$title."
".$sub_title."
".$content."
".$title."
".$sub_title."
".$content."