首页 > CMS建站 > PhpCMS > 正文

phpcms更新首页

2020-10-10 21:40:06
字体:
来源:转载
供稿:网友
  1. html.class.php  
  2.  
  3. /**
  4. * 更新首页  
  5. */ 
  6. public function index() {  
  7. if($this->siteid==1) {  
  8. $file = PHPCMS_PATH.'index.html';  
  9. //添加到发布点队列  
  10. $this->queue->add_queue('edit','/index.html',$this->siteid);  
  11. else {  
  12. $site_dir = $this->sitelist[$this->siteid]['dirname'];  
  13. $file = $this->html_root.'/'.$site_dir.'/index.html';  
  14. //添加到发布点队列  
  15. $this->queue->add_queue('edit',$file,$this->siteid);  
  16. $file = PHPCMS_PATH.$file;  
  17. }  
  18. define('SITEID', $this->siteid);  
  19. //SEO  
  20. $SEO = seo($this->siteid);  
  21. $siteid = $this->siteid;  
  22. $CATEGORYS = $this->categorys;  
  23. $style = $this->sitelist[$siteid]['default_style'];  
  24. ob_start();  
  25. include template('content','index',$style);  
  26. return $this->createhtml($file, 1);  
  27. }  
  28.  
  29.    
  30.  
  31. queue_model.class.php  
  32.  
  33. /**
  34. * 添加同步队列  
  35. * @param string $type 操作类型{add:添加,edit:修改,del:删除}  
  36. * @param string $path 文档地址  
  37. * @param integer $siteid 站点ID  
  38. */ 
  39. final public function add_queue($type = 'add', $path, $siteid = '') {  
  40. if (empty($siteid)) $siteid = get_siteid();  
  41. $sites = pc_base::load_app_class('sites''admin');  
  42. $site = $sites->get_by_id($siteid);  
  43. if (empty($site['release_point'])) return false;  
  44.  
  45. if ($r = $this->get_one(array('type'=>$type, 'path'=>$path, 'siteid'=>$siteid), 'id')) {  
  46. if ($this->update(array('status1'=>'0''status2'=>'0''status3'=>'0''status4'=>'0''times'=>SYS_TIME), array('id'=>$r['id']))) {  
  47. return true;  
  48. else {  
  49. return false;  
  50. }  
  51. else {  
  52. if ($this->insert(array('type'=>$type, 'path'=>$path, 'siteid'=>$siteid, 'times'=>SYS_TIME))) {  
  53. return true;  
  54. else {  
  55. return false;  
  56. }  
  57. }  

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表