论坛在phpBB3板上的成就?
我最近开始了一个新社区。论坛软件是phpBB3,到目前为止还不错。为了让我的社区更加独特和有趣,我不得不考虑拥有用户成就。让我给你一个快速的概述。
每个用户都有他们可以获得的成就(这些可能适用于所有用户),例如,当用户点击 1,000 个帖子、上传头像、当他们的某个主题获得 1,000 次浏览等时获得成就。每个成就都有积分,例如上传头像之类的成就将获得10点成就,达到10,000点将获得50点成就点。如果这里有人玩《魔兽世界》,你可能会明白我的想法是从哪里来的。 :)
我正在努力解决的是如何准确地编码这个...我可以保留所有用户活动的记录并将其添加到可能的特殊数据库表中,然后每分钟左右通过 cron 检查一次如果任何用户满足了成就标准...但是我也希望它可以通过 ACP 进行控制,这样我就可以轻松添加新的成就并更改他们的分数等。除了最简单的事情之外,当涉及到任何事情时,我的大脑都是一片空白。
我在这里发帖的真正目的是为了得到关于这个想法的反馈以及你们认为我应该如何去做这件事。一旦我了解了如何编写 phpBBB MOD,编码部分对我来说应该非常简单。
感谢您的阅读,期待您的回复。 :)
I recently started a new community. The forum software is phpBB3, and so far so good. In an attempt to make my community more unique and interesting, I had to idea of having user achievements. Let me give you a quick run-down.
Each user has achievements that they can earn (these will probably be across all users), for example an achievement for when a user hits 1,000 posts, when they upload an avatar, when one of their topics gets 1,000 views and so on. Each achievement has points, for example an achievement like uploading an avatar will be 10 points and reaching 10,000 points will grant 50 achievement points. If anyone here plays World of Warcraft you may be seeing where I'm getting the ideas from. :)
What I'm struggling to get my head around though is how exactly to code this... I could keep a record of all users activity and add it to a special database table possibly, and then check via cron every minute or so if any user has met achievement criteria... but then I also want it controllable through the ACP so I can easily add new achievements and change their points etc. My mind is pretty blank when it comes to anything but the most simple things.
What I really posted here for was feedback on the idea and how you all think I should go about doing this. The coding part should be pretty simple for me once I get my head around how phpBBB MODs need to be written.
Thanks for reading, and I look forward to your replies. :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你检查过这个模组吗?
http://www.phpbb.com/community/viewtopic。 php?f=70&t=1696785
目前处于测试阶段,但看起来这正是您想要完成的任务。即使不是,您也可以随时利用它并用它来制作其他东西。我对现有模组进行了大量修改以适应我的网站。您需要花一些时间来了解 phpbb3 是如何完成工作的,但是当您开始这样做时,一切就很容易了。
关于创建您自己的,我认为这不必在 crontab 上完成。您可以简单地将函数注入到代码的相关部分中。
对于帖子计数,已经有一个函数可以根据某些帖子编号更新用户头像下的描述,您可以在其中添加一个额外的函数
update_achievement()
。更新头像也是如此。不幸的是,采用这种方法,您将无法完全从 ACP 编辑成就,但您可能有一个可以启用/禁用某些成就的界面。为此,您显然需要一两张额外的桌子。无需考虑太多,我就会有 1 个表,其中有 2 列:user 和 acheivement_id。然后是另一个表,其中仅列出了成就 ID 和描述等。
Have you checked out this mod?
http://www.phpbb.com/community/viewtopic.php?f=70&t=1696785
It's in beta at the moment but it looks like it's sorta what you're trying to accomplish. Even if it isn't, you can always take it and make something else out of it. I have heavily modified existing mods to suite my site. It takes a little while to get your head around how things are done with phpbb3 but it is easy when you start doing it.
In regards to creating your own, I don't think this has to be done on crontab. You could simply inject a function into the relevant parts of code.
With post counts, there is already a function that updates the description under the avatar of users based on certain post numbers, you could probably put an extra function
update_achievement()
there. Same goes with the avatar being updated. Unfortunately, taking this approach you will not be able to edit the achievements completely from the ACP but you could possibly have an interface that could enable/disable certain achievements.You will obviously need an extra table or two for this. Without thinking too much, I would have 1 table that has 2 columns, user and acheivement_id. Then another table which just lists the acheivements ids and descriptions etc..