MyBB Community Forums

Full Version: Wrong format but sort of fixed
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey guys I followed the tutorial here: http://community.mybb.com/thread-116225.html

It sort of worked so I had to alter it a bit to make it work. The writer said to make the template like this:
<html>
<head>
<title>Your title here</title>
{$headerinclude}
</head>
<body>
{$header}
<table border="0" cellspacing="1" cellpadding="4" class="tborder">
<tr>
<td class="thead"><span class="smalltext"><strong>Your title here.</strong></span></td>
</tr>
<tr>
<td class="trow1">

Add here your custom messages.

</td></tr></table>
{$footer}
</body>
</html>

Instead I've had to do mine like this to make it work:
<html>
<head>
<title>Your title here</title>
{$headerinclude}
</head>
{$header}
<table border="0" cellspacing="1" cellpadding="4" class="tborder">
<tr>
<td class="thead"><span class="smalltext"><strong>Forum Rules</strong></span></td>
</tr>
<tr>
<td class="trow1">
<body>

<center><img src="/images/Photorules.gif" width="493" height="99" alt="Forum Rules" longdesc="Forum Rules image" /></centre>

<p>&nbsp;</p>
<p>Rules are generalized in terms of  what is deemed appropriate by the admin. These can be termed as, but not  limited to the following:</p>
<ul>
  <li>No adult content unless posted in the Innuendo  section</li>
  <li>No unrelated topics in the wrong section of the  forum</li>
  <li>Forum posts must not contain spam or  advertisements including, but not limited to companies pertaining to illegal  goods or services.</li>
  <li>All users are responsible for their posts</li>
  <li>Swearing and profanity is allowed, but not to be  overused that would otherwise be frowned upon</li>
</ul>
<p>&nbsp;</p>
<p>Follow the above rules and your  stay should be a enjoyable and educational experience, if you have any  questions or would like a question to be answered please send me a private  message <a href="http://scriptingcode.org/member.php?action=profile&uid=1">[HERE]</a></p>
<p>Thank you</p>


</td></tr></table>
{$footer}
</body>
</html>

My Rules.php now looks like this with the code:
<title>Forum Rules</title>

<?php 

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

add_breadcrumb("Forum Rules", "Rules.php"); 

eval("\$html = \"".$templates->get("Rules")."\";"); 

output_page($html);

?>

Is this the correct way of doing it as I couldn't get the formatting good otherwise with the text being in the Rules.php

Please respond and help me out here, I hate doing half as* stuff :/

Thank you greatly

So basically all the code is in the template because otherwise in the rules.php it was on top of the templates format, how do i fix this? Thank you.
bumping this to see if someone can help me out.

Thank you Smile
rules.php:
<?php

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

add_breadcrumb("Forum Rules", "Rules.php");

eval("\$html = \"".$templates->get("Rules")."\";");

output_page($html);

?>

Admin CP > Templates & Style > Add new Template > name it "Rules" and put it in Global Templates:

<html>
<head>
<title>{$mybb->settings['bbname']} - Forum Rules</title> <!--Assume you want this bit here? You just left "Your Title Here" in the OP-->
{$headerinclude}
</head>
{$header}
<table border="0" cellspacing="1" cellpadding="4" class="tborder">
<tr>
<td class="thead"><span class="smalltext"><strong>Forum Rules</strong></span></td>
</tr>
<tr>
<td class="trow1">
<body>

<center><img src="/images/Photorules.gif" width="493" height="99" alt="Forum Rules" longdesc="Forum Rules image" /></centre>

<p>&nbsp;</p>
<p>Rules are generalized in terms of  what is deemed appropriate by the admin. These can be termed as, but not  limited to the following:</p>
<ul>
  <li>No adult content unless posted in the Innuendo  section</li>
  <li>No unrelated topics in the wrong section of the  forum</li>
  <li>Forum posts must not contain spam or  advertisements including, but not limited to companies pertaining to illegal  goods or services.</li>
  <li>All users are responsible for their posts</li>
  <li>Swearing and profanity is allowed, but not to be  overused that would otherwise be frowned upon</li>
</ul>
<p>&nbsp;</p>
<p>Follow the above rules and your  stay should be a enjoyable and educational experience, if you have any  questions or would like a question to be answered please send me a private  message <a href="http://scriptingcode.org/member.php?action=profile&uid=1">[HERE]</a></p>
<p>Thank you</p>


</td></tr></table>
{$footer}
</body>
</html>

Then visit rules.php and check it works alright. Remember to keep this in either the same folder as, or below the folder of your forum. So if your website was www.example.com and MyBB was in /forum, then:

OK: www.example.com/forum/rules.php
OK: www.example.com/forum/misc/rules.php
Not OK: www.example.com/rules.php
(2012-12-16, 10:13 AM)Seabody Wrote: [ -> ]rules.php:
<?php

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

add_breadcrumb("Forum Rules", "Rules.php");

eval("\$html = \"".$templates->get("Rules")."\";");

output_page($html);

?>

Admin CP > Templates & Style > Add new Template > name it "Rules" and put it in Global Templates:

<html>
<head>
<title>{$mybb->settings['bbname']} - Forum Rules</title> <!--Assume you want this bit here? You just left "Your Title Here" in the OP-->
{$headerinclude}
</head>
{$header}
<table border="0" cellspacing="1" cellpadding="4" class="tborder">
<tr>
<td class="thead"><span class="smalltext"><strong>Forum Rules</strong></span></td>
</tr>
<tr>
<td class="trow1">
<body>

<center><img src="/images/Photorules.gif" width="493" height="99" alt="Forum Rules" longdesc="Forum Rules image" /></centre>

<p>&nbsp;</p>
<p>Rules are generalized in terms of  what is deemed appropriate by the admin. These can be termed as, but not  limited to the following:</p>
<ul>
  <li>No adult content unless posted in the Innuendo  section</li>
  <li>No unrelated topics in the wrong section of the  forum</li>
  <li>Forum posts must not contain spam or  advertisements including, but not limited to companies pertaining to illegal  goods or services.</li>
  <li>All users are responsible for their posts</li>
  <li>Swearing and profanity is allowed, but not to be  overused that would otherwise be frowned upon</li>
</ul>
<p>&nbsp;</p>
<p>Follow the above rules and your  stay should be a enjoyable and educational experience, if you have any  questions or would like a question to be answered please send me a private  message <a href="http://scriptingcode.org/member.php?action=profile&uid=1">[HERE]</a></p>
<p>Thank you</p>


</td></tr></table>
{$footer}
</body>
</html>

Then visit rules.php and check it works alright. Remember to keep this in either the same folder as, or below the folder of your forum. So if your website was www.example.com and MyBB was in /forum, then:

OK: www.example.com/forum/rules.php
OK: www.example.com/forum/misc/rules.php
Not OK: www.example.com/rules.php
Thank you very very much Smile