> Does this code work for Q2A 1.6.3 at all?
Yes.
> Could you please tell me which exactly file do you mean by "theme.php"?
If you are using Snow theme, add codes at end (before of last "}" ) of qa-theme/Snow/qa-theme.php. I modified a little codes of christoph.
http://www.question2answer.org/qa/27468
function q_view_buttons($q_view) {
if (!empty($q_view['form'])) {
if(qa_get_logged_in_userid() == $q_view['raw']['userid']) {
/*
define('QA_USER_LEVEL_BASIC', 0);
define('QA_USER_LEVEL_APPROVED', 10);
define('QA_USER_LEVEL_EXPERT', 20);
define('QA_USER_LEVEL_EDITOR', 50);
define('QA_USER_LEVEL_MODERATOR', 80);
define('QA_USER_LEVEL_ADMIN', 100);
define('QA_USER_LEVEL_SUPER', 120);
*/
if(qa_get_logged_in_level() < QA_USER_LEVEL_EXPERT) {
if(isset($q_view['form']['buttons']['close']))
unset($q_view['form']['buttons']['close']);
if(isset($q_view['form']['buttons']['hide']))
unset($q_view['form']['buttons']['hide']);
}
}
}
qa_html_theme_base::q_view_buttons($q_view);
}
function a_item_buttons($a_item) {
if (!empty($a_item['form'])) {
if (qa_get_logged_in_userid() == $a_item['raw']['userid']) {
/*
define('QA_USER_LEVEL_BASIC', 0);
define('QA_USER_LEVEL_APPROVED', 10);
define('QA_USER_LEVEL_EXPERT', 20);
define('QA_USER_LEVEL_EDITOR', 50);
define('QA_USER_LEVEL_MODERATOR', 80);
define('QA_USER_LEVEL_ADMIN', 100);
define('QA_USER_LEVEL_SUPER', 120);
*/
if (qa_get_logged_in_level() < QA_USER_LEVEL_EXPERT) {
if (isset($a_item['form']['buttons']['hide']))
unset($a_item['form']['buttons']['hide']);
}
}
}
qa_html_theme_base::a_item_buttons($a_item);
}
function c_item_buttons($c_item) {
if (!empty($c_item['form'])) {
if (qa_get_logged_in_userid() == $c_item['raw']['userid']) {
/*
define('QA_USER_LEVEL_BASIC', 0);
define('QA_USER_LEVEL_APPROVED', 10);
define('QA_USER_LEVEL_EXPERT', 20);
define('QA_USER_LEVEL_EDITOR', 50);
define('QA_USER_LEVEL_MODERATOR', 80);
define('QA_USER_LEVEL_ADMIN', 100);
define('QA_USER_LEVEL_SUPER', 120);
*/
if (qa_get_logged_in_level() < QA_USER_LEVEL_EXPERT) {
if (isset($c_item['form']['buttons']['hide']))
unset($c_item['form']['buttons']['hide']);
}
}
}
qa_html_theme_base::c_item_buttons($c_item);
}