Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.

Adding a custom button to add a user to favorites

+1 vote
26 views
asked Sep 9 in Plugins by hasan tahsin
I am trying to develop a plugin. The aim is to create a best user list which the active user could add a user to its favorites by clicking to the star icon next to user name.

However, I could not add the classic star icon by using qa_favorite_form() function. What I get only is a "Array text" on the page.

Does anyone have an ideo to fix it?

----------

$loginuserid = qa_get_logged_in_userid(); // activeuser

$entityid = $all_tags[$count_array]['userid']; // userid of the listed item

if (isset($loginuserid) && $loginuserid != $entityid && !QA_FINAL_EXTERNAL_USERS) {

$qa_content = qa_content_prepare();

$favorite = @$favoritemap[$entityid][$loginuserid];

$qa_content['favorite'] = qa_favorite_form('QA_ENTITY_USER', $loginuserid, $favorite,

qa_lang_sub($favorite ? 'main/remove_x_favorites' : 'users/add_user_x_favorites', $all_tags[$count_array]['handle']));

}

Please log in or register to answer this question.

...