Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
640 views
in Plugins by
`best-user-per-month` plugin doesn't work with external users because of this code:

     $user = qa_db_select_with_pending( qa_db_user_account_selectspec($currentUser, false) );

Can anyone offer an alternative code for this line to external users compability?
Q2A version: 1.6.2

2 Answers

0 votes
by
Hey,

Try to get it from your session id . $currentUser['userid'] is basically the user name you can pass that to it.

 

Thank you

Shoaib
0 votes
by

Hey! What i did is as follow

 

function sidebar()
{
qa_html_theme_base::sidebar();
 
$users=qa_db_single_select(qa_db_top_users_selectspec(0));
$this->output("<div class='qa-active-users'>");
$this->output("<div class='qa-active-users-header'>");
$this->output("<b>Most Active Users</b>");
$this->output("</div>");
$i=1;
foreach (array_slice($users,0,10) as $user){
$userNameURL = str_replace(" ", "+", $user['userid']);
$this->output('<P>'.$i.'. <strong><a class="qa-user-link" href="./user/'.$userNameURL.'">'.$user['userid'].'</a></strong> ('.number_format($user['points']).' points)</P>');
$i++;
}
$this->output("</div>");
    
}
...