導讀:織夢技巧織夢技巧第一步調用隨機文章: 織夢模板 給出了隨機文章調用的參數如下: {dede:arclist sort=rand titlelen=48 row=16}lia h網站推廣優化seoseo網站優化培訓。
第一步調用隨機文章: 織夢模板 給出了隨機文章調用的參數如下: {dede:arclist sort=rand titlelen=48 row=16}lia href=[field:arcurl/] title=[field:title/] target=_blank[field:title/]/a/li{/dede:arclist} 第二步設置 […]
第一步調用隨機文章:
織夢模板給出了隨機文章調用的參數如下:
{dede:arclist sort=’rand’ titlelen=48 row=16}<li><a href="[field:arcurl/]" title="[field:title/]" target="_blank">[field:title/]</a></li>{/dede:arclist}
第二步設置定時自動更新文件:
復制下面代碼,粘貼到一個新文件中,命名為:autoindex.php,上傳到ftp的plus文件夾中:
<?php function sp_input( $text ) { $text = trim( $text ); $text = htmlspecialchars( $text ); if (!get_magic_quotes_gpc()) return addslashes( $text ); else return $text; } $autotime = 3600;//自動更新時間,單位為秒,這里我設為一小時,大家可以自行更改。 $fpath = "../data/last_time.inc";//記錄更新網站建設制作時間文件,如果不能達到目的,請檢查是否有讀取權限。 include( $fpath ); if( empty($last_time)) $last_time = 0; if( sp_input($_GET['renew'])=="now") $last_time = 0; if((time()-$last_time)>=$autotime ) { define('DED網站建設EADMIN', ereg_replace("[/\\]{1,}",'/',dirname(__FILE網站seo優化診斷工具__) ) ); require_once相關網站推廣優化seoseo網站優化培訓。
關鍵詞標簽: 首頁 織夢 自動更新
聲明: 本文由我的SEOUC技術文章主頁發布于:2023-05-26 ,文章織夢dedecms首頁調用隨機文章實現自動更新織夢技主要講述首頁,自動更新,織夢網站建設源碼以及服務器配置搭建相關技術文章。轉載請保留鏈接: http://www.bifwcx.com/article/web_8942.html