TinyPortal

Development => Support => Topic started by: dbailey on April 07, 2010, 01:50:39 PM

Title: remove TP option from profile
Post by: dbailey on April 07, 2010, 01:50:39 PM
How can I remove the Tinyportal option from the member profile menu please? I don't want my members to have access to this.

Cheers
Duane
Title: Re: remove TP option from profile
Post by: IchBin on April 07, 2010, 04:29:44 PM
It's not a setting that you can turn off. The only way to make it go away off the top of my head would be to change the function. This would remove it from ALL profiles though.

In Sources/TPmodules.php at about line 1190 right before the ending } bracket for the tp_getprofileareas() function, you can unset the $data array by putting in this code:

unset($data['tp']['areas']);


That should do it I think.
Title: Re: remove TP option from profile
Post by: stormlrd on April 07, 2010, 04:51:27 PM
Quote from: IchBinâ„¢ on April 07, 2010, 04:29:44 PM
It's not a setting that you can turn off. The only way to make it go away off the top of my head would be to change the function. This would remove it from ALL profiles though.

In Sources/TPmodules.php at about line 1190 right before the ending } bracket for the tp_getprofileareas() function, you can unset the $data array by putting in this code:

unset($data['tp']['areas']);


That should do it I think.

Ich remember each theme works like SMF default, if the template file is not present in the theme it will default back to the default theme template files.

So if they want a specific theme not to show something they would load the template file into that theme and go into that file and simply blank the inside of the display functions.

Edit i thought this was that theme specific one, but the same principle applies but in this case goto default theme template file and instead of blanking it i'd just comment it out so you dont lose it in case you change your mind lol.

Title: Re: remove TP option from profile
Post by: IchBin on April 07, 2010, 04:52:10 PM
But the files I referenced is not a template file. It's a TP Source file. This modification can't be done per theme AFAIK.
Title: Re: remove TP option from profile
Post by: stormlrd on April 07, 2010, 04:58:35 PM
Bro are you sure?

Now you got me thinking lol, i will have to try this out to see what happens, you know me hard headed lmao

okay what ive done just removes the summary not the link in the profile menu. I was hoping he wouldnt have to mess with the source files

with the way smf 2.0 is setup we should just be able to remove it from the profile menu shouldnt we?
Title: Re: remove TP option from profile
Post by: IchBin on April 07, 2010, 05:34:56 PM
Yes, any file in the Sources/ directory is not theme dependent. Bloc uses the functions in the TPmodules.php file to add to the $context['profiles_areas'] array if I remember right. The Profile template automatically generates the menu's by output that array. So it's not something you can do in a template file to my knowledge.
Title: Re: remove TP option from profile
Post by: stormlrd on April 07, 2010, 05:37:19 PM
Quote from: IchBinâ„¢ on April 07, 2010, 05:34:56 PM
Yes, any file in the Sources/ directory is not theme dependent. Bloc uses the functions in the TPmodules.php file to add to the $context['profiles_areas'] array if I remember right. The Profile template automatically generates the menu's by output that array. So it's not something you can do in a template file to my knowledge.

Gotcha, its pulling it from the menu and that array defines the menu, the way its laidout after is in the template