Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+7 votes
814 views
in Q2A Core by
edited by

Determination of the Hotness depends on following factors:

  • Entry is new: 100 / 100
  • Entry has a new answer: 100 / 100
  • Entry has many answer: 90 / 100
  • Entry has many up votes: 90 / 100
  • Entry has many views: 80 / 100

But consider three users: A with 1000 points, B with 250 points, and a fresh user C with 0 points.

CASE 1:  User A, User B, User C add new questions simultaneously. How their questions will be ranked among three. Currently, the last added question will be hotter than other. But I believe question that was added by user A with higher points should have more weight on hotness. Because user A with higher points is more respected, and his/her questions are more important than a fresh user C with zero points.

CASE 2: Same logic as in case 1 should be integrated in answering action. Consider 2 questions (Q1 and Q2) added at same time by equal pointed users. User A  posts an answer on Q1, and User C posts an answer on Q2. In this case hotness ranking of Q1 and Q2 wont affected. If Q2 was hotter than Q1, then after all it will stay same. However, answer made by User A is more important because the user has more points. So, Q1 should be hotter than the Q2.

If you think this logic makes sense, please vote it to keep it hotter. Also, I welcome you all to make brainstorm on implementation of this hotness algorithm.

Q2A version: 1.7.5
by
I like your idea, it's definitely worth taking into consideration.
by
definitely, it will be a "smart" hotness process.

1 Answer

+1 vote
by
edited by

I believe to set this, you should edit lines 41-47 in qa-include/db/hotness.php.

Especially, start with editing line 41, the table userpoints from DB should be left joined.

LEFT JOIN ^userpoints AS up ON up.userid == a.userid;

 

by
can you write down exact code?
by
1) add this code just above "$arguments=array(..."
$userid_of_post = "SELECT p.userid FROM ^post AS p";
$user_points=qa_db_user_points_selectspec($userid_of_post, true);

2) add this just below "qa_opt('hot_weight_views')*4000,"
$user_points*64000,

try if it works.
by
no man, it does not work.  Modifications needed in $query part at line 41. There we should somehow integrate userpoints table. Then in $argument part we should also refer to userpoints.
...