Wordpress 中的邀请码和用户数据库
我需要你宝贵的帮助。我正在努力组织一场与 WordPress 网站相关的竞赛。这就是它应该运作的方式:
- 有一场竞赛。用户必须在 WP(还有 Facebook Connect/Open Graph)中注册为新用户才能参加比赛。
- 当新用户注册时,系统会向他发送一封电子邮件:“恭喜!您是新用户。这里有一些邀请码(或链接),可以邀请您的朋友。如果他们用邀请码(或链接)在这里注册,您将收到一份礼物”。
我怎样才能完成这个工作流程?每次新用户进入 WP 网站时,我都需要生成一些代码(或链接)并分配它们(将这些数据链接到用户)。 我需要知道新用户(称为 B)是否由于另一位用户(称为 A)而来到我的网站,以便向 A 赠送礼物。
谢谢你们。
I need your precious help. I'm working hard on organizing a contest linked to a wordpress site. That's the way it should work:
- There's a contest. The user have to register as new user in WP (there's also the Facebook Connect/Open Graph) to enter the contest.
- When a new user register himself, the system sends him an email: "Congratulations! You are a new user. Here there are some invitation codes (or links) to invite your friends. If they register here with the invitation code (or link), you'll receive a gift".
How can i do this workflow? I need to generate some codes (or links) every time a new user enter the WP site and assign them (linking those data to the users). I need to know if a new user (called B) comes to my site thanks to another user (called A), in order to give to A a gift.
Thank you guys.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您必须进行前端注册。然后,在用户注册后,您向他发送一封电子邮件,例如 www.yourdomain.com/register?uid=his_id(链接到注册表单,并以他的 id 作为参数)。
当他将链接传递给他的朋友 B 时,朋友 B 正在注册,您检查是否有 $_GET['uid']。是的,你给他添加一个包含 id 的元数据。
要进行前端注册,您应该检查此文章。
对于邮件发送,您可以使用 wp_mail() 函数。
要在url中传递参数并访问,您必须熟悉$_GET< /p>
要为用户添加元,您必须使用add_user_meta()。
如果您了解基本的 PHP 并愿意从 Wordpress codex 学习,上述步骤并不一定困难。
You must make a frontend registration. Then, after user is registered you send him an email like www.yourdomain.com/register?uid=his_id(link to te registration form with his id as a parameter).
The when he passes the link to his friend B, friend B is registering and you check if there's a $_GET['uid']. It yes you add him a meta containing the id.
To make a front-end registeration, you should check this article.
For mail sending you could use wp_mail() function.
For passing params in the url and accessing you must be familiar with $_GET
For adding a meta for an user you must use the add_user_meta(). function.
The above steps are not necessarily difficult if you know basic PHP and willing to learn from Wordpress codex.
我们创建了一个名为 Cm 邀请码的插件,允许您为每个组分配代码。这样您就可以知道每个注册来自哪个站点,并控制来自特定站点的用户注册数量。尝试 WordPress 插件目录中的 CM 邀请码 http://wordpress.org/extend/plugins/ cm-邀请码/
We created a plug called Cm Invitation Codes that allows you to assign codes per groups. This way you can know from which site each registration is coming and control also the number of user registration from a specific site. Try CM Invitation Code in WordPress Plugin Directory http://wordpress.org/extend/plugins/cm-invitation-codes/