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

If you have questions about the platform, click here to ask and please use English.

If you just want to try Q2A, please use the demo, which also grants admin access.

Apr 29: Q2A 1.5.2

how to show Rotating question?

0 votes
How can Rotating question in front page? any idea?
asked May 28, 2010 in Q2A Core by minnkyaw
What exactly do you mean by a "rotating question"?
when refresh the page or visitor come to page each times to show difference post in top of questions.

1 Answer

+1 vote
To randomize the question order you can insert this code in qa-page-home.php:

function random_comparison($a, $b)
{
    return rand(-1, 1);
}

uasort($questions, 'random_comparison');

Insert it after this:

if (isset($pagesize))
    $questions=array_slice($questions, 0, $pagesize);
answered May 29, 2010 by gidgreen
Yes, it is work well. Thank you