MyBB Community Forums
How do I hide the new thread button? - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Extensions (https://community.mybb.com/forum-201.html)
+--- Forum: Plugins (https://community.mybb.com/forum-73.html)
+---- Forum: Plugin Support (https://community.mybb.com/forum-72.html)
+---- Thread: How do I hide the new thread button? (/thread-22395.html)

Pages: 1 2


How do I hide the new thread button? - jpang - 2007-08-26

I set the permissions so that normal registered users can't post in a certain forum. However, the new thread button is still there even though they can't post. How do I make it so the button is hidden?


RE: How do I hide the new thread button? - Bless - 2007-08-26

Thats not possible without php file editing, if i'm not mistaken


RE: How do I hide the new thread button? - LeX- - 2007-08-26

Can't post in a certain forum ? That's the New Reply button ?

Open showthread.php
Find
		else
		{
			eval("\$newreply = \"".$templates->get("showthread_newreply")."\";");
		}

Replace by
		else if($forumpermissions['canpostreplys'] != "no")
		{
			eval("\$newreply = \"".$templates->get("showthread_newreply")."\";");
		}
		else
		{
			$newreply = "";
		}



RE: How do I hide the new thread button? - jpang - 2007-08-26

That's what I want to do except with the new thread button.


RE: How do I hide the new thread button? - LeX- - 2007-08-26

Then add
$newthread = "";

into the code.


RE: How do I hide the new thread button? - jpang - 2007-08-26

Thanks, it works Smile

But I want to make it so the new thread button is hidden when they can't make new threads.

Sorry about all the questions, but I would also like to do this in the forumdisplay.php, too


RE: How do I hide the new thread button? - LeX- - 2007-08-26

jpang Wrote:Thanks, it works Smile

But I want to make it so the new thread button is hidden when they can't make new threads.

-sighs-

First can't make new posts, hide new thread button =/ , then can't make new threads, hide new thread button ...

change that canpostsreplys to canpostthreads

Open forumdisplay.php
Find
if($foruminfo['type'] == "f" && $foruminfo['open'] != "no")
{
	eval("\$newthread = \"".$templates->get("forumdisplay_newthread")."\";");
}

Change into
if($foruminfo['type'] == "f" && $foruminfo['open'] != "no" && $fpermissions['canpostthreads'] != "no" )
{
	eval("\$newthread = \"".$templates->get("forumdisplay_newthread")."\";");
}



RE: How do I hide the new thread button? - jpang - 2007-08-26

LeX- Wrote:change that canpostsreplys to canpostthreads

Yeah, I tried that before and it didn't work. It makes both buttons disappear.


RE: How do I hide the new thread button? - LeX- - 2007-08-26

jpang Wrote:
LeX- Wrote:change that canpostsreplys to canpostthreads

Yeah, I tried that before and it didn't work. It makes both buttons disappear.

Probably because you have

$newthread = "";
$newreply = "";

Remove that $newreply = "";


RE: How do I hide the new thread button? - jpang - 2007-08-26

I tried
		else if($forumpermissions['canpostthreads'] != "no")
		{
			eval("\$newreply = \"".$templates->get("showthread_newreply")."\";");
		}
		else
		{
			$newthread = "";
		}
and
		else if($forumpermissions['canpostthreads'] != "no")
		{
			eval("\$newthread = \"".$templates->get("showthread_newthread")."\";");
		}
		else
		{
			$newthread = "";
		}
They both make both buttons disappear. Changing canpostreplys to canpostthreads makes the new reply button disappear no matter what the permissions are set. I don't want the new reply button to disappear, just the new threads button