MyBB Community Forums

Full Version: Turn Off Sidebar In Portal.php
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am trying to setup a second portal page. But this page is only gonna have announcements. And the default portal.php will have the sidebar, my question is how can I disable the sidebar, this includes the welcome, search, who's online, login and recent discussions?

I commented out a few lines and got everything but the login to dissapear, however there has got to be a easier way to accomplish this?
If you want only the portal page that already brings MyBB and display the login box you can use the plugin template conditionals http://mybbhacks.zingaburga.com/showthread.php?tid=464

& Leave the portal template as follows:

<html>
<head>
	<title>{$mybb->settings['bbname']}</title>
	{$headerinclude}
</head>
<body>
{$header}
<table width="100%" cellspacing="0" cellpadding="{$theme['tablespace']}" border="0" align="center">
	<tr>
		<if ($mybb->settings['portal_showwelcome'] == 1 AND $mybb->user['uid'] == 0)>
		<td valign="top" width="200">
			{$welcome}
		</td>
		</if>
		<td>&nbsp;</td>
		<td valign="top">
			{$announcements}
		</td>
	</tr>
</table>
{$footer}
</body>
</html>

I do not know if conditionals are fine, but looking more on that.
I am trying to disable in portal.php, template conditionals effects the first portal page too.

I have commented out lines 222 to 432 and set

if($mybb->settings['portal_showwelcome'] != 1)
{
if($mybb->user['uid'] != 1)

That removes all the boxes on the portal, now I am just trying to get rid of the whitespace that its grabbing from portal settings.
The easiest thing is to copy the MyBB portal.php and rename it. Then delete all the code for the boxes you do not want in the new php file. This will help to prevent unnecessary queries.
Watch as conditionals do, something that the plugin does not edit the templates portal.php and only.

But with this you can put conditional as you want and I'll leave this enabled check box to show welcome and that the user ID is equal to 0, that is, a guest, I think so.
I renamed a second portal.php to latest.php.

Doesn't commenting out the code keep the script from making unnecessary queries?
You can also comment out the code of course. I just delete it to keep file size down.