A5下载程序插件

分类分类

心情评论插件 for DedeCMS5.3

心情评论插件 for DedeCMS5.3

v2.53

大小:34 KB更新:2010/09/08

类别:dedecms插件系统:Linux/2003/PHP

立即下载

 使用方法:
 将压缩包内的文件上传到DEDE的安装目录中,
 然后在后台SQL命令运行器中运行(记得要把DEDE替换为你安装时设置的表前缀)
CREATE TABLE `dede_mood` (
  `id` int(11) NOT NULL auto_increment,
  `aid` int(11) NOT NULL,
  `mood1` int(10) NOT NULL default '0',
  `mood2` int(10) NOT NULL default '0',
  `mood3` int(10) NOT NULL default '0',
  `mood4` int(10) NOT NULL default '0',
  `mood5` int(10) NOT NULL default '0',
  `mood6` int(10) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM;
CREATE TABLE `dede_mood_ranking` (
  `id` int(11) NOT NULL auto_increment,
  `aid` int(10) NOT NULL,
  `mood` int(1) NOT NULL,
  `time` int(11) NOT NULL,
  `ip` varchar(15) NOT NULL,
  PRIMARY KEY  (`id`),
  KEY `aid` (`mood`,`aid`,`time`,`ip`)
) ENGINE=MyISAM;

在内容页模板</head>的前面加入
<script language='java script' type='text/java script' src='{dede:global.cfg_cmsurl/}/include/dedeajax2.js'></script>
<script language="java script">
function mood(){
  var mood_obj = document.getElementById('_mood');
  myajax = new DedeAjax(mood_obj,false,false,"","","");
  myajax.SendGet2("{dede:global name='cfg_phpurl'/}/mood/mood.php?aid={dede:field name='aid'/}&up="+10*Math.random());
  DedeXHTTP = null;
}
function moodGet(mood)
{
  var mood_obj = document.getElementById('_mood');
  myajax = new DedeAjax(mood_obj,false,false,"","","");
  myajax.SendGet2("{dede:global name='cfg_phpurl'/}/mood/mood.php?aid={dede:field name='aid'/}&action=mood&mood="+mood+"&up="+10*Math.random());
  myajax = null;
}
</script>

然后在DedeCMS的内容页模板中要调用心情投票的地方插入
<div id="_mood">数据统计中!!</div>
<script language="java script">mood();</script>

即可。
最后别忘了生成HTML哦

 


 

 

精品推荐
开发者应用
同类推荐
      相关文章
      相关下载
      说两句网友评论
        我要跟贴
        取消
        推荐专题