2011-10-21, 03:36 AM
If you have your forum in a fodler below the site root, you can use the MyBB portal as a home page very easily.
file/folder changes
template changes
then there are some edits to deal with PM notices that come up on the index page (was portal).
in global.php
find:
replace:
find:
replace:
then in inc/languages/english/global.lang.php
find:
replace:
find:
replace:
I think that is all the big changes needed
file/folder changes
- assume MyBB is in the /forum folder, your actual subfolder can be different
- leave index.php as index.php in /forum folder
- edit settings to use new /forum directory
- move portal.php to site root
- edit portal.php and find
$forumdir = "./";
replace
$forumdir = "./forum";
- make these changes as well
in portal.php (now index.php in site root)
find:
$parser = new postParser;
add after:
global $theme; $theme['imgdir'] = $forumdir.'/'.substr($theme['imgdir'],0);
- rename portal.php to index.php
- to make quick login work, you need to edit /jscripts/general.js and find the quickLogin function and make the 3 lines look like (the bburl and bburl+)
find:
quickLogin: function() { if($("quick_login")) { var form = new Element("form", { method: "post", action: "member.php" });
replace:
quickLogin: function(bburl) { if($("quick_login")) { var form = new Element("form", { method: "post", action: bburl+"member.php" });
template changes
- edit "header" so it is similar to this, where the Home link goes to your site root (homeurl), and the Forums link goes to the forum (bburl)
<div class="menu"> <ul> <li><a href="{$mybb->settings['homeurl']}"><img src="{$mybb->settings['bburl']}/{$theme['imgdir']}/toplinks/portal.gif" alt="Home" title="Home" width="16" height="16" />Home</a></li> <li><a href="{$mybb->settings['bburl']}/index.php"><img src="{$mybb->settings['bburl']}/{$theme['imgdir']}/toplinks/forum.png" alt="Forums" title="Forums" width="16" height="16" />Forums</a></li>
- edit "header" to correct the logo link to use homeurl
<div class="logo"><a href="{$mybb->settings['homeurl']}"><div style="float:left"><img src="{$theme['logo']}" alt="{$mybb->settings['bbname']}" title="{$mybb->settings['bbname']}" width="600" /></a></div>
- edit the header_welcomeblock_guest template and change
toonclick="MyBB.quickLogin();
onclick="MyBB.quickLogin('{$mybb->settings['bburl']}/');
then there are some edits to deal with PM notices that come up on the index page (was portal).
in global.php
find:
$privatemessage_text = $lang->sprintf($lang->newpm_notice_one, $user_text, $pm['pmid'], htmlspecialchars_uni($pm['subject']));
replace:
$privatemessage_text = $lang->sprintf($lang->newpm_notice_one, $user_text, $mybb->settings['bburl'], $pm['pmid'], htmlspecialchars_uni($pm['subject']));
find:
$privatemessage_text = $lang->sprintf($lang->newpm_notice_multiple, $mybb->user['pms_unread'], $user_text, $pm['pmid'], htmlspecialchars_uni($pm['subject']));
replace:
$privatemessage_text = $lang->sprintf($lang->newpm_notice_multiple, $mybb->user['pms_unread'], $user_text, $mybb->settings['bburl'], $pm['pmid'], htmlspecialchars_uni($pm['subject']));
then in inc/languages/english/global.lang.php
find:
$l['newpm_notice_multiple'] = "<strong>You have {1} unread private messages.</strong> The most recent is from {2} titled <a href=\"private.php?action=read&pmid={3}\" style=\"font-weight: bold;\">{4}</a>";
replace:
$l['newpm_notice_multiple'] = "<strong>You have {1} unread private messages.</strong> The most recent is from {2} titled <a href=\"{3}/private.php?action=read&pmid={4}\" style=\"font-weight: bold;\">{5}</a>";
find:
$l['newpm_notice_one'] = "<strong>You have one unread private message</strong> from {1} titled <a href=\"private.php?action=read&pmid={2}\" style=\"font-weight: bold;\">{3}</a>";
replace:
$l['newpm_notice_one'] = "<strong>You have one unread private message</strong> from {1} titled <a href=\"{2}/private.php?action=read&pmid={3}\" style=\"font-weight: bold;\">{4}</a>";
I think that is all the big changes needed