织梦实现自动更新主页功能的方法
织梦实现自动更新主页功能的方法?这个问题可能是我们日常学习或工作经常见到的。希望通过这个问题能让你收获颇深。下面是小编给大家带来的参考内容,让我们一起来看看吧!

创新互联公司服务项目包括上虞网站建设、上虞网站制作、上虞网页制作以及上虞网络营销策划等。多年来,我们专注于互联网行业,利用自身积累的技术优势、行业经验、深度合作伙伴关系等,向广大中小型企业、政府机构等提供互联网行业的解决方案,上虞网站推广取得了明显的社会效益与经济效益。目前,我们服务的客户以成都为中心已经辐射到上虞省份的部分城市,未来相信会继续扩大服务区域并继续获得客户的支持与信任!
织梦如何实现自动更新主页功能?
推荐学习:织梦cms
织梦DEDECMS实现自动更新主页功能
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'");
}
?>感谢各位的阅读!看完上述内容,你们对织梦实现自动更新主页功能的方法大概了解了吗?希望文章内容对大家有所帮助。如果想了解更多相关文章内容,欢迎关注创新互联行业资讯频道。
当前名称:织梦实现自动更新主页功能的方法
当前路径:http://www.jxjierui.cn/article/ihehoc.html


咨询
建站咨询
