<?php  
foreach ($result_subreg as $k=>$v) {  
 
$bgcolor=$bgimg='';
$bgrepeat= 'no-repeat';
$bgposi= 'center center';
$bgsize= 'cover';
$bgattach = 'fixed';
$stylev= '';
$titlefg = 'notitle';
$bgtmd='';
$arr_cfg=$v['arr_cfg'];  $format = $v['format'];
$reganchor= $cssname = $dmpadT = $dmpadB ='';
$bscntarr = explode('==#==',$arr_cfg);
//pre($bscntarr );
     if(count($bscntarr)>1){
          foreach ($bscntarr as   $bsvalue) {
             if(strpos($bsvalue, ':##')){
               $bsvaluearr = explode(':##',$bsvalue);
               $bsccc = $bsvaluearr[0];
               $$bsccc=$bsvaluearr[1];
             }
          }
      }
$pidnamehere=$v['pidname'];
$pid=$v['pid'];$tid=$v['id'];$format=$v['format']; 

$cssstyle1 = $cssstyle2 = '';
if($dmpadT<>'') $cssstyle1 = 'padding-top:'.$dmpadT.'px;';
if($dmpadB<>'') $cssstyle2 = 'padding-bottom:'.$dmpadB.'px;';

$cssstyle = $cssstyle1.$cssstyle2.$cssstyle;


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';

$anchorv = $reganchor==''?'region'.$tid:$reganchor;
//-------------
 ?>


<?php // class  block is for js or hover edit link
$wowtop = '';
if($haswow=='y') $wowtop = ' wow fadeInUp'; 
  
?>
 <?php 
 
 if($bgtmd=='') $bgtmd = 1;
 if($bgcolor<>''){
  ?>
<style type="text/css">
  
  #<?php echo $anchorv?>::before{ background: <?php echo $bgcolor?> ;opacity: <?php echo $bgtmd?>;content: ''}
</style>

  <?php

 }
 ?>

<?php

echo '<div id="'.$anchorv.'" class="regionbox dmyiblock dmbgtmd '.$cssname.$wowtop.'" '.$stylev.'>';
if(dmlogin())  dmeditlink($pid,$tid,'regionblock');  
 
subreg_echocnt($v,$haswow);

echo '</div>';
 
	//------------------------ 
}


?>