POST TIME:2017-10-26 20:28
第一步調(diào)用隨機(jī)文章:
織夢(mèng)給出了隨機(jī)文章調(diào)用的參數(shù)如下:
{dede:arclist sort=’rand’ titlelen=48 row=16}
<li><a href="[field:arcurl/]" title="[field:title/]" target="_blank">[field:title/]</a></li>
{/dede:arclist}
第二步設(shè)置定時(shí)自動(dòng)更新文件:
復(fù)制下面代碼,粘貼到一個(gè)新文件中,命名為: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;//自動(dòng)更新時(shí)間,單位為秒,這里我設(shè)為一小時(shí),大家可以自行更改。 $fpath = "../data/last_time.inc";//記錄更新時(shí)間文件,如果不能達(dá)到目的,請(qǐng)檢查是否有讀取權(quán)限。 include( $fpath ); if( empty($last_time)) $last_time = 0; if( sp_input($_GET['renew'])=="now") $last_time = 0; if((time()-$last_time)>=$autotime ) { define('DEDEADMIN', ereg_replace("[/\\]{1,}",'/',dirname(__FILE__) ) ); require_once