MyBB Community Forums

Full Version: Intergrate a php page to the forum
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi once again im trying to get a php page i coded. but it kinda seems lame cuz i cant intergrate it to the forums. Owguru.com is the forums. Owguru.com/gods.php is the page i want to intergrate.
http://community.mybb.com/thread-51222.h...stom+pages

Follow this tutorial, and simply use your PHP page code.
For some reason this wont work X_X
This is the code im using
<?
include ("config.php");

if (!$_GET[god]) {
  echo "<center><table border=0><tr>";
  $lasttype = '';
  $results = mysql_query("select * from Gods order by type_rank, rank  Asc")or die(mysql_error());
  while ($row = mysql_fetch_array($results)) {
    if ($lasttype != $row[type]) {
      echo "</tr></table><table border=0><th align=center colspan=15><br><b><u>$row[type]</b></u></th><tr>";
    }
    echo "<center><td align=center><a href='gods.php?=".$row[short]."'><img src='".$row[image]."' title='".$row[name]."' border=0 width=100 height=100></img></a></td></center>";
    $lasttype = $row[type];
  }
}

if ($_GET[short]) {
 //Display your individual god stuff here 
}

You need to make a new template in the ACP, and add your pages code to that.

<html>
<head>
<title>{$mybb->settings[bbname]} - Example Page</title>
{$headerinclude}
</head>
<body>
{$header}
<br />
<!-- Content: Start -->
CODE HERE
<!-- Content: End -->
{$footer}
</body>
</html>

Then you need to make a new PHP document, like this one:

<?php

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

add_breadcrumb("Example Page", "example.php");

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

And change the Examplepage to your page name, the example.php to your file name, and the other examples to whatever you called your template.


(If that is too hard, there are plugins around to do it Wink
Thats what i did X_X
and i get www.owguru.com/gods.php
Try Page Manager or MyCMS, if you're looking for a full-featured CMS. Smile
ive tried Page Manager X_X ill try the cms later