Add Privacy Function to php site.
1. All questions are viewed by all users. I want them private. Can't be viewed.
2. I need them to be viewable by users who asked them only. Other users and visitors can not view them.
3. teacher/admin can view everything.
This privacy functions hides other user's question content only. but not question title, answers and comments
class qa_html_theme_layer extends qa_html_theme_base {
public function q_view_content($q_view) {
if(isset($q_view['content'])) {
if(qa_is_logged_in() && $q_view['raw']['handle'] != qa_get_logged_in_handle()
||(!qa_is_logged_in() && $q_view['who']['data'] != qa_lang_html('main/me'))) {
unset($q_view['content']);
}
}
qa_html_theme_base::q_view_content($q_view);
}
}
can anyone modify this code to make questions private from non-authors?