織夢(mèng)實(shí)現(xiàn)自動(dòng)更新主頁(yè)功能的方法?這個(gè)問(wèn)題可能是我們?nèi)粘W(xué)習(xí)或工作經(jīng)常見(jiàn)到的。希望通過(guò)這個(gè)問(wèn)題能讓你收獲頗深。下面是小編給大家?guī)?lái)的參考內(nèi)容,讓我們一起來(lái)看看吧!
創(chuàng)新互聯(lián)公司服務(wù)項(xiàng)目包括上虞網(wǎng)站建設(shè)、上虞網(wǎng)站制作、上虞網(wǎng)頁(yè)制作以及上虞網(wǎng)絡(luò)營(yíng)銷(xiāo)策劃等。多年來(lái),我們專(zhuān)注于互聯(lián)網(wǎng)行業(yè),利用自身積累的技術(shù)優(yōu)勢(shì)、行業(yè)經(jīng)驗(yàn)、深度合作伙伴關(guān)系等,向廣大中小型企業(yè)、政府機(jī)構(gòu)等提供互聯(lián)網(wǎng)行業(yè)的解決方案,上虞網(wǎng)站推廣取得了明顯的社會(huì)效益與經(jīng)濟(jì)效益。目前,我們服務(wù)的客戶(hù)以成都為中心已經(jīng)輻射到上虞省份的部分城市,未來(lái)相信會(huì)繼續(xù)擴(kuò)大服務(wù)區(qū)域并繼續(xù)獲得客戶(hù)的支持與信任!
織夢(mèng)如何實(shí)現(xiàn)自動(dòng)更新主頁(yè)功能?
推薦學(xué)習(xí):織夢(mèng)cms
織夢(mèng)DEDECMS實(shí)現(xiàn)自動(dòng)更新主頁(yè)功能
<?php require_once (dirname(__FILE__) . "/../include/common.inc.php"); $row = $dsql->GetOne("Select uptime From `cmsxx_arccache` where md5hash = 'autonew';"); if(!is_array($row)) exit(autonew(5)); $interval=60; //時(shí)間 秒 if(time() - $row['uptime'] < $interval ) exit(); autonew($no); function machom($no=''){ define('DEDEADMIN', ereg_replace("[/\\]{1,}",'/',dirname(__FILE__) ) ); require_once(dirname(__FILE__)."/../include/common.inc.php"); require_once(dirname(__FILE__)."/../include/arc.partview.class.php"); $dsql = new DedeSql(false); $row = $dsql->GetOne("Select * From cmsxx_homepageset"); $dsql->Close(); $templet=$row['templet']; $position=$row['position']; $homeFile = DEDEADMIN."/".$position; $homeFile = str_replace("\\","/",$homeFile); $homeFile = str_replace("//","/",$homeFile); $templet = str_replace("{style}",$cfg_df_style,$templet); $pv = new PartView(); $GLOBALS['_arclistEnv'] = 'index'; $pv->SetTemplet($cfg_basedir.$cfg_templets_dir."/".$templet); $pv->SaveToHtml($homeFile); } function autonew($no=''){ global $dsql; $sql = "SELECT id FROM `cmsxx_archives` where arcrank <>'0' limit $no ;"; $dsql->SetQuery($sql); $dsql->Execute(); while($row = $dsql->GetArray()){ $id = $row['id']; $time = time() - rand(0,$interval * 10); $dsql->ExecuteNoneQuery("Update `cmsxx_arctiny` set `arcrank`='0', `sortrank`='$time' where id = '$id';"); $dsql->ExecuteNoneQuery("Update `cmsxx_archives` set `arcrank`='0', `sortrank`='$time', `pubdate`='$time' where id = '$id';"); } machom($no); $dsql->ExecuteNoneQuery("Update `cmsxx_arccache` set `uptime`=".time()." where md5hash = 'autonew'"); } ?>
感謝各位的閱讀!看完上述內(nèi)容,你們對(duì)織夢(mèng)實(shí)現(xiàn)自動(dòng)更新主頁(yè)功能的方法大概了解了嗎?希望文章內(nèi)容對(duì)大家有所幫助。如果想了解更多相關(guān)文章內(nèi)容,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道。
文章標(biāo)題:織夢(mèng)實(shí)現(xiàn)自動(dòng)更新主頁(yè)功能的方法
文章URL:http://www.muchs.cn/article2/ihehoc.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供定制開(kāi)發(fā)、品牌網(wǎng)站建設(shè)、面包屑導(dǎo)航、網(wǎng)站排名、手機(jī)網(wǎng)站建設(shè)、Google
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶(hù)投稿、用戶(hù)轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀(guān)點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話(huà):028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)