Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
580 views
in Q2A Core by

In connection of the revision history plugin, you might want to show only edit notices for loggedin users and only for questions. For this, the following edit of app/format.php is necessary: 

if (@$options['updateview'] && isset($post['updated']) &&

($post['updatetype'] != QA_UPDATE_SELECTED || $isselected) && // only show selected change if it's still selected

( // otherwise check if one of these conditions is fulfilled...

(!isset($post['created'])) || // ... we didn't show the created time (should never happen in practice)

($post['hidden'] && ($post['updatetype'] == QA_UPDATE_VISIBLE)) || // ... the post was hidden as the last action

(isset($post['closedbyid']) && ($post['updatetype'] == QA_UPDATE_CLOSED)) || // ... the post was closed as the last action

(abs($post['updated'] - $post['created']) > 300) || // ... or over 5 minutes passed between create and update times

($post['lastuserid'] != $post['userid']) // ... or it was updated by a different user

)

&& ($post['type']=='Q') // q2apro hack: ONLY Questions

&& ($post['updatetype']==QA_UPDATE_CONTENT) // q2apro hack: ONLY content edits, not retagging

&& (qa_get_logged_in_userid()) // q2apro hack: ONLY show for loggedin users

) {

Just a tip.

Q2A version: 1.8.0
by
Understand the importance of "only content edits". But why only for question edits?
by
Because the edit history plugin does only store the revision history for questions. Otherwise we could allow all posts (Q/A/C).
by
oh! I did not know that. Thank you.

1 Answer

0 votes
by

Do I understand correctly that today the history plugin also displays a history of answers, but the plugin page does not say which answer, only which question?

Anyway, what would be the correct code!?

And I would like show edit notices only for a certain level, editors, for example. And to the author of the post.

And not everyone who is loggedin.

...