- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我需要实现一个带有评级系统的留言板。类似于堆栈溢出的东西,但要简单得多。
我需要对问题/答案进行评分并计算每个用户的评分。
我正在寻找 Drupal 中的模块来实现它。你能给我一些小费吗?
谢谢
最佳答案
Fivestar , 和 User Points可以用于此目的,但您只会得到类似于 Stack Overflow 的东西。
第一个模块(需要 Voting API )可用于允许用户投票,第二个模块可用于将投票转换为已投票用户的点数(除其他外,该模块不限于此)。要集成这两个模块,还有另一个模块,但我不确定它是“用户点”的一部分,还是 User Points Contributed modules .
Fivestar 的问题是允许用户从 1 到 X 投票(我认为可以更改最大投票数),这与 Stack Overflow 使用的投票系统不同,用户可以简单地报告“我喜欢它” ,或“我不喜欢它”。有了 Fivestar,只有赞成票,没有人可以否决评论或节点;可以通过给予最低投票来降低平均水平。
在我列出的模块之间,没有一个模块可以给节点/评论的作者打分;使用“投票 API”和“用户积分”可以做到这一点,但我看过的任何模块都不允许这样做(这意味着你可能会编写一个自定义模块)。
如果您查看 list of the modules包含在安装配置文件中ArrayShift ,您可以了解可用于实现相同目的的模块。
模块列表包括
/**
* Below, a bunch of simple hook implementations that award userpoints based
* on various events that happen. In theory, Rules module and various other tools
* could be used to do these things, but most of those modules don't have easy
* to export/import configuration data.
*/
// VotingAPI hook. When a user casts a vote on a node, the author should
// get/lose points..
function as_tweaks_votingapi_insert($votes) {
foreach ($votes as $vote) {
if ($vote['content_type'] == 'node' && ($node = node_load($vote['content_id']))) {
// Award the points
userpoints_userpointsapi(array(
'uid' => $node->uid,
'points' => $vote['value'] * 10,
'operation' => 'vote up',
'entity_id' => $node->nid,
'entity_type' => 'node',
));
}
}
}
// VotingAPI hook. When a user casts a vote on a node, the author should
// get/lose points..
function as_tweaks_votingapi_delete($votes) {
foreach ($votes as $vote) {
if ($vote['content_type'] == 'node' && ($node = node_load($vote['content_id']))) {
// Award the points
userpoints_userpointsapi(array(
'uid' => $node->uid,
'points' => $vote['value'] * -10,
'operation' => 'vote up',
'entity_id' => $node->nid,
'entity_type' => 'node',
));
}
}
}
关于drupal - 用户和帖子(和评论)的评分系统,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3258920/
是否有一个 drupal 模块可以在 drupal 站点中启用实时聊天? 最佳答案 我推荐drupalchat ,它是维护最完善、最完整的版本。它使用 node.js作为服务器。它适用于 Drupal
在 Drupal 中,;$Id$ 是什么? ? 我知道我们在 .info 文件中使用它,它告诉 Drupal 我们的模块信息。 我的问题是为什么 ;$Id$必要的? 最佳答案 $Id$ 是并发版本系统
我有一个 Drupal 模块“示例”。我已将模块的管理和客户端功能拆分为两个包含文件 example.admin.inc 和 example.pages.inc。我在 example.module 文
我的网页中有几种表单,并且我希望能够向所有提交按钮添加一个类(现在我已经将表单提交作为标准)。而且,在某些表单中,我具有使用AHAH来显示内容的按钮,但我不希望这些按钮具有新类,仅希望那些在表单上进行
关闭。这个问题是off-topic .它目前不接受答案。 想改进这个问题? Update the question所以它是on-topic对于堆栈溢出。 10年前关闭。 Improve this qu
是否有用户可以喜欢或不喜欢的 Drupal 模块,并喜欢该节点?比如 stackoverflow 的按钮? tnx。 最佳答案 Vote Up/Down module很像 StackOverflow
我没有找到如何在管理模式下的 drupal 页面列表中添加元描述以提高我的 SEO SEO metadescription pages list drupal我能做什么? 最佳答案 使用元标记模块自动
我想学习如何在 drupal- 模块中创建模块,这些模块可以与用户、数据库、分配权限、 View 交互。 是否有任何好的视频教程或简单的示例模块可以涵盖这些内容? 谢谢。 最佳答案 我的建议是获取 P
我正在 Drupal 中创建信用卡表格。我需要一个日期选择字段,用户可以在其中选择他们的信用卡到期日期,该日期仅包含月份和年份 - 没有日期。 Drupal 表单 #type 'date' 产生一个日
如何覆盖drupal主页的node.tpl文件?我尝试了各种 node--front.tpl.php page--node--front.tpl.php page--front--n
这个问题不太可能帮助任何 future 的访客;它仅与一个小地理区域、一个特定时刻或一个非常狭窄的情况相关,而这些情况通常不适用于互联网的全局受众。如需帮助使这个问题更广泛地适用,visit the
是否有按类别对内容进行分组的好方法。 我希望我可以有一个 CCK 类别字段。 最佳答案 使用分类法。它与 View 有很好的集成。我们用它在我们的投资组合上按分类词对投资组合项目进行分组。 http:
我有带 CCK 的 Drupal, 我有一个名为 Article 的内容类型。 本文有 5 个节点引用。 我正在使用 CCK 中的表字段,我正在尝试将其连接到 引用文献,所以每篇文章[包含一个表格字段
一个网站已经运行了一段时间。但是最近,当我上传图片时,它总是会引发这个错误: An unrecoverable error occurred. This form was missing from t
所以 Drupal 6 的一个麻烦是很难将更改从开发服务器转移到测试服务器或登台服务器到生产服务器。 这在 Drupal 7 中变得更容易了吗?模块开发人员现在应该遵循一些编码约定吗?所以开发人员可以
我正在为我的drupal 7网站编写一个包装器类,它使我可以连接到并查询我的phpbb数据库。 当连接到外部数据源时(根据drupal文档),您已经设置了事件数据库,运行查询,然后将事件数据库设置回默
如何在drupal菜单项中将页面参数之一设置为可选页面参数? 我有 $items['activities_list/%/%']=array( 'title callback' => 'activiti
我正在运营一个网站 xyz.org在 Drupal 中。 现在我想安装一些其他模块,例如 PHPBB 论坛和铜矿 画廊。当我安装这些并尝试访问链接 xyz.org/gallery 时,它给了我 dru
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引起辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the he
我想获取一个字段的图像路径。我在节点中,我需要图像的Url才能将其作为背景图像放入内嵌CSS中。 我找不到解决方案。你能帮助我吗? 最佳答案 要从URI中获取图像的路径: file_create_ur
我是一名优秀的程序员,十分优秀!