POST TIME:2017-10-26 20:28
第一步調用隨機文章:
織夢給出了隨機文章調用的參數如下:
{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('DEDEADMIN', ereg_replace("[/\\]{1,}",'/',dirname(__FILE__) ) ); require_once