Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+3 votes
666 views
in Q2A Core by
My site users started posting "waiting for ansers" or "up up up" so that post appear at top of "All activity"

Is there is any wait to do "update" button, so when button is clicked question gets updated at top of list.

It would be verry similar to edit function with no editing.

1 Answer

+4 votes
by

It's a great idea, and definitely a candidate for a future version. in the meantime you can implement this yourself with a couple of small code changes..

First, insert the following code in qa-page-question.php

if ($question['editbutton'])

$qa_content['q_view']['form']['buttons']['bump']=array(
'tags' => ' NAME="dobumpq" ',
'label' => 'bump',
'popup' => 'Make this question appear recent',
);
 
Depending on where you want it in the button order, put this code between other similar blocks, after the section entitled // Buttons for operating on the question In the file.
 
Second, insert the following code in qa-page-question-post.php
 
elseif (qa_clicked('dobumpq')) {
qa_db_query_sub(
'UPDATE ^posts SET updated=NOW(), lastuserid=$, lastip=INET_ATON($) WHERE postid=#',
$qa_login_userid, @$_SERVER['REMOTE_ADDR'], $questionid
);

qa_redirect($qa_request); }

Insert it immediately before this line in the file:
 
elseif (qa_clicked('dosaveq') && qa_page_q_permit_edit($question, 'permit_edit_q')) {
 
That should do the trick - hope this is helpful to you and others.
by
edited by
Thats great, it's working. If you add this feature in new version please do that user would able bump only once a day.

Welcome to the Q&A site for Question2Answer.

If you have a question about Q2A, please ask here, in English.

To report a bug, please create a new issue on Github or ask a question here with the bug tag.

If you just want to try Q2A, please use the demo site.

Categories

...