Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+9 votes
1.6k views
in Q2A Core by
How to display "More information for your question" when someone mouse over question?

2 Answers

+2 votes
by
edited by
 
Best answer
Great question! There are two things that need to be done here.

First, in qa_post_html_fields(...) in qa-app-format.php, insert these lines:

elseif (strlen($post['content']))
    $fields['title']='<SPAN TITLE="'.qa_html($post['content']).'">'.$fields['title'].'</SPAN>';

... after ...

if ($microformats)
    $fields['title']='<SPAN CLASS="entry-title">'.$fields['title'].'</SPAN>';

Second, you need to ensure that more full information about the posts is retrieved from the database wherever you show a question list. You can do this on an individual basis by making sure that the $full parameter is set to true whenever an appropriate function from qa-db-selects.php is called.

Or you can just take a shortcut and change qa_db_posts_basic_selectspec(...) in qa-db-selects.php - where it says:

if ($full) {

... you can replace with...

if (true) {

Please note that this will mean more information is being retrieved from the database, but it shouldn't make a meaningful speed difference.
by
edited by
Thanks for the quick reply.

if ($full) { in qa-db-selects.php is at two places, replaced at both the place, is it ok?

If someone want to see how it look then check this image
http://prothoughts.com/q2a/mouse_over_question_info.png

or it is live on http://answers.prothoughts.com
just mouse over any question.
by
when question is opened it is still showing more info, when mouse over , how to disable here
http://prothoughts.com/q2a/abc.png
by
I've modified the answer in a way I think will fix this.
by
perfect! its working fine, many thanks!
by
Any modifications required for 1.2 or will work above changes?
by
As far as I know it should still work but please try it and let us know!
by
It is working fine. is it possible to add this as a optional feature?
by
Great feature would be great to add in next 1.3 q2a version. Or maybe it's possible to add code to qa-theme.php ? becouse after update i will loose this code.
by
This trick is not working proper in Version 1.3.

In the mouse over comment along with the question, appears the html tags.

The user is not able to read the question as it shows the html tags also.

Find the screenshot here

http://www.urappointed.com/err.jpg
0 votes
by
This is works, thanks, but the sentence which is longer than 1 line, I can see the: <p></p>, <a href= etc. html codes.....

How can get rid of them?
Q&A 1.5

Thanks
...