MyBB Community Forums

Full Version: Page Manager
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How do I add the header and footer?
I have added the following template and it do not appear...
<?php
if($mybb->user['uid'] == 0)
{
error_no_permission();
} 

?>
<html>
<head>
<title>{$mybb->settings[bbname]} • ShoutBox</title>
{$headerinclude}
</head>
<body>
{$header}
<table border="0" cellspacing="1" cellpadding="4" class="tborder">
<tr>
<td class="thead"><center><strong>NAME HERE</strong></center></td>
</tr>
<tr>
<td class="tcat">TEXT HERE</td>
</tr>
<tr>
<td class="trow1" valign="top" align="center">
TEXT HERE
</td>
</tr>
<table border="0" cellspacing="1" cellpadding="4" class="tborder">
<br />
<tr>
<td class="trow1" valign="top" align="center">
<strong>TEXT HERE</strong>
</td></tr>
</table>
</table>
<br />
{$footer}
</body>
</html>

Also how do I make guests not access the page?
I have added this code at the top and nothing happened..
<?php
if($mybb->user['uid'] == 0)
{
error_no_permission();
} 

?>
this is my problem too.waiting for any suggestion.
This works fine:

<?php

if($mybb->user['uid'] == 0)
{
    error_no_permission();
}

global $headerinclude, $header, $theme, $footer;

$template='<html>
<head>
<title>'.$pages['name'].'</title>
{$headerinclude}
</head>
<body>
{$header}
<table border="0" cellspacing="'.$theme['borderwidth'].'" cellpadding="'.$theme['tablespace'].'" class="tborder">
<thead>
<tr>
<td class="thead">
<strong>'.$pages['name'].'</strong>
</td>
</tr>
</thead>
<tbody>
<tr>
<td class="trow1">MyBB is a free bulletin board system software package developed by the MyBB Group.<br />
It is written in PHP and licensed as free software under the GNU General Public License, version 3.</td>
</tr>
</tbody>
</table>
<br />
{$footer}
</body>
</html>';

$template=str_replace("\'", "'", addslashes($template));

add_breadcrumb($pages['name']);

eval("\$page=\"".$template."\";");

output_page($page);

?>

It's important to make global any MyBB object you want to use (but that's normal PHP programming).

Also the error_no_permission() works fine for me. Have you logged out and try to view the page? You should see an error page.
Thank you. Your code worked like a charm.
(2010-01-14, 09:16 AM)querschlaeger Wrote: [ -> ]Also the error_no_permission() works fine for me. Have you logged out and try to view the page? You should see an error page.

so if we cut off this these lines then everybody can see the page,right?
if($mybb->user['uid'] == 0)
{
    error_no_permission();
}
(2010-01-14, 04:34 PM)untitle Wrote: [ -> ]so if we cut off this these lines then everybody can see the page,right?

Right! Smile
thank you sir Smile