Tips and Tricks HQ Support Portal › Forums › WP eMember › WP eMember General Questions › Integrating eMember with another plugin?
- This topic has 2 replies, 2 voices, and was last updated 12 years, 7 months ago by einfohound.
-
AuthorPosts
-
April 4, 2012 at 10:25 pm #6026einfohoundParticipant
I am working on intergrating eMember with another plugin that will handle credits for users. Credits are assigned when a user joins, and are deducted when users download files. Different levels of membership will be assigned different amounts of credits.
I have most of this working. There are two areas that I think I am going to have to do some coding myself.
The credits plugin maintains credits based on a WordPress userid, so I have eMember set to create a WP user too. Here are the areas I need help with…
1.) When a user is created, I need to assign a starting number of credits to them. The credits plugin has a shortcode that I can put on a page that will “increase” the number of credits for a user. I have two problems with this. One is that I would not want the user to be able to go back to this page (or “reload” it) and get more credits added to their account. The second is that I cannot see any way with eMember that I can make a user go to a page anyway. It would have to be at the completion of the “registration” process, because the WP user is not created until this time. eMember does allow me to send a user to a page after registration is complete, but as far as I can tell, all membership levels go to the same page. (Allowing redirection to different pages based on membership level would be a neat addition – BTW!)
The only way I can think of overcoming this problem is to add some code to the user credits plugin. All I need to do is retrieve the membership level for a given user from the eMember database. Can you provide me with a code sample to do this (that I could add to the other plugin)? Unless, of course, you have another idea.
2.) The other area that I need to provide for is doing this same thing every month. For every month that a user is active, they will get more credits added to their account. (example Level1 = 10 credits/month, Level2 = 20 credits/month, etc.)
For this, I think I am going to have to create a cron job that will run every day and check if each person has been active for another month and increase their credits. I guess there is not really anything different that I need from you for this – except I need to know how to get the date the member joined from the eMember database. I will have to figure out how to keep track of accounts that have been updated for the current month, etc.
Hey, maybe you could consider adding this “credit” system to eMembers in the future!
Thanks for any suggestions/samples you can give me!
April 6, 2012 at 1:32 am #43792adminKeymasterThis topic is beyond the scope of this support forum. Please read the 3rd point from our forum rules:
https://support.tipsandtricks-hq.com/forums/topic/forum-rules
Please contact us using the contact form on our site for this type of customer development work.
April 6, 2012 at 1:03 pm #43793einfohoundParticipantSorry about that! I have submitted via the contact form. Thanks!
-
AuthorPosts
- You must be logged in to reply to this topic.