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

Recent

Welcome to TinyPortal. Please login or sign up.

April 30, 2024, 05:52:20 PM

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

Hide Panel/Block when logged in as Admin

Started by Pravi, August 12, 2016, 09:04:45 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Pravi

Hello guys,

     I want to hide the Panel only for admin. The "Hide panels when in admin section" in panel section seems to not working. Need a little help over here.


Thank you.

Link to my forum: http://pix2box.com
SMF version: 2.0.11
TP version: 1.2
Default Forum Language: English
Theme name and version: Redsy
Browser Name and Version: Chrome and firefox
Mods installed: Tiny portal (only)


illori

what type of panel are you wanting to hide?
where are you want it hidden?
that setting only works in the admin panel not anywhere else.

Pravi

Quote from: illori on August 12, 2016, 10:05:58 AM
what type of panel are you wanting to hide?
where are you want it hidden?
that setting only works in the admin panel not anywhere else.

Hi illori,
I want to hide a 'HTML and javascript code' block in admin section.

illori

you mean that block is showing to the admin and you want to hide it only when in the admin panel? if that option is selected it should hide all the blocks/panels when in the admin panel.

Pravi

Quote from: illori on August 12, 2016, 09:59:57 PM
you mean that block is showing to the admin and you want to hide it only when in the admin panel? if that option is selected it should hide all the blocks/panels when in the admin panel.

Can you please tell me exactly how to hide a block?


Thank you

illori

can you instead answer the question i asked? if i understand what you are trying to do then we can tell you what to do to get it done.

Pravi

Quote from: illori on August 12, 2016, 09:59:57 PM
you mean that block is showing to the admin and you want to hide it only when in the admin panel?

yes i want to hide the block in the admin panel...

illori

if that option is enabled, it should be hidden already. i dont know how it would show otherwise.

Pravi

Quote from: illori on August 13, 2016, 08:13:20 PM
if that option is enabled, it should be hidden already. i dont know how it would show otherwise.

Hi illori,
The blocks are hidden in the admin panel but its visible in the forum and all other places .. I want to hide the block when LOGGED in as admin. Not only in admin panel but also in every section of the forum.


Thank you

lurkalot

Not sure if there's an easier way around this problem, but you could take a look at this solution, http://www.tinyportal.net/index.php?topic=34936.msg279215#msg279215

illori

Quote from: lurkalot on August 15, 2016, 08:53:35 AM
Not sure if there's an easier way around this problem, but you could take a look at this solution, http://www.tinyportal.net/index.php?topic=34936.msg279215#msg279215

i dont think that will work as admin can see/do everything, so the admin group would override that group.

is this a block that should be visible to guests or just one group and hidden from the admin group?

lurkalot

Quote from: illori on August 15, 2016, 10:12:53 AM
Quote from: lurkalot on August 15, 2016, 08:53:35 AM
Not sure if there's an easier way around this problem, but you could take a look at this solution, http://www.tinyportal.net/index.php?topic=34936.msg279215#msg279215

i dont think that will work as admin can see/do everything, so the admin group would override that group.

is this a block that should be visible to guests or just one group and hidden from the admin group?

Ok sorry Illori. I guess the other way is to make the html work in a php block and use the trick you gave me a while back to hide it from admin.  Unless you have something else up your sleeve. ;)

Pravi

Hi.

I just want to hide a block which contains my adsense ads while logged in as admin. I want to avoid accidental clicks on the ads. Can I use css to hide the block only for the admin ??

illori

no you cant use css to hide it from the admin.

what group(s) should the block be visible to?

if more the just guest, provide the group id number.

Pravi

Quote from: illori on August 16, 2016, 10:10:12 AM
no you cant use css to hide it from the admin.

what group(s) should the block be visible to?

if more the just guest, provide the group id number.

Hi illori,
I want the block visible only for guest, regular members and moderators.

illori


Pravi

Quote from: illori on August 16, 2016, 10:21:12 PM
global moderators or?

Hide block only for admin. Except admin, it should visible to everyone.

illori

you would need to use a php block, with code similar to this
i have not tested it but it should work.

global $context
if (!$context['user']['is_admin'])
echo '
<div align="center">
your ad code here
</div>';

Pravi

#18
Quote from: illori on August 17, 2016, 09:39:18 PM
you would need to use a php block, with code similar to this
i have not tested it but it should work.

global $context
if (!$context['user']['is_admin'])
echo '
<div align="center">
your ad code here
</div>';


Hi illori,
I tried the code, its working fine. Initially it was not working, add a semicolon to global variable and every thing is working fine.

global $context;
if (!$context['user']['is_admin'])
echo '
<div align="center">
your ad code here
</div>';

[/quote]

Thank you illori,
Thank you very much