Current time: 03-21-2010, 05:01 AM Hello There, Guest! (LoginRegister)


Post Reply 
 
Thread Rating:
  • 11 Votes - 4.64 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Include your custom pages in Mybb
12-14-2007, 08:05 PM
Post: #71
RE: Include your custom pages in Mybb
Hi,

If I make a custom page, how can I make it my starting page?

thank you

My ideas:
Redirect counter
Favourites in administration
Visit this user's website Find all posts by this user
Quote this message in a reply
03-30-2008, 12:53 PM
Post: #72
RE: Include your custom pages in Mybb
Excellent guide: an answer to my prayers
Find all posts by this user
Quote this message in a reply
03-31-2008, 10:53 AM
Post: #73
RE: Include your custom pages in Mybb
Hi,

How can I make a custom page paginated?

Thanks

My ideas:
Redirect counter
Favourites in administration
Visit this user's website Find all posts by this user
Quote this message in a reply
05-31-2008, 06:31 PM
Post: #74
RE: Include your custom pages in Mybb
An excellent guide, which has helped me a lot in the production of my site!
Find all posts by this user
Quote this message in a reply
07-07-2008, 08:35 AM (This post was last modified: 07-07-2008 08:40 AM by jimbojetset.)
Post: #75
RE: Include your custom pages in Mybb
To include PHP into your custom page without using <iFrame> what is required is that you evaluate your PHP code within your custom.php page before the page is built.... for example here my custom.php page which queries a database and places the results into a table... the code with the results in is stored in a PHP variable called $content..
PHP Code:
<?php
$content 
"<table width=\"800\" border=\"0\" cellspacing=\"1\" cellpadding=\"4\" class=\"tborder\"><thead><tr><td class=\"thead\" width=\"200\">Server IP & Port</td><td class=\"thead\" width=\"400\">Server Name</td><td class=\"thead\" width=\"200\">Date Added</td></tr><tbody>";

$conn mysql_connect("localhost","database","password");

$sql "SELECT * FROM table ORDER BY data DESC";

$result mysql_db_query("database",$sql,$conn);

while(
$row mysql_fetch_array($result))
  {
  
$content .= "<tr><td class=\"trow1\">".$row['address']."</td><td class=\"trow1\">".$row['data']."</td><td class=\"trow1\">".$row['date']."</td></tr>";
  }

$content.="</tbody></table>";

// From here the custom page is no different that that provided by the originator of the thread

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

add_breadcrumb("Custom""custom.php"); // (2)

eval("\$custom = \"".$templates->get("custom")."\";"); // (3)
output_page($custom); // (4)
?>

Within the template where I want to see my dynamically generated content I use the {$content} reference variable... for example my template content might look like...

<html>
<head>
<title>{$mybb->settings[bbname]}</title>
{$headerinclude}
</head>
<body>
{$header}
<table width="100%" border="0">
<tbody>
{$content} <- Here is where your PHP results will be inserted
</tbody>
</table>
{$footer}
</body>
</html>

When everything is complete you should end up with something like this...

I hope I've explained this well enough on how to get dynamic PHP content into your custom pages without using <iFrame>
Find all posts by this user
Quote this message in a reply
07-31-2008, 11:27 PM
Post: #76
RE: Include your custom pages in Mybb
This apparently does not work with MyBB 1.4
Any ideas?
http://www.x-ind.com/board/tos.php

[Image: Sig-1.png]
Cross into dreams...
Quality free & paid Direct Admin hosting
Find all posts by this user
Quote this message in a reply
08-05-2008, 01:25 PM
Post: #77
RE: Include your custom pages in Mybb
(07-31-2008 11:27 PM)Schmarvin Wrote:  This apparently does not work with MyBB 1.4
Any ideas?
http://www.x-ind.com/board/tos.php

It worked for me! Undecided
Find all posts by this user
Quote this message in a reply
08-07-2008, 10:41 AM
Post: #78
RE: Include your custom pages in Mybb
Brilliant tutorial. Always a bit unsure on how to do this, but this explains it in a clear and simple way. Smile
Find all posts by this user
Quote this message in a reply
08-24-2008, 07:58 PM
Post: #79
RE: Include your custom pages in Mybb
(07-31-2008 11:27 PM)Schmarvin Wrote:  This apparently does not work with MyBB 1.4
Any ideas?
http://www.x-ind.com/board/tos.php


It definitely works (with no modification) on 1.4.0 & 1.4.1

See here...
Find all posts by this user
Quote this message in a reply
09-03-2008, 10:36 AM (This post was last modified: 09-03-2008 10:37 AM by Jed K.)
Post: #80
RE: Include your custom pages in Mybb
So if I have a forum on my root directory and want to create a custom page at /directory1/custompage.php, how should I change the code in the rules.php page? require "./global.php"; doesn't work and I tried a number of other combinations as well with no success.

Please advise. Thanks.

Hey, Mr. Feather!
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: