

<tr style="background:#dce8f4">
        <td class="tr fb">效果文件：</td>
        <td>
 <?php
 
 $filedir = BLOCKROOT.'jtblock/jtblock_common/';
 $filearr = getFile($filedir); 

 //------merge template selfblock file
 //echo $ppid;
 $ppid7 = substr($ppid,0,7);
 
// echo $iscurstyle;
// if($iscurstyle=='y') {
 // $filedir2 = TPLCURROOT.'selfblock/'.$typecur;
 //}
 
  if($ppid7 =='jtblock'){ 
  $whereblockfile = '';
  $wherefile =  BLOCKROOT.'jtblock/'.$ppid.'/whereblockfile.php';
  if(is_file($wherefile)) require_once $wherefile;
  if($whereblockfile<>'')  $filedir2 = BLOCKROOT.'jtblock/'.$whereblockfile.'/';
  else  $filedir2 = BLOCKROOT.'jtblock/'.$ppid.'/';

 }
 else if($ppid7 =='jthome_'){ 
  $filedir2 = BLOCKROOT.'jthome/'.$ppid.'/';
 }
 else if($ppid7 =='mbhome_'){ 
  $filedir2 = TPLCURROOT.'selfblock/mbhome/'.$ppid.'/';
 }


 if(is_dir($filedir2)){
  $filearr2 = getFile($filedir2); 
  $filearr = array_merge($filearr2,$filearr);
}
 
 

     
    echo  '<select name="template">';
   // if(sizeof($filearr2)==0) echo '<option value="nofile">'.$fileposi.' 目录下没有文件</option>';
   // else 
    select_from_arr2($filearr,$template,'');
     //select_from_filearr($filedir,$template);
    //select_from_filearr2($filedir,$filedirself,$template);
    echo '</select>';
 
 //echo $typecur;
if($template<>''){
    $file = '';
  //  if($ppid=='common') $file =  BLOCKROOT.'sysblock/'.$typecur.'/'.$template;
  //  else if($ppid4=='styl') $file =  TPLCURROOT.'selfblock/'.$typecur.'/'.$template;
    // else if($ppid4=='vipb')  $file = BLOCKROOT.'vipblock/'.$typecur.'/'.$template;
   // else if($ppid4=='jtef')  $file = BLOCKROOT.'jteffect/'.$ppid.'/'.$template;

   $ppid7 = substr($ppid,0,7);

if(substr($template,0,5)=='comm_') {
    $file = BLOCKROOT.'jtblock/jtblock_common/'.$template;
    $fileposi = 'DM-block/jtblock/jtblock_common/';
  } 
  else  if($ppid7 =='jthome_'){    
      $file = BLOCKROOT.'jthome/'.$ppid.'/'.$template;
    $fileposi = 'DM-block/jthome/'.$ppid.'/';
  } 
  else if($ppid7 =='mbhome_'){    
    $file = TPLCURROOT.'selfblock/mbhome/'.$ppid.'/'.$template;
  $fileposi = 'DM-template/'.HTMLDIR.'/selfblock/mbhome/'.$ppid.'/';
} 

  else if(substr($template,0,5)=='self_') {
    $file = TPLCURROOT.'selfblock/'.$typecur.'/'.$template;
    $fileposi = 'DM-template/'.HTMLDIR.'/selfblock/'.$typecur.'/';
  } 
 
  else if(substr($template,0,7)=='bknode_') {
    $file = BLOCKROOT.'jtblock/jtblock_bknode/'.$template;
    $fileposi = 'DM-block/jtblock/jtblock_bknode/';
  } 
  else if(substr($template,0,5)=='bkdh_') {
    $file = BLOCKROOT.'jtblock/jtblock_bkdh/'.$template;
    $fileposi = 'DM-block/jtblock/jtblock_bkdh/';
  } 
else {    
    $file = BLOCKROOT.'jtblock/'.$ppid.'/'.$template;
  $fileposi = 'DM-block/jtblock/'.$ppid.'/';
} 
 
     checkfile($file) ;

     echo '<p class="cgray">文件位于：'.$fileposi.'</p>';

/*
    if($ppid=='common') $file =  BLOCKROOT.'sysblock/'.$typecur.'/'.$template;
    else if($ppid4=='styl') {
        if(substr($template,0,5)=='self_')  $file =  TPLCURROOT.'selfblock/'.$typecur.'/'.$template;
        else $file ='notbeginself_';
    }
    else if($ppid4=='dmre')  {
        if(substr($template,0,5)=='dmre_')  $file = REGIONROOT.'dmreblock/'.$typecur.'/'.$template;
        else $file ='notbegindmre_';
    }
    else if($ppid4=='jtef')  {
        if(substr($template,0,9)=='jteffect_')  $file = REGIONROOT.'jteffect/'.$ppid.'/'.$template;
        else $file ='notbeginjteff_';
    }  
 
    if($file == 'notbeginself_') echo '<p class="cred">出错，当前模板下的区块文件，必须要以 self_ 开头 </p>';
    else if($file == 'notbegindmre_') echo '<p class="cred">出错，dmreblock的区块文件，必须要以 dmre_ 开头 </p>';
    else if($file == 'notbeginjteff_') echo '<p class="cred">出错，jteffect的区块文件，必须要以 jteffect_ 开头 </p>';
   else  checkfile($file) ;
   */

}
    ?>



</td>
    </tr>
