MyBB Community Forums

Full Version: how the "Quick Reply" can be used a specific user
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
how to add or edit code php if "quick reply" can only be used a few users, or users who can not use "quick reply"
please tell me if there is someone who can solve my problem.
Use this plugin and then edit your templates with the proper code to allow only certain users/usergroups to see the quickreply.
(2013-03-21, 08:43 PM)Syryus Wrote: [ -> ]Use this plugin and then edit your templates with the proper code to allow only certain users/usergroups to see the quickreply.

Indeed this would be your best bet as far as I can tell. It doesn't appear there is a plugin created yet.
(2013-03-21, 08:43 PM)Syryus Wrote: [ -> ]Use this plugin and then edit your templates with the proper code to allow only certain users/usergroups to see the quickreply.

is there any way besides using the "plugin" I like the manual way, it seems to only edit beberpa code in php, but I do not understand exactly how to modify the php file.
and the URL that you provide forum URL it is not "thread"

I want the manual way Big Grin
Ok my friend, the manual way for you Wink

Then go & edit Showthread.php file of your forum

Find this line:

// Guests cannot use this feature
if(!$mybb->user['uid'])
{
	error_no_permission();
}

Add below it:

// Replace X with your Group ID from which you want to hide Quick Reply Form :D
if($post['usergroup'] == 'X')  
{
       $displaystyle = "display:none";
}
else {
       $displaystyle = "";
}

Save it.

No Go To Your Theme Templates -> Showthread -> showthread_quickreply

Find:

<form method="post" action="newreply.php?tid={$tid}&amp;processed=1" name="quick_reply_form" id="quick_reply_form">

Replace it with:

<form method="post" action="newreply.php?tid={$tid}&amp;processed=1" name="quick_reply_form" id="quick_reply_form" style="{$displaystyle}">

Save it.

You are done, now test it!
@Cedric

okay
thank you very much, this works great i do by just adding php code

// Replace X with your Group ID from which you want to hide Quick Reply Form :D
if($post['usergroup'] < 3)  
{
       $displaystyle = "display:none";
}
else {
       $displaystyle = "";
}

and add

<form method="post" action="newreply.php?tid={$tid}&amp;processed=1" name="quick_reply_form" id="quick_reply_form" style="{$displaystyle}">

thank you very much Big Grin
I am sorry this dispute back

Cedric
what about this problem?
if the "quick reply" in the inspector and CSS elements from the "display: none;" to remove the "quick reply" will appear.
what's the solution so that it does not appear and was not detected in the element inspector no code "quick reply"?

[Image: ekjl.png]

what if editing the PHP section below

[Image: TPIx9Jm.png]

but I do not understand how to add these variables
I've done a variety of ways, but still failed

if($mybb->settings['quickreply'] != '0' && function_exists("quickreply") && ($mybb->user['usergroup'] < 3))
if($mybb->settings['quickreply'] != 0 && function_exists("quickreply") && ($mybb->user['usergroup'] < 3))
if($mybb->settings['quickreply'] != '0' && function_exists("showquickreply") && ($mybb->user['usergroup'] < 3))
if($mybb->settings['showquickreply'] != '0' && function_exists("quickreply") && ($mybb->user['usergroup'] < 3))
if($mybb->settings['quickreply'] != 1 && function_exists("quickreply") && ($mybb->user['usergroup'] < 3))
if($mybb->settings['quickreply'] != 1 && function_exists("showquickreply") && ($mybb->user['usergroup'] < 3))
if($mybb->settings['showquickreply'] != 1 && function_exists("quickreply") && ($mybb->user['usergroup'] < 3))
if($mybb->settings['showquickreply'] != 1 && function_exists("showquickreply") && ($mybb->user['usergroup'] < 3))

failed all
Maybe you can just cover up the whole quickreply code from the "<form" element in a varible like this:

// Replace X with your Group ID from which you want to hide Quick Reply Form :D
if($post['usergroup'] < 3)  
{
       $myditor = '';
}
else {
       $myditor = '
<form method="post" action="newreply.php?tid={$tid}&amp;processed=1" name="quick_reply_form" id="quick_reply_form">
...
...
...
</form>
';
} 

and add this to the template

{$myeditor}

EDIT: Syntax Error in code = fixed
Parse error: syntax error, unexpected T_STRING in /public_html/showthread.php on line 40

this showthread.php

[Image: 68ko.png]

this template showthread_quickreply

[Image: ugoc.png]

help Huh