Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
405 views
in Q2A Core by
It seems that a user with no priveldges (level 0) can hide/reshow their own question. is this correct? I have mods and admins only allowed to hide/reshow.

If so, I would like to make it truly according to the options in admin. What is the best way to make this happen (preferabley using theme override)?
by
I think that is by design, although if a question is hidden by admin I don't think the user can reshow it. I do see a slightly obscure potential problem here though - a user could post something spammy then hide it, then reshow it months later and go undetected.
by
Thing is, I have an event plugin setting all new questions to hidden on submission. Once the user submits the question, he is shown his question immediately (albeit greyed out as hidden). The reshow link is there to click and if he does it goes live.
However, if the user navigates away from his question page, he can no longer see it/access it normally via homepage/question pages etc...(unless he uses back button on browser) as it is hidden.
So it only becomes a problem on the page loaded after submitting.
by
edited by
Well I have come up with a hack in theme override to remove the repost link unless the user has level>40 and the post isn't hidden:

        function q_view_buttons($q_view)
        {
            //print_r($q_view);

            if (!empty($q_view['form'])) {
                $this->output('<DIV CLASS="qa-q-view-buttons">');

                // my hack
                $thisuserlevel = qa_get_logged_in_level();
                if ( ($thisuserlevel<40) && ($q_view['raw']['hidden']==1) ){
                    unset($q_view['form']['buttons']['reshow']);
                }
                                ......

There must be a better way than manually overiding the php form array but hey it works :-)

Please log in or register to answer this question.

...