<?php
/*
	欢迎使用DM建站系统，网址：www.demososo.com
*/
if(!defined('IN_DEMOSOSO')) {
	exit('this is wrong page,please back to homepage');
}

 
 $file222 = dmget_jtfile($pidfile);
 
  if(checkfile($file222)) { }
    else{
      exit;
    }
              



  if($act=='update')
 {

if(@$_POST['inputmust']=='') {echo $inputmusterror.$backlist;exit;}


 //$despcontent = zbdesp_onlyinsert($_POST['despcontent']);

 //$despjj=zbdespadd2($abc2);
 //gpc_add
$desp = zbdesp_onlyinsert($_POST['despcontent']); //note: desp and addr not use variable abc1.
    $desptext = zbdesp_onlyinsert($_POST['editor1text']);

 $subtitle=zbdesp_onlyinsert($_POST['subtitle']);
  $title=zbdesp_onlyinsert($_POST['title']);

 //$blockid=htmlentitdm($_POST['blockid']); 
  $cateid=htmlentitdm($_POST['cateid']);
 

  $arrcanexcerpt =  array("subtitle","title","jteditor","name","cateid");  //move top line

 $bscnt22 = '';
 if(count($_POST)>1){
         foreach ($_POST as  $k=>$v) {
           if(strtolower($k)=='submit') break;if(strtolower($k)=='inputmust') break;
           if(in_array($k,$arrcanexcerpt))   continue;
           $bscnt22 .= $k.':##'.trim($v).'==#==';

         }
     }
      $bscnt22 = zbdesp_onlyinsert(substr($bscnt22,0,-5));

 

//usr linkcss,not use linkstyle
 $ss = "update  $tablename set   name='$abc1',cateid='$cateid',subtitle='$subtitle',title='$title',desp='$desp',desptext='$desptext',arr_cfg='$bscnt22' where     pidfile='$pidfile' $andlangbh";
   //  echo $ss;exit;
		 	iquery($ss);
			$jumpvp = $jumpvf;
     // echo $jumpvp;
		  jump($jumpvp);
 }



else
 {
	$jumpv_insert = $jumpvf.'&act=update';

	$sql = "SELECT * from  $tablename  where  pidfile='$pidfile' $andlangbh order by id limit 1";
 // echo $sql;
$row = getrow($sql);
 
// pre($row);
if($row=='no') {

   //echo '<p>文件区块以 <strong>'.JTTEXTLANG.'语言</strong> 为主。</p>';


 //     $sql2 = "SELECT * from  $tablename  where  pidfile='$pidfile' and lang='".JTTEXTLANG."' order by id limit 1";
 // // echo $sql;
 //     if(getnum($sql2)==0) {

 //         $link = 'mod_jttext.php?lang='.JTTEXTLANG.'&file=add&pidfile='.$pidfile;

 //            echo '<p>本文件区块没有 <strong>'.JTTEXTLANG.'语言</strong> 的内容，<a href="'.$link.'">请先添加</a>。</p>';



 //     }else{
          
 //         // echo $mainlang;
 //         if(JTTEXTLANG<>LANG) echo '<p style="color:#666">这个文件区块没有'.LANG.'语言的内容，则会使用 <strong>'.JTTEXTLANG.'语言</strong> 的内容。或者<a href="'.$jumpv.'&file=add">添加'.LANG.'语言的内容</a>。</p>';
    
         
 //     }

             
        echo '<p>没有找到内容。可以尝试复制区块功能。</p>';

   
         exit;
 

}

$name=$row['name'];


$bgcolor=$bgimg=$cssstyle='';
$bgrepeat= 'no-repeat';
$bgposi= 'center center';
$bgsize= 'cover';
$bgattach = '';
$reganchor = $dmpadT = $dmpadB ='';

$titlefg='notitle';

 $name = $row['name']; 
$pidnamehere = $row['pidname']; 

$cateid = $row['cateid'];
$effect = $row['effect'];
$blockid = $row['blockid'];
$jtimg = $row['jtimg'];$jtimg2 = $row['jtimg2'];$jtimg3 = $row['jtimg3'];$jtimg4 = $row['jtimg4'];
$blockid = $formid = $videoid = $cssname = $cssstyle = '';
$maxline = 10;
$cus_columns = 3;
$excerptnum = 60;
$fullwidth = 'y';

$linktitle = $linkurl = $readmore =  $jtetext1 =  $jtetext2 =  $jtetext3 =  $jtetext4 =  $jtetext5 =  $jtetext6 =  $jtetext7 =  $jtetext8 =  '';
$testimg = 'n';
 $title = zbdesp_imgpath($row['title']); 
 $textstyle = zbdesp_imgpath($row['textstyle']); 

$subtitle=zbdesp_imgpath($row['subtitle']);
$desp = zbdesp_imgpath($row['desp']);
$desptext = zbdesp_imgpath($row['desptext']);

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

?>

<h3 style="margin-top:5px"><?php echo $name?>  </h3>
<div style="margin-bottom:5px">
   <span style="color:#666;font-size:14px">文件：<?php echo $pidfile?></span>
   &nbsp;&nbsp;
 <?php  echo  adm_previewlink($pidfile);  ?>

</div>

<form  onsubmit="javascript:return checkhere(this)" action="<?php echo $jumpv_insert;?>" method="post">
  <table class="formtab">
   

 <tr style="background:#fff">
 <td class="tr">后台标题：
 <br />
   <a class="needpopup" href="mod_jttext_copy.php?pidfile=<?php echo $pidfile?>&lang=<?php echo LANG?>">复制区块</a>
   </td>
 <td>
 <?php 
    if($name=='') $name = '后台标题 '.LANG;
 ?>
<input name="name" type="text" value="<?php echo $name?>"  class="form-control" /> 

</td></tr>
<?php 
 require_once HERE_ROOT.'mod_block/plugin_cssname.php';
 

?>


<tr><td colspan="2" class="trbg">图片 </td></tr>

<?php
 
require_once HERE_ROOT.'mod_jt_region/plugin_region_image.php';
?>
<tr><td colspan="2" class="trbg">内容 </td></tr>

<?php
 
require_once HERE_ROOT.'mod_jt_region/plugin_region_editcnt.php';
?>

<?php
 
require_once HERE_ROOT.'mod_jt_region/plugin_region_editor.php';
?>

  


<tr>
      <td></td>
      <td>
      <input  class="mysubmit" type="submit" name="Submit" value="提交"></td>
    </tr>
  </table>

    <?php echo $inputmust;?>

</form>


<?php
}
?>

<script>
function checkhere(thisForm) {
   if (thisForm.name.value==""){
		alert("请输入标题。");
		thisForm.name.focus();
		return (false);
	}





   // return;

}


</script>


<style type="text/css">
  
  textarea{ font-size: 14px }
</style>