');
} elseif(in_array($_k, $fields)) {
$_POST['info'][$_k] = new_html_special_chars(trim_script($_v));
}
}
$_POST['linkurl'] = str_replace(array('"','(',')',",",' ','%'),'',new_html_special_chars(strip_tags($_POST['linkurl'])));
$this->content_db->edit_content($_POST['info'],$id);
$forward = $_POST['forward'];
showmessage(L('update_success'),$forward);
}
} else {
$show_header = $show_dialog = $show_validator = '';
$temp_language = L('news','','content');
//设置cookie 在附件添加处调用
param::set_cookie('module', 'content');
$id = intval($_GET['id']);
if(isset($_GET['catid']) && $_GET['catid']) {
$catid = $_GET['catid'] = intval($_GET['catid']);
param::set_cookie('catid', $catid);
$siteids = getcache('category_content', 'commons');
$siteid = $siteids[$catid];
$CATEGORYS = getcache('category_content_'.$siteid, 'commons');
$category = $CATEGORYS[$catid];
if($category['type']==0) {
$modelid = $category['modelid'];
$this->model = getcache('model', 'commons');
$this->content_db = pc_base::load_model('content_model');
$this->content_db->set_model($modelid);
$this->content_db->table_name = $this->content_db->db_tablepre.$this->model[$modelid]['tablename'];
$r = $this->content_db->get_one(array('id'=>$id,'username'=>$_username,'sysadd'=>0));
if(!$r) showmessage(L('illegal_operation'));
#if($r['status']==99) showmessage(L('has_been_verified'));
$this->content_db->table_name = $this->content_db->table_name.'_data';
$r2 = $this->content_db->get_one(array('id'=>$id));
$data = array_merge($r,$r2);
require CACHE_MODEL_PATH.'content_form.class.php';
$content_form = new content_form($modelid,$catid,$CATEGORYS);
$forminfos_data = $content_form->get($data);
$forminfos = array();
foreach($forminfos_data as $_fk=>$_fv) {
if($_fv['isomnipotent']) continue;
if($_fv['formtype']=='omnipotent') {
foreach($forminfos_data as $_fm=>$_fm_value) {
if($_fm_value['isomnipotent']) {
$_fv['form'] = str_replace('{'.$_fm.'}',$_fm_value['form'],$_fv['form']);
}
}
}
$forminfos[$_fk] = $_fv;
}
$formValidator = $content_form->formValidator;
include template('member', 'content_publish');
}
}
header("Cache-control: private");
}
}
/**
*
* 会员删掉投稿 ...
*/
public function delete(){
$id = intval($_GET['id']);
if(!$id){
return false;
}
//推论该文章与否待审,并且属该会员
$username = param::get_cookie('_username');
$userid = param::get_cookie('_userid');
$siteid = get_siteid();
$catid = intval($_GET['catid']);
$siteids = getcache('category_content', 'commons');
$siteid = $siteids[$catid];
$CATEGORYS = getcache('category_content_'.$siteid, 'commons');
$category = $CATEGORYS[$catid];
if(!$category){
showmessage(L('operation_failure'), HTTP_REFERER);
}
$modelid = $category['modelid'];
$checkid = 'c-'.$id.'-'.$modelid;
#$where = " checkid='$checkid' and username='$username' and status!=99 ";
$where = " checkid='$checkid' and username='$username'";
$check_pushed_db = pc_base::load_model('content_check_model');
$array = $check_pushed_db->get_one($where);
if(!$array){
showmessage(L('operation_failure'), HTTP_REFERER);
}else{
$content_db = pc_base::load_model('content_model');
$content_db->set_model($modelid);
$table_name = $content_db->table_name;
$content_db->delete_content($id,"",$catid); //删除文章
$check_pushed_db->delete(array('checkid'=>$checkid));//删除对应投稿表
showmessage(L('operation_success'), HTTP_REFERER);
}
}