News: Welcome to the TinyPortal Support site.

Login  |  Register
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media
Welcome, Guest. Please login or register.
Did you miss your activation email?

February 28, 2020, 04:04:38 AM

Login with username, password and session length

Recent

Members
Stats
  • Total Posts: 189516
  • Total Topics: 20802
  • Online Today: 105
  • Online Ever: 917
  • (January 21, 2020, 09:02:26 AM)
Users Online
Users: 0
Guests: 88
Total: 88

Author Topic: Modinstructions for SMF 1.1.4 and TP V1.0.5  (Read 20350 times)

0 Members and 1 Guest are viewing this topic.

Offline G6Cad

  • Friends
  • *
  • Posts: 12643
    • FamiljeGodis
Modinstructions for SMF 1.1.4 and TP V1.0.5
« on: April 07, 2008, 12:12:23 PM »
<edit file>
$boarddir/index.php
Code: [Select]
<search for>
require_once($sourcedir . '/Security.php');

<add after>
       
Code: [Select]
// TinyPortal include
       require_once($sourcedir . '/TPortal.php');


<search for>
   
Code: [Select]
// Is the forum in maintenance mode? (doesn't apply to administrators.)
<add before>
       
Code: [Select]
// TinyPortal
        TPortal_init();


<search for>
      
Code: [Select]
// Action and board are both empty... BoardIndex!
if (empty($board) && empty($topic))
{
require_once($sourcedir . '/BoardIndex.php');
return 'BoardIndex';
}

<replace>
      
Code: [Select]
// first..if the action is set, but empty, don't go any further
if (isset($_REQUEST['action']) && $_REQUEST['action']=='')
{
require_once($sourcedir . '/BoardIndex.php');
return 'BoardIndex';
}

// Action and board are both empty... maybe the portal page?
if (empty($board) && empty($topic) && $settings['TPortal_front_type']!='boardindex')
{
require_once($sourcedir . '/TPortal.php');
return 'TPortal';
}
if (empty($board) && empty($topic) && $settings['TPortal_front_type']=='boardindex' && (isset($_GET['cat']) || isset($_GET['page'])))
{
require_once($sourcedir . '/TPortal.php');
return 'TPortal';
}
// Action and board are still both empty...and no portal startpage - BoardIndex!
elseif (empty($board) && empty($topic) && $settings['TPortal_front_type']=='boardindex')
{
require_once($sourcedir . '/BoardIndex.php');
return 'BoardIndex';
}


<search for>
      
Code: [Select]
'.xml' => array('News.php', 'ShowXmlFeed'),
<add after>
               
Code: [Select]
'tpadmin' => array('TPortalAdmin.php', 'TPortalAdmin'),
                'forum' => array('BoardIndex.php', 'BoardIndex'),
                'tpmod' => array('TPmodules.php', 'TPmodules'),


<edit file>
$sourcedir/Load.php


<search for>
   
Code: [Select]
$settings = $themeData[0];
<add after>
   
Code: [Select]
if (!empty($context['TPortal']['front_type'])){
$settings['TPortal_front_type'] = $context['TPortal']['front_type'];
}


<search for>
   
Code: [Select]
// Start the linktree off empty..
$context['linktree'] = array();

<replace>
       
Code: [Select]
// Start the linktree off empty..not quite, have to insert forum
        $context['linktree'] = array(array('url' => $scripturl . '?action=forum', 'name' => 'Forum'));


<search for>
      
Code: [Select]
// Build up the linktree.
$context['linktree'] = array_merge(
$context['linktree'],
array(array(
'url' => $scripturl . '#' . $board_info['cat']['id'],
'name' => $board_info['cat']['name']
)),

<replace>
               
Code: [Select]
// Build up the linktree (adding TPortal forum index)
                $context['linktree'] = array_merge(
                        $context['linktree'],
                        array(array(
                                'url' => $scripturl . '?action=forum#' . $board_info['cat']['id'],
                                'name' => $board_info['cat']['name']
                        )),


<search for>
   
Code: [Select]
// The theme is the forum's default.
else
$ID_THEME = $modSettings['theme_guests'];


<add after>

   
Code: [Select]
// TinyPortal
$newtheme=TP_loadTheme();
if($newtheme!=$ID_THEME && $newtheme>0)
$ID_THEME=$newtheme;
// end TinyPortal


<edit file>
$themedir/index.template.php


<search for>
   
Code: [Select]
if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm')))
<replace>
   
Code: [Select]
if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm', 'forum', 'tpadmin')))

<search for>
      
Code: [Select]
$current_action = 'search';
<add after>
   
Code: [Select]
if (isset($_GET['dl']))
$current_action = 'dlmanager';

if (isset($_GET['board']) || isset($_GET['topic']) || $context['current_action']=='forum')
$current_action = 'forum';

if ($context['current_action']=='tpadmin')
$current_action = 'admin';


<search for>
   
Code: [Select]
// Show the [help] button.

<add before>
Code: [Select]
if($settings['TPortal_front_type']!='boardindex')
// Show the [forum] button.
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, '?action=forum">'.$txt['tp-forum'].'</a>
</td>' , $current_action=='forum' ? '<td class="maintab_active_last">&nbsp;</td>' : '';


<search for>
   
Code: [Select]
// The end of tab section.
echo '
<td class="maintab_' , $last , '">&nbsp;</td>

<add after>
Code: [Select]
';
// TinyPortal
if($context['TPortal']['leftbar'])
             echo '<td style="padding-left: 1ex;"><a href="javascript:void(0);" onclick="shrinkHeaderLeftbar(!current_leftbar); return false;"><img id="upshrinkLeftbar" src="', $settings['images_url'], '/', empty($options['collapse_leftbar']) ? 'upshrink.gif' : 'upshrink2.gif', '" alt="*" title="', $txt['upshrink_description'], '" style="margin: 2px 0;" border="0" /></a><img id="upshrinkTempLeftbar" src="', $settings['images_url'], '/blank.gif" alt="" style="margin-right: 0ex;" /></td>';
         if($context['TPortal']['rightbar'])
             echo '<td style="padding-left: 1ex;"><a href="javascript:void(0);" onclick="shrinkHeaderRightbar(!current_rightbar); return false;"><img id="upshrinkRightbar" src="', $settings['images_url'], '/', empty($options['collapse_rightbar']) ? 'upshrink.gif' : 'upshrink2.gif', '" alt="*" title="', $txt['upshrink_description'], '" style="margin: 2px 0;" border="0" /></a><img id="upshrinkTempRightbar" src="', $settings['images_url'], '/blank.gif" alt="" style="margin-right: 0ex;" /></td>';
// TinyPortal end
echo '


<edit file>
$boarddir/Themes/babylon/index.template.php



<search for>
      
Code: [Select]
<a href="javascript:void(0);" onclick="shrinkHeader(!current_header); return false;"><img id="upshrink" src="', $settings['images_url'], '/', empty($options['collapse_header']) ? 'upshrink.gif' : 'upshrink2.gif', '" alt="*" title="', $txt['upshrink_description'], '" style="margin: 2px 2ex 2px 0;" border="0" /></a>';
<replace>
Code: [Select]
';
// TinyPortal

         if($context['TPortal']['showtop'])
             echo '<a href="javascript:void(0);" onclick="shrinkHeader(!current_header); return false;"><img id="upshrink" src="', $settings['images_url'], '/', empty($options['collapse_header']) ? 'upshrink.gif' : 'upshrink2.gif', '" alt="*" title="', $txt['upshrink_description'], '" style="margin: 2px 0;" border="0" /></a><img id="upshrinkTemp" src="', $settings['images_url'], '/blank.gif" alt="" style="margin-right: 1ex;" /> ';
         if($context['TPortal']['leftbar'])
             echo '<a href="javascript:void(0);" onclick="shrinkHeaderLeftbar(!current_leftbar); return false;"><img id="upshrinkLeftbar" src="', $settings['images_url'], '/', empty($options['collapse_leftbar']) ? 'upshrink.gif' : 'upshrink2.gif', '" alt="*" title="', $txt['upshrink_description'], '" style="margin: 2px 0;" border="0" /></a><img id="upshrinkTempLeftbar" src="', $settings['images_url'], '/blank.gif" alt="" style="margin-right: 0ex;" />';
         if($context['TPortal']['rightbar'])
             echo '<a href="javascript:void(0);" onclick="shrinkHeaderRightbar(!current_rightbar); return false;"><img id="upshrinkRightbar" src="', $settings['images_url'], '/', empty($options['collapse_rightbar']) ? 'upshrink.gif' : 'upshrink2.gif', '" alt="*" title="', $txt['upshrink_description'], '" style="margin: 2px 0;" border="0" /></a><img id="upshrinkTempRightbar" src="', $settings['images_url'], '/blank.gif" alt="" style="margin-right: 0ex;" />';
// TinyPortal end


<search for>
   
Code: [Select]
// Show the [home] and [help] buttons.
echo '
<a href="', $scripturl, '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/home.gif" alt="' . $txt[103] . '" style="margin: 2px 0;" border="0" />' : $txt[103]), '</a>', $context['menu_separator'], '
<a href="', $scripturl, '?action=help">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/help.gif" alt="' . $txt[119] . '" style="margin: 2px 0;" border="0" />' : $txt[119]), '</a>', $context['menu_separator'];

<replace>
   
Code: [Select]
// Show the [home] and [help] buttons.
echo '
                     <a href="', $scripturl, '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/home.gif" alt="' . $txt[103] . '" style="margin: 2px 0;" border="0" />' : $txt[103]), '</a>', $context['menu_separator'];
if($settings['TPortal_front_type']!='boardindex')
echo '        <a href="', $scripturl, '?action=forum">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/forum.gif" alt="Forum Index" style="margin: 2px 0;" border="0" />' : 'Forum Index'), '</a>', $context['menu_separator'];

echo '        <a href="', $scripturl, '?action=help" target="_blank">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/help.gif" alt="' . $txt[119] . '" style="margin: 2px 0;" border="0" />' : $txt[119]), '</a>', $context['menu_separator'];


<edit file>
$sourcedir/Subs.php


<search for>
   
Code: [Select]
$context['allow_admin'] = allowedTo(array('admin_forum', 'manage_boards', 'manage_permissions', 'moderate_forum', 'manage_membergroups', 'manage_bans', 'send_mail', 'edit_news', 'manage_attachments', 'manage_smileys'));

<add after>

   
Code: [Select]
// tinyportal //
global $sourcedir;
require_once($sourcedir.'/TPSubs.php');
TPcheckAdminAreas();
// end //


<search for>
   
Code: [Select]
// Admin area 'Members'.
<add before>
   
Code: [Select]
// TinyPortal
global $sourcedir;
require_once($sourcedir.'/TPSubs.php');
TPsetupAdminAreas();
// TinyPortal end


<search for>
Code: [Select]
function redirectexit($setLocation = '', $refresh = false)

<replace>
Code: [Select]
function redirectexit($setLocation = '', $refresh = false, $tp_not = false)
<search for>
   
Code: [Select]
// Put the session ID in.
if (defined('SID') && SID != '')


<add before>
   
Code: [Select]
// TinyPortal
if ($setLocation == $scripturl && !$tp_not)
$setLocation .= '?action=forum';
// end
   

<edit file>
$sourcedir/ManagePermissions.php


<search for>
   
Code: [Select]
// This is just a helpful array of permissions guests... cannot have.

<add before>
   
Code: [Select]
// TPortal
foreach($context['TPortal']['permissonlist'] as $perm )
$permissionList['membergroup'][$perm['title']] = $perm['perms'];

// end TinyPortal


<search for>
   
Code: [Select]
// All permission groups that will be shown in the left column.
$leftPermissionGroups = array(
'general',
'calendar',
'maintenance',
'member_admin',
'general_board',
'topic',
'post',
);


<replace>
   
Code: [Select]
// All permission groups that will be shown in the left column.
$leftPermissionGroups = array(
'general',
'maintenance',
'member_admin',
'profile',
'general_board',
'topic',
'post',
);


<edit file>
$sourcedir/Security.php


<search for>
Code: [Select]
// Require a user who is logged in. (not a guest.)
function is_not_guest($message = '')
{
global $user_info, $txt, $context;


<add after>

   
Code: [Select]
// TinyPortal
TPortal_init();


<edit file>
$sourcedir/Errors.php


<search for>
   
Code: [Select]
// We don't have $txt yet, but that's okay...
if (empty($txt))
die($error);


<add after>

   
Code: [Select]
// TinyPortal
if(!isset($context['tp_prefix']))
TPortal_init();
// end


<edit file>
$themedir/style.css


<search for>
Code: [Select]
/* Normal, standard links. */

<add before>
Code: [Select]
/* TP specific classes */
.sitemap{
margin: 0;
padding: 0;
list-style: none;
}
.sitemap_topheader{
background: #ECEDF3;
border-bottom: solid 1px #ffffff;
padding: 4px;
}

.sitemap_header{
background: #ECEDF3;
border-bottom: solid 1px #ffffff;
padding: 4px;
display: block;
font-weight: bold;
 }

.sitemap_header_active{
background: #C8D6E1;
border-bottom: solid 1px #ffffff;
padding: 4px;
display: block;
font-weight: bold;
}

.sitemap_header:hover , .sitemap_header_active:hover{
background: #DBE4ED;
border-bottom: solid 1px #ffffff;
padding: 4px;
display: block;
text-decoration: none;
}

/* TP other styles */
ul#articlelist
{
margin: 0;
padding: 0.5ex 0;
list-style: none;
}
ul#catlist
{
margin: 0;
padding: 0;
list-style: none;
border-top: solid 1px #d0d0d0;
}

ul#articlelist li
{
margin: 0;
display: block;
padding: 0 0 0 3ex;
background: url(images/divider.gif) no-repeat 5px 3px;
}
ul#catlist li
{
display: block;
padding: 0 0 0 3ex;
margin: 0;
}

/* TP rss feed styles */
.rss_title{
 font-weight: bold;
}

.rss_body{
margin-bottom: 1ex;
}

.rss_image{
margin: 4px 0 4px 0;
}


<edit file>
$themedir/Help.template.php


<search for>
   
Code: [Select]
global $context, $settings, $options, $txt, $scripturl;

echo '
<div class="tborder" style="margin-top: 1ex;">
<div id="helpmenu" class="titlebg" style="padding: 4px;">';


<replace>
   
Code: [Select]
global $context, $settings, $options, $txt, $scripturl;

// Tinyportal
echo '
<table cellpadding="0" cellspacing="0" border="0" style="margin-left: 10px;">
<tr>
<td class="mirrortab_first">&nbsp;</td>
<td class="mirrortab_active_first">&nbsp;</td>
<td valign="top" class="mirrortab_active_back">
<a href="', $scripturl, '?action=help">' , $txt['tp-smfhelp'] , '</a>
</td>
<td class="mirrortab_active_last">&nbsp;</td>
<td valign="top" class="mirrortab_back">
<a href="', $scripturl, '?action=tpmod;sa=help">' , $txt['tp-tphelp'] , '</a>
</td>
<td class="mirrortab_last">&nbsp;</td>
     </tr>
</table>';

echo '
<div class="tborder">
<div id="helpmenu" class="titlebg" style="padding: 4px;">';
// end Tinyportal


<edit file>
$sourcedir/Profile.php


<search for>
      
Code: [Select]
'deleteAccount' => array(array('profile_remove_any', 'profile_remove_own'), array('profile_remove_any')),

<add after>
      
Code: [Select]
// Tinyportal
'tpsummary' => array(array('profile_view_any', 'profile_view_own'), array('profile_view_any')),
'tparticles' => array(array('profile_extra_any', 'profile_extra_own'), array('tp_articles')),
'tpdownload' => array(array('profile_extra_any', 'profile_extra_own'), array('tp_dlmanager')),
'tpshoutbox' => array(array('profile_extra_any', 'profile_extra_own'), array('tp_blocks')),
'tpgallery' => array(array('profile_extra_any', 'profile_extra_own'), array('tp_gallery')),
'tplinks' => array(array('profile_extra_any', 'profile_extra_own'), array('tp_links')),
// end Tinyportal


<search for>
   
Code: [Select]
// If you have permission to do something with this profile, you'll see one or more actions.
if (($context['user']['is_owner'] && allowedTo('profile_remove_own')) || allowedTo('profile_remove_any') || (!$context['user']['is_owner'] && allowedTo('pm_send')))


<add before>

   
Code: [Select]
// TinyPortal
if (!$user_info['is_guest'] && (($context['user']['is_owner'] && allowedTo('profile_view_own')) || allowedTo(array('profile_view_any', 'moderate_forum', 'manage_permissions','tp_dlmanager','tp_blocks','tp_articles','tp_gallery','tp_linkmanager'))))
{
$context['profile_areas']['tinyportal'] = array(
'title' => $txt['tp-profilesection'],
'areas' => array()
);

$context['profile_areas']['tinyportal']['areas']['tpsummary'] = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=tpsummary">' . $txt['tpsummary'] . '</a>';
if ($context['user']['is_owner'] || allowedTo('tp_articles'))
$context['profile_areas']['tinyportal']['areas']['tparticles'] = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=tparticles">' . $txt['articlesprofile'] . '</a>';
if(($context['user']['is_owner'] || allowedTo('tp_dlmanager')) && $context['TPortal']['show_download'])
$context['profile_areas']['tinyportal']['areas']['tpdownload'] = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=tpdownload">' . $txt['downloadprofile'] . '</a>';
if($context['user']['is_owner'] || allowedTo('tp_blocks'))
$context['profile_areas']['tinyportal']['areas']['tpshoutbox'] = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=tpshoutbox">' . $txt['shoutboxprofile'] . '</a>';
if(($context['user']['is_owner'] || allowedTo('tp_gallery')) && $context['TPortal']['show_gallery'])
$context['profile_areas']['tinyportal']['areas']['tpgallery'] = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=tpgallery">' . $txt['galleryprofile'] . '</a>';
if(($context['user']['is_owner'] || allowedTo('tp_linkmanager')) && $context['TPortal']['show_linkmanager'])
$context['profile_areas']['tinyportal']['areas']['tplinks'] = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=tplinks">' . $txt['linksprofile'] . '</a>';
}
    // end TinyPortal


<search for>
Code: [Select]
?>

<add before>
Code: [Select]
// Tinyportal
function tpsummary($memID)
{
global $txt, $user_profile, $db_prefix, $context, $db_prefix;

loadtemplate('TPprofile');
$context['page_title'] = $txt['tpsummary'];
TP_profile_summary($memID);
}
function tparticles($memID)
{
global $txt, $user_profile, $db_prefix, $context, $db_prefix;

loadtemplate('TPprofile');
$context['page_title'] = $txt['articlesprofile'];
TP_profile_articles($memID);
}
function tpdownload($memID)
{
global $txt, $user_profile, $db_prefix, $context, $db_prefix;

loadtemplate('TPprofile');
$context['page_title'] = $txt['downloadprofile'];
TP_profile_download($memID);
}
function tpshoutbox($memID)
{
global $txt, $user_profile, $db_prefix, $context, $db_prefix;

loadtemplate('TPprofile');
$context['page_title'] = $txt['shoutboxprofile'];
TP_profile_shoutbox($memID);
}
function tpgallery($memID)
{
global $txt, $user_profile, $db_prefix, $context, $db_prefix;

loadtemplate('TPprofile');
$context['page_title'] = $txt['galleryprofile'];
TP_profile_gallery($memID);
}
function tplinks($memID)
{
global $txt, $user_profile, $db_prefix, $context, $db_prefix;

loadtemplate('TPprofile');
$context['page_title'] = $txt['linksprofile'];
TP_profile_links($memID);
}


<edit file>
$boarddir/SSI.php


<search for>
Code: [Select]
require_once($sourcedir . '/Security.php');

<add after>
Code: [Select]
require_once($sourcedir . '/TPortal.php');

<edit file>
$sourcedir/BoardIndex.php


<search for>
            
Code: [Select]
'href' => $scripturl . '#' . $row_board['ID_CAT'],

<replace>
            
Code: [Select]
'href' => $scripturl . '?action=forum#' . $row_board['ID_CAT'],

<edit file>
$sourcedir/QueryString.php


<search for>
      
Code: [Select]
// Let's do something special for session ids!
if (defined('SID') && SID != '')
$buffer = preg_replace('/"' . preg_quote($scripturl, '/') . '\?(?:' . SID . ';)((?:board|topic)=[^#"]+?)(#[^"]*?)?"/e', "'\"' . \$scripturl . '/' . strtr('\$1', '&;=', '//,') . '.html?' . SID . '\$2\"'", $buffer);
else
$buffer = preg_replace('/"' . preg_quote($scripturl, '/') . '\?((?:board|topic)=[^#"]+?)(#[^"]*?)?"/e', "'\"' . \$scripturl . '/' . strtr('\$1', '&;=', '//,') . '.html\$2\"'", $buffer);


<replace>
      
Code: [Select]
// Let's do something special for session ids!
if (defined('SID') && SID != '')
$buffer = preg_replace('/"' . preg_quote($scripturl, '/') . '\?(?:' . SID . ';)((?:board|topic|page|cat|action)=[^#"]+?)(#[^"]*?)?"/e', "'\"' . \$scripturl . '/' . strtr('\$1', '&;=', '//,') . '.html?' . SID . '\$2\"'", $buffer);
else
$buffer = preg_replace('/"' . preg_quote($scripturl, '/') . '\?((?:board|topic|page|cat|action)=[^#"]+?)(#[^"]*?)?"/e', "'\"' . \$scripturl . '/' . strtr('\$1', '&;=', '//,') . '.html\$2\"'", $buffer);



<edit file>
$sourcedir/Subs-Post.php


<search>
Code: [Select]
function theme_postbox($msg)

<replace>
Code: [Select]
function theme_postbox($msg, $from_tp = false)

<search>
   
Code: [Select]
// Load the Post template and language file.
loadLanguage('Post');
loadTemplate('Post');


<replace>
   
Code: [Select]
// Load the Post template and language file.
loadLanguage('Post');
if(!$from_tp)
loadTemplate('Post');


<search>
   
Code: [Select]
// Go!  Supa-sub-template-smash!
template_postbox($msg);


<replace>
   
Code: [Select]
// Go!  Supa-sub-template-smash!
if(!$from_tp)
template_postbox($msg);
else
tp_renderbbc($msg);


<edit file>
$sourcedir/Admin.php


<search for>
   
Code: [Select]
// You have to be able to do at least one of the below to see this page.
isAllowedTo(array('admin_forum', 'manage_permissions', 'moderate_forum', 'manage_membergroups', 'manage_bans', 'send_mail', 'edit_news', 'manage_boards', 'manage_smileys', 'manage_attachments'));


<replace>
   
Code: [Select]
// You have to be able to do at least one of the below to see this page.
$admPerms = TP_addPerms();
isAllowedTo($admPerms);
« Last Edit: April 12, 2008, 04:28:01 AM by G6 »