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

Hi, is there any way to remove "Hiding questions" button from users who ask questions, so that only Admin could hide users' questions. Cause now almost all users hide them, so that I have to go to Admin panel and press button "show" all the time. 

I tried to do that in qa-include/qa-page-question-view.php and remove the lines responsible for that hiding, but it didn't help, - it removed that button from Admin also. So, I don't know.

Thank you very much.

2 Answers

+2 votes
by
  1. Add plugin
  2. Add layer

Layer example:

class qa_html_theme_layer extends qa_html_theme_base {
  function q_view_buttons($q_view) {
    if($q_view['raw']['userid'] == qa_get_logged_in_userid()) {
      if (!empty($q_view['form'])) {
        if(isset($q_view['form']['buttons']['hide']))
          unset($q_view['form']['buttons']['hide']);
      }
    }
  qa_html_theme_base::q_view_buttons($q_view);
  }
}

It will be early to copy mouseover-layer equipped by default in Q2A.

by
Thank you very much!!! You really helped me.
I just inserted that php code into qa-mouseover-layer.php without deleting the original code. So, even not Switching on that  Mouseover Layer Plagin, button "hide" successfully disappeared)).
Appreciate your help.
+2 votes
by

I use Block Editing by Q2A Market plugin.

 

Block Editing by Q2A Market
==============
VERSION 1.0
-----------
 
This plugin will allow to block edit, hide and close buttions from questions, answers and comments after defined minutes in the options.
 
Features
--------
- Block Editing
- Block Hiding
- Block Closing
- Admin Can Access Everything
- Option to Exlude Moderators
- Option to Exclude Userids
 
Installation Guide
------------------
1. Extrat zip file.
2. Place directory called `q2am-block-editing` in qa-plugin folder.
3. Done
 
Usage Guide
-----------
 
once you complete installation than you can start to use the plugin with following steps.
 
1. Login with admin id.
2. Go to Admin > Plugins page.
3. Scroll down to `Q2AM Block Editing` in plugin list.
4. Click on `options` link to jump to the options section,
 
Here you will find all available options to customize your advert.
 
### Options
 
##### Enable Block Editing 
This will activate the plugin
 
##### Block After
The system will block editing after defined minutes. Make sure value should be in minutes only. No seconds or hours allowed. If you want to set 2hours than set it to `120` the system will calculate it as `120/60 = 2`
 
##### Exclude Group and Above 
This will exclude all members from the selected group and above level. For e.g if selected `Editor` than `Editor`, `Moderator`, `Admin` and `Super Admin` will be excluded from blocking.
 
##### Block Editing 
This will block `edit` buttion after defined minutes above
 
##### Block Hiding and Closing  
This will block `hide` and `close` buttions after defined minutes above
 
##### Exclude by User IDs 
You can exclude user by set userid in the field. For instance `19` or if you wan to exclude multiple users than separate it by comma e.g. `10, 24, 79, 1035, 4568`
 
##### Save Changes
Will save all changes.
 
FAQ
====
Q: Buttons doesn't block after defined time in the options  
A: Check your server or script timezone set with your country timezone
 
Q: I have set timezone but still plugin don't hide buttions
A: Make sure `Enable Block Editing` checkbox is **selected**
 
Q: I have set `1` in `Block After` but plugin blocking buttions very early and not after one hour
A: You must have to define minute value for the `Block After` option. So if you want to set for one hour than you need to set value of `60`
 
Q: Why moderators can't see all buttions?  
A: To allow moderators to see all buttions you need to select `Exclude Moderator from Blocking ` option
 
Q: I have done everything correctly but still plugin don't block some of buttions.  
A: Check if any other plugin conflict with this. To find remove all other plugin and add one by one and check which plugin create conflict.
 
Q: Edit buttion is blocked but user still can see hide buttion.
A: Make sure you have selected `Block Hiding and Closing` option
 
Q: How can I allow certain users to unblocked and allow editing and closing?
A: Set userid in `Exclude by User IDs` option
 
Change Logs V1.0
===========
This is the first version
 
About Question2Answer
=====================
[Question2Answer][q2a_link] is a open source question and answer system built on PHP. Built with great flexibilities to customize according to the requirements. [Find out Question2Answer community][q2a_community]
 
About Q2A Market
================
[Q2A Market ][author]is the leading developer for Question2Answer open source system. It is providing high quality theme, plugins and customization service.
by
Probably your way is also good, but I couldn't find that Block Editing Plugin by Q2A Market nowhere.
Still appreciate your time and efforts.
by
It is made exclusively for him. Let me contact him and if he allows me to make it available for all others than will put on our Q2A Market store
...