Advertisement:

Navigation

Readme

This will install SimplePortal 2.3.1 for SMF 1.1.

File Edits

./index.php

Find: [Select]
require_once($sourcedir . '/Security.php');
Replace With: [Select]
require_once($sourcedir . '/Security.php');
require_once($sourcedir . '/Subs-Portal.php');

Find: [Select]
// Is the forum in maintenance mode? (doesn't apply to administrators.)
if (!empty($maintenance) && !allowedTo('admin_forum'))
Replace With: [Select]
// Load SimplePortal.
sportal_init();

// Is the forum in maintenance mode? (doesn't apply to administrators.)
if (!empty($maintenance) && !allowedTo('admin_forum'))

Find: [Select]
'findmember' => array('Subs-Auth.php', 'JSMembers'),
Replace With: [Select]
'findmember' => array('Subs-Auth.php', 'JSMembers'),
'forum' => array('BoardIndex.php', 'BoardIndex'),
'portal' => array('PortalMain.php', 'sportal_main'),
'manageportal' => array('PortalAdminMain.php', 'sportal_admin_main'),

Find: [Select]
// Action and board are both empty... BoardIndex!
Replace With: [Select]
// Go catch it boy! Catch it!
$sp_action = sportal_catch_action();
if ($sp_action)
return $sp_action;

// Action and board are both empty... BoardIndex!

Find: [Select]
empty($modSettings['allow_guestAccess'])
Replace With: [Select]
empty($modSettings['allow_guestAccess']) && !(!empty($_REQUEST['action']) && $_REQUEST['action'] == 'dlattach' && !empty($_REQUEST['type']) && $_REQUEST['type'] == 'avatar') && !(empty($_REQUEST['action']) && empty($board) && empty($topic) && $modSettings['sp_portal_mode'] == 1)
Find: [Select]
if (empty($_REQUEST['action']) ||
Replace With: [Select]
if (empty($_REQUEST['action']) || !($_REQUEST['action'] == 'portal' && isset($_GET['xml'])) &&
Find: [Select]
// Get the function and file to include - if it's not there, do the board index.
Replace With: [Select]
if (!empty($context['disable_sp']))
unset($actionArray['portal'], $actionArray['forum']);

// Get the function and file to include - if it's not there, do the board index.

./SSI.php

Find: [Select]
require_once($sourcedir . '/Security.php');
Replace With: [Select]
require_once($sourcedir . '/Security.php');
require_once($sourcedir . '/Subs-Portal.php');

Find: [Select]
loadPermissions();
Replace With: [Select]
loadPermissions();

// Load some SP stuff.
sportal_init();

./Sources/Admin.php

Find: [Select]
'manage_smileys', 'manage_attachments'
Replace With: [Select]
'manage_smileys', 'manage_attachments', 'sp_admin', 'sp_manage_settings', 'sp_manage_blocks', 'sp_manage_articles', 'sp_manage_pages', 'sp_manage_shoutbox'

./Sources/BoardIndex.php

Find: [Select]
'href' => $scripturl . '#' . $row_board['ID_CAT'],
Replace With: [Select]
'href' => $scripturl . '?action=forum#' . $row_board['ID_CAT'],

./Sources/Display.php

Find: [Select]
// Is this topic sticky, or can it even be?
Replace With: [Select]
// Is this already an article?
$request = db_query("
SELECT ID_MESSAGE
FROM {$db_prefix}sp_articles
WHERE ID_MESSAGE = '$context[topic_first_message]'
LIMIT 1", __FILE__, __LINE__);
list ($context['topic_is_article']) = mysql_fetch_row($request);
mysql_free_result($request);

// Is this topic sticky, or can it even be?

./Sources/Help.php

Find: [Select]
// Load the admin help language file and template.
loadLanguage('Help');
Replace With: [Select]
// Load the admin help language file and template.
loadLanguage('Help');
if (loadLanguage('SPortalHelp', '', false) === false)
loadLanguage('SPortalHelp', 'english');

./Sources/Load.php

Find: [Select]
// Verify the ID_THEME... no foul play.
Replace With: [Select]
global $sp_standalone;

// Maybe we have a portal specific theme?
if (!isset($_GET['action']) && !isset($_GET['board']) && !isset($_GET['topic']) && ($modSettings['sp_portal_mode'] == 1 || !empty($sp_standalone)) && !empty($modSettings['portaltheme']))
$ID_THEME = (int) $modSettings['portaltheme'];

// SMF doesn't seem to be liking -1...
if ($ID_THEME == -1 && !empty($_SESSION['ID_THEME']))
{
unset($_SESSION['ID_THEME']);
$ID_THEME = $modSettings['theme_guests'];
}

// Verify the ID_THEME... no foul play.

Find: [Select]
// Wireless mode? Load up the wireless stuff.
Replace With: [Select]
// We'll be on the safe side, and load our language here!
if (loadLanguage('SPortal', '', false) === false)
loadLanguage('SPortal', 'english', false);

// Wireless mode? Load up the wireless stuff.

./Sources/ManagePermissions.php

Find: [Select]
'pm' => array(
Replace With: [Select]
'sp' => array(
'sp_admin' => false,
'sp_manage_settings' => false,
'sp_manage_blocks' => false,
'sp_manage_articles' => false,
'sp_manage_pages' => false,
'sp_manage_shoutbox' => false,
'sp_add_article' => false,
'sp_auto_article_approval' => false,
),
'pm' => array(

./Sources/ManageServer.php

Find: [Select]
loadLanguage('Help');
Replace With: [Select]
loadLanguage('Help');
if (loadLanguage('SPortalHelp', '', false) === false)
loadLanguage('SPortalHelp', 'english');

./Sources/QueryString.php

Find: [Select]
// If $scripturl is set to nothing, or the SID is not defined (SSI?) just quit.
Replace With: [Select]
// It's just a blue dream...
if (function_exists('sp_query_string'))
$buffer = sp_query_string($buffer);

// If $scripturl is set to nothing, or the SID is not defined (SSI?) just quit.

./Sources/Recent.php

Find: [Select]
'href' => $scripturl . '#' . $row['ID_CAT'],
'link' => '<a href="' . $scripturl . '#' . $row['ID_CAT'] . '">' . $row['cname'] . '</a>'
Replace With: [Select]
'href' => $scripturl . '?action=forum#' . $row['ID_CAT'],
'link' => '<a href="' . $scripturl . '?action=forum#' . $row['ID_CAT'] . '">' . $row['cname'] . '</a>'

Find: [Select]
'url' => $scripturl . '#' . (int) $_REQUEST['c'],
Replace With: [Select]
'url' => $scripturl . '?action=forum#' . (int) $_REQUEST['c'],
Find: [Select]
'url' => $scripturl . '#' . (int) $_REQUEST['c'][0],
Replace With: [Select]
'url' => $scripturl . '?action=forum#' . (int) $_REQUEST['c'][0],

./Sources/Subs.php

Find: [Select]
function parse_bbc($message, $smileys = true, $cache_id = ''
Replace With: [Select]
function parse_bbc($message, $smileys = true, $cache_id = '', $parse_tags = false
Find: [Select]
static $disabled;
Replace With: [Select]
static $disabled, $parse_tag_cache;
Find: [Select]
// Shall we take the time to cache this?
Replace With: [Select]
if ($parse_tags !== false && is_array($parse_tags))
{
$temp_bbc = $bbc_codes;
$tags_cache_id = implode(',', $parse_tags);

if (isset($parse_tag_cache[$tags_cache_id]))
$bbc_codes = $parse_tag_cache[$tags_cache_id];
else
{
foreach ($bbc_codes as $key_bbc => $bbc)
foreach ($bbc as $key_code => $code)
if (!in_array($code['tag'], $parse_tags))
unset($bbc_codes[$key_bbc][$key_code]);

$parse_tag_cache = array($tags_cache_id => $bbc_codes);
}
}

// Shall we take the time to cache this?

Find: [Select]
cache_put_data($cache_key, $message, 240);
Replace With: [Select]
cache_put_data($cache_key, $message, 240);

if (isset($temp_bbc))
{
$bbc_codes = $temp_bbc;
$temp_bbc = null;
}

Find: [Select]
'admin_forum', 'manage_boards'
Replace With: [Select]
'admin_forum', 'manage_boards', 'sp_admin', 'sp_manage_settings', 'sp_manage_blocks', 'sp_manage_articles', 'sp_manage_pages', 'sp_manage_shoutbox'
Find: [Select]
// Admin area 'Members'.
Replace With: [Select]
if (allowedTo(array('sp_admin', 'sp_manage_settings', 'sp_manage_blocks', 'sp_manage_articles', 'sp_manage_pages', 'sp_manage_shoutbox')))
{
if (loadLanguage('SPortalAdmin', '', false) === false)
loadLanguage('SPortalAdmin', 'english', false);

$context['admin_areas']['sportal'] = array(
'title' => $txt['sp-adminCatTitle'],
'areas' => array()
);

if (allowedTo(array('sp_admin', 'sp_manage_settings')))
$context['admin_areas']['sportal']['areas']['portalconfig'] = '<a href="' . $scripturl . '?action=manageportal;area=portalconfig">' . $txt['sp-adminConfiguration'] . '</a>';

if (allowedTo(array('sp_admin', 'sp_manage_blocks')))
$context['admin_areas']['sportal']['areas']['portalblocks'] = '<a href="' . $scripturl . '?action=manageportal;area=portalblocks">' . $txt['sp-blocksBlocks'] . '</a>';

if (allowedTo(array('sp_admin', 'sp_manage_articles')))
$context['admin_areas']['sportal']['areas']['portalarticles'] = '<a href="' . $scripturl . '?action=manageportal;area=portalarticles">' . $txt['sp-adminColumnArticles'] . '</a>';

if (allowedTo(array('sp_admin', 'sp_manage_pages')))
$context['admin_areas']['sportal']['areas']['portalpages'] = '<a href="' . $scripturl . '?action=manageportal;area=portalpages">' . $txt['sp_admin_pages_title'] . '</a>';

if (allowedTo(array('sp_admin', 'sp_manage_shoutbox')))
$context['admin_areas']['sportal']['areas']['portalshoutbox'] = '<a href="' . $scripturl . '?action=manageportal;area=portalshoutbox">' . $txt['sp_admin_shoutbox_title'] . '</a>';
}

// Admin area 'Members'.

Find: [Select]
$add = preg_match('~^(ftp|http)[s]?://~', $setLocation) == 0 && substr($setLocation, 0, 6) != 'about:';
Replace With: [Select]
$add = preg_match('~^(ftp|http)[s]?://~', $setLocation) == 0 && substr($setLocation, 0, 6) != 'about:';

// We need the empty redirect for the smf portal go to the action=forum site =)
if ((empty($setLocation) || $scripturl == $setLocation) && $modSettings['sp_portal_mode'] == 1 && empty($modSettings['sp_disableForumRedirect']))
$setLocation = 'action=forum';

./Sources/Who.php

Find: [Select]
// Actions that require a specific permission level.
Replace With: [Select]
if ($modSettings['sp_portal_mode'] == 1)
{
$txt['who_index'] = $txt['sp_who_index'];
$txt['whoall_forum'] = $txt['sp_who_forum'];
}

// Actions that require a specific permission level.

Find: [Select]
$board_ids = array();
Replace With: [Select]
$board_ids = array();
$page_ids = array();

Find: [Select]
// It's the board index!! It must be!
Replace With: [Select]
elseif (isset($actions['page']))
{
$data[$k] = $txt['who_hidden'];
$page_ids[$actions['page']][$k] = $txt['sp_who_page'];
}
// It's the board index!! It must be!

Find: [Select]
// Load member names for the profile.
Replace With: [Select]
if (!empty($page_ids))
{
$numeric_ids = array();
$string_ids = array();
$page_where = array();

foreach ($page_ids as $page_id => $dummy)
if (is_numeric($page_id))
$numeric_ids[] = (int) $page_id;
else
$string_ids[] = '\'' . $page_id . '\'';

if (!empty($numeric_ids))
$page_where[] = 'ID_PAGE IN (' . implode(', ', $numeric_ids) . ')';

if (!empty($string_ids))
$page_where[] = 'namespace IN (' . implode(', ', $string_ids) . ')';

$result = db_query("
SELECT ID_PAGE, namespace, title, allowed_groups, permission_type
FROM {$db_prefix}sp_pages
WHERE " . implode(' OR ', $page_where) . "
LIMIT " . count($page_ids), __FILE__, __LINE__);
$page_data = array();
while ($row = mysql_fetch_assoc($result))
{
if (!sp_allowed_to('page', $row['ID_PAGE'], $row['allowed_groups'], $row['permission_type']))
continue;

$page_data[] = array(
'id' => $row['ID_PAGE'],
'namespace' => $row['namespace'],
'title' => $row['title'],
);
}
mysql_free_result($result);

if (!empty($page_data))
{
foreach ($page_data as $page)
{
if (isset($page_ids[$page['id']]))
foreach ($page_ids[$page['id']] as $k => $session_text)
$data[$k] = sprintf($session_text, $page['id'], $page['title']);

if (isset($page_ids[$page['namespace']]))
foreach ($page_ids[$page['namespace']] as $k => $session_text)
$data[$k] = sprintf($session_text, $page['namespace'], $page['title']);
}
}
}

// Load member names for the profile.

./Themes/default/index.template.php

Find: [Select]
$current_action = 'home';
Replace With: [Select]
global $modSettings;
$current_action = $modSettings['sp_portal_mode'] == 3 && empty($context['standalone']) && empty($context['disable_sp']) ? 'forum' : 'home';

Find: [Select]
'login', 'help', 'pm'
Replace With: [Select]
'login', 'help', 'pm', 'forum'
Find: [Select]
'smileys', 'viewErrorLog', 'viewmembers'
Replace With: [Select]
'smileys', 'viewErrorLog', 'viewmembers', 'manageportal'
Find: [Select]
$current_action = 'search';
Replace With: [Select]
$current_action = 'search';
if (empty($context['disable_sp']) && (isset($_GET['board']) || isset($_GET['topic']) || in_array($context['current_action'], array('unread', 'unreadreplies'))) && in_array($modSettings['sp_portal_mode'], array(1, 3)))
$current_action = 'forum';

Find: [Select]
// Show the [home] button.
echo ($current_action=='home' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'home' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '">' , $txt[103] , '</a>
</td>' , $current_action == 'home' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
Replace With: [Select]
// Show the [home] button.
echo ($current_action=='home' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'home' ? 'active_back' : 'back' , '">
<a href="', ($modSettings['sp_portal_mode'] == 3 && empty($context['disable_sp']) ? $modSettings['sp_standalone_url'] : $scripturl), '">' , $txt[103] , '</a>
</td>' , $current_action == 'home' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// Show the [forum] button.
if (empty($context['disable_sp']) && in_array($modSettings['sp_portal_mode'], array(1, 3)))
echo ($current_action=='forum' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'forum' ? 'active_back' : 'back' , '">
<a href="', $scripturl . ($modSettings['sp_portal_mode'] == 1 ? '?action=forum' : ''), '">', empty($txt['sp-forum']) ? 'Forum' : $txt['sp-forum'], '</a>
</td>' , $current_action=='forum' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

./Themes/default/Display.template.php

Find: [Select]
// Show the page index... "Pages: [1]".
Replace With: [Select]
// Make Article Button
if ($context['can_make_article'])
$normal_buttons['article'] = array('text' => 'sp-' . ($context['topic_is_article'] ? 'remove' : 'add') . '_article', 'image' => 'addarticle.gif', 'lang' => true, 'url' => $scripturl . '?action=portal;sa=' . ($context['topic_is_article'] ? 'remove' : 'add') . 'article;message=' . $context['topic_first_message'] . ';return=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id']);

// Show the page index... "Pages: [1]".

Code

install1-1.php

This file should be able to execute standalone.

File Operations

Move the included file "PortalStandalone.php" to "the root directory".
Move the included directory "smf1/Sources" to "the root directory".
Move the included directory "smf1/Themes" to "the root directory".
Move the included directory "languages" to "./Themes/default".
Move the included directory "sp" to "./Themes/default/images".
Move the included file "portal.css" to "./Themes/default".
Move the included file "portal_rtl.css" to "./Themes/default".
Move the included file "portal.js" to "./Themes/default".