MyBB Community Forums

Full Version: Comprehensive Guide to Custom Page Creation
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6
It's OK. Cool

Problem is, I don't want to use index2/index3/etc. It wouldn't make sense to have /custom/index2.php and not /custom/index.php. Each directory needs its own index.php file.

Perhaps someone else has a solution? I can't imagine I'm the only one who has wanted to do this.
You can still use index.php, but add a _2, _3, etc. to denote your case in your files.
<?php

define('IN_MYBB', 1); 
require "./global.php"; 

add_breadcrumb("Music Index", "custom/music/index.php");

eval("\$index_2 = \"".$templates->get("index_2")."\";"); 
output_page($index_2); 
?>

That is my guess, I haven't tried that out yet.
I already have something like that set up, but that by itself won't do anything. What about the code inside functions_online.php?

case "example":   
            $user_activity['activity'] = "example"; 
            break;

"example" is supposed to be replaced with the name of the PHP file, not the template name. So unless I can give a more specific path to which index.php file I'm referring to, I don't see how to make this work. I can't just list "index" multiple times.
'Case' is the file name without the .php, but it isn't the same case as this:
case "example":
            $location_name = 'Viewing <a href="example.php">Example Page</a>.'; 
            break; 
That 'case' is basically the same as the activity function.
So your activity would be index_2, as well as your 'case' in the PHP section shown above.
Your first 'case', would probably by, my best guess, a path such as ./custom/index; but that I am not entirely sure of.
Test this out first, but if it were to be in a separate directory, I'm guessing you have many other files in the same directory using the same interface as MyBB.
Doesn't seem to work. Undecided Instead of continuing to guess, could you possibly try to work out a solution? Or perhaps someone else can step in and help get this resolved?

Thanks.
that is very helpful. I'll try and make use of it. thanks very much.
I'm Having Serious Problems With This.

Go Here and click "Home"

What's Wrong? Here's The PHP Code:

<?php

define('IN_MYBB', 1); 
require "./global.php"; 

add_breadcrumb("home", "Home.php");

eval("\$home = \"".$templates->get("home")."\";"); 
output_page($home); 
?>
(2009-07-16, 03:14 AM)Jed K Wrote: [ -> ]Doesn't seem to work. Undecided Instead of continuing to guess, could you possibly try to work out a solution? Or perhaps someone else can step in and help get this resolved?

Thanks.

Undecided
@swimguy
Name the actual PHP file "home.php"

@Jed K
I really have no solution to your problem sorry, first of all, I'm pretty confused, second of all, Zynge.net seems to work for me, and the index.php is modified.
How can you possibly be confused? My question is not difficult and I have explained it in every way possible. Zynge.net's index.php file isn't in it's own directory, so of course it works. Dodgy If your forum is installed on the root, it would be like trying to get a page of yours at zynge.net/page1/index.php to appear on the Who's Online list. Or your /tracker/index.php, for example.

Anyway, can anyone else help, please?
Pages: 1 2 3 4 5 6