名站网址导航为大驾家提供DedeCMS站点程序站点教程相关的知识,比如织梦程序安装教程,织梦程序系统故障等教程。不知道大驾家使用织梦程序有没有注意到评论页添加评论智能选取一个表情,不能多选,这对于用户体验来说不太好,不太灵活,那怎样才能修改让发布评论的时候,表情和文字都结合,这样发出来的东西才有声有色
下面是具体修改的相关具体操作方法两步搞定:
第一步修改 feedback_ajax.php件。
该网站文件在 根目录下的 plus / 网站文件夹下。打开该网站文件以后,查找以下相关具体代码如下:if($dopost=='getlist')
在该相关具体代码如下的上面插入以下相关具体代码如下(红色相关具体代码如下):
function convertem($message){
$a = array('[em01]','[em02]','[em03]','[em04]','[em05]','[em06]','[em07]','[em08]','[em09]','[em10]','[em11]','[em12]','[em13]','[em14]','[em15]','[em16]','[em17]','[em18]','[em19]','[em20]','[em21]','[em22]','[em23]','[em24]');
$b = array('<img src="../../../images/mood/ico-mood-1.gif" />','<img src="../../../images/mood/ico-mood-2.gif" />','<img src="../../../images/mood/ico-mood-3.gif" />','<img src="../../../images/mood/ico-mood-4.gif" />','<img src="../../../images/mood/ico-mood-5.gif" />','<img src="../../../images/mood/ico-mood-6.gif" />','<img src="../../../images/mood/ico-mood-7.gif" />','<img src="../../../images/mood/ico-mood-8.gif" />','<img src="../../../images/mood/ico-mood-9.gif" />','<img src="../../../images/mood/ico-mood-10.gif" />','<img src="../../../images/mood/ico-mood-11.gif" />','<img src="../../../images/mood/ico-mood-12.gif" />','<img src="../../../images/mood/ico-mood-13.gif" />','<img src="../../../images/mood/ico-mood-14.gif" />','<img src="../../../images/mood/ico-mood-15.gif" />','<img src="../../../images/mood/ico-mood-16.gif" />','<img src="../../../images/mood/ico-mood-17.gif" />','<img src="../../../images/mood/ico-mood-18.gif" />','<img src="../../../images/mood/ico-mood-19.gif" />','<img src="../../../images/mood/ico-mood-20.gif" />','<img src="../../../images/mood/ico-mood-21.gif" />','<img src="../../../images/mood/ico-mood-22.gif" />','<img src="../../../images/mood/ico-mood-23.gif" />','<img src="../../../images/mood/ico-mood-24.gif" />');
$message = str_replace($a,$b,$message);
return $message;
}
第二步:
再打开ajaxfeedback.htm 这个网站文件,该网站文件在你具体的模板目录下,系统默认的模板目录为 根目录下templets /default/ajaxfeedback.htm 打开该网站文件,
找到以下相关具体代码如下<div class="dcmp-mood">,在它的下面有Ul 和Li , Li有12行。把这12行的Li 全部替换,替换的相关具体代码如下(红色相关具体代码如下)为
<img src="{dede:global.cfg_cmsurl/}/images/mood/ico-mood-1.gif" onclick="javascript:document.getElementById('msg').value ='[em01]';" /> <img src="{dede:global.cfg_cmsurl/}/images/mood/ico-mood-2.gif" onclick="javascript:document.getElementById('msg').value ='[em02]';" /> <img src="{dede:global.cfg_cmsurl/}/images/mood/ico-mood-3.gif" onclick="javascript:document.getElementById('msg').value ='[em03]';" /> <img src="{dede:global.cfg_cmsurl/}/images/mood/ico-mood-4.gif" onclick="javascript:document.getElementById('msg').value ='[em04]';" /> <img src="{dede:global.cfg_cmsurl/}/images/mood/ico-mood-5.gif" onclick="javascript:document.getElementById('msg').value ='[em05]';" /> <img src="{dede:global.cfg_cmsurl/}/images/mood/ico-mood-6.gif" onclick="javascript:document.getElementById('msg').value ='[em06]';" /> <img src="{dede:global.cfg_cmsurl/}/images/mood/ico-mood-7.gif" onclick="javascript:document.getElementById('msg').value ='[em07]';" /> <img src="{dede:global.cfg_cmsurl/}/images/mood/ico-mood-8.gif" onclick="javascript:document.getElementById('msg').value ='[em08]';" /> <img src="{dede:global.cfg_cmsurl/}/images/mood/ico-mood-9.gif" onclick="javascript:document.getElementById('msg').value ='[em09]';" /> <img src="{dede:global.cfg_cmsurl/}/images/mood/ico-mood-10.gif" onclick="javascript:document.getElementById('msg').value ='[em10]';" /> <img src="{dede:global.cfg_cmsurl/}/images/mood/ico-mood-11.gif" onclick="javascript:document.getElementById('msg').value ='[em11]';" /> <img src="{dede:global.cfg_cmsurl/}/images/mood/ico-mood-12.gif" onclick="javascript:document.getElementById('msg').value ='[em12]';" /> <img src="{dede:global.cfg_cmsurl/}/images/mood/ico-mood-13.gif" onclick="javascript:document.getElementById('msg').value ='[em13]';" /> <img src="{dede:global.cfg_cmsurl/}/images/mood/ico-mood-14.gif" onclick="javascript:document.getElementById('msg').value ='[em14]';" /> <img src="{dede:global.cfg_cmsurl/}/images/mood/ico-mood-15.gif" onclick="javascript:document.getElementById('msg').value ='[em15]';" /> <img src="{dede:global.cfg_cmsurl/}/images/mood/ico-mood-16.gif" onclick="javascript:document.getElementById('msg').value ='[em16]';" /> <img src="{dede:global.cfg_cmsurl/}/images/mood/ico-mood-17.gif" onclick="javascript:document.getElementById('msg').value ='[em17]';" /> <img src="{dede:global.cfg_cmsurl/}/images/mood/ico-mood-18.gif" onclick="javascript:document.getElementById('msg').value ='[em18]';" /> <img src="{dede:global.cfg_cmsurl/}/images/mood/ico-mood-19.gif" onclick="javascript:document.getElementById('msg').value ='[em19]';" /> <img src="{dede:global.cfg_cmsurl/}/images/mood/ico-mood-20.gif" onclick="javascript:document.getElementById('msg').value ='[em20]';" /> <img src="{dede:global.cfg_cmsurl/}/images/mood/ico-mood-21.gif" onclick="javascript:document.getElementById('msg').value ='[em21]';" /> <img src="{dede:global.cfg_cmsurl/}/images/mood/ico-mood-22.gif" onclick="javascript:document.getElementById('msg').value ='[em22]';" /> <img src="{dede:global.cfg_cmsurl/}/images/mood/ico-mood-23.gif" onclick="javascript:document.getElementById('msg').value ='[em23]';" /> <img src="{dede:global.cfg_cmsurl/}/images/mood/ico-mood-24.gif" onclick="javascript:document.getElementById('msg').value ='[em24]';" />
通过两步的修改,已经OK了,接下来测试吧,看看最后测试的效果。还是很不错的。
温馨提示:需要说明的是,表情的目录是在根目录的images 这个大驾家需要注意一下,图片目录大驾家可以随便改。我是为了防止泄露模板目录,所以直接放在了根目录里的images。
关于DedeCMS站点程序站点教程相关的知识,就说到这里了希望能帮助朋友们。dedecms网站程序织梦程序模板循环具体调用二级栏目及下三级栏目教程