*

Author Topic: Manually Remove TP V1.1* from your Site  (Read 2690 times)

Offline Ken

  • Administrator
  • Full Member
  • *****
  • Posts: 138
Manually Remove TP V1.1* from your Site
« on: November 17, 2015, 11:55:02 AM »
How to Manually Remove your TinyPortal install from your site.


OPEN FILE

index.php

Find and Remove

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




Find and Remove

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



Find and 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';
      }

Replace with

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


Find and Remove:

Code: [Select]
'tpadmin' => array('TPortalAdmin.php', 'TPortalAdmin'),
                'forum' => array('BoardIndex.php', 'BoardIndex'),
                'tpmod' => array('TPmodules.php', 'TPmodules'),




OPEN FILE:

$sourcedir/Load.php

Find and Remove:

Code: [Select]
if (!empty($context['TPortal']['front_type'])){
      $settings['TPortal_front_type'] = $context['TPortal']['front_type'];
   }



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


Replace with

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


Find and 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']
                        )),


Replace with

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']
         )),



Find and Remove

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




OPEN FILE:

$themedir/index.template.php

Find and Replace

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


Replace With:

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

Find and Remove:

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';




Find and Remove:

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>' : '';




Find and Remove:

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 '


Open Dir:

$boarddir/Themes/babylon/index.template.php

Find and 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



Replace with

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>';

Find and 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'];

Replace with

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'];






OPEN FILE:

$sourcedir/Subs.php

Find and Remove:

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




Find and Remove:

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




Find and Replace:
Code: [Select]
function redirectexit($setLocation = '', $refresh = false, $tp_not = false)
Replace with
Code: [Select]
function redirectexit($setLocation = '', $refresh = false)
Find and Remove:

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




OPEN FILE:

$sourcedir/ManagePermissions.php

Find and Remove:

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

   // end TinyPortal




Find and 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',
   );

Replace with

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


OPEN FILE:

$sourcedir/Security.php

Find and Remove:

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



OPEN FILE:

$sourcedir/Errors.php

Find and Remove:

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




OPEN FILE:

$themedir/style.css

Find and Remove:

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;
}




OPEN FILE:

$themedir/Help.template.php

Find and 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

Replace with

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

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


OPEN FILE:

$sourcedir/Profile.php

Find and Remove:

Code: [Select]
// TinyPortal
$tp_areas = TP_fetchprofile_areas();
foreach($tp_areas as $tp)
$sa_allowed[$tp['name']] = array(array('profile_view_any', 'profile_view_own'), array($tp['permission']));
// end TinyPortal


Find and Remove:

Code: [Select]

// TinyPortal
TP_fetchprofile_areas2($memID);


Find and Replace:

Code: [Select]
if(isset($_GET['tpmodule']))
{
global $boarddir, $db_prefix;

// prefix of the TP tables
$tp_prefix = $db_prefix.'tp_';

$request = db_query("SELECT modulename,autoload_run FROM {$tp_prefix}modules WHERE active=1 and profile = '" . $_GET['sa'] . "'", __FILE__, __LINE__);
if(mysql_num_rows($request)>0)
{
$what=mysql_fetch_assoc($request);
mysql_free_result($request);
// load the appropiate source file
if(file_exists($boarddir .'/tp-files/tp-modules/' . $what['modulename']. '/Sources/'. $what['autoload_run']))
{
require_once($boarddir .'/tp-files/tp-modules/' . $what['modulename']. '/Sources/'. $what['autoload_run']);
}
}
$_GET['sa']($memID);
}
else
$_REQUEST['sa']($memID);

Replace With:

Code: [Select]
$_REQUEST['sa']($memID);

OPEN FILE:

$boarddir/SSI.php

Find and Remove:

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



OPEN FILE:

$sourcedir/BoardIndex.php

Find and Replace:

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

Replace With

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


OPEN FILE:

$sourcedir/QueryString.php

Find and 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);

Replace with

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);


OPEN FILE:

$sourcedir/Subs-Post.php

Find and Replace:

Code: [Select]
function theme_postbox($msg, $from_tp = false)
Replace with

Code: [Select]
function theme_postbox($msg)


Find and Replace:

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

Replace with

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



Find and Replace:

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

Replace With

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


OPEN FILE:

$sourcedir/Admin.php

Find and 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);

Replace With

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'));


That is the end of the manual file edits to remove tinyportal from your SMF files.
Now we have the folders and some files we need to remove using your FTP utility.
The list below are the folders and files that you need to remove and when you are done, you have completed the removal of TinyPortal from your site.

Open Sources folder and remove the following files

TPcommon.php
TPdlmanager.php
TPhelp.php
TPmodules.php
TPortalAdmin.php
TPsubs.php


Open Themes/Default folder

Remove the following files.

TPBlockLayout.template.php
TPBlocks.template.php
TPdladmin.template.php
TPdlmanager.template.php
TPhelp.template.php
TPmodules.template.php
TPortal.template.php
TPortalAdmin.template.php
TPprint.template.php
TPprofile.template.php
TPShout.css
TPShout.template.php
tp-style.php
TPwireless.template.php



Open Themes/Default/images/

Remove the entire folder "tinyportal"

Open the folder Themes/Default/Languages

Remove the following files

TPdlmanager.english.php
TPhelp.english.php
TPmodules.english.php
TPortal.english.php
TPortalAdmin.english.php
TPShout.english.php


With this we have only one thing left to do and that is to remove the TP database tables.
( NOTE!! ) if you are uninstalling manually because of upgrading TP to a NEW version, you LEAVE this step alone as you will need to have the TP Tables in your DB to save all content.
If you want to get rid of TP all together, you proceed to the next step.

Open your cPanel or PHPMyadmin account on your server and check the database where you have the SMF and TP installed to.
Check the following tables in your database.

SMF ( or what ever db name you have chosen )

SMF_tp_articles
SMF_tp_blocks
SMF_tp_data
SMF_tp_dlmanager
SMF_tp_modules
SMF_tp_settings
SMF_tp_shoutbox
SMF_tp_variables


All you have to do now is choose DELETE TABLE's and you have successfully removed everything regarding tinyportal on your SMF forum.

Doc Written By: G6

Doc Updated 11/17/2015 By: Ken.