TinyPortal

Development => Support => Topic started by: jotade29 on May 02, 2022, 03:40:39 AM

Title: How i removed TinyPortal profiles buttons
Post by: jotade29 on May 02, 2022, 03:40:39 AM
I use v2.0.19 SMF
Version TinyPortal 2.1.0

I have tried to comment out the code in tpsubs but nothing, the menu keeps showing up. How can I remove it?
Title: Re: How i removed TinyPortal profiles buttons
Post by: @rjen on May 02, 2022, 06:45:08 AM
Hi, can you be a bit more specific ? What are you trying to remove ?
Title: Re: How i removed TinyPortal profiles buttons
Post by: @rjen on May 02, 2022, 05:05:44 PM
Just guessing you mean the TinyPortal option in the profile...

You have to change the file Integrate.php in Tinyportal folder

change this code

    public static function hookProfileArea(&$profile_areas)
    {
        global $txt, $context;

        $profile_areas['tp'] = array(
            'title' => 'TinyPortal',
            'areas' => array(),
        );
               // Profile area for 2.1
        if( TP_SMF21 ) {
            $profile_areas['tp']['areas']['tpsummary'] = array(
                'label' => $txt['tpsummary'],
                'file' => 'TPSubs.php',
                'function' => 'tp_summary',
                'icon' => 'menu_tp',
                'permission' => array(
                    'own' => 'profile_view_own',
                    'any' => 'profile_view_any',
                ),
            );

            if (!$context['TPortal']['use_wysiwyg']=='0') {
                $profile_areas['tp']['areas']['tparticles'] = array(
                    'label' => $txt['articlesprofile'],
                    'file' => 'TPSubs.php',
                    'function' => 'tp_articles',
                    'icon' => 'menu_tparticle',
                    'permission' => array(
                        'own' => 'profile_view_own',
                        'any' => 'profile_view_any',
                    ),
                    'subsections' => array(
                        'articles' => array($txt['tp-articles'], array('profile_view_own', 'profile_view_any')),
                        'settings' => array($txt['tp-settings'], array('profile_view_own', 'profile_view_any')),
                    ),
                );
            }
            else {
                $profile_areas['tp']['areas']['tparticles'] = array(
                    'label' => $txt['articlesprofile'],
                    'file' => 'TPSubs.php',
                    'function' => 'tp_articles',
                    'icon' => 'menu_tparticle',
                    'permission' => array(
                        'own' => 'profile_view_own',
                        'any' => 'profile_view_any',
                    ),
                );
            }

            if(!empty($context['TPortal']['show_download'])) {
                $profile_areas['tp']['areas']['tpdownload'] = array(
                    'label' => $txt['downloadsprofile'],
                    'file' => 'TPSubs.php',
                    'function' => 'tp_download',
                    'icon' => 'menu_tpdownload',
                    'permission' => array(
                        'own' => 'profile_view_own' && !empty($context['TPortal']['show_download']),
                        'any' => 'profile_view_any' && !empty($context['TPortal']['show_download']),
                    ),
                );
            }

            if(!$context['TPortal']['profile_shouts_hide']) {
                $profile_areas['tp']['areas']['tpshoutbox'] = array(
                    'label' => $txt['shoutboxprofile'],
                    'file' => 'TPShout.php',
                    'function' => 'tp_shoutb',
                    'icon' => 'menu_tpshout',
                    'permission' => array(
                        'own' => 'profile_view_own',
                        'any' => 'profile_view_any',
                    ),
                );
            }
        }
        else {
            // Profile area for 2.0 - no icons
            $profile_areas['tp']['areas']['tpsummary'] = array(
                'label' => $txt['tpsummary'],
                'file' => 'TPSubs.php',
                'function' => 'tp_summary',
                'permission' => array(
                    'own' => 'profile_view_own',
                    'any' => 'profile_view_any',
                ),
            );

            if (!$context['TPortal']['use_wysiwyg']=='0') {
                $profile_areas['tp']['areas']['tparticles'] = array(
                    'label' => $txt['articlesprofile'],
                    'file' => 'TPSubs.php',
                    'function' => 'tp_articles',
                    'permission' => array(
                        'own' => 'profile_view_own',
                        'any' => 'profile_view_any',
                    ),
                    'subsections' => array(
                        'articles' => array($txt['tp-articles'], array('profile_view_own', 'profile_view_any')),
                        'settings' => array($txt['tp-settings'], array('profile_view_own', 'profile_view_any')),
                    ),
                );
            }
            else {
                $profile_areas['tp']['areas']['tparticles'] = array(
                    'label' => $txt['articlesprofile'],
                    'file' => 'TPSubs.php',
                    'function' => 'tp_articles',
                    'permission' => array(
                        'own' => 'profile_view_own',
                        'any' => 'profile_view_any',
                    ),
                );
            }

            if(!empty($context['TPortal']['show_download'])) {
                $profile_areas['tp']['areas']['tpdownload'] = array(
                    'label' => $txt['downloadsprofile'],
                    'file' => 'TPSubs.php',
                    'function' => 'tp_download',
                    'permission' => array(
                        'own' => 'profile_view_own',
                        'any' => 'profile_view_any',
                    ),
                );
            }

            if(!$context['TPortal']['profile_shouts_hide']) {
                $profile_areas['tp']['areas']['tpshoutbox'] = array(
                    'label' => $txt['shoutboxprofile'],
                    'file' => 'TPShout.php',
                    'function' => 'tp_shoutb',
                    'permission' => array(
                        'own' => 'profile_view_own',
                        'any' => 'profile_view_any',
                    ),
                );
            }

        }

    }


to this code..


    public static function hookProfileArea(&$profile_areas)
    {
        global $txt, $context;

        $profile_areas['tp'] = array(
            'title' => 'TinyPortal',
            'areas' => array(),
        );
               // Profile area for 2.1
        if( TP_SMF21 ) {
            $profile_areas['tp']['areas']['tpsummary'] = array(
                'label' => $txt['tpsummary'],
                'file' => 'TPSubs.php',
                'function' => 'tp_summary',
                'icon' => 'menu_tp',
                'permission' => array(
                    'own' => 'profile_view_own',
                    'any' => 'profile_view_any',
                ),
            );

            if (!$context['TPortal']['use_wysiwyg']=='0') {
                $profile_areas['tp']['areas']['tparticles'] = array(
                    'label' => $txt['articlesprofile'],
                    'file' => 'TPSubs.php',
                    'function' => 'tp_articles',
                    'icon' => 'menu_tparticle',
                    'permission' => array(
                        'own' => 'profile_view_own',
                        'any' => 'profile_view_any',
                    ),
                    'subsections' => array(
                        'articles' => array($txt['tp-articles'], array('profile_view_own', 'profile_view_any')),
                        'settings' => array($txt['tp-settings'], array('profile_view_own', 'profile_view_any')),
                    ),
                );
            }
            else {
                $profile_areas['tp']['areas']['tparticles'] = array(
                    'label' => $txt['articlesprofile'],
                    'file' => 'TPSubs.php',
                    'function' => 'tp_articles',
                    'icon' => 'menu_tparticle',
                    'permission' => array(
                        'own' => 'profile_view_own',
                        'any' => 'profile_view_any',
                    ),
                );
            }

            if(!empty($context['TPortal']['show_download'])) {
                $profile_areas['tp']['areas']['tpdownload'] = array(
                    'label' => $txt['downloadsprofile'],
                    'file' => 'TPSubs.php',
                    'function' => 'tp_download',
                    'icon' => 'menu_tpdownload',
                    'permission' => array(
                        'own' => 'profile_view_own' && !empty($context['TPortal']['show_download']),
                        'any' => 'profile_view_any' && !empty($context['TPortal']['show_download']),
                    ),
                );
            }

            if(!$context['TPortal']['profile_shouts_hide']) {
                $profile_areas['tp']['areas']['tpshoutbox'] = array(
                    'label' => $txt['shoutboxprofile'],
                    'file' => 'TPShout.php',
                    'function' => 'tp_shoutb',
                    'icon' => 'menu_tpshout',
                    'permission' => array(
                        'own' => 'profile_view_own',
                        'any' => 'profile_view_any',
                    ),
                );
            }
        }
        else {
            // Profile area for 2.0 - no icons
/*            $profile_areas['tp']['areas']['tpsummary'] = array(
                'label' => $txt['tpsummary'],
                'file' => 'TPSubs.php',
                'function' => 'tp_summary',
                'permission' => array(
                    'own' => 'profile_view_own',
                    'any' => 'profile_view_any',
                ),
            );

            if (!$context['TPortal']['use_wysiwyg']=='0') {
                $profile_areas['tp']['areas']['tparticles'] = array(
                    'label' => $txt['articlesprofile'],
                    'file' => 'TPSubs.php',
                    'function' => 'tp_articles',
                    'permission' => array(
                        'own' => 'profile_view_own',
                        'any' => 'profile_view_any',
                    ),
                    'subsections' => array(
                        'articles' => array($txt['tp-articles'], array('profile_view_own', 'profile_view_any')),
                        'settings' => array($txt['tp-settings'], array('profile_view_own', 'profile_view_any')),
                    ),
                );
            }
            else {
                $profile_areas['tp']['areas']['tparticles'] = array(
                    'label' => $txt['articlesprofile'],
                    'file' => 'TPSubs.php',
                    'function' => 'tp_articles',
                    'permission' => array(
                        'own' => 'profile_view_own',
                        'any' => 'profile_view_any',
                    ),
                );
            }

            if(!empty($context['TPortal']['show_download'])) {
                $profile_areas['tp']['areas']['tpdownload'] = array(
                    'label' => $txt['downloadsprofile'],
                    'file' => 'TPSubs.php',
                    'function' => 'tp_download',
                    'permission' => array(
                        'own' => 'profile_view_own',
                        'any' => 'profile_view_any',
                    ),
                );
            }

            if(!$context['TPortal']['profile_shouts_hide']) {
                $profile_areas['tp']['areas']['tpshoutbox'] = array(
                    'label' => $txt['shoutboxprofile'],
                    'file' => 'TPShout.php',
                    'function' => 'tp_shoutb',
                    'permission' => array(
                        'own' => 'profile_view_own',
                        'any' => 'profile_view_any',
                    ),
                );
            }
*/
        }

    }
Title: Re: How i removed TinyPortal profiles buttons
Post by: jotade29 on May 04, 2022, 01:56:38 AM
Yes, thank you very much. Before it was in the following file -> TPassimilate.php but apparently its content has been migrated to integrate.php