MyBB Community Forums

Full Version: Include your custom pages in Mybb
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14
Ah, many thanks, it's working now.

Only.... the
{$header}
{$welcome}
{$pms}
{$search}
{$stats}
{$whosonline}
{$latestthreads}
aren't showing on the page...
http://www.wearewriters.co.uk/forums/newpage.php
The header and works,  for the rest of course they won't because they should be first initialized in the php file.

For example
{$stats}
{$whosonline}
{$latestthreads}

are a part of the portal.php and they are only parsed through the portal.php, in portal.php you can find these variables, i recommend to copy and paste them in your file.

For example to show $latestthreads add to your newpage.php

// Latest forum discussions
if($mybb->settings['portal_showdiscussions'] != "no" && $mybb->settings['portal_showdiscussionsnum'])
{
	$altbg = alt_trow();
	$threadlist = '';
	$query = $db->query("
		SELECT t.*, u.username
		FROM ".TABLE_PREFIX."threads t
		LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=t.uid)
		WHERE 1=1 $unviewwhere AND t.visible='1' AND t.closed NOT LIKE 'moved|%'
		ORDER BY t.lastpost DESC 
		LIMIT 0, ".$mybb->settings['portal_showdiscussionsnum']
	);
	while($thread = $db->fetch_array($query))
	{
		$lastpostdate = my_date($mybb->settings['dateformat'], $thread['lastpost']);
		$lastposttime = my_date($mybb->settings['timeformat'], $thread['lastpost']);
		// Don't link to guest's profiles (they have no profile).
		if($thread['lastposteruid'] == 0)
		{
			$lastposterlink = $thread['lastposter'];
		}
		else
		{
			$lastposterlink = build_profile_link($thread['lastposter'], $thread['lastposteruid']);
		}
		if(my_strlen($thread['subject']) > 25)
		{
			$thread['subject'] = my_substr($thread['subject'], 0, 25) . "...";
		}
		$thread['subject'] = htmlspecialchars_uni($thread['subject']);
		eval("\$threadlist .= \"".$templates->get("portal_latestthreads_thread")."\";");
		$altbg = alt_trow();
	}
	if($threadlist)
	{ // show the table only if there are threads
		eval("\$latestthreads = \"".$templates->get("portal_latestthreads")."\";");
	}
}

Remember that some parts also need the portal lang files, make sure to load the portal lang files
$lang->load("portal");

regards
Template - called features

<html>
<head>
<title>{$mybb->settings[bbname]}</title>
{$headerinclude}
</head>
<body>
{$header}
<br />
<table width="100%" border="0">
<thead>
<tr>
<th>Rules</th>
</tr>
<tbody>
<tr>
UNDER CONSTRUCTION --UNDER CONSTRUCTION
</tr>
</tbody>
</table>
{$footer}
</body>
</html>

.php - called features.php

<?php

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

add_breadcrumb("Features page", "features.php"); // (2)

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

what am i doing wrong as im getting a blank page
Quote:eval("\$rules = \"".$templates->get("features")."\";"); // (3)
output_page($features); // (4)

Change $rules to $features Big Grin
Thanks
Im getting this error -


Parse error: parse error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' in /home/fhlinux183/t/tussaudtimes.co.uk/user/htdocs/2007.php on line 9

Here is the code i put -

<?php

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

add_breadcrumb("2007 page", "2007.php"); // (2)

eval("\$2007 = \"".$templates->get("2007")."\";"); // (3)
output_page($2007); // (4)
?>
You cannot start a variable with a number...

so $2007 will produce the errors you are seeing.

Try something like $year2007 or $y2007, or any other word that starts with a letter Toungue

As a rule, variables can only start with a letter or an underscore...not a number.
ok thanks. I have another question -

I want to put a chat room in my forum in an iframe how do i go about this.

EDIT:

I got this working -

<iframe frameborder="no" scrolling="no" width="100%" height="100%"
src="http://www.tussaudtimes.co.uk/flashchat/flashchat.php"></iframe>

But the height isn't showing http://www.tussaudtimes.co.uk/chat.php
The height attribute isn't good with percentages. I suggest you choose a definite value.
thanks it worked
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14