";
$data_type="product";
$one_page=3;
$list_q="select v.sn ";
$list_q.="from ".$db_prefix."video as v ";
$list_q.="left join ".$db_prefix."video_local_status as vls on v.sn=vls.info_sn and vls.lang='".$_SESSION[web][lang]."'";
$list_q.="where 1 and ((v.lang ='global' and vls.status='Y') or v.lang='".$_SESSION[web][lang]."') and v.data_type='".$data_type."' and v.status='Y' order by v.order_num ";
$list_r=db_q($list_q);
$chk_num=r_size($list_r);
if($chk_num)
{
$page_data=get_page($one_page,$page,$chk_num);
//$list_q="select * from ".$db_prefix."video where 1 ".$sql_lang." and data_type='product' and status='Y' order by order_num limit ".$one_page." ";
$list_q="select v.* ";
$list_q.="from ".$db_prefix."video as v ";
$list_q.="left join ".$db_prefix."video_local_status as vls on v.sn=vls.info_sn and vls.lang='".$_SESSION[web][lang]."' ";
$list_q.="where 1 and ((v.lang ='global' and vls.status='Y') or v.lang='".$_SESSION[web][lang]."') and v.data_type='".$data_type."' and v.status='Y' order by v.order_num ";
$list_q.=" limit ".$page_data[start_page].",".$page_data[one_page]." ";
$list_r=db_q($list_q);
while($rs=get_data($list_r))
{
$pic1=$rs[pic1];
$sn=$rs[sn];
$title=$rs[title];
$url=restore_data_all($rs[url]);
$chk_q="select url,lang from ".$db_prefix."video_lang where 1 and lang='".$_SESSION[web][lang]."' and info_sn='".$rs[sn]."' ";
$chk_r=db_q($chk_q);
if($rs1=get_data($chk_r))
{
if($rs1[url])
{
$url=restore_data_all($rs1[url]);
}
}
$url=str_replace("\"","'",$url);
$show_link="";
if($url)
{
if(instr($url,"youtu.be"))
{
$code=explode("/",$url);
$y_code=$code[count($code)-1];
}
else
{
$code=explode("&",basename($url));
$y_code=str_replace("watch?v=","",$code[0]);
}
$show_link="

".$title."
";
}
else
{
$show_link="

".$title."
";
}
if($show_link)
{
print "
".$show_link."
";
}
}//while
}//if($chk_num
print "