phpcms更新首页
发布时间:2021-12-17 10:43 所属栏目:19 来源:互联网
导读:html.class.php /** * 更新首页 */ public function index() { if($this-siteid==1) { $file = PHPCMS_PATH.index.html; //添加到发布点队列 $this-queue-add_queue(edit,/index.html,$this-siteid); } else { $site_dir = $this-sitelist[$this-siteid][dirn
html.class.php /** * 更新首页 */ public function index() { if($this->siteid==1) { $file = PHPCMS_PATH.'index.html'; //添加到发布点队列 $this->queue->add_queue('edit','/index.html',$this->siteid); } else { $site_dir = $this->sitelist[$this->siteid]['dirname']; $file = $this->html_root.'/'.$site_dir.'/index.html'; //添加到发布点队列 $this->queue->add_queue('edit',$file,$this->siteid); $file = PHPCMS_PATH.$file; } define('SITEID', $this->siteid); //SEO $SEO = seo($this->siteid); $siteid = $this->siteid; $CATEGORYS = $this->categorys; $style = $this->sitelist[$siteid]['default_style']; ob_start(); include template('content','index',$style); return $this->createhtml($file, 1); } queue_model.class.php /** * 添加同步队列 * @param string $type 操作类型{add:添加,edit:修改,del:删除} * @param string $path 文档地址 * @param integer $siteid 站点ID */ final public function add_queue($type = 'add', $path, $siteid = '') { if (empty($siteid)) $siteid = get_siteid(); $sites = pc_base::load_app_class('sites', 'admin'); $site = $sites->get_by_id($siteid); if (empty($site['release_point'])) return false; if ($r = $this->get_one(array('type'=>$type, 'path'=>$path, 'siteid'=>$siteid), 'id')) { if ($this->update(array('status1'=>'0', 'status2'=>'0', 'status3'=>'0', 'status4'=>'0', 'times'=>SYS_TIME), array('id'=>$r['id']))) { return true; } else { return false; } } else { if ($this->insert(array('type'=>$type, 'path'=>$path, 'siteid'=>$siteid, 'times'=>SYS_TIME))) { return true; } else { return false; } } } (编辑:ASP站长网) |
相关内容
网友评论
推荐文章
热点阅读