MyBB Community Forums

Full Version: Change Portal.php to Index.php
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
It's not that hard to do this. I know it has been discussed, but this is a much easier way to do it.
#
#
#
#First, copy and paste index.php and portal.php into a new folder somewhere on #your hardrive.
#######################################
#Open portal.php and find
#######################################
# $lang->load("index");
#######################################
#change to
#######################################
# $lang->load("portal");
#######################################
#Close and save.
#######################################
#Rename index.php to whatever you want. I chose forum.php
#Rename portal.php to index.php
#######################################
#######################################

Now your done. Upload an try it out. Make sure you keep a copy of your origional copies. If you have previously modded these files, it is essential tou save a backup so you dont lose any data.

Demo at http://www.wow-database.net/mybb/
If you want people to visit your portal page instead of your forum when they visit your domain like this for example www.ukfisherman.com

Create a index.php file and add this code to it, then put the file outside your forums folder in the root directory.

<html>
<head>
<title>UK Fisherman Portal</title>
<META HTTP-EQUIV="Refresh" CONTENT="0;URL=http://www.ukfisherman.com/mybb/portal.php">
</HEAD>

Just replace the obvious bits of code to suit your site where the index page will lead them too. Then anybody using the domain name will be re-directed to your portal page instead of the forum page first. Thats one way of being able to just post your shorty domain name as a link leading to your portal.
Thats what im using Gary, I've have http://www.d-frame.co.uk going straight to portal.php Smile
Yeah but if you dont want a gateway page, then my way is the way to go.
yukisho Wrote:It's not that hard to do this. I know it has been discussed, but this is a much easier way to do it.
#
#
#
#First, copy and paste index.php and portal.php into a new folder somewhere on #your hardrive.
#######################################
#Open portal.php and find
#######################################
# $lang->load("index");
#######################################
#change to
#######################################
# $lang->load("portal");
#######################################
#Close and save.
#######################################
#Rename index.php to whatever you want. I chose forum.php
#Rename portal.php to index.php
#######################################
#######################################

Now your done. Upload an try it out. Make sure you keep a copy of your origional copies. If you have previously modded these files, it is essential tou save a backup so you dont lose any data.

Demo at http://www.wow-database.net/mybb/


Of course if you are going to do this with the changing of the file names, then it will also effect your navigation bar when navigating through the forums. When users click on the forum name link in the top of the forum nav area they will still be taken to the index.php page (which is now the main portal page).

To modify where that link takes you you will need to open your global.php file in your favorite text editor.

Look for:
$navbits[0]['name'] = $settings['bbname'];
$navbits[0]['url'] = "$settings[bburl]/index.php";

Change that to the name of your new forum index page (not the new main page index.php). I named my forum page forum.php so I changed the code to this:
$navbits[0]['name'] = $settings['bbname'];
$navbits[0]['url'] = "$settings[bburl]/forum.php";

Note: if you are using one of my skins that has a forum and home link in the top bar then you will also have to edit the "toplinks" templates and switch them to your new names.
Gary Bolton Wrote:If you want people to visit your portal page instead of your forum when they visit your domain like this for example www.ukfisherman.com

Create a index.php file and add this code to it, then put the file outside your forums folder in the root directory.

<html>
<head>
<title>UK Fisherman Portal</title>
<META HTTP-EQUIV="Refresh" CONTENT="0;URL=http://www.ukfisherman.com/mybb/portal.php">
</HEAD>

Just replace the obvious bits of code to suit your site where the index page will lead them too. Then anybody using the domain name will be re-directed to your portal page instead of the forum page first. Thats one way of being able to just post your shorty domain name as a link leading to your portal.

You forgot the </html> tag, and </HEAD> should be </head> Smile

I prefer to do this with php, seems to be a little quicker and dos'nt take as much code, put this in a file called index.php in your webroot and it will redirect also Big Grin

<?php

header("Location: http://www.mybboard.com/forum/portal.php");
exit();

?>
I plan on having portal.php, well the data inside being on the main website index.php, and then those links leading to the forums index.

*I shall figure a way to pull just what you need from the portal items and arrange it into a proper portal sytem*
I've done this.

I haven't written a proper tutorial on how to do it, but I plan too.
how about, putting at the top of index.php a cookie checker, if your "check" cookie isnt there your sent to the portal.php and a cookie is created, if it is there you stay on the index page.. =p
Pages: 1 2