首页站内杂志技术文摘
文章内容页

帝国CMS自动刷新首页自定义列表的方法

  • 作者:雨祺
  • 来源: 原创
  • 发表于2024-06-02 20:35:21
  • 被阅读0
  • 体实现方法如下:
    在首页模板中加入下面代码,尽量放在底部.
    代码如下:
    <script language=”javascript” type=”text/javascript” src=”/e/htmlindex/index_html.php”></script>
    在 /e/ 建立文件夹 htmlindex 并设置 777权限,将下面代码保存在 /e/htmlindex/index_html.php
    代码如下:
    1. <?php 
    2. require("../class/connect.php"); 
    3. include("../class/db_sql.php"); 
    4. include("../config/config.php"); 
    5. include("../class/functions.php"); 
    6. include("../class/t_functions.php"); 
    7. require LoadLang("pub/fun.php"); 
    8. require("../data/dbcache/class.php"); 
    9. require("../data/dbcache/MemberLevel.php"); 
    10. include("../class/chtmlfun.php"); 
    11. $link=db_connect(); 
    12. $empire=new mysqlquery(); 
    13. //更新首页 
    14. $indextemp=GetIndextemp();//取得模板 
    15. NewsBq($classid,$indextemp,1,0); 
    16. insert_dolog("");//操作日志 
    17. //跟新自定义列表 
    18. $b=0; 
    19. $sql=$empire->query("select listid,pagetitle,filepath,filetype,totalsql,listsql,maxnum,lencord,listtempid,pagekeywords,pagedescription from {$dbtbpre}enewsuserlist where listid>0 order by listid limit ".$public_r['reuserlistnum']); 
    20. while($r=$empire->fetch($sql)) 
    21.     $b=1; 
    22.     $newstart=$r[listid]; 
    23.     ReUserlist($r,""); 
    24. echo '更新首页,自定义列表页成功'
    25. db_close(); 
    26. ?> 
    然后在宝塔的计划任务中设置好定时访问这个连接即可。
    【审核人:站长】

        标题:帝国CMS自动刷新首页自定义列表的方法

        本文链接:https://www.meiweny.cn/zazhi/zhongwangjiaocheng/981.html

        赞一下

        深度阅读

        • 您也可以注册成为美文苑的作者,发表您的原创作品、分享您的心情!

        阅读记录

          关注美文苑