WordPress.org

Forums

myCRED
[resolved] Sync points from another DB (7 posts)

  1. envieme
    Member
    Posted 1 year ago #

    Hello I use Q2A forum software integrated with wordpress user database which has it's own points system. Also I am using mycred on the buddypress instalation.

    I need to be able to sync the points generated at Q2A site with the users buddypress points.

    Am thinking of a few ways of doing this. Please let me know which one is the best:

    1) Write mycred hooks in q2a for all actions (but this is going to be difficult as q2a is not in wordpress plugin but a seperate DB just sharing wp users table)

    2) write a cron to periodically (say daily) sync both the points as one. That is q2a has same points as mycred and vice versa

    3) q2a points are kept seperate and q2a points generated are added to mycred points somehow

    I would like to have it as 3,2,1 in order of preference. How to accomplish this?

    https://wordpress.org/plugins/mycred/

  2. Gabriel
    Member
    Plugin Author

    Posted 1 year ago #

    Hey.

    Do you know where Q2A stores your users point balances? Is it in the yourprefix_usermeta table?

  3. envieme
    Member
    Posted 1 year ago #

    Hello Gabriel,

    Thanks for this great plugin. I bought an addon to support your work though I don't need now :)

    qa_userpoints is the table and is seperate from wp tables. The link is the coloumn userid which is same as wordpress.

  4. Gabriel
    Member
    Plugin Author

    Posted 1 year ago #

    I hope you forgive me for all these questions but I never used Q2A before.

    Ok so this qa_userpoints table is in a different database from your wp_usermeta table right? See if both tables were in the same database, option 2 would be best since then you can just "sync" the two tables and update balances because myCRED will save your balance in your user meta table.

  5. envieme
    Member
    Posted 1 year ago #

    No. qa_userpoints table is in the same database. just another table. it has a column userid which corresponds to user_id in wp database.

  6. Gabriel
    Member
    Plugin Author

    Posted 1 year ago #

    Ok in that case I would definitely go with option 2. A daily cron job that syncs the two tables could be achieved with relatively little code.

  7. envieme
    Member
    Posted 1 year ago #

    Thank you for helping with my doubt, I have started doing 2 as you said, looks like that's the best option. I have a couple of more questions. Will open a new thread.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • myCRED
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic