Include your custom pages in Mybb
#91
This has got to be a piece of cake for someone. Please help me out.
Hey, Mr. Feather!
Reply
#92
Why is no one acknowledging this thread?
Hey, Mr. Feather!
Reply
#93
How long will I have to bump this thing until someone responds?
Hey, Mr. Feather!
Reply
#94
Ok, I finally managed to find some free time to take a look at this.

This error occurred because PHP think the file that requiring the './inc/init.php' is the first custom file, instead of global.php and therefore goes for the wrong path.

You'll have to manually edit your global.php file.

I've managed to find two solutions for this problem:
1. using the __FILE__ magic variable of php
2. make some string manipulation on the paths to find the correct path

I think the __FILE__ method is better, but I'm not sure, I've never used this before.

I'll attach my solutions in a minute...

UPDATE:
what a waste of time... almost 30 minutes for nothing, after creating and testing my solutions on my testing board (v1.4.0) I've checked it also on an updated board (v1.4.2) just to find that -
MyBB FIXED this problem in the last update!
BTW, they're using the __FILE__ method.
my conclusion: ALWAYS update your board to the last version, even the testing/development board!
Creativity is a drug I cannot live without.
[Image: 1]Support PM will be ignored
Reply
#95
Thanks this is very helpful to me
Reply
#96
Come to think of this, you could be able to use this for a very advanced theme.
Good job! Big Grin
I'm not even angry. I'm being so sincere right now, even though you broke my heart and killed me. And tore me to pieces, and threw every piece into a fire.
Reply
#97
I've also asked it long ago:
(2007-06-21, 05:50 PM)xiao Wrote:
dvb Wrote:how can I restrict the new page so only registered member can view the page?

thanks for helping

add this at the top of your page:
<?php

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


// CHECK IF USER IS LOGGED IN
if($mybb->user['uid'] == 0)
{
    error_no_permission();
}

// DO YOUR STUFF ...

?>
Creativity is a drug I cannot live without.
[Image: 1]Support PM will be ignored
Reply
#98
good work Zaheer.........
Reply
#99
Is there a way where my registered group needs X amount of posts to view my custom page?
Reply
Why not using the promotion system and require a specific group?
Creativity is a drug I cannot live without.
[Image: 1]Support PM will be ignored
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)