向上/向下投票脚本
我正在尝试用 PHP 为我的帖子开发一个投票系统,访问者可以对帖子进行投票赞成或反对,然后我应该能够按最高/最低评分对帖子进行排序。
谁能推荐一个我可以用的好脚本吗?
I'm trying to develop a voting system in PHP for my posts where visitors can vote them up or down and then I should be able to sort posts by highest/lowest rated.
Can anyone please recommend a good script I can use for this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
没有任何“脚本”可以神奇地为您完成此操作。
您需要在 MySQL 数据库中创建一个表,该表至少有两个字段:帖子 ID 和投票计数。
您还需要创建一个 PHP 页面来处理投票更新以及按排序顺序返回帖子。
There is no "script" that will magically do this for you.
You will need to create a table in your MySQL database, which at the very least has two fields, post id, and vote count.
You will also need to create a PHP page which handles vote updates as well as returning posts in sorted order.
以下链接会将您引导至包含大量此类投票脚本的页面。有些是免费的,有些则需要付费:
hotscripts.com
PHP 位于 script.com
The following links refer you to pages with a bunch of such voting scripts. Some are free and some you have to pay for:
hotscripts.com
for PHP at scripts.com
您可以使用这个: http:// /www.technabled.com/2011/02/pulse-lite-reddit-ajax-up-down-voting.html
披露:我是开发商。
You can use this one: http://www.technabled.com/2011/02/pulse-lite-reddit-ajax-up-down-voting.html
Disclosure: I am the developer.