织梦模板顶一下踩一下调用方法,DEDE技术
导读:DEDE技术DEDE技术织梦仿站时,在内容页模板经常会用到顶一下踩一下调用,调用方法很简单,主要就是js和dede代码,调dede模板安装。
织梦仿站时,在内容页模板经常会用到顶一下踩一下调用,调用方法很简单,主要就是js和dede代码,调用方法如下:
需要调用代码:
1、在织梦文章模板<head></head>中调用js代码,如下dede免费模板: <script language="javascript" type="text/javascript"
src="{dede:global.cfg_cmsurl/}/include/dedeajax2.js"></script> <script language="javascript" type="text/javascript"> <!-- function CheckLogin(){ var taget_obj = document.getElementById('_ajax_feedback'); myajax = new DedeAjax(taget_obj,false,false,'','',''); myajax.SendGet2("{dede:global.cfg_cmsurl/}/member/ajax_feedback.php"); DedeXHTTP = null; } function postBadGood(ftype,fid) { var taget_obj = document.getElementById(ftype+fid); var saveid = GetCookie('badgoodid'); if(saveid != null) { var saveids = saveid.split(','); var hasid = false; saveid = ''; j = 1; for(i=saveids.length-1;i>=0;i--) { if(saveids[i]==fid && hasid) continue; else { if(saveids[i]==fid && !hasid) hasid = true; saveid += (saveid=='' ? saveids[i] : ','+saveids[i]); j++; if(j==10 && hasid) break; if(j==9 && !hasid) break; } } if(hasid) { alert('您刚才已表决过了喔!'); return false;} else saveid += ','+fid; SetCookie('badgoodid',saveid,1); } else { SetCookie('badgoodid',fid,1); } myajax = new DedeAjax(taget_obj,false,false,'','',''); myajax.SendGet2("{dede:field name='phpurl'/}/feedback.php?aid="+fid+"&action="+ftype+"&fid="+fid); } function postDigg(ftype,aid) { var taget_obj = document.getElementById('newdigg'); var saveid = GetCookie('diggid'); if(saveid != null) { var saveids = saveid.split(','); var hasid = false; saveid = ''; j = 1; for(i=saveids.length-1;i>=0;i--) { if(saveids[i]==aid && hasid) continue; else { if(saveids[i]==aid && !hasid) hasid = true; saveid += (saveid=='' ? saveids[i] : ','+saveids[i]); j++; if(j==20 && hasid) break; if(j==19 && !hasid) break; } } if(hasid) { alert("您已经顶过该帖,请不要重复顶帖 !"); return; } else saveid += ','+aid; SetCookie('diggid',saveid,1); } else { SetCookie('diggid',aid,1); } myajax = new DedeAjax(taget_obj,false,false,'','',''); var url = "{dede:global.cfg_phpurl/}/digg_ajax.php?action="+ftype+"&id="+aid; myajax.SendGet2(url); } function getDigg(aid) { var taget_obj = document.getElementById('newdigg'); myajax = new DedeAjax(taget_obj,false,false,'','',''); myajax.SendGet2("{dede:global.cfg_phpurl/}/digg_ajax.php?id="+aid); DedeXHTTP = null; } --> </script>
声明: 本文由我的SEOUC技术文章主页发布于:2023-07-19 ,文章织梦模板顶一下踩一下调用方法,DEDE技术主要讲述模板,标签,织梦网站建设源码以及服务器配置搭建相关技术文章。转载请保留链接: https://www.seouc.com/article/web_31095.html