Segun Egbeyinka
asked 8 years ago

Over here we are given $tone for supplying comments, how can i do the same for my own Forum?

5 Answers
well wisher
answered 8 years ago

install mycred plugin 🙂

Guru
answered 8 years ago

You can use many plugins systems. Such as the myCred plugin mentioned by Well wisher. There is also https://wordpress.org/plugins/cubepoints/ but you need to first understand or describe what you actually need to figure out whats best for you!

harsh deshmukh
replied 8 years ago

Hi Guru/Well wisher
Does these plugins are compatible with DWQa..?? Does it work in same way we see the points in Desingwall profile..?

Regards,
harsh

well wisher
answered 8 years ago

Pretty much compatible moreover my cred is the plugin designwall team is currently working on to integrate completely !!!

Segun Egbeyinka
answered 8 years ago

Thank you very much Well wisher. But how will I be able to display the top scorers and their score and other categories beside the forum? Just as it is done on DW.

well wisher
replied 8 years ago

the plugin provides widgets for the same which you may find in your widgets section once you have installed mycred

Guru
answered 8 years ago

Dear wellwisher, have you tried to integrate the mycred system on your end like the DW team have done so far? If you please share the details with us to follow.

Jackie Lord
answered 8 years ago

We are using those codes to intergrade MyCred Point with DW Question & Answer plugin. You can put this into functions.php file of your theme.

  // Question
function yourtheme_question_point( $post_id ) {
  $post = get_post($post_id);
  if(($post->post_status != 'publish') && ($post->post_status != 'private'))
    return;
  $user_id = get_current_user_id();
  if(function_exists('mycred_add')) {
    if($post->post_status == 'private') {
      mycred_add( 'new_question', $user_id, '-20', '%plural% for Ask a Question', $post_id, array( 'ref_type' => 'post' ) );
    } else {
      mycred_add( 'new_question', $user_id, '-10', '%plural% for Ask a Question', $post_id, array( 'ref_type' => 'post' ) );
    }
  }
}
add_action( 'dwqa_add_question', 'yourtheme_question_point');

//Answer
function yourtheme_answer_point( $post_id ) {
  $post = get_post($post_id);
  if($post->post_status != 'publish')
    return;
  $user_id = $post->post_author;

  if(function_exists('mycred_add')) mycred_add( 'new_answer', $user_id, '20', '%plural% for Answer a Question', $post_id, array( 'ref_type' => 'post' ) );
}
add_action( 'dwqa_add_answer', 'yourtheme_answer_point');

//Comment
function yourtheme_comment_point( $comment_id ) {
  $comment = get_comment($comment_id);
  $user_id = get_current_user_id();
  $post_id = $comment->comment_post_ID;
  if(function_exists('mycred_add')) mycred_add( 'new_comment', $user_id, '10', '%plural% for a Comment', $post_id, array( 'ref_type' => 'comment' ) );
}
add_action( 'dwqa_add_comment', 'yourtheme_comment_point');

Hope this helps,
Jackie

Guru
replied 8 years ago

Hi Jackie,

Thanks for sharing. What code are you using to display the widget leaderboard?

Jackie Lord
replied 8 years ago

I will sharing later

vahid
answered 8 years ago

but if someone gives points to a user (I mean for example click on +1 near an answer or a question) then how can we change the myCRED’s points?
I hope you understand what I mean! because I don’t know English well 😐

BigHug
answered 8 years ago

Hi vahid, we do not integrate with myCred plugin at the moment. If you know php and WordPress you can use a function from myCred is http://codex.mycred.me/functions/mycred_add/ mycred_add  and some DWQA action hook to add your custom point.

Powered by DW Question & Answer Pro