万名网
您好,亲爱的缘友! 传统民俗测试,所有内容仅供休闲娱乐,不作任何用途或决策之用。
导航频道
宝宝起名
八字起名
诗词起名
成人改名
姓名测试
公司起名
周易起名
起名知识
康熙字典
百家姓
节气
万年历查询
选择类型
文章
康熙字典
百家姓
名字
首页
宝宝起名
八字起名
诗词起名
成人改名
姓名测试
公司起名
周易起名
起名知识
康熙字典
百家姓
黄历
4月吉日
2026日历
祭祀
祈福
求嗣
纳畜
入殓
启钻
谢土
除服
成服
吉神
天恩 续世 明堂
财神位
喜神:
西北
福神:
西南
财神:
东北
2117年2月23日 星期二 双鱼座 (阳历)
23
星期二
二一一七年正月廿二 属牛(阴历)
生肖:牛
月名:孟春
月相:下弦月
物候:雨水 初候 獭祭鱼
星宿:西方觜火猴(凶)
九星:八白土洞明
六曜:佛灭
日禄:卯命互禄
栽种
开光
出行
针灸
结婚
乔迁
动土
破土
凶煞宜忌
月煞 月虚 血支 天贼 五虚 土符 归忌 血忌
纳音五行
[丁丑年] 涧下水
[壬寅月] 金箔金
[乙丑日] 海中金
值神
明堂(黄道日)
冲煞
牛日冲(己未)羊 煞东
值日
闭值位(吉)
今日胎神
碓磨厕 外东南
彭祖百忌
乙不栽植千株不长 丑不冠带主不还乡
本月胎神
占房床
节气
当前节气:
雨水
下一节气:
惊蛰
于2117-03-05 23:33:10开始
2月吉日查询
结婚吉日
订婚吉日
搬家吉日
出行吉日
开业吉日
装修吉日
动土吉日
提车吉日
财神方位
今日吉时
择日择吉
择吉热读
_count(array('id'=>0, 'uid'=>$uid, 'isimage'=>1)); $filenum = $this->cms_content_attach->find_count(array('id'=>0, 'uid'=>$uid, 'isimage'=>0)); if($imagenum || $filenum){ $cms_content['imagenum'] = $imagenum; $cms_content['filenum'] = $filenum; } // 如果缩略图为空,并且附件表有图片,开启自动缩略图,则将第一张图片设置为缩略图 if(empty($cms_content['pic']) && $imagenum && $auto_pic) { $cms_content['pic'] = $this->auto_pic($table, $uid, 0, $models); } //开启自动缩略图,匹配内容里面的图片(这里不生成缩略图小图,直接是完整的图片网址) if(empty($cms_content['pic']) && $auto_pic){ $pattern="/<[img|IMG].*?src=[\'|\"](.*?(?:[\.gif|\.jpg|\.png]))[\'|\"].*?[\/]?>/"; preg_match_all($pattern, $contentstr, $match); if( isset($match[1]) && isset($match[1][0]) ){ $match_pic = $match[1][0]; if(substr($match_pic, 0, 2) == '..'){ $match_pic = substr($match_pic, 2); } $webdir_len = strlen($this->cfg['webdir']); if(substr($match_pic, 0, $webdir_len) == $this->cfg['webdir']){ $cms_content['pic'] = substr($match_pic, $webdir_len); }else{ $cms_content['pic'] = $match[1][0]; } } } //处理缩略图 end //标签处理 start $tagdatas = $tags = array(); if($tagstr){ $tags_arr = explode(',', $tagstr); $tags_arr = array_unique($tags_arr); //去重 $tags_arr = array_filter($tags_arr); //去掉空 $this->cms_content_tag->table = 'cms_'.$table.'_tag'; for($i = 0; isset($tags_arr[$i]) && $i < 8; $i++) { //只保留8个标签 $name = $this->cms_content_tag->_tagformat($tags_arr[$i]); if($name){ $tagdata = $this->cms_content_tag->find_fetch(array('name'=>$name), array(), 0, 1); //看看是否已经存在 if($tagdata) { $tagdata = current($tagdata); }else{ $tag_post = array('name'=>$name, 'count'=>0, 'content'=>''); $tagid = $this->cms_content_tag->create($tag_post); if(!$tagid){ DEBUG && log::le_log($tag_post, 'cms_content_xadd_error'); return array('err'=>1 ,'msg'=>lang('write_tag_table_failed')); } $tagdata = $this->cms_content_tag->get($tagid); } $tagdata['count']++; $tagdatas[] = $tagdata; if( _strlen(_json_encode($tags)) > 500){ //主表tags长度限制 break; } $tags[$tagdata['tagid']] = $tagdata['name']; } } } if($tags){ $cms_content['tags'] = _json_encode($tags); } //标签处理 end //有无指定ID? 写入主表 if($id){ if(!$this->set($id, $cms_content)) {$id = 0;} }else{ $id = $this->create($cms_content); } if($id) { $cms_content['id'] = $id; }else{ DEBUG && log::le_log($cms_content, 'cms_content_xadd_error'); return array('err'=>1 ,'msg'=>lang('write_content_table_failed')); } //附表数据 if($this->cms_content_data->set_cms_content_data($id, $cms_content_data, $table)) { }else{ DEBUG && log::le_log($cms_content_data, 'cms_content_xadd_error'); $this->delete($id); //删除主表数据 return array('err'=>1 ,'msg'=>lang('write_content_data_table_failed')); } // 写入查看数表 $cms_content_views = array( 'cid'=>$cid, 'views'=>isset($post['views']) ? (int)$post['views'] : 0, ); if(!$this->cms_content_views->set_cms_content_views($id, $cms_content_views, $table)) { $this->delete($id); //删除主表数据 $this->cms_content_data->delete_cms_content_data($id, $table); //删除附表数据 DEBUG && log::le_log($cms_content_views, 'cms_content_xadd_error'); return array('err'=>1 ,'msg'=>lang('write_content_views_table_failed')); } // 写入全站唯一别名表 if($alias && !$this->only_alias->create(array('alias'=> $alias ,'mid' => $mid, 'cid' => $cid, 'id' => $id))) { $this->update(array('id'=>$id, 'alias'=>'')); } //标签表和标签内容表对应 if($tagdatas){ $this->cms_content_tag_data->table = 'cms_'.$table.'_tag_data'; foreach($tagdatas as $tagdata) { $this->cms_content_tag->update($tagdata); $this->cms_content_tag_data->set(array($tagdata['tagid'], $id), array('id'=>$id)); } } // 写入内容属性标记表,set里面的data要完整,避免在开启缓存的时候写入数据不完整,导致读取不到完整数据 if($flags){ $this->cms_content_flag->table = 'cms_'.$table.'_flag'; foreach($flags as $flag) { $this->cms_content_flag->set(array($flag, $id), array('flag'=>$flag,'cid'=>$cid,'id'=>$id)); } } // 更新附件归宿 cid 和 id if($imagenum || $filenum) { $this->cms_content_attach->find_update(array('id'=>0, 'uid'=>$uid), array('cid'=>$cid, 'id'=>$id)); } // 更新用户发布的内容条数 $user['contents']++; $this->user->update($user); // 更新分类的内容条数 $categorys['count']++; $this->category->update($categorys); $this->category->update_cache($cid); //返回数据 $return_data = array( 'cid'=>$cid, 'id'=>$id, 'alias'=>$alias, 'mid'=>$mid ); //分类筛选 发布内容写入筛选值 --- 写入对应的 filter_cms_content 表 if($fids_arr){ $this->filter_cms_content->table = 'filter_cms_'.$table; foreach ($fids_arr as $fid){ $this->filter_cms_content->set(array($fid, $id), array('id'=>$id)); } } return array('err'=>0, 'msg'=>lang('fabu_successfully').$endstr, 'data'=>$return_data); } //编辑内容 public function xedit($post = array(), $user = array(), $table = 'article'){ if( !isset($post['id']) ){ return array('err'=>1 ,'msg'=>lang('id_not_exists')); } $isremote = isset($post['isremote']) ? (int)$post['isremote'] : 0; $err = $this->check_post($post, 0); if($err){ return array('err'=>1 ,'msg'=>$err); } $this->table = 'cms_'.$table; $this->cms_content_data->table = 'cms_'.$table.'_data'; $id = (int)$post['id']; $olddata = $this->cms_content->get($id); if(empty($olddata)){ return array('err'=>1 ,'msg'=>lang('data_no_exists')); } $cid = isset($post['cid']) ? (int)$post['cid'] : 0; //优先使用传递过来的uid if(isset($post['uid'])){ $uid = max(1, (int)$post['uid']); $user = array(); }elseif (isset($user['uid'])){ $uid = max(1, (int)$user['uid']); }else{ $uid = 1; } $title = isset($post['title']) ? trim(strip_tags($post['title'])) : ''; $contentstr = isset($post['content']) ? trim($post['content']) : ''; $intro = isset($post['intro']) ? trim($post['intro']) : ''; $tagstr = isset($post['tags']) ? trim($post['tags'], ", \t\n\r\0\x0B") : ''; $flags = isset($post['flag']) ? (array)$post['flag'] : array(); $author =isset($post['author']) ? trim($post['author']) : ''; $alias = isset($post['alias']) ? strtolower(trim($post['alias'])) : ''; $auto_pic = isset($this->cfg['auto_pic']) ? (int)$this->cfg['auto_pic'] : 0; //自动提取缩略图 $open_title_check = isset($this->cfg['open_title_check']) ? (int)$this->cfg['open_title_check'] : 0; //是否开启标题重复检查 if($alias && preg_match("/^\d+_\d+$/u",$alias)){ // 数字_数字 会和没有别名的 别名型URL冲突,导致404页面 return array('err'=>1 ,'msg'=>lang('alias_error_number_and_number')); } if($open_title_check && $title != $olddata['title'] && $this->find_fetch(array('title'=>$title), array('id' => 1), 0, 1)){ return array('err'=>1 ,'msg'=>lang('title_exists')); } $intro = auto_intro($intro, $contentstr); empty($user) AND $user = $this->user->get($uid); if( empty($user) ){ return array('err'=>1 ,'msg'=>lang('user_not_exists')); } empty($author) AND $author = empty($user['author'] ) ? $user['username'] : $user['author']; //分类检查 $categorys = $this->category->get($cid); if(empty($categorys)){ return array('err'=>1 ,'msg'=>lang('category_not_exists')); } $mid = (int)$categorys['mid']; $models = $this->models->get($mid); if(empty($models) || $models['tablename'] != $table){ return array('err'=>1 ,'msg'=>lang('cid_error')); } // 检测别名是否能用 $alias_old = $olddata['alias']; if($alias && $alias != $alias_old && $err_msg = $this->only_alias->check_alias($alias, 1)) { return array('err'=>1 ,'msg'=>$err_msg); } $cms_content = array( 'id' => $id, 'cid' => $cid, 'title' => $title, 'alias' => $alias, 'tags' => '', 'intro' => $intro, 'pic' => isset($post['pic']) ? trim($post['pic']) : '', 'uid' => $uid, 'author' => $author, 'source' => isset($post['source']) ? trim($post['source']) : '', 'lasttime' => isset($post['lasttime']) ? $post['lasttime'] : $_ENV['_time'], 'ip' => isset($post['ip']) ? $post['ip'] : ip2long($_ENV['_ip']), 'imagenum' => $olddata['imagenum'], 'filenum' => $olddata['filenum'], 'iscomment' => isset($post['iscomment']) ? (int)$post['iscomment'] : 0, 'comments' => (int)$olddata['comments'], 'flags' => implode(',', $flags), 'seo_title' => isset($post['seo_title']) ? trim(strip_tags($post['seo_title'])) : '', 'seo_keywords' => isset($post['seo_keywords']) ? trim(strip_tags($post['seo_keywords'])) : '', 'seo_description' => isset($post['seo_description']) ? trim(strip_tags($post['seo_description'])) : '', 'jumpurl' => isset($post['jumpurl']) ? trim($post['jumpurl']) : '', ); //发布时间 可以传递 2024-07-10 这种格式 if( isset($post['dateline']) && $post['dateline'] ){ if(!is_numeric($post['dateline'])){ $cms_content['dateline'] = strtotime($post['dateline']); }else{ $cms_content['dateline'] = $post['dateline']; } if(empty($cms_content['dateline'])){unset($cms_content['dateline']);} } //内容模板 if(isset($post['show_tpl'])){ $cms_content['show_tpl'] = $post['show_tpl']; } //分类筛选 编辑内容写入筛选值 if( isset($post['fids']) ){ //$fids_arr = (array)$post['fids']; $fids_arr = is_array($post['fids']) ? $post['fids'] : explode(',', $post['fids']); foreach ($fids_arr as $k=>$v){ if(empty($v)){unset($fids_arr[$k]);} } $cms_content['fids'] = implode(',', $fids_arr); // 比较筛选值变化 $fids_old = array(); if($olddata['fids']) { $fids_old = explode(',', $olddata['fids']); foreach($fids_arr as $fid) { $key = array_search($fid, $fids_old); if($key !== false) unset($fids_old[$key]); } } }else{ $fids_arr = $fids_old = array(); } $cms_content_data = array( 'content'=>$contentstr, ); //执行编辑内容时,处理自定义字段内容 //获取自定义字段的值 $user_defined_field = $this->models_field->user_defined_field($mid); foreach ($user_defined_field as $field => $field_set) { if (isset($post[$field])) { $val = $post[$field]; if ($field_set['inputtype'] == 'checkbox') { //传递的是数组 $val = implode(',', $val); } elseif ($field_set['inputtype'] == 'images' || $field_set['inputtype'] == 'attachs') { //图集和附件集数组转为json存放 $more_files_arr = (array)$val; //附件集排序 if($field_set['inputtype'] == 'attachs'){ _array_multisort($more_files_arr, 'orderby'); } $val = _json_encode($more_files_arr); //同步信息到附件表 $this->cms_content_attach->table = 'cms_'.$table.'_attach'; foreach ($more_files_arr as $files){ if(isset($files['filename']) || isset($files['golds']) || isset($files['credits'])){ $aid = isset($files['aid']) ? (int)$files['aid'] : 0; if($aid){ $attach_data['aid'] = $aid; isset($files['filename']) && $attach_data['filename'] = $files['filename']; isset($files['golds']) && $attach_data['golds'] = $files['golds']; isset($files['credits']) && $attach_data['credits'] = $files['credits']; $this->cms_content_attach->update($attach_data); } } } } $err = $this->models_field->check_field_val($val, $field_set); if ($err) { return array('err' => 1, 'msg' => $err); } if ($field_set['isbase']) { //主表 $cms_content[$field] = $val; } else { $cms_content_data[$field] = $val; } } } $endstr = ''; $this->cms_content_attach->table = 'cms_'.$table.'_attach'; if($isremote) { $endstr .= $this->get_remote_img($table, $cms_content_data['content'], $uid, $cid, $id); } // 计算图片数,和非图片文件数 $imagenum = $this->cms_content_attach->find_count(array('id'=>$id, 'uid'=>$uid, 'isimage'=>1)); $filenum = $this->cms_content_attach->find_count(array('id'=>$id, 'uid'=>$uid, 'isimage'=>0)); if($imagenum || $filenum){ $cms_content['imagenum'] = $imagenum; $cms_content['filenum'] = $filenum; } // 如果缩略图为空,并且附件表有图片,开启自动缩略图,则将第一张图片设置为缩略图 if(empty($cms_content['pic']) && $imagenum && $auto_pic) { $cms_content['pic'] = $this->auto_pic($table, $uid, $id, $models); } //开启自动缩略图,匹配内容里面的图片(这里不生成缩略图小图,直接是完整的图片网址) if(empty($cms_content['pic']) && $auto_pic){ $pattern="/<[img|IMG].*?src=[\'|\"](.*?(?:[\.gif|\.jpg|\.png]))[\'|\"].*?[\/]?>/"; preg_match_all($pattern, $contentstr, $match); if( isset($match[1]) && isset($match[1][0]) ){ $match_pic = $match[1][0]; if(substr($match_pic, 0, 2) == '..'){ $match_pic = substr($match_pic, 2); } $webdir_len = strlen($this->cfg['webdir']); if(substr($match_pic, 0, $webdir_len) == $this->cfg['webdir']){ $cms_content['pic'] = substr($match_pic, $webdir_len); }else{ $cms_content['pic'] = $match[1][0]; } } } //处理缩略图 end // 比较属性变化 $flags_old = array(); if($olddata['flags']) { $flags_old = explode(',', $olddata['flags']); foreach($flags as $flag) { $key = array_search($flag, $flags_old); if($key !== false) unset($flags_old[$key]); } } $tags_arr = $tags = array(); $tags_old = (array)_json_decode($olddata['tags']); //旧标签数组 // 比较标签变化 if($tagstr){ $tags_new = explode(',', $tagstr); $tags_new = array_unique($tags_new); //去重 $tags_new = array_filter($tags_new); //去掉空 }else{ $tags_new = array(); } foreach($tags_new as $tagname) { $tagname = $this->cms_content_tag->_tagformat($tagname); if($tagname){ $key = array_search($tagname, $tags_old); if($key === false) { $tags_arr[] = $tagname; }else{ $tags[$key] = $tagname; unset($tags_old[$key]); } } } // 标签预处理,最多支持8个标签 $this->cms_content_tag->table = 'cms_'.$table.'_tag'; $tagdatas = array(); for($i = 0; isset($tags_arr[$i]) && $i < 8; $i++) { $name = $this->cms_content_tag->_tagformat($tags_arr[$i]); if($name){ $tagdata = $this->cms_content_tag->find_fetch(array('name'=>$name), array(), 0, 1); if($tagdata) { $tagdata = current($tagdata); }else{ $tag_post = array('name'=>$name, 'count'=>0, 'content'=>''); $tagid = $this->cms_content_tag->create($tag_post); if(!$tagid){ return array('err'=>1 ,'msg'=>lang('write_tag_table_failed')); } $tagdata = $this->cms_content_tag->get($tagid); } $tagdata['count']++; $tagdatas[] = $tagdata; if( _strlen(_json_encode($tags)) > 500){ //主表tags长度限制 break; } $tags[$tagdata['tagid']] = $tagdata['name']; } } if($tags){ $cms_content['tags'] = _json_encode($tags); } //标签处理 end if($this->cms_content->update($cms_content)) { // 编辑时,别名有三种情况需要处理 if($alias && $alias_old && $alias != $alias_old) { // 写入新别名 if(!$this->only_alias->set($alias, array('mid' => $mid, 'cid' => $cid, 'id' => $id))) { $this->update(array('id'=>$id, 'alias'=>'')); } // 删除旧别名 $this->only_alias->delete($alias_old); }elseif($alias && empty($alias_old)) { // 写入新别名 if(!$this->only_alias->set($alias, array('mid' => $mid, 'cid' => $cid, 'id' => $id))) { $this->update(array('id'=>$id, 'alias'=>'')); } }elseif(empty($alias) && $alias_old) { // 删除旧别名 $this->only_alias->delete($alias_old); } }else{ return array('err'=>1 ,'msg'=>lang('write_content_table_failed')); } //附表数据 if($this->cms_content_data->set_cms_content_data($id, $cms_content_data, $table)) { }else{ return array('err'=>1 ,'msg'=>lang('write_content_data_table_failed')); } // 写入内容查看数表 $this->cms_content_views->table = 'cms_'.$table.'_views'; $cms_content_views = array( 'cid'=>$cid, 'views'=>isset($post['views']) ? (int)$post['views'] : 0, ); if($this->cms_content_views->set_cms_content_views($id, $cms_content_views, $table)) { }else{ return array('err'=>1 ,'msg'=>lang('write_content_views_table_failed')); } // 写入内容属性标记表 $this->cms_content_flag->table = 'cms_'.$table.'_flag'; foreach($flags as $flag) { $this->cms_content_flag->set(array($flag, $id), array('cid'=>$cid)); } // 删除去掉的属性 foreach($flags_old as $flag) { $flag = intval($flag); if($flag) $this->cms_content_flag->delete($flag, $id); } // 写入内容标签表 $this->cms_content_tag_data->table = 'cms_'.$table.'_tag_data'; foreach($tagdatas as $tagdata) { $this->cms_content_tag->update($tagdata); $this->cms_content_tag_data->set(array($tagdata['tagid'], $id), array('id'=>$id)); } // 删除不用的标签 foreach($tags_old as $tagid => $tagname) { $tagdata = $this->cms_content_tag->get($tagid); $tagdata['count']--; $this->cms_content_tag->update($tagdata); $this->cms_content_tag_data->delete($tagid, $id); } //改变分类了 if($cid != $olddata['cid']){ // 旧的分类内容数减1 $categorys_old = $this->category->get($olddata['cid']); $categorys_old['count'] = max(0, $categorys_old['count']-1); $this->category->update($categorys_old); // 新的分类内容数加1 $categorys['count']++; $this->category->update($categorys); //删除两个分类缓存数据 $this->category->delete_cache_one($cid); $this->category->delete_cache_one($olddata['cid']); if($alias_old == $alias){ //这里只处理别名未变动情况下的cid更新,别名有变动的话 会在上面的三种情况下更新数据 if(!$this->only_alias->set($alias, array('mid' => $mid, 'cid' => $cid, 'id' => $id))) { $this->update(array('id'=>$id, 'alias'=>'')); } } //更新附件表的cid $this->cms_content_attach->find_update(array('id'=>$id), array('cid'=>$cid)); //更新评论排序表的cid if($olddata['comments']){ $this->cms_content_comment_sort->find_update(array('mid'=>$mid, 'id'=>$id), array('cid'=>$cid)); } } //返回数据 $return_data = array( 'cid'=>$cid, 'id'=>$id, 'alias'=>$alias, 'mid'=>$mid ); //分类筛选 编辑内容写入筛选值 --- 写入对应的 filter_cms_content 表 if($fids_arr || $fids_old){ $this->filter_cms_content->table = 'filter_cms_'.$table; foreach ($fids_arr as $fid){ $this->filter_cms_content->set(array($fid, $id), array('id'=>$id)); } //删除已经抛弃的fid foreach ($fids_old as $fid){ $this->filter_cms_content->delete($fid, $id); } } return array('err'=>0, 'msg'=>lang('edit_successfully').$endstr, 'data'=>$return_data); } // 内容关联删除 public function xdelete($table = 'article', $id = 0, $cid = 0) { $this->table = 'cms_'.$table; $this->cms_content_data->table = 'cms_'.$table.'_data'; $this->cms_content_attach->table = 'cms_'.$table.'_attach'; $this->cms_content_flag->table = 'cms_'.$table.'_flag'; $this->cms_content_tag->table = 'cms_'.$table.'_tag'; $this->cms_content_tag_data->table = 'cms_'.$table.'_tag_data'; $this->cms_content_views->table = 'cms_'.$table.'_views'; //内容读取 $data = $this->get($id); if(empty($data)) return lang('data_no_exists'); //删除附件表里面的附件 $attach_arr = $this->cms_content_attach->find_fetch(array('id'=>$id)); foreach($attach_arr as $v) { if($v['isimage']){ $updir = ROOT_PATH.'upload/'.$table.'/'; }else{ $updir = ROOT_PATH.'upload/attach/'; } $file = $updir.$v['filepath']; if($v['isimage']){ $thumb = image::thumb_name($file); }else{ $thumb = ''; } try{ is_file($file) && unlink($file); if($thumb && is_file($thumb)) unlink($thumb); }catch(Exception $e) {} $this->cms_content_attach->delete($v['aid']); } //更新标签表 if(isset($data['tags']) && !empty($data['tags'])) { $tags_arr = _json_decode($data['tags']); foreach($tags_arr as $tagid => $name) { $this->cms_content_tag_data->delete($tagid, $id); $tagdata = $this->cms_content_tag->get($tagid); $tagdata['count']--; if($tagdata['count'] > 0) { $this->cms_content_tag->update($tagdata); }else{ $this->cms_content_tag->delete($tagid); } } } //更新分类表 $catedata = $this->category->get($cid); if(empty($catedata)) return lang('category_not_exists'); if($catedata['count'] > 0) { $catedata['count']--; if(!$this->category->update($catedata)) return lang('write_content_table_failed'); $this->category->update_cache($cid); } //更新用户内容数 if(isset($data['uid']) && $data['uid']){ $user = $this->user->get($data['uid']); if($user && $user['contents'] > 0) { $user['contents']--; $this->user->update($user); } } //删除内容 $this->cms_content_data->delete_cms_content_data($id, $table); //删除浏览量 $this->cms_content_views->delete_cms_content_views($id, $table); //删除属性 $this->cms_content_flag->find_delete(array('id'=>$id)); //删除别名 (isset($data['alias']) && !empty($data['alias'])) && $this->only_alias->delete($data['alias']); //删除评论和评论排序 if(isset($data['comments']) && $data['comments']){ $where = array('mid'=>$catedata['mid'], 'id'=>$id); $this->cms_content_comment->find_delete($where); $this->cms_content_comment_sort->find_delete($where); } //删除基础数据 $ret = $this->delete($id); //开启的筛选分类 删除内容,删除对应的 filter_cms_content 表数据 $le_category_filter_cids = $this->cfg['le_category_filter_cids']; $le_category_filter_cids_arr = explode(',', $le_category_filter_cids); if(in_array($cid, $le_category_filter_cids_arr) && isset($data['fids']) && !empty($data['fids'])){ $this->filter_cms_content->table = 'filter_cms_'.$table; $this->filter_cms_content->find_delete(array('id'=>$id)); } return $ret ? '' : lang('delete_failed'); } //移动内容 public function xmove($table = 'article', $id = 0, $old_cid = 0, $cid = 0){ if(empty($id) || empty($old_cid) || empty($cid) || $old_cid == $cid){ return lang('data_error'); } $this->table = 'cms_'.$table; $this->cms_content_attach->table = 'cms_'.$table.'_attach'; $this->cms_content_flag->table = 'cms_'.$table.'_flag'; $this->cms_content_views->table = 'cms_'.$table.'_views'; //内容读取 $data = $this->get($id); if(empty($data)) return lang('data_no_exists'); $old_cate = $this->category->get($old_cid); $new_cate = $this->category->get($cid); if(empty($old_cate) || empty($new_cate)){ return lang('data_error'); } $old_mid = $old_cate['mid']; $mid = $new_cate['mid']; if($old_mid != $mid || $mid < 2){ return lang('data_error'); } //更新主表 $data['cid'] = $cid; if( !$this->update($data) ){ return lang('opt_failed'); } //更新别名表 if($data['alias']){ $this->only_alias->find_update(array('alias'=>$data['alias']), array('cid'=>$cid)); } //更新属性内容表 if($data['flags']) { $this->cms_content_flag->find_update(array('id'=>$id), array('cid'=>$cid)); } //更新附件表 $this->cms_content_attach->find_update(array('id'=>$id), array('cid'=>$cid)); //更新浏览量表 $this->cms_content_views->find_update(array('id'=>$id), array('cid'=>$cid)); //更新评论排序表 $this->cms_content_comment_sort->find_update(array('mid'=>$mid,'id'=>$id), array('cid'=>$cid)); //更新旧的分类 $old_cate['count'] = max(0, $old_cate['count']-1); $this->category->update($old_cate); $this->category->delete_cache_one($old_cid); //更新新的分类 $new_cate['count']++; $this->category->update($new_cate); $this->category->delete_cache_one($cid); return ''; } // 标签链接格式化 public function tag_url($mid = 2, $tags = array(), $page = FALSE, $extra = array()) { $link_tag_type = isset($this->cfg['link_tag_type']) ? (int)$this->cfg['link_tag_type'] : 0; $name = isset($tags['name']) ? $tags['name'] : ''; $tagid = isset($tags['tagid']) ? (int)$tags['tagid'] : 0; //使用相对URL if(isset($this->cfg['url_path']) && !empty($this->cfg['url_path'])){ $this->cfg['weburl'] = $this->cfg['webdir']; } if(empty($name) || empty($tagid)){ return ''; } $name = $this->cms_content_tag->_tagformat($name, 0); if(empty($_ENV['_config']['lecms_parseurl'])) { $s = $page ? '-page-{page}' : ''; switch ($link_tag_type){ case 0: return $this->cfg['weburl'].'index.php?tag-'.($mid > 2 ? '-mid-'.$mid : '').'-name-'.urlencode($name).$s.$_ENV['_config']['url_suffix']; break; case 1: return $this->cfg['weburl'].'index.php?tag-'.($mid > 2 ? '-mid-'.$mid : '').'-tagid-'.$tagid.$s.$_ENV['_config']['url_suffix']; break; case 2: $encrypt = encrypt($mid.'_'.$tagid); return $this->cfg['weburl'].'index.php?tag--encrypt-'.$encrypt.$s.$_ENV['_config']['url_suffix']; break; case 3: $encrypt = hashids_encrypt($mid,$tagid); return $this->cfg['weburl'].'index.php?tag--encrypt-'.$encrypt.$s.$_ENV['_config']['url_suffix']; break; } }else{ $s = $page ? '/page_{page}' : ''; switch ($link_tag_type){ case 0: return $this->cfg['weburl'].$this->cfg['link_tag_pre'].($mid > 2 ? $mid.'_' : '').urlencode($name).$s.$this->cfg['link_tag_end']; break; case 1: return $this->cfg['weburl'].$this->cfg['link_tag_pre'].($mid > 2 ? $mid.'_' : '').$tagid.$s.$this->cfg['link_tag_end']; break; case 2: $encrypt = encrypt($mid.'_'.$tagid); return $this->cfg['weburl'] . $this->cfg['link_tag_pre'] . $encrypt.$s.$this->cfg['link_tag_end']; break; case 3: $encrypt = hashids_encrypt($mid,$tagid); return $this->cfg['weburl'] . $this->cfg['link_tag_pre'] . $encrypt.$s.$this->cfg['link_tag_end']; break; } } } // 评论链接格式化 public function comment_url($cid = 0, $id = 0, $page = FALSE) { //使用相对URL if(isset($this->cfg['url_path']) && !empty($this->cfg['url_path'])){ $this->cfg['weburl'] = $this->cfg['webdir']; } if(empty($_ENV['_config']['lecms_parseurl'])) { $s = $page ? '-page-{page}' : ''; return $this->cfg['weburl'].'index.php?comment--cid-'.$cid.'-id-'.$id.$s.$_ENV['_config']['url_suffix']; }else{ return $this->cfg['weburl'].$this->cfg['link_comment_pre'].$cid.'_'.$id.($page ? '_{page}' : '').$_ENV['_config']['url_suffix']; } } // 内容链接格式化 public function content_url(&$content, $mid = 2, $page = FALSE, $extra = array()) { $url = ''; $link_show_end = isset($this->cfg['link_show_end']) ? $this->cfg['link_show_end'] : $_ENV['_config']['url_suffix']; $id = isset($content['id']) ? (int)$content['id'] : 0; $cid = isset($content['cid']) ? (int)$content['cid'] : 0; $alias = isset($content['alias']) ? $content['alias'] : ''; empty($alias) && $alias = $cid.'_'.$id; $dateline = isset($content['dateline']) ? (int)$content['dateline'] : 0; //使用相对URL if(isset($this->cfg['url_path']) && !empty($this->cfg['url_path'])){ $this->cfg['weburl'] = $this->cfg['webdir']; } if(empty($id) || empty($cid)){ return ''; } if(empty($_ENV['_config']['lecms_parseurl'])) { $url .= $this->cfg['weburl'].'index.php?show--cid-'.$cid.'-id-'.$id.($page ? '-page-{page}' : '').$_ENV['_config']['url_suffix']; }else{ switch($this->cfg['link_show_type']) { case 1: //数字型 $url .= $this->cfg['weburl'].$cid.'/'.$id.$link_show_end; break; case 2: //推荐型 if(!isset($this->cfg['cate_arr'][$cid])){return '';} $url .= $this->cfg['weburl'].$this->cfg['cate_arr'][$cid].'/'.$id.$link_show_end; break; case 3: //别名型 $url .= $this->cfg['weburl'].$alias.$link_show_end; break; case 4: //加密型 $url .= $this->cfg['weburl'].encrypt($cid.'_'.$id).$link_show_end; break; case 8: //HashId,放前面 提高命中率 $url .= $this->cfg['weburl'].hashids_encrypt($cid,$id).$link_show_end; break; case 5: //模型ID_数字型 if($mid > 2){ $url .= $this->cfg['weburl'].$mid.'_'.$id.$link_show_end; }else{ $url .= $this->cfg['weburl'].$id.$link_show_end; } break; case 6: //分类别名+内容别名型 if(!isset($this->cfg['cate_arr'][$cid])){return '';} $url .= $this->cfg['weburl'].$this->cfg['cate_arr'][$cid].'/'.$alias.$link_show_end; break; case 7: //灵活型 $url .= $this->cfg['weburl'].strtr($this->cfg['link_show'], array( '{cid}' => $cid, '{mid}' => $mid, '{id}' => $id, '{alias}' => $alias, '{cate_alias}' => isset($this->cfg['cate_arr'][$cid]) ? $this->cfg['cate_arr'][$cid] : '', '{password}' => encrypt($cid.'_'.$id), '{ymd}' => date('Ymd', $dateline), '{y}' => date('Y', $dateline), '{m}' => date('m', $dateline), '{d}' => date('d', $dateline), '{auth_key}' => substr(md5($_ENV['_config']['auth_key']), 0, 6), '{hashids}' => hashids_encrypt($cid,$id) )); break; } if($page){ $url .= '&page={page}'; } } return $url; } //用户模块相关URL,只涉及 user-xxx 或者 my-xxx(为了兼容旧版本的插件使用该函数, 新的开发请使用 urls_model里面的该函数) public function user_url($action = 'index', $control = 'user', $page = false, $extra = array()){ //使用相对URL if(isset($this->cfg['url_path']) && !empty($this->cfg['url_path'])){ $this->cfg['weburl'] = $this->cfg['webdir']; } $allow_control = array('user', 'my'); if(!in_array($control, $allow_control)){ return ''; } $s = ''; if($page){ $s .= $page ? '-page-{page}' : ''; } // 附加参数 if($extra) { foreach ($extra as $k=>$v){ $s .= '-'.$k.'-'.$v; } } if(empty($_ENV['_config']['lecms_parseurl'])) { return $this->cfg['weburl'].'index.php?'.$control.'-'.$action.$s.$_ENV['_config']['url_suffix']; }else{ return $this->cfg['weburl'].$control.'-'.$action.$s.$_ENV['_config']['url_suffix']; } } //获取模型的自定义字段(不执行格式化) public function get_model_fields_by_mid($mid = 2){ if(!plugin_is_enable('models_filed')){ return array(); } if(isset($this->data['models_field'.$mid]) && !empty($this->data['models_field'.$mid])) { $models_field = $this->data['models_field'.$mid]; }else{ $models_field = $this->models_field->user_defined_field($mid); $this->data['models_field'.$mid] = $models_field; } return $models_field; } // 自动生成缩略图 public function auto_pic($table = 'article', $uid = 1, $id = 0, $models = array()) { $this->cms_content_attach->table = 'cms_'.$table.'_attach'; $pic_arr = $this->cms_content_attach->find_fetch(array('id'=>$id, 'uid'=>$uid, 'isimage'=>1), array(), 0, 1); if($pic_arr){ $pic_arr = current($pic_arr); $path = 'upload/'.$table.'/'.$pic_arr['filepath']; $pic = image::thumb_name($path); $src_file = ROOT_PATH.$path; $dst_file = ROOT_PATH.$pic; if( !is_file($dst_file) && $models ) { image::thumb($src_file, $dst_file, $models['width'], $models['height'], $this->cfg['thumb_type'], $this->cfg['thumb_quality']); return $path; }else{ return $path; } }else{ return ''; } } /** * 获取远程图片 * @param $table 表名 * @param $content 内容 * @param int $uid 用户ID * @param int $cid 分类ID * @param int $id 内容ID * @param int $write_db 是否写入附件表 * @return string */ public function get_remote_img($table = 'article', &$content = '', $uid = 1, $cid = 0, $id = 0, $write_db = 1) { if(empty($content)){ return ''; } function_exists('set_time_limit') && set_time_limit(0); $updir = 'upload/'.$table.'/'; $_ENV['_prc_err'] = 0; $_ENV['_prc_arg'] = array( 'hosts'=>array('127.0.0.1', 'localhost', $_SERVER['HTTP_HOST'], $this->cfg['webdomain']), 'uid'=>$uid, 'cid'=>$cid, 'id'=>$id, 'maxSize'=>10000, 'upDir'=>ROOT_PATH.$updir, 'preUri'=>$this->cfg['webdir'].$updir, //相对图片地址,绝对图片地址用 weburl 'cfg'=>$this->cfg, 'write_db'=>$write_db ); $this->cms_content_attach->table = 'cms_'.$table.'_attach'; $content = preg_replace_callback('#\
]*src=["\']((?:http|https|ftp)\://[^"\']+)["\'][^\>]*\>#iU', array($this, 'img_replace'), $content); unset($_ENV['_prc_arg']); return $_ENV['_prc_err'] ? lang('isremote_failed_tip_1').$_ENV['_prc_err'].lang('isremote_failed_tip_2') : ''; } // 远程图片处理 (如果抓取失败则不替换) // $conf 用到4个参数 hosts preUri cfg upDir private function img_replace($mat) { static $uris = array(); $uri = $mat[1]; $conf = &$_ENV['_prc_arg']; if( !isset($conf['write_db']) ){ $conf['write_db'] = 1; } // 排除重复保存相同URL图片 if(isset($uris[$uri])) return str_replace($uri, $uris[$uri], $mat[0]); // 根据域名排除本站图片 $urls = parse_url($uri); if(in_array($urls['host'], $conf['hosts'])) return $mat[0]; $file = $this->cms_content_attach->remote_down($uri, $conf, (int)$conf['write_db']); if($file) { $uris[$uri] = $conf['preUri'].$file; $cfg = $conf['cfg']; // 是否添加水印 if(!empty($cfg['watermark_pos'])) { image::watermark($conf['upDir'].$file, ROOT_PATH.'static/img/watermark.png', null, $cfg['watermark_pos'], $cfg['watermark_pct']); } return str_replace($uri, $uris[$uri], $mat[0]); }else{ $_ENV['_prc_err']++; return $mat[0]; } } }
Lecms 3.0.3 错误
错误信息
消息:
[程序异常] : Class 'cms_content' not found
文件:
/www/wwwroot/www.wanmingwang.com/lecms/xiunophp/lib/core.class.php
位置:
第449行
错误位置
#445
}
#446
}
#447
#448
include $objfile;
#449
$mod = new $model();
#450
$_ENV['_models'][$modelname] = $mod;
#451
#452
return $mod;
#453
}
#454
基本信息
模型:
/www/wwwroot/www.wanmingwang.com/lecms/model/
视图:
/www/wwwroot/www.wanmingwang.com/view/qm_pro/
控制器:
/www/wwwroot/www.wanmingwang.com/lecms/control/
hl_control.class.php
日志目录:
/www/wwwroot/www.wanmingwang.com/runcache/logs/
程序流程
#0 /www/wwwroot/www.wanmingwang.com/lecms/xiunophp/lib/control.class.php(10): core::model()
#1 /www/wwwroot/www.wanmingwang.com/runcache/lecms_view/qm_pro,hl_index.htm.php(297): control->__get()
#2 /www/wwwroot/www.wanmingwang.com/runcache/lecms_view/qm_pro,hl_index.htm.php(784): block_list()
#3 /www/wwwroot/www.wanmingwang.com/lecms/xiunophp/lib/view.class.php(25): include('/www/wwwroot/ww...')
#4 /www/wwwroot/www.wanmingwang.com/lecms/xiunophp/lib/control.class.php(23): view->display()
#5 /www/wwwroot/www.wanmingwang.com/runcache/lecms_control/hl_control.class.php(282): control->display()
#6 /www/wwwroot/www.wanmingwang.com/lecms/xiunophp/lib/core.class.php(341): hl_control->index()
#7 /www/wwwroot/www.wanmingwang.com/lecms/xiunophp/lib/core.class.php(11): core::init_control()
#8 /www/wwwroot/www.wanmingwang.com/lecms/xiunophp/xiunophp.php(100): core::init_start()
#9 /www/wwwroot/www.wanmingwang.com/index.php(107): require('/www/wwwroot/ww...')
#10 {main}
SQL
#0
[time:0.0005s]
SELECT * FROM le_runtime WHERE k='cfg' LIMIT 1
#1
[time:0.0002s]
SELECT url_alias_prefix FROM le_ai_qiming_config LIMIT 1
#2
[time:0.0038s]
SELECT mid FROM le_models
#3
[time:0.0004s]
SELECT * FROM le_models WHERE mid='1' OR mid='2' OR mid='3' OR mid='4' OR mid='5'
#4
[time:0.0005s]
SELECT * FROM le_runtime WHERE k='693aea0b1e1a8ca87c15cc17b077f245' LIMIT 1
#5
[time:0.0002s]
SELECT * FROM le_runtime WHERE k='4e808335710b4872d77ba9e8ab9626c6' LIMIT 1
#6
[time:0.0002s]
SELECT * FROM le_runtime WHERE k='1eb52b08622a6bf126e62160c96d7bec' LIMIT 1
#7
[time:0.0002s]
SELECT * FROM le_kv WHERE k='navigate' LIMIT 1
#8
[time:0.0023s]
SELECT * FROM le_runtime WHERE k='5093fafb3a0d3383f181bb6ed9697b37' LIMIT 1
$_GET
#control => hl
#action => index
#nian => 2117
#yue => 2
#ri => 23
$_POST
$_COOKIE
包含文件
#0 /www/wwwroot/www.wanmingwang.com/index.php
#1 /www/wwwroot/www.wanmingwang.com/lecms/xiunophp/xiunophp.php
#2 /www/wwwroot/www.wanmingwang.com/lecms/config/config.inc.php
#3 /www/wwwroot/www.wanmingwang.com/lecms/xiunophp/lib/base.func.php
#4 /www/wwwroot/www.wanmingwang.com/lecms/xiunophp/lib/core.class.php
#5 /www/wwwroot/www.wanmingwang.com/lecms/xiunophp/lib/debug.class.php
#6 /www/wwwroot/www.wanmingwang.com/lecms/xiunophp/lib/log.class.php
#7 /www/wwwroot/www.wanmingwang.com/lecms/xiunophp/lib/model.class.php
#8 /www/wwwroot/www.wanmingwang.com/lecms/xiunophp/lib/view.class.php
#9 /www/wwwroot/www.wanmingwang.com/lecms/xiunophp/lib/control.class.php
#10 /www/wwwroot/www.wanmingwang.com/lecms/xiunophp/db/db.interface.php
#11 /www/wwwroot/www.wanmingwang.com/lecms/xiunophp/db/db_pdo_mysql.class.php
#12 /www/wwwroot/www.wanmingwang.com/lecms/xiunophp/cache/cache.interface.php
#13 /www/wwwroot/www.wanmingwang.com/lecms/xiunophp/cache/cache_memcache.class.php
#14 /www/wwwroot/www.wanmingwang.com/lecms/xiunophp/ext/network/Network__interface.php
#15 /www/wwwroot/www.wanmingwang.com/lecms/config/plugin.inc.php
#16 /www/wwwroot/www.wanmingwang.com/lecms/plugin/editor_um/conf.php
#17 /www/wwwroot/www.wanmingwang.com/lecms/plugin/le_ai_qiming/conf.php
#18 /www/wwwroot/www.wanmingwang.com/lecms/plugin/le_category_filter/conf.php
#19 /www/wwwroot/www.wanmingwang.com/lecms/plugin/le_douhao_ai_article/conf.php
#20 /www/wwwroot/www.wanmingwang.com/lecms/plugin/le_hl/conf.php
#21 /www/wwwroot/www.wanmingwang.com/lecms/plugin/le_links/conf.php
#22 /www/wwwroot/www.wanmingwang.com/lecms/plugin/le_quming_pro/conf.php
#23 /www/wwwroot/www.wanmingwang.com/lecms/plugin/le_quming_pro_backup/conf.php
#24 /www/wwwroot/www.wanmingwang.com/lecms/plugin/le_title_pic/conf.php
#25 /www/wwwroot/www.wanmingwang.com/lecms/plugin/models_filed/conf.php
#26 /www/wwwroot/www.wanmingwang.com/runcache/misc.func.php
#27 /www/wwwroot/www.wanmingwang.com/runcache/core_lang/zh-cn.php
#28 /www/wwwroot/www.wanmingwang.com/runcache/lang/zh-cn.php
#29 /www/wwwroot/www.wanmingwang.com/runcache/lecms_control/parseurl_control.class.php
#30 /www/wwwroot/www.wanmingwang.com/runcache/lecms_model/runtime_model.class.php
#31 /www/wwwroot/www.wanmingwang.com/runcache/lecms_control/hl_control.class.php
#32 /www/wwwroot/www.wanmingwang.com/runcache/lecms_control/base_control.class.php
#33 /www/wwwroot/www.wanmingwang.com/runcache/lecms_model/urls_model.class.php
#34 /www/wwwroot/www.wanmingwang.com/runcache/lecms_model/models_model.class.php
#35 /www/wwwroot/www.wanmingwang.com/runcache/lecms_model/hl_model.class.php
#36 /www/wwwroot/www.wanmingwang.com/lecms/plugin/le_hl/lib/vendor/autoload.php
#37 /www/wwwroot/www.wanmingwang.com/lecms/plugin/le_hl/lib/vendor/composer/autoload_real.php
#38 /www/wwwroot/www.wanmingwang.com/lecms/plugin/le_hl/lib/vendor/composer/ClassLoader.php
#39 /www/wwwroot/www.wanmingwang.com/lecms/plugin/le_hl/lib/vendor/composer/autoload_static.php
#40 /www/wwwroot/www.wanmingwang.com/lecms/plugin/le_hl/lib/src/SolarWeek.php
#41 /www/wwwroot/www.wanmingwang.com/lecms/plugin/le_hl/lib/src/Solar.php
#42 /www/wwwroot/www.wanmingwang.com/lecms/plugin/le_hl/lib/src/util/SolarUtil.php
#43 /www/wwwroot/www.wanmingwang.com/lecms/plugin/le_hl/lib/src/Lunar.php
#44 /www/wwwroot/www.wanmingwang.com/lecms/plugin/le_hl/lib/src/LunarYear.php
#45 /www/wwwroot/www.wanmingwang.com/lecms/plugin/le_hl/lib/src/util/ShouXingUtil.php
#46 /www/wwwroot/www.wanmingwang.com/lecms/plugin/le_hl/lib/src/LunarMonth.php
#47 /www/wwwroot/www.wanmingwang.com/lecms/plugin/le_hl/lib/src/util/LunarUtil.php
#48 /www/wwwroot/www.wanmingwang.com/lecms/plugin/le_hl/lib/src/Tao.php
#49 /www/wwwroot/www.wanmingwang.com/lecms/plugin/le_hl/lib/src/Foto.php
#50 /www/wwwroot/www.wanmingwang.com/lecms/plugin/le_hl/lib/src/util/FotoUtil.php
#51 /www/wwwroot/www.wanmingwang.com/lecms/plugin/le_hl/lib/src/FotoFestival.php
#52 /www/wwwroot/www.wanmingwang.com/lecms/plugin/le_hl/lib/src/EightChar.php
#53 /www/wwwroot/www.wanmingwang.com/lecms/plugin/le_hl/lib/src/JieQi.php
#54 /www/wwwroot/www.wanmingwang.com/lecms/plugin/le_hl/lib/src/NineStar.php
#55 /www/wwwroot/www.wanmingwang.com/lecms/plugin/le_hl/lib/src/SolarMonth.php
#56 /www/wwwroot/www.wanmingwang.com/runcache/lecms_view/qm_pro,hl_index.htm.php
#57 /www/wwwroot/www.wanmingwang.com/runcache/lecms_model/kv_model.class.php
#58 /www/wwwroot/www.wanmingwang.com/runcache/lecms_model/category_model.class.php
#59 /www/wwwroot/www.wanmingwang.com/runcache/lecms_model/cms_content_model.class.php
#60 /www/wwwroot/www.wanmingwang.com/lecms/xiunophp/tpl/exception.php
其他信息
请求路径:
/huangli/2117-2-23.html
当前时间:
2026-04-10 16:36:30
当前网协:
216.73.216.168
运行时间:
0.4637
内存开销:
4.19 MB
Lecms 3.0.3