TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

May 02, 2024, 02:30:42 AM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,176
  • Total Topics: 21,220
  • Online today: 120
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 105
  • Total: 105

How to disable TinyPortal menu option in members' profile

Started by davo88, April 29, 2024, 10:31:24 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

davo88

I would like to disable the TinyPortal menu option that appears in members' profiles.

You cannot view this attachment.

So far, 'Hide TinyPortal menu option' has been enabled in TP General Settings.

You cannot view this attachment.

And 'ShowTPdownloads' has been turned off in TPdownloads > Settings

You cannot view this attachment.

But I am unable to find any further options that might remove that menu from the Profile.

@rjen

No option to do that. You can try removing this section from Integrate.php

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

        $profile_areas['tp'] = array(
            'title' => 'TinyPortal',
            'areas' => array(),
        );

        $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',
                ),
            );
        }
    }
Running Latest TP on SMF2.1 at: www.fjr-club.nl

davo88

Thanks @rjen. We got a couple of error messages in the log after commenting that section out.
Hook call: function "TinyPortal\Integrate::hookProfileArea" in file /home/... could not be called.The callable TinyPortal\Integrate::hookProfileArea could not be called.Taking out this line out seems to have addressed those and there has been no more errors so far. Will keep an eye on it though.
        $hooks['pre_profile_areas']     = 'TinyPortal\Integrate::hookProfileArea';
A setting for this could be a good candidate for future versions. When introducing TP to a long running forum-only site, it will take a while for members (and me) to adjust and manage all the new features. So being able to slow that process down and roll things out in stages is very good. Thanks again for posting your fix.