Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
698 views
in Q2A Core by

Hi There and thanks all of you guys for developing this awesome platform.

I have a question regarding Anonymous users.

When they post a question, later they can "hide" the question. How I can disable Anonymous user s(or other users) of hiding their questions?

I found this post related, but it didn't help. any idea ?

Q2A version: 1.7.4

1 Answer

+1 vote
by
selected by
 
Best answer

One method is to use an event module. Follow the docs to create the plugin, then look for the 'q_hide' event in the process_event function. Something along the lines of

process_event($event, $userid, $handle, $cookieid, $params)
{
    if ($event === 'q_hide' && $userid === null) {
        qa_post_set_hidden($params['postid'], false)
    }
}

It's a bit of a hack though since the post gets hidden, then you reshow it right away. I have thought about adding a permissions option for users closing their own questions, so might add it for hiding in the future as well.

...