(2017-09-04, 03:26 PM).m. Wrote: [ -> ]^ reg. templates, theme properties has a option to select the templates set
forum admin panel >> Templates & Style >> Themes >> [theme] >> edit theme properties >> Template Set
related guidance : Themes (MyBB 1.6.x) | Templates (MyBB 1.8.x)
Not exactly what I'm after.
I have tried many things and cant seem to work it out.
The closest I got was a custom php page using copied headers and footers from a theme.
But if a user would have a separate forum theme that becomes moot.
What I want is to set a separate theme for a php page I created.
I tried a template but that didn't work too well either.
Calling a template from a php file:
Theme used for this is Square
<?php
define("IN_MYBB",1);
include("global.php");
eval("\$page .= \"".$templates->get("test")."\";");
output_page($page);
?>
The template I called:
<html>
<head>
<title>site test</title>
{$headerinclude}
<style>
#container {
background: #003965;
}
.breadcrumb {
display: none;
}
.indexpage
{
color: #FFFFFF;
}
</style>
</head>
<body>
<div class="scrolltotop"><i class="fa fa-caret-up fa-2x"></i></div>
<div id="container">
<div id="header">
<div class="wrapper">
<div class="logo"><div class="logo2"><i class="fa fa-cube fa-fw"></i></div> Square</div>
<div class="menu">
<ul>
<li><a href="{$mybb->settings['bburl']}/index.php"><i class="fa fa-comments fa-2x"></i><br />Index</a></li>
<li><a href="{$mybb->settings['bburl']}/search.php"><i class="fa fa-search fa-2x"></i><br />Search</a></li>
<li><a href="{$mybb->settings['bburl']}/memberlist.php"><i class="fa fa-users fa-2x"></i><br />Members</a></li>
<li><a href="{$mybb->settings['bburl']}/calendar.php"><i class="fa fa-calendar-o fa-2x"></i><br />Calendar</a></li>
<li><a href="{$mybb->settings['bburl']}/misc.php?action=help"><i class="fa fa-question-circle fa-2x"></i><br />Help</a></li>
</ul>
</div>
</div>
</div>
<div id="content">
<div class="wrapper">
<div class="indexpage">
<br />
Front page content goes here
</div>
</div>
</div>
<style="clear: both;" />
<div id="footer">
<div class="wrapper">
<div class="one">
<h3>About us</h3>
<p>Fill me with text pleaaaaaaaaaaaaaaase.</p>
<p>Fill me with text pleaaaaaaaaaaaaaaase.</p>
<p>Fill me with text pleaaaaaaaaaaaaaaase.</p>
<p>Fill me with text pleaaaaaaaaaaaaaaase.</p>
<p>Fill me with text pleaaaaaaaaaaaaaaase.</p>
</div>
<div class="two">
<h3>Navigation</h3>
<ul>
<li><a href="{$mybb->settings['bburl']}/index.php"><i style="font-size: 14px;" class="fa fa-comments fa-fw"></i> Index</a></li>
<li><a href="{$mybb->settings['bburl']}/search.php"><i style="font-size: 14px;" class="fa fa-search fa-fw"></i> Search</a></li>
<li><a href="{$mybb->settings['bburl']}/memberlist.php"><i style="font-size: 14px;" class="fa fa-users fa-fw"></i> Members</a></li>
<li><a href="{$mybb->settings['bburl']}/calendar.php"><i style="font-size: 14px;" class="fa fa-calendar-o fa-fw"></i> Calendar</a></li>
<li><a href="{$mybb->settings['bburl']}/misc.php?action=help"><i style="font-size: 14px;" class="fa fa-question-circle fa-fw"></i> Help</a></li>
</ul>
</div>
<div class="three">
<h3>Quick links</h3>
<ul>
{$contact_us}
<li><a href="{$mybb->settings['bburl']}/misc.php?action=syndication"><i style="font-size: 14px;" class="fa fa-rss fa-fw"></i> {$lang->bottomlinks_syndication}</a></li>
<li><a href="{$mybb->settings['bburl']}/search.php?action=getnew"><i style="font-size: 14px;" class="fa fa-comments fa-fw"></i> {$lang->welcome_newposts}</a></li>
<li><a href="{$mybb->settings['bburl']}/search.php?action=getdaily"><i style="font-size: 14px;" class="fa fa-comments-o fa-fw"></i> {$lang->welcome_todaysposts}</a></li>
<li><a href="<archive_url>"><i style="font-size: 14px;" class="fa fa-file-o fa-fw"></i> {$lang->bottomlinks_litemode}</a></li>
</ul>
</div>
</div>
</div>
<div id="copyright">
<div class="wrapper">
<div style="float: left;">
<!-- MyBB is free software developed and maintained by a volunteer community.
It would be much appreciated by the MyBB Group if you left the full copyright and "powered by" notice intact,
to show your support for MyBB. If you choose to remove or modify the copyright below,
you may be refused support on the MyBB Community Forums.
This is free software, support us and we'll support you. -->
{$lang->powered_by} <a href="https://mybb.com" target="_blank">MyBB{$mybbversion}</a>, © 2002-{$copy_year} <a href="https://mybb.com" target="_blank">MyBB Group</a>.
<!-- End powered by -->
</div>
<div style="float: right;">
Square theme by <a href="http://community.mybb.com/user-75705.html" target="_blank">eNvy</a> © 2015-2017.
</div>
</div>
<!-- The following piece of code allows MyBB to run scheduled tasks. DO NOT REMOVE -->{$task_image}<!-- End task image code -->
{$auto_dst_detection}
</div>
</body>
</html>
Also tried making a stand alone php file that that din't work too well.
Anytime the theme is changed, the template or php messes up as it tries to apply to the selected theme instead of just the 1 it was coded for.
Eg its coded for Square and if anyone uses default or something else it'll mess up.
If I only wanted to force 1 theme and that's it no changes allowed on the forum by users it would be fine.
Basically all I wanted is a separate front page using a certain MyBB theme so if a user would change the theme in the forums the front page stays on a certain theme.
I'm not really a coder so I guess it would have to be written all independent of MyBB as I was also hoping once I had a separate page with a theme I could put blocks on showing current threads etc in a custom div layout structure.