<?php
if(!defined('IN_DEMOSOSO')) {
    exit('this is wrong page,please back to homepage');
}

?>

<?php
 //pre($row_detail);
$dhtrigger = 'slick'.rand(1000,9999);
$videoid= $row_detail['videoid'];$albumid= $row_detail['albumid'];
$nodepidname= $row_detail['pidname'];
$detpriceold= $row_detail['detpriceold'];$detprice= $row_detail['detprice'];
$stock= $row_detail['stock'];
$sku= $row_detail['sku'];
$langrelid= addslashes($row_detail['langrelid']);
$desptext= web_despdecode($row_detail['desptext']);
$desp= web_despdecode($row_detail['desp']);
$despjj= web_despdecode($row_detail['despjj']);
$despv = $desptext<>''?$desptext:$desp;
 
$news_titlev = $news_title<>''?$news_title:'内容详情';
 
$detailkv = $row_detail['kv'];
$titledetail = $title; //override by album.so set again

 $despprocan = web_despdecode($row_detail['despprocan']);
//$despcan = detail_nodetext('node','nodeprocan',$nodepidname);
$desptab1 = detail_nodetext('node','nodetab1',$nodepidname);
$desptab2 = detail_nodetext('node','nodetab2',$nodepidname);
$desptab3 = detail_nodetext('node','nodetab3',$nodepidname);


function nodeinfo($id){ 
     $arr = get_fieldarr(TABLE_NODE,$id,'pidname');
     $revarr['title'] = $arr['title'];
     $revarr['url'] = get_url($arr);
    
    return $revarr;


}


function cateinfo($id){
    
     $arr = get_fieldarr(TABLE_CATE,$id,'pidname');
     $revarr['name'] = $arr['name'];
     $revarr['url'] = get_url($arr);
    
      return $revarr; 


}

?>

<?php
publishtext(); // in frontcommon.php

?>
<div class="content_desp content_shop">

<div class="shopw1">
<?php
 
//when domain, $mainlang is not effective
 
$albumid2 = $albumid==''?$nodepidname:$albumid;

//echo $albumid;
//langalbum --lang id, 会在album的模板文件里有用。
if($albumid<>''){
     if(strpos($albumid,'|')){
        //like: node20150806_0929404264|cn  //因为多语言可能nodeid重复。所以用langid指定
        $arr = explode('|',$albumid);
        $langalbum = $arr[1];
        $albumid2 = $arr[0];
     }else{
       // $langalbum = get_fieldnolang(TABLE_NODE,'lang',$albumid,'pidname');
         $langalbum = MAINLANG;
    }
} 
else $langalbum = LANG; 

//echo $langalbum;  //  vv_album.php also have langalbum

//$langalbum = $mainlang;

//$langalbum = LANG; -- no use

//MAINLANGALBUM  -- no use
//if(MAINLANGALBUM <> '' && $albumid=='' && 1==2) { 
       // if(ENABLEMULTISITE=='y'){
          //get 主语言的nodeid havesub($table,$field,$v){
          //if(havesub(TABLE_NODELANGREL,'nodeid',$nodepidname)){
              // $nrlangnodeid = get_field(TABLE_NODELANGREL,'pidname',$nodepidname,'nodeid');
              // if($nrlangnodeid<>'noid'){
               // $mainlang_nodeid = get_field_lang(MAINLANGALBUM,TABLE_NODELANGREL,'nodeid',$nrlangnodeid,'pidname');
                 
               //  $albumid2 = $mainlang_nodeid;
                 // $langalbum = MAINLANGALBUM;;

              // }
      //}
//} 

$row_abm_v = detail_album('node',$albumid2,$langalbum); //多语言时，nodepidname会有重复，所以要传langalbum
//pre($row_abm_v);

if(!$row_abm_v[0])  {
   if($detailkv=='') echo '<img src = "'.STAPATH.'img/noimg.png" alt="" />';
   else {
    echo '<a href="'.get_img($detailkv,$title,'nodiv').'" data-fancybox data-caption="'.$title.'">';
    echo get_img($detailkv,$title,'div');
    echo '</a>';
  }
  //
}
else {
$row_abm = $row_abm_v[1];
  $cus_columnsv = ' '.cus_columnsfun($cus_columns_album);
  $cus_columnsv_bt = ' '.cus_columnsfun_bt($cus_columns);

//if(DMFABU=='n'){    //此代码仅测试时用。
 //echo @$_COOKIE["cookievaluealbum"];
  //if(@$_COOKIE["cookievaluealbum"]<>'')  $albumfg = @$_COOKIE["cookievaluealbum"];
//}

   //if(substr($albumfg,0,5)=='self_')  $albumfile = TPLCURROOT.'selfblock/album/'.$albumfg;
   //else if(substr($albumfg,0,5)=='dmre_')   $albumfile =  REGIONROOT.'dmregion_block/dmreblock/album/'.$albumfg;
   //else  $albumfile = BLOCKROOT.'album/'.$albumfg;
 //$albumfile = BLOCKROOT.'jteffect/'.$albumfg.'.php';
 if(substr($albumfg,0,5)=='self_') $albumfile =  TPLCURROOT.'selfblock/album/'.$albumfg;
 else if(substr($albumfg,0,13)=='jthome_effect') $albumfile =  JTHOMEROOT.$albumfg;
   else  $albumfile =SYSBLOCKROOT.'album/'.$albumfg;

  if(checkfile($albumfile))  require($albumfile);
//-----------------------
    if(dmlogin()){  

             $urlhere = BASEURL.ADMINDIR;
             //mod_album/mod_album.php?lang=en&pid=album20180605_1746046650
             $editlink = $urlhere.'/mod_album/mod_album.php?lang='.$langalbum.'&pid='.$row_abm_v[2];
             echo '<div style="padding:10px;text-align:center"><a  target="_blank" href="'.$editlink.'">编辑相册</a></div>';
         }

}


 ?>
</div>

<div class="shopw2">
<h1><?php echo decode($titledetail); ?></h1>


<?php
 
//if($despjj<>'') echo '<div class="despjj">'.web_despdecode($despjj).'</div>';
//$can_title = $can_title==''?'参数':$can_title;
 if($despprocan) {
   echo '<div class="despjj">';
   if($can_title<>'') echo '<h3>'.$can_title.'</h3>';
    // dmblockid($despcan);
   echo $despprocan;
   

    if(dmlogin()){  
             $urlhere = BASEURL.ADMINDIR;
             //mod_node/mod_node_edit.php?lang=cn&tid=252&file=editprocan
             $editlink = $urlhere.'/mod_node/mod_node_edit.php?lang='.LANG.'&tid='.$row_detail['id'].'&file=editprocan';
             echo '<div style="text-align:left"><a  target="_blank" href="'.$editlink.'">编辑参数</a></div>';
         }
   echo '</div>';

 }


if($shop_price=='y'){
 
  if($detprice<>0)  {
        echo '<div class="detailprice detailpriceold"><span class="w1">'.PRICE_TEXTOLD.'</span><span class="w2"><em>'.PRICE_CURRENCY.'</em><strong class="del">'.$detpriceold.'</strong></span></div>';

          echo '<div class="detailprice detailpricenow"><span class="w1">'.PRICE_TEXT.'</span><span class="w2"><em>'.PRICE_CURRENCY.'</em><strong class="price">'.$detprice.'</strong></span></div>';
        }
       // if($sku<>'') echo '<div class=" ">'.PRICE_MODEL.$sku.'</div>';
       // if($stock<>0) echo '<div class=" ">'.PRICE_STOCK.$stock.'</div>';
        if($detlinktitle<>'' && $detlinkurl<>'') echo '<div class="detaillinkurl dmbtn mt10 moresm"><a class="more " href="'.$detlinkurl.'" target="_blank"><i class="fa fa-shopping-cart"></i> '.$detlinktitle.'</a></div>';


} //hide price part


//when trade, show enquery button
 if($tab_formtitle<>'') echo '<div id="tradeinquery" class="dmbtn mt10 moresm"><a class="more " href="#detailtab">'.$tab_formtitle.'</a></div>';

?>


<?php

//download
echo '<div class="detaildownbtn ">';
echo '<span>';
detail_downloadurl($downloadurl);
echo '</span><span>';
detail_linkmore($linkmore);

echo '</span></div>';


?>




</div>
<div class="c"> </div>

<?php
detail_fontsize();

?>


<div id="detailtab" class="nodetab">

 <div class="nodetabhd">

 <span class="cur">
 <?php
  echo $news_titlev;
?>
 </span>

 <?php
if($nodetab1<>'') echo '<span class="dn">'.$nodetab1.'</span>';
if($nodetab2<>'') echo '<span class="dn">'.$nodetab2.'</span>';
if($nodetab3<>'') echo '<span class="dn">'.$nodetab3.'</span>';

if($tab_formtitle<>'') echo '<span id="tabform" class=" dn">'.$tab_formtitle.'</span>';
?>


   </div><!--end nodetabhd-->



  <div class="nodetabcnt content_size">
  	  <?php //显示 内容?>
  	  <div class="nodetabcntinc">



	<?php
  if($row_abm_v[0]) {
        if($detailkv<>'' && $nodekvshow=='y'){
            echo '<div class="kv c">';
            echo get_img($detailkv,$title,'div');
            echo '</div>';
        }
  }
//video----
if($videosrc<>'') {
    $videofile2 =  SYSBLOCKROOT.'videofile/'.$videofile;
    if(is_file($videofile2)) require $videofile2;
}

//---music
$resmusic = detail_music('node',$nodepidname);
if($resmusic)   require_once BLOCKROOT.'music/'.$musicfg;

  //视频的内容
if($videoid<>'') {
	       if(is_int(strpos($videoid,'|'))){
			   $videoid = explode('|', $videoid);
				foreach ($videoid as $v) {
				 block($v);
        }
		   }
		   else {
				  block($videoid);
		   }


}
else{
   $detailvideo = detail_video('node',$nodepidname);
      if($detailvideo)   block($detailvideo);
}


//---

dmblockid($despv);


?>
 </div>


 <?php

if($nodetab1<>'') {
   echo '<div class="nodetabcntinc  dn">';
     if($desptab1) dmblockid($desptab1);
     else echo NOARTICLE;
   echo '</div>';
}
if($nodetab2<>'') {
   echo '<div class="nodetabcntinc  dn">';
      if($desptab2) dmblockid($desptab2);
      else echo NOARTICLE;
   echo '</div>';
}
if($nodetab3<>'') {
   echo '<div class="nodetabcntinc  dn">';
      if($desptab3) dmblockid($desptab3);
      else echo NOARTICLE;
   echo '</div>';
}

if($tab_formtitle<>'') {
   echo '<div id="tabformtext" class="nodetabcntinc  dn">';
      if($formblockid) block($formblockid);
  echo '</div>';
}
 

?>

  </div><!--end nodetabcnt-->

</div><!--end nodetab-->

</div>


<?php

detail_langrelid($nodepidname,$langrelid,$detail_title);


if($sta_tag=='y') taglink($nodepidname,$tag_title);

 if(substr($nextprev,0,5)=='self_')  $file = TPLCURROOT.'selfblock/nextprev/'.$nextprev;
   else  $file = SYSBLOCKROOT.'nextprev/'.$nextprev;
if(checkfile($file)) require $file;

$file = SYSBLOCKROOT.'relative/vv_relative.php';
if(checkfile($file)) require $file;

 ?>
