Current time: 08-01-2014, 09:49 AM Hello There, Guest! (LoginRegister)


Post Reply 
 
Thread Rating:
  • 6 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Add new custom PHP page.
04-04-2012, 11:57 AM
Post: #1
Add new custom PHP page.
This user has been denied support. This user has been denied support.
I didn't found some good ones floating around. So here is how I create them and here is how you can create them.

Its quite easy. Heres how you do.

First create, somepage.php file. Inside it, paste below code and save it:

PHP Code:
<?php 

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

add_breadcrumb("Title here""somename.php"); 

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

output_page($html);

?>

Next, Themes & templates > Templates > Global Templates > Add template.

Add below example template:

Code:
<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>

And for title, give any title to it but make sure you enter same title name in the somename.php file where it is calling (evaluating eval) the template name. As in this example case, you should enter title as template_name since we entered and recalled same global template in somename.php file.

Save the global template and it should work fine now.

Z5T - Dynamic URL Shortener
My Plugins & Themes
Find all posts by this user
Quote this message in a reply
04-04-2012, 12:01 PM
Post: #2
RE: Add new custom PHP page.
http://community.mybb.com/thread-116043.html

Visit this user's website Find all posts by this user
Quote this message in a reply
04-04-2012, 12:03 PM
Post: #3
RE: Add new custom PHP page.
This user has been denied support. This user has been denied support.
Did you try to see it fully? Look how much complicated that guy had made it. Anyways, this is a simple method.

Z5T - Dynamic URL Shortener
My Plugins & Themes
Find all posts by this user
Quote this message in a reply
04-04-2012, 12:08 PM
Post: #4
RE: Add new custom PHP page.
Fair enough. I can certainly see why you'd say that with the whole .navigation2 stuff he went on about haha

Visit this user's website Find all posts by this user
Quote this message in a reply
04-04-2012, 12:15 PM
Post: #5
RE: Add new custom PHP page.
This is the method I used when I created additional pages with the Social Groups plugin, although I don't have the next thing always be a table.
Find all posts by this user
Quote this message in a reply
04-04-2012, 02:43 PM
Post: #6
RE: Add new custom PHP page.
http://community.mybb.com/thread-6615.html

People would rather use a plugin to create custom pages
Find all posts by this user
Quote this message in a reply
04-04-2012, 03:34 PM
Post: #7
RE: Add new custom PHP page.
This user has been denied support. This user has been denied support.
(04-04-2012 02:43 PM)Dragon_Void Wrote:  http://community.mybb.com/thread-6615.html

People would rather use a plugin to create custom pages
1. Queries or plugins should be avoided as far as possible.

2. Plugins like page manager creates pages like misc.php?action=page, this is for those who wants a PHP page.

3. Your above link is not a plugin.

Z5T - Dynamic URL Shortener
My Plugins & Themes
Find all posts by this user
Quote this message in a reply
04-04-2012, 03:44 PM
Post: #8
RE: Add new custom PHP page.
Thanks, this is very helpful! Wink
Find all posts by this user
Quote this message in a reply
04-04-2012, 07:38 PM
Post: #9
RE: Add new custom PHP page.
(04-04-2012 03:34 PM)crazy4cs Wrote:  
(04-04-2012 02:43 PM)Dragon_Void Wrote:  http://community.mybb.com/thread-6615.html

People would rather use a plugin to create custom pages
1. Queries or plugins should be avoided as far as possible.

2. Plugins like page manager creates pages like misc.php?action=page, this is for those who wants a PHP page.

3. Your above link is not a plugin.

I didn't say it is a plugin Toungue I just said that people will rather use an plugin, due to the ease of administration. As for the page manager plugin, you can use php in it, as seen here: http://mods.mybb.com/view/page-manager

But thanks for the Tutorial, I still prefer "normal" pages Toungue
Find all posts by this user
Quote this message in a reply
04-09-2012, 09:16 AM
Post: #10
RE: Add new custom PHP page.
This is great tutorial
crazy4cs, can you help me on this thread http://community.mybb.com/thread-116550.html

thanks before
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)

Contact Us | MyBB | Return to Top | Return to Content | Lite (Archive) Mode | RSS Syndication