Coyote
Experienced User
Joined: 08 Dec 2006
Posts: 338
|
Posted: November 10th 2007, 3:43 pm Post subject: phpBB 2 as a Content Management System (CMS) |
|
|
This tutorial will show you how to use phpBB 2 as a complete website/content management system (CMS). It will allow you to use IM Portal to add as many pages to your site as you like without having to edit PHP or .tpl files and without needing FTP access. It turns the portal page into the home page and index.php into forums.php. If someone visits your site by typing in the root URL, i.e. http://www.yourdomain.com, it will take them to the home (portal) page without using redirects. Installation will cause EasyMOD to cease to function.
Back up all applicable files before proceeding.
1. Install IM Portal. Skip the file edits for login.php.
Do the following file edits only if you have already installed IM Portal and only if you have already done the file edits for login.php.
| Code:
|
#
#-----[ OPEN ]------------------------------------------
#
login.php
#
#-----[ FIND ]------------------------------------------
#
redirect(append_sid("portal.$phpEx", true));
#
#-----[ REPLACE WITH ]------------------------------------------
#
redirect(append_sid("index.$phpEx", true));
#
#-----[ FIND ]------------------------------------------
#
$url = ( !empty($HTTP_POST_VARS['redirect']) ) ? str_replace('&', '&', htmlspecialchars($HTTP_POST_VARS['redirect'])) : "portal.$phpEx";
#
#-----[ REPLACE WITH ]------------------------------------------
#
$url = ( !empty($HTTP_POST_VARS['redirect']) ) ? str_replace('&', '&', htmlspecialchars($HTTP_POST_VARS['redirect'])) : "index.$phpEx";
#
#-----[ FIND ]------------------------------------------
#
redirect(append_sid("portal.$phpEx", true));
#
#-----[ REPLACE WITH ]------------------------------------------
#
redirect(append_sid("index.$phpEx", true));
#
#-----[ FIND ]------------------------------------------
#
$url = ( !empty($HTTP_POST_VARS['redirect']) ) ? str_replace('&', '&', htmlspecialchars($HTTP_POST_VARS['redirect'])) : "portal.$phpEx";
#
#-----[ REPLACE WITH ]------------------------------------------
#
$url = ( !empty($HTTP_POST_VARS['redirect']) ) ? str_replace('&', '&', htmlspecialchars($HTTP_POST_VARS['redirect'])) : "index.$phpEx";
#
#-----[ FIND ]------------------------------------------
#
redirect(append_sid("portal.$phpEx", true));
#
#-----[ REPLACE WITH ]------------------------------------------
#
redirect(append_sid("index.$phpEx", true));
#
#-----[ SAVE AND CLOSE ]------------------------------------------
#
|
2. Change the link to {U_INDEX}.
| Code:
|
#
#-----[ OPEN ]------------------------------------------
#
includes/page_header.php
#
#-----[ FIND ]------------------------------------------
#
'U_INDEX' => append_sid('index.'.$phpEx),
#
#-----[ REPLACE WITH ]------------------------------------------
#
'U_INDEX' => append_sid('forums.'.$phpEx),
#
#-----[ SAVE AND CLOSE ]------------------------------------------
#
|
3. Continue with the file edits below, allowing you to have a separate title for each portal page.
| Code:
|
#
#-----[ OPEN ]------------------------------------------
#
portal.php
#
#-----[ FIND ]------------------------------------------
#
$sql = "SELECT template, forum_wide, view, groups FROM " . LAYOUT_TABLE . " WHERE lid = '" . $layout . "'";
#
#-----[ INLINE FIND ]------------------------------------------
#
$sql = "SELECT
#
#-----[ INLINE AFTER, ADD ]------------------------------------------
#make sure there is a space between name, and template,
name,
#
#-----[ FIND ]------------------------------------------
#
$sql = "SELECT template, forum_wide FROM " . LAYOUT_TABLE . " WHERE lid = '" . $layout . "'";
#
#-----[ INLINE FIND ]------------------------------------------
#
$sql = "SELECT
#
#-----[ INLINE AFTER, ADD ]------------------------------------------
#make sure there is a space between name, and template,
name,
#
#-----[ FIND ]------------------------------------------
#
$page_title = $lang['Home'];
#
#-----[ REPLACE WITH ]------------------------------------------
#
$page_title = !empty($layout_row['name']) ? $layout_row['name'] : $lang['Home'];
#
#-----[ SAVE AND CLOSE ]------------------------------------------
#
|
4. Rename index.php to forums.php and rename portal.php to index.php.
After you have done so, make these edits to the file:
| Code:
|
After you renamed index.php to forums.php and renamed portal.php to index.php
#
#-----[ OPEN ]------------------------------------------
#
forums.php
#
#-----[ FIND ]------------------------------------------
#
'U_VIEWCAT' => append_sid("index.$phpEx?" . POST_CAT_URL . "=$cat_id"))
#
#-----[ REPLACE WITH ]------------------------------------------
#
'U_VIEWCAT' => append_sid("forums.$phpEx?" . POST_CAT_URL . "=$cat_id"))
#
#-----[ SAVE AND CLOSE ]------------------------------------------
#
|
5. Use the IM Portal manual to learn how to add new portal pages, such as about us, contact, etc. Link to them like so (example):
| Code:
|
|
<a href="index.php?page=2">About Us</a>
|
6. Try visiting http://www.yourdomain.com/index.php?page=2.
Optional
7. Install Advanced BBCode Box and Advanced BBCode Box (IM Portal). If you are uncomfortable using HTML, now you can create entire web pages with BBCode!
Note that the title for your home page should now be "IM Portal Default" and will remain that way until you change the page title in Page Management in the ACP.
If you install hacks in the future that require you to edit index.php, remember it is now called forums.php!
Credit for part 3 of the tutorial goes to dcz. _________________ Free Code Editor | phpBB2 as CMS | My Hacks |
|