=======================================================================================================================================
Modification Title: Portal System

Modification Version: 6.0

Modification Author: John Briggs

Updated/Repackaged for XMB 1.9.11 by The XMB Group

Modification Description:
This modification will add a portal system interface section to your forum.
This modification provide the ability to create additional blocks for the portal.

Modification Copyright: 2008 The XMB Group. All rights reserved.

Modification Compatibility: XMB 1.9.11 (Only)

Modification Install Note: Before adding this modification to your forum you should back up all files related to this mod.

Modification License Note: This modification is released under the GPL v3 License. A copy is provided with this software package.

******IMPORTANT!!!!!!!!!!!!!*********
This modification must be applied in the exact order it is laid out in - step 1 followed by step 2 ..............
******IMPORTANT!!!!!!!!!!!!!*********

=======================================================================================================================================
=======
Step 1:
=======

Please upload the following files to your forum directory.

"portal.php", "cp_portal.php", "portal.xmb"

Please upload the following file to your forum "include" directory.

include\"portal.inc.php"

Please upload the following file to your forum "lang" directory.

"English.portal.php"

Please upload the following image to all your theme folders.

images\"top_portal.gif"

=======================================================================================================================================
=======
Step 2:
=======

Please run install.php from your forum directory.

Example: http://www.yourdomain.ext/yourforum/install.php

=======================================================================================================================================
=======
Step 3:
=======
================
Edit File: index.php
================
==========
Find Code:
==========

require 'header.php';

===============
Add Code Below:
===============

// Portal System Mod Begin
if ($SETTINGS['portalstatus'] == 'on' && $SETTINGS['portalview'] == 'on' && !isset($forums) && !isset($gid)) {
    redirect('portal.php', 0);
}
// Portal System Mod End

==========
Find Code:
==========

    setCanonicalLink('./');

================
Replace Code With:
================

    // Portal System Mod Begin
    if ($SETTINGS['portalstatus'] == 'on' && $SETTINGS['portalview'] == 'on') {
        setCanonicalLink('index.php?forums');
    } else {
        setCanonicalLink('./');
    }
    // Portal System Mod End

=======================================================================================================================================
=======
Step 4:
=======
=================
Edit File: header.php
=================
==========
Find Code:
==========

'members',

===============
Add Code Below:
===============

'portal_templates',

==========
Find Code:
==========

    $logo = '<a href="./"><img src="'.$boardimg.'" alt="'.$bbname.'" border="0" /></a>';

================
Replace Code With:
================

    // Portal System Mod Begin
    if ($SETTINGS['portalstatus'] == 'on' && $SETTINGS['portalview'] == 'on') {
        $logo = '<a href="index.php?forums"><img src="'.$boardimg.'" alt="'.$bbname.'" border="0" /></a>';
    } else {
        $logo = '<a href="./"><img src="'.$THEME['boardimg'].'" alt="'.$SETTINGS['bbname'].'" border="0" /></a>';
    }

==========
Find Code:
==========

    // Search-link
    $searchlink = makeSearchLink();

===============
Add Code Above:
===============

    // Portal-link
    $portallink = '';
    if ($SETTINGS['portalstatus'] == 'on') {
        if (!isset($lang['portalnav'])) {
            require ROOT.'include/portal.inc.php';
            assertPortalTranslation();
        }
        if (X_SCRIPT != 'portal.php') {
            $portallink = '<img src="'.$THEME['imgdir'].'/top_portal.gif" alt="'.$lang['portalnav'].'" border="0" /> <a href="portal.php"><font class="navtd">'.$lang['portalnav'].'</font></a> &nbsp; ';
        } elseif ($SETTINGS['portalstatus'] == 'on' && $SETTINGS['portalview'] == 'on') {
            $portallink = '<img src="'.$THEME['imgdir'].'/top_portal.gif" alt="'.$lang['portalindexnav'].'" border="0" /> <a href="index.php?forums"><font class="navtd">'.$lang['portalindexnav'].'</font></a> &nbsp; ';
        } else {
            $portallink = '<img src="'.$THEME['imgdir'].'/top_portal.gif" alt="'.$lang['portalindexnav'].'" border="0" /> <a href="./"><font class="navtd">'.$lang['portalindexnav'].'</font></a> &nbsp; ';
        }
    }

=======================================================================================================================================
=======
Step 5:
=======
=======================
Edit File: inlcude/admin.inc.php
=======================
==========
Find Code:
==========

if (!defined('IN_CODE')) {
    header('HTTP/1.0 403 Forbidden');
    exit("Not allowed to run this file directly.");
}

===============
Add Code Below:
===============

// Portal System Mod Begin
require_once(ROOT.'include/portal.inc.php');
assertPortalTranslation();
// Portal System Mod End

==========
Find Code:
==========

    &raquo;&nbsp;<a href="tools.php?action=whosonlinedump"><?php echo $lang['cpwodump']?></a><br />
    </td>
    <td class="tablerow" align="left" valign="top" width="20%" bgcolor="<?php echo $THEME['altbg2']?>">

===============
Add Code Below:
===============

    <!-- Portal System Mod Begin -->
    &raquo;&nbsp;<a href="cp_portal.php"><?php echo $lang['portalcp']?></a><br />
    <!-- Portal System Mod End -->

=======================================================================================================================================
=======
Step 6:
=======
=======================
Edit File: include/online.inc.php
=======================
==========
Find Code:
==========

    } else if (false !== strpos($url, '/cp.php') || false !== strpos($url, '/cp2.php')) {

==================
Replace Code With:
==================

    } else if (false !== strpos($url, '/cp.php') || false !== strpos($url, '/cp2.php') || false !== strpos($url, '/cp_portal.php')) {

==========
Find Code:
==========

    } else if (false !== strpos($url, '/topicadmin.php')) {
        $location = $lang['onlinetopicadmin'];

===============
Add Code Below:
===============

    // Portal System Mod Begin
    } else if (false !== strpos($url, '/portal.php')) {
        $location = $lang['portalonline'];
    // Portal System Mod End

=======================================================================================================================================
=======
Step 7:
=======

==============================
Go to administration panel -> Templates
==============================
=================
Edit Template: footer
=================

==========
Find Code:
==========

<a href="index.php">

================
Replace Code With:
================

<a href="./index.php?forums">

=======================================================================================================================================
=======
Step 8:
=======
==============================
Go to administration panel -> Templates
==============================
=================
Edit Template: header
=================
==========
Find Code:
==========

<td class="navtd"><font class="navtd">$searchlink $links $pluglink</font></td>

================
Replace Code With:
================

<td class="navtd"><font class="navtd">$portallink $searchlink $links $pluglink</font></td>

==========
Find Code:
==========

<a href="./">

================
Replace Code With:
================

<a href="./index.php?forums">

=======================================================================================================================================
=======
Step 9:
=======

Please DELETE!! the following files from your "forum" directory if they still exist.

"install.php", "portal.xmb"

=======================================================================================================================================
========
Step 10:
========

To learn how to create new portal blocks please read the provided text file named "How_To.txt".

=======================================================================================================================================
Enjoy!