内射老阿姨1区2区3区4区_久久精品人人做人人爽电影蜜月_久久国产精品亚洲77777_99精品又大又爽又粗少妇毛片

如何設(shè)置網(wǎng)站首頁(yè)隨機(jī)文章板塊自動(dòng)更新

2021-04-21    分類: 網(wǎng)站建設(shè)

使用織夢(mèng)的朋友都知道首頁(yè)添加完隨機(jī)文章板塊后不會(huì)實(shí)現(xiàn)自動(dòng)更新,那怎樣才能實(shí)現(xiàn)隨機(jī)文章自動(dòng)更新呢?

第一步、復(fù)制下面紅色部分內(nèi)容到記事本,完成后,另存為名稱為autoindex.php的文件,并將其上傳到織夢(mèng)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(DEDEADMIN."/../include/common.inc.php");
require_once(DEDEINC."/arc.partview.class.php");
/*
$row = $dsql->GetOne("Select * From dede_homepageset");
$dsql->Close();
$templet=$row['templet'];
$position=$row['position'];
*/
$templet = “tnbjh/index.htm”;
$position = "../index.html";
$homeFile = dirname(__FILE__)."/".$position;
$homeFile = str_replace("\\", "/", $homeFile );
$homeFile = str_replace( "http://", "/", $homeFile );
$pv = new PartView();
$pv ->SetTemplet( $cfg_basedir.$cfg_templets_dir."/".$templet );
$pv -> SaveToHtml( $homeFile );
$pv -> Close();
$file = fopen( $fpath, "w");
fwrite( $file, "<?php\");
fwrite( $file,"\$last_time=".time().";\");
fwrite( $file, '?>' );
fclose( $file );
}
?>
  第二步、登錄織夢(mèng)后臺(tái),在head.htm文件中加入下面代碼,我加在了<!-- //header -->前面
<script src="/plus/autoindex.php" language="javascript"></script>

溫馨提示:千萬(wàn)不要上傳到錯(cuò)誤位置,否則會(huì)調(diào)用不成功!

標(biāo)題名稱:如何設(shè)置網(wǎng)站首頁(yè)隨機(jī)文章板塊自動(dòng)更新
轉(zhuǎn)載來(lái)源:http://www.rwnh.cn/news10/109210.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供全網(wǎng)營(yíng)銷推廣、用戶體驗(yàn)外貿(mào)網(wǎng)站建設(shè)、網(wǎng)站改版、手機(jī)網(wǎng)站建設(shè)、微信小程序

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

猜你還喜歡下面的內(nèi)容

商城網(wǎng)站建設(shè)

網(wǎng)站建設(shè)知識(shí)

同城分類信息

慈溪市| 勐海县| 台东市| 神池县| 浏阳市| 府谷县| 慈利县| 黑龙江省| 北碚区| 沧州市| 连南| 乾安县| 蓝山县| 德昌县| 丽水市| 石家庄市| 襄城县| 长顺县| 临邑县| 涟源市| 文登市| 昭苏县| 潍坊市| 章丘市| 淮阳县| 伊通| 左贡县| 资源县| 革吉县| 忻州市| 东源县| 玉田县| 镇巴县| 鄢陵县| 洛扎县| 富民县| 青河县| 秦皇岛市| 六枝特区| 湛江市| 固始县|