随着互联网的飞速发展,网站建设已经成为企业、个人展示形象、拓展业务的重要手段。DedeCMS作为国内领先的网站内容管理系统,凭借其强大的功能和良好的口碑,深受广大用户的喜爱。而Dedeinc插件则是DedeCMS的得力助手,它可以帮助用户轻松打造个性化网站,实现无限可能。本文将围绕DedeCMS Dedeinc展开,探讨其在网站建设中的应用及优势。
一、DedeCMS Dedeinc简介
DedeCMS Dedeinc是一款基于DedeCMS开发的插件,旨在为用户提供更多功能、更丰富的网站体验。它由众多开源插件组成,涵盖了网站内容、模板、功能等多个方面。通过安装和使用Dedeinc插件,用户可以轻松实现以下功能:
1. 扩展网站功能:Dedeinc插件提供了丰富的功能模块,如在线商城、论坛、投票、问卷调查等,满足不同用户的需求。
2. 美化网站界面:Dedeinc插件提供了丰富的模板资源,用户可以根据自己的喜好选择合适的模板,快速打造个性化网站。
3. 优化网站性能:Dedeinc插件可以帮助用户优化网站代码,提高网站加载速度,提升用户体验。
4. 增强网站安全:Dedeinc插件提供了安全防护功能,如防SQL注入、防止恶意攻击等,保障网站安全稳定运行。
二、DedeCMS Dedeinc应用案例
为了让大家更好地了解DedeCMS Dedeinc的应用,以下列举几个典型案例:
1. 企业官网:某企业通过安装Dedeinc插件,实现了产品展示、新闻发布、在线咨询等功能,有效提升了企业形象。
2. 教育机构:某教育机构利用Dedeinc插件搭建了在线课程平台,方便学生在线学习,提高了教学效果。
3. 电商平台:某电商平台通过安装Dedeinc插件,实现了商品展示、购物车、订单管理等功能,降低了运营成本。
4. 个人博客:某个人博客用户通过安装Dedeinc插件,打造了具有个性化风格的博客网站,吸引了大量粉丝。
三、DedeCMS Dedeinc优势
相比于其他网站建设工具,DedeCMS Dedeinc具有以下优势:
1. 功能强大:Dedeinc插件涵盖了网站建设的各个方面,满足用户多样化需求。
2. 易于上手:Dedeinc插件操作简单,用户无需具备专业技术即可轻松使用。
3. 免费开源:Dedeinc插件免费开源,用户可以自由下载、安装和使用。
4. 更新及时:Dedeinc插件团队会定期更新插件,确保用户使用到最新版本。
四、DedeCMS Dedeinc使用技巧
为了更好地发挥Dedeinc插件的作用,以下提供一些使用技巧:
1. 选择合适的插件:根据网站需求和功能,选择合适的Dedeinc插件。
2. 合理配置插件:安装插件后,根据实际情况进行配置,确保插件正常运行。
3. 定期更新插件:关注插件更新,及时更新插件版本,确保网站安全稳定运行。
4. 备份网站数据:在使用插件过程中,定期备份网站数据,以防意外情况发生。
DedeCMS Dedeinc作为一款优秀的网站建设工具,为广大用户提供了丰富的功能、便捷的操作和良好的用户体验。通过使用DedeCMS Dedeinc,用户可以轻松打造个性化网站,实现无限可能。相信在未来的发展中,DedeCMS Dedeinc将继续为用户提供更多优质服务,助力网站建设事业。
dedecms 列表点击加载更多读取数据库内容怎么实现
使用方法:
1、加载是用AJAX,需要先引用jQuery
2、模板在arcajax.php第二十八行请自行按需修改
3、arcajax.php放到plus目录下
HTML和js代码:
<divid=”loading27″>加载中</div>
<ahref=”javascript:;”id=”getMore”pnum=”2″class=”index-morebgwmt15″>浏览更多案例……</a>
<scripttype=”text/javascript”>
$(“#getMore”).click(function(){
var_this=$(this),
pnum=_this.attr(“pnum”),//分页码
typeid=1;//栏目ID
if(pnum==0){
returnfalse;
}
$(“#loading27”).show();
$.ajax({
url:'/plus/arcajax.php',
data:{typeid:typeid,pnum:pnum},
success:function(data){
if(data!=''){
$(“.index-list”).append(data);//数据显示到页面
_this.attr(“pnum”,Number(pnum)+1);//分页+1
}else{
_this.text(“没有更多的数据”);
_this.attr(“pnum”,0)
}
$(“#loading27”).hide();
}
})
returnfalse;
})
</script>
PHP代码(arcajax.php):
<?php
require_once(dirname(__FILE__).”/../include/common.inc.php”);
require_once(DEDEINC.'/channelunit.class.php');
require_once(DEDEINC.'/taglib/arcpagelist.lib.php');
$pnum=empty($pnum)?0:intval(preg_replace(“/[^\d]/”,'',$pnum));
$typeid=empty($typeid)?0:intval(preg_replace(“/[^\d]/”,'',$typeid));
if($typeid==0||$pnum==0)die(“RequestError!”);
if($typeid>0)
{
$titlelen=AttDef($titlelen,30);
$infolen=AttDef($infolen,160);
$imgwidth=AttDef($imgwidth,120);
$imgheight=AttDef($imgheight,120);
$listtype=AttDef($listtype,'all');
$arcid=AttDef($arcid,0);
$channelid=AttDef($channelid,0);
$orderby=AttDef($orderby,'default');
$orderWay=AttDef($order,'desc');
$subday=AttDef($subday,0);
$line=$row;
$artlist='';
//通过页面及总数解析当前页面数据范围
$strnum=($pnum-1)*12;
$limitsql=”LIMIT$strnum,12″;
$innertext='<li[field:globalname=”autoindex”runphp=”yes”]if(@me%3==0)@me=\'class=”mrnone”\';else@me=””;[/field:global]>
<div><ahref=”[field:arcurl/]”title=”[field:title/]”><imgsrc=”[field:litpic/]”width=”278″height=”245″></a></div>
<h3><ahref=”[field:arcurl/]”title=”[field:title/]”>[field:title/]</a></h3>
<p>[field:descriptionfunction=”cn_substr(@me,150)”/]</p>
<spanclass=”more”><ahref=”[field:arcurl/]”>浏览案例</a></span>
</li>';//模板
//处理列表内容项
$query=”SELECTarc.*,tp.typedir,tp.typename,tp.corank,tp.isdefault,tp.defaultname,tp.namerule,tp.namerule2,tp.ispart,
tp.moresite,tp.siteurl,tp.sitepathFROM`#@__archives`arcLEFTJOIN`#@__arctype`tpONarc.typeid=tp.id
WHEREarc.typeidIN(“.GetSonIds($typeid).”)ORDERBYarc.sortrankdesc$limitsql”;
$dsql->SetQuery($query);
$dsql->Execute('al');
$dtp2=newDedeTagParse();
$dtp2->SetNameSpace('field','[',']');
$dtp2->LoadString($innertext);
$GLOBALS['autoindex']=0;
$ids=array();
for($i=0;$i<12;$i++)
{
for($j=0;$j<1;$j++)
{
if($row=$dsql->GetArray(“al”))
{
$ids[]=$row['id'];
//处理一些特殊字段
$row['info']=$row['infos']=cn_substr($row['description'],$infolen);
$row['id']=$row['id'];
if($row['corank']>0&&$row['arcrank']==0)
{
$row['arcrank']=$row['corank'];
}
$row['filename']=$row['arcurl']=GetFileUrl($row['id'],$row['typeid'],$row['senddate'],$row['title'],$row['ismake'],
$row['arcrank'],$row['namerule'],$row['typedir'],$row['money'],$row['filename'],$row['moresite'],$row['siteurl'],$row['sitepath']);
$row['typeurl']=GetTypeUrl($row['typeid'],$row['typedir'],$row['isdefault'],$row['defaultname'],$row['ispart'],
$row['namerule2'],$row['moresite'],$row['siteurl'],$row['sitepath']);
if($row['litpic']=='-'||$row['litpic']=='')
{
$row['litpic']=$GLOBALS['cfg_cmspath'].'/images/defaultpic.gif';
}
if(!preg_match(“#^http:\/\/#”,$row['litpic'])&&$GLOBALS['cfg_multi_site']=='Y')
{
$row['litpic']=$GLOBALS['cfg_mainsite'].$row['litpic'];
}
$row['picname']=$row['litpic'];
$row['stime']=GetDateMK($row['pubdate']);
$row['typelink']=”<ahref='”.$row['typeurl'].”'>”.$row['typename'].”</a>”;
$row['image']=”<imgsrc='”.$row['picname'].”'border='0'width='$imgwidth'height='$imgheight'alt='”.preg_replace(“#['><]#”,””,$row['title']).”'>”;
$row['imglink']=”<ahref='”.$row['filename'].”'>”.$row['image'].”</a>”;
$row['fulltitle']=$row['title'];
$row['title']=cn_substr($row['title'],$titlelen);
if($row['color']!='')$row['title']=”<fontcolor='”.$row['color'].”'>”.$row['title'].”</font>”;
if(preg_match('#b#',$row['flag']))$row['title']=”<strong>”.$row['title'].”</strong>”;
//$row['title']=”<b>”.$row['title'].”</b>”;
$row['textlink']=”<ahref='”.$row['filename'].”'>”.$row['title'].”</a>”;
$row['plusurl']=$row['phpurl']=$GLOBALS['cfg_phpurl'];
$row['memberurl']=$GLOBALS['cfg_memberurl'];
$row['templeturl']=$GLOBALS['cfg_templeturl'];
if(is_array($dtp2->CTags))
{
foreach($dtp2->CTagsas$k=>$ctag)
{
if($ctag->GetName()=='array')
{
//传递整个数组,在runphp模式中有特殊作用
$dtp2->Assign($k,$row);
}else{
if(isset($row[$ctag->GetName()]))$dtp2->Assign($k,$row[$ctag->GetName()]);
else$dtp2->Assign($k,'');
}
}
$GLOBALS['autoindex']++;
}
$artlist.=$dtp2->GetResult().”
“;
}//ifhasRow
else{
$artlist.='';
}
}//LoopCol
}//loopline
$dsql->FreeResult(“al”);
}else
{
die(“RequestError!”);
}
AjaxHead();
echo$artlist;
exit();
dedecms织梦程序首页如何去除index.html
DEDECMS织梦CMS建站程序用户会发现,输入地址后,而打开的实际地址后面有个index.html,下面飞花如梦就和大家一起分享下这个问题的两种解决方法:
1、把网站默认首页index.html放到index.php前面,这样它自动读到index.html就不会跳转了
2、把DEDECMS的index.php更改为
<?php//自动生成HTML版 require_once(dirname(__FILE__).”/include/common.inc.php”); require_once DEDEINC.”/arc.partview.class.php”;$GLOBALS['_arclistEnv']='index';$row=$dsql->GetOne(“Select* From `#@__homepageset`”);$row['templet']= MfTemplet($row['templet']);$pv= new PartView();$pv->SetTemplet($cfg_basedir.$cfg_templets_dir.”/”.$row['templet']);$pv->SaveToHtml(dirname(__FILE__).'/index.html'); include(dirname(__FILE__).'/index.html'); exit();?>
<?php
//自动生成HTML版
require_once(dirname(__FILE__).”/include/common.inc.php”);
require_once DEDEINC.”/arc.partview.class.php”;
$GLOBALS['_arclistEnv']='index';
$row=$dsql->GetOne(“Select* From `#@__homepageset`”);
$row['templet']= MfTemplet($row['templet']);
$pv= new PartView();
$pv->SetTemplet($cfg_basedir.$cfg_templets_dir.”/”.$row['templet']);
$pv->SaveToHtml(dirname(__FILE__).'/index.html');
include(dirname(__FILE__).'/index.html');
exit();
?>
4
其实主要就是把那段301定向代码删除
header(‘HTTP/1.1 301 Moved Permanently’);
header(‘Location:index.html’);
以上两种方法绝对能解决dedecms首页地址不带index.html。
dedecms如何去掉首页index.html的方法
dedecms如何去掉首页index.html出现的原因是动态PHP转换为静态html的原因,去除方法如下:
第一种、伪静态设置代码,具体操作如下:
在主机里面找到伪静态文件.htaccess,下载到本地,用编辑器打开,在里面加入以下代码DirectoryIndex index.html index.php index.htm然后在上传至主机。
第二种、在网站虚拟主机里面把网站默认首页index.html放到index.php前面,具体如下图:




