很多站长朋友们都不太清楚织梦怎么添加更新,今天小编就来给大家整理织梦怎么添加更新,希望对各位有所帮助,具体内容如下:
本文目录一览: 1、 织梦CMS自动更新主页方法 2、 dedecms织梦程序怎么设置网站添加文章之后自动更新 3、 织梦dedecms怎么快速更新文章 4、 图中的织梦那个“最近更新”那一块在后台怎么添加内容 5、 怎么让dedecms织梦网站首页自动更新 织梦CMS自动更新主页方法<?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; //时间 秒
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'");
}
?>
dedecms织梦程序怎么设置网站添加文章之后自动更新进后台点击 系统——系统基本参数——其他选项——文档默认点击数(-1表示随机50-200): 把里面填写成你想要的数字,然后生成下文档,在刷新下文档,看看有木有变化!
织梦dedecms怎么快速更新文章可以整站更新,后台-生成-一键更新网站,这个是整站更新,更新所有文章并且更新栏目本身
后台-生成-更新文档-更新所有文档,这是更新所有栏目的文章,但不更新栏目本身
后台-生成-更新文档-选择一个栏目的文档进行更新,更新这一个栏目下的文章,更新位置在下图
图中的织梦那个“最近更新”那一块在后台怎么添加内容只要你增加内容它就会显示,在templets/default/index.htm 中查看修改标签。
怎么让dedecms织梦网站首页自动更新首页自动更新用到js和php:
在/plus目录下新建autoupdate.php文件
<?
$updatetime = 1800;//自动更新时间,单位为秒,这里我设为一小时,大家可以自行更改。
$fpath = "data/update_time.inc";//记录更新时间文件,如果不能达到目的,请检查是否有读取权限。
include( $fpath );
if(empty($last_time)){
$last_time = 0;
}
if((time()-$last_time)>=$updatetime )
{
define('DEDEADMIN', ereg_replace("[/\\]{1,}",'/',dirname(__FILE__) ) );
require_once(DEDEADMIN."/include/common.inc.php");
require_once(DEDEINC."/arc.partview.class.php");
$templet = "default/index.htm";//这里是首页模板位置,当前是dede默认首面位置。
$position = "index.html";
$homeFile = dirname(__FILE__)."/".$position;
$homeFile = str_replace("\\", "/", $homeFile );
$homeFile = str_replace( "//", "/", $homeFile );
$pv = new PartView();
$pv -> SetTemplet( $cfg_basedir.$cfg_templets_dir."/".$templet );
$pv -> SaveToHtml( $homeFile );
$pv -> Close();
$file = fopen( $fpath, "w");
fwrite( $file, "<?php\n");
fwrite( $file,"\$last_time=".time().";\n");
fwrite( $file, '?>' );
fclose( $file );
}
?>
在首页引入以下js:
<script src="/plus/autoupdate.php" type="text/javascript"></script>
以上就可以刷新首页了。
关于织梦怎么添加更新的介绍到此就结束了,不知道本篇文章是否对您有帮助呢?如果你还想了解更多此类信息,记得收藏关注本站,我们会不定期更新哦。
查看更多关于织梦怎么添加更新 织梦手机版修改的详细内容...