<?php
/*
	欢迎使用DM企业建站系统，本系统由www.demososo.com开发。
*/
if(!defined('IN_DEMOSOSO')) {
	exit('this is wrong page,please back to homepage');
}

   $blockimg=$blockimg2=$blockimg3=$blockimg4=$bkbz1=$bkbz2=$bkbz3=$cssname= $namefront=$blockid=$nodebtnmore='';
        $bgcolor=$bgimg=$cssstyle= $videosrc= $videotext = '';
        $bgrepeat= 'no-repeat';
        $bgposi= 'center center';
        $bgsize= 'cover';
        $bgattach = '';
        $stylev=$linkurl=$linktitle='';

        $cus_columns = 3;$cus_substrnum=$excerptnum=0;
         $maxline=1;

         //------------------------------

    // pre($farr);
 $title = 'DM...no record...';
if($needarr =='')   $arr =  edit_data_injtsql($pidfile);
     // pre($arr);
if($arr['res']=='nores'){
     echo '<p class="errorfront">'.$arr['title'].'</p>';
}else{

   $desp = $despv =  get_nodedesp($arr['desp'],$arr['desptext']); 
           
       
       foreach ($arr as $k => $v) {
          $$k = web_despdecode(($v));
       }

      

        $bscntarr = explode('==#==',$arr_cfg);
 if(count($bscntarr)>1){
      foreach ($bscntarr as   $bsvalue) {
         if(strpos($bsvalue, ':##')){
           $bsvaluearr = explode(':##',$bsvalue);
           $bsccc = $bsvaluearr[0];
           $$bsccc = $bsvaluearr[1];
         }
      }
  }

$nodebtnmore = $readmore;
 //-------------
  $cus_columnsv = ' '.cus_columnsfun($cus_columns);
  $cus_columnsv_bt = ' '.cus_columnsfun_bt($cus_columns);
 $dhtrigger = 'jsdh'.rand(1000,9999).'d'.rand(11111,99999);
 //----------
    if($cssstyle<>'' || $bgcolor<>'' || $bgimg<>''){
     $stylebg = regionbg($bgcolor,$bgimg,$bgrepeat,$bgposi,$bgsize,$bgattach);
    
     if($cssstyle=='')   $stylev =  'style = "'.$stylebg.'"';
      else {
         
              $stylev =  'style = "'.$stylebg.' '.$cssstyle.'"';
          }
    }
    if($bgimg<>'') $cssname = $cssname.' dmbgimg';


//-----------------

    if($cateid<>''){

             //------------------
        $pidcate = $cateid;
          if(substr($pidcate, 0,4)<>'dsub'){ 
              edit_fenode($pidcate);//用来在前台编辑后台。
              if(substr($pidcate, 0,4)=='cate') $pidcatemain = $pidcate;
              else $pidcatemain = get_field(TABLE_CATE,'ppid',$pidcate,'pidname');

                $sqlwhere = wherecatev($pidcatemain,$pidcate);
                $orderv = " order by pos desc,dateedit desc ";
              }
          else { 
             // $sqlwhere = " pid='$pidcate' and modtype='blockdh' ";
              $orderv = " order by pos desc,id ";
               edit_fenode_blockdh($pidcate);//用来在前台编辑后台。
             }

             if(is_int(strpos($cssname,'nodetj'))) $wheretj= " and sta_tj='y' ";
             else $wheretj='';
             if(is_int(strpos($cssname,'nodenew'))) $wherenew= " and sta_new='y' ";
             else $wherenew='';


            //$sqlnode="select * from ".TABLE_NODE." where  $sqlwhere and sta_visible='y' $wheretj $wherenew ".ANDLANGBH." $orderv limit 0,$maxline";
               //echo $sqlnode;
           // $fenum = getnum($sqlnode);
            //if($fenum==0) {

              //if($pidcate<>'nocate') {  //when member node,then not notice error.
                 //  if(!is_int(strpos($pidcate,'|')))  echo '没有node记录  in vblock.php';
              //}

              // $result = array();
            //}
           // else  $result = getall($sqlnode);
                 $cus_substrnum = $excerptnum;
               $sqlarr = array( 
                'excerpt'=>$excerptnum,
                'start'=>0,
                'maxline'=>$maxline,
                'order'=>'','where'=>$wheretj.$wherenew
                );
               //pre($sqlarr);
              $result = getarr_node($pidcate,$sqlarr);

             //pre($result);

          //--------------
         }




}


if($cateid<>''){
  //edit_node_inblock($cateid,''); 
}

