MyBB Community Forums

Full Version: Switch index.php and portal.php
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
If I renamed portal.php to index.php and index.php to forums.php will I have any troubles? If I would, is there a way to do this?
Maybe this in your .htaccess already does what you want? It will leave the filenames the same, but yoursite/yourforum/ will display the portal. And you have to go to index.php directly to get to the forum.

DirectoryIndex portal.php index.php index.html index.htm

Alternatively you can rename the files. There should be no problems - some things link and redirect directly to index.php though so you should have an index.php in any case. If you don't want to be redirected to index.php (don't want the main breadcrumb link go to index.php) you'll have to make some changes in MyBB code, unfortunately.

index.php should be a setting but alas it is not...
I did this to my board and have caused the portal to return this error:
Parse error: syntax error, unexpected '"' in /home/a4063392/public_html/index.php on line 177



This is what I did:
Portal (index.php)
add_breadcrumb($lang->nav_portal, "portal.php");

replaced with
add_breadcrumb($lang->nav_portal, "index.php");



redirect("portal.php", $lang->redirect_loggedin);

replaced with
redirect("index.php", $lang->redirect_loggedin);


Global.php
$navbits[0]['url'] = $mybb->settings['bburl']."/index.php";

replaced with
$navbits[0]['url'] = $mybb->settings['bburl']."/board.php";

Any ideas how to fix?
You'll have a " too many or too few somewhere, double check around line 177.
How come it worked previously? I can't see any extra "s.

Line 177:
		eval("\$welcometext = \"".$templates->get("portal_welcome_membertext")."\";");

Line 152 to 192:
		// Make the text
		if($newann == 1)
		{
			$lang->new_announcements = $lang->new_announcement;
		}
		else
		{
			$lang->new_announcements = $lang->sprintf($lang->new_announcements, $newann);
		}
		if($newthreads == 1)
		{
			$lang->new_threads = $lang->new_thread;
		}
		else
		{
			$lang->new_threads = $lang->sprintf($lang->new_threads, $newthreads);
		}
		if($newposts == 1)
		{
			$lang->new_posts = $lang->new_post;
		}
		else
		{
			$lang->new_posts = $lang->sprintf($lang->new_posts, $newposts);
		}
		eval("\$welcometext = \"".$templates->get("portal_welcome_membertext")."\";");

	}
	else
	{
		$lang->guest_welcome_registration = $lang->sprintf($lang->guest_welcome_registration, $mybb->settings['bburl'] . '/member.php?action=register');
		$mybb->user['username'] = $lang->guest;
		eval("\$welcometext = \"".$templates->get("portal_welcome_guesttext")."\";");
	}
	$lang->welcome = $lang->sprintf($lang->welcome, $mybb->user['username']);
	eval("\$welcome = \"".$templates->get("portal_welcome")."\";");
	if($mybb->user['uid'] == 0)
	{
		$mybb->user['username'] = "";
	}
}
(2011-01-21, 09:04 PM)Clarkie Wrote: [ -> ]How come it worked previously?

Well, something went wrong with your edit. The changes you posted seem to be fine though. Revert to the original file and try again...? Or attach the whole file here...
I've reverted twice. I can't see why it's doing it at all.
Right, I added
DirectoryIndex portal.php index.php index.html index.htm

To .htaccess and htaccess.txt which is a MyBB file. Do I need the .txt file and if I only need some of what's in it, which bits do I need in the .htaccess?