SimplePortal

Development => Feature Requests => Topic started by: Sudhakar on December 01, 2008, 07:42:40 PM

Title: Hiding Blocks for Admin
Post by: Sudhakar on December 01, 2008, 07:42:40 PM
Hi Team,

Could i Hide a block to Admin.  :)
Title: Re: Hiding Blocks for Admin
Post by: [SiNaN] on December 02, 2008, 07:30:26 AM
Hmmm, not really. Because they have all the permissions for all blocks.

It is like the board permissions in SMF; you cannot hide a board from admin.
Title: Re: Hiding Blocks for Admin
Post by: H on December 02, 2008, 01:08:00 PM
Why would you want to do this? :)
Title: Re: Hiding Blocks for Admin
Post by: Burke Knight on December 02, 2008, 01:11:55 PM
Some admins like to show some blocks to guests and members that they don't always want to see themself. Like me, I set up the news board block, which cannot be collapsed, yet I really as admin, do not need to always see it, since I wrote all the posts there. :P
Title: Re: Hiding Blocks for Admin
Post by: H on December 02, 2008, 01:13:21 PM
Perhaps then it would be an idea for admins to be able to collapse any block, regardless of what it is set to?
Title: Re: Hiding Blocks for Admin
Post by: Burke Knight on December 02, 2008, 01:24:06 PM
That would be good idea. :)

Maybe move this to Feature Requests?
Title: Re: Hiding Blocks for Admin
Post by: Sudhakar on December 02, 2008, 08:43:00 PM
Yes BurkeKnight,

You are really right. I need to hide news and other block to Admin.

Burkeknight and K give me a sample code to workout .  :)
Title: Re: Hiding Blocks for Admin
Post by: Burke Knight on December 02, 2008, 09:20:29 PM
I'm only a beta tester, not a coder... Well, ok, I'm a coder, but not for SP yet.... Well, not for long time, as I still have TONS to learn.


I'll leave that coding to the more experienced team members. :)
Title: Re: Hiding Blocks for Admin
Post by: Sudhakar on December 02, 2008, 11:26:02 PM
Ok, and hope some team member will help me soon. :whistle:
Title: Re: Hiding Blocks for Admin
Post by: Sudhakar on December 08, 2008, 07:46:55 PM
Any Updates for this post.

Once this feature is added, Simple portal will be more reliable to admin.

where they could hide advertisement tabs.  :)
Title: Re: Hiding Blocks for Admin
Post by: Sudhakar on December 11, 2008, 02:51:18 PM
Any update on the Feature Request Team.  :shh:
Title: Re: Hiding Blocks for Admin
Post by: Sudhakar on December 19, 2008, 08:41:22 AM
Suppose, if i have a advertisement block.

I could block that particular block to an admin.
Title: Re: Hiding Blocks for Admin
Post by: ianus on December 21, 2008, 01:48:59 AM
Greetings!

Yes, an advertisment block is something an admin must not see always.

Try
Code: [Select]
if ($context['user']['is_logged']){
"your code here"
}
if($context['user']['is_admin']){
"leave blank"
}

This should show the content to all logged users, but not to admins.
I have some problems with $context. It seems that SP don't use some SMF code automatic.
So it is possible that you have to add something like
global $context, $scripturl, $settings, $member, $memberContext, $member_id
at the very beginning of you blockcode. I haven't figure out yet how SP handeles this.
Title: Re: Hiding Blocks for Admin
Post by: Sudhakar on December 21, 2008, 04:45:40 AM
Great "ianus".

I do even have a member group where i have removed the ads using the block permissions at simple portal configuration.
Title: Re: Hiding Blocks for Admin
Post by: [SiNaN] on February 02, 2009, 04:56:08 AM
http://simpleportal.net/index.php?issue=116.0
Title: Re: Hiding Blocks for Admin
Post by: Aw06 on March 06, 2009, 01:43:48 PM
Greetings!

Yes, an advertisment block is something an admin must not see always.

Try
Code: [Select]
if ($context['user']['is_logged']){
"your code here"
}
if($context['user']['is_admin']){
"leave blank"
}

This should show the content to all logged users, but not to admins.
I have some problems with $context. It seems that SP don't use some SMF code automatic.
So it is possible that you have to add something like
global $context, $scripturl, $settings, $member, $memberContext, $member_id
at the very beginning of you blockcode. I haven't figure out yet how SP handeles this.

Where is this info to go ? inside of the block ? and did you getting it working ?

This is definately a needed feature for 2.2  >:-D
Title: Re: Hiding Blocks for Admin
Post by: [SiNaN] on March 06, 2009, 02:27:18 PM
Not really. 2.2 is feature frozen ATM, you'll have to wait next version.

About some frequently used variables not being as default globals for PHP block; that is how it should be. You should global what you need yourself.
Title: Re: Hiding Blocks for Admin
Post by: KahneFan on March 06, 2009, 04:50:14 PM

Where is this info to go ? inside of the block ? and did you getting it working ?

This is definately a needed feature for 2.2  >:-D

You would want to create a "PHP Block" adding the above code and then adding your needed code where it says "your code here".
Title: Re: Hiding Blocks for Admin
Post by: Aw06 on March 07, 2009, 12:04:17 AM

Where is this info to go ? inside of the block ? and did you getting it working ?

This is definately a needed feature for 2.2  >:-D

You would want to create a "PHP Block" adding the above code and then adding your needed code where it says "your code here".

thanks. ... but what about all this you posted

global $context, $scripturl, $settings, $member, $memberContext, $member_id

?
Title: Re: Hiding Blocks for Admin
Post by: Sudhakar on February 13, 2011, 08:40:14 PM
Hi Team,

Could i Hide a block to Admin.  :)

Still i could not hide the block for admin.

Any idea would be appreciated.
Title: Re: Hiding Blocks for Admin
Post by: willerby on February 14, 2011, 01:28:38 PM
I had a second admin who objected to seeing every block (sometimes duplicated for different member groups with different content).

I set him up as Admin2 then manually altered his permissions. Be careful if you do this to your own profile and make sure you still retain the permissions to give yourself full admin privileges or leave these on a second login account.
Title: Re: Hiding Blocks for Admin
Post by: Sudhakar on February 14, 2011, 03:08:10 PM
Thanks for your reply willerby.

But i need to hide the blocks for my id - main admin id.

How it is possible.
Title: Re: Hiding Blocks for Admin
Post by: AngelinaBelle on February 15, 2011, 08:39:24 AM
This is a feature planned for version 2.4.
Title: Re: Hiding Blocks for Admin
Post by: Sudhakar on February 15, 2011, 03:24:52 PM
This is a feature planned for version 2.4.

Nice that you have answered me.

Could you tell me some estimated time for v 2.4 to get released.
Title: Re: Hiding Blocks for Admin
Post by: AngelinaBelle on February 15, 2011, 06:44:03 PM
V 2.4 will be released when our developers have time to work on it.
Unfortunately, they are very busy students, and will not work on this code until they have time to devote to doing it properly.
 
In the meantime, please have a look at this topic, which gives you a customization you can apply:
 
http://simpleportal.net/index.php?issue=116.0 (http://simpleportal.net/index.php?issue=116.0)
Title: Re: Hiding Blocks for Admin
Post by: rocknroller on February 19, 2011, 02:10:51 PM
+1 vote for this.
Title: Re: Hiding Blocks for Admin
Post by: rocknroller on February 19, 2011, 02:18:28 PM
V 2.4 will be released when our developers have time to work on it.
Unfortunately, they are very busy students, and will not work on this code until they have time to devote to doing it properly.
 
In the meantime, please have a look at this topic, which gives you a customization you can apply:
 
http://simpleportal.net/index.php?issue=116.0 (http://simpleportal.net/index.php?issue=116.0)

what this will do?
Title: Re: Hiding Blocks for Admin
Post by: Sudhakar on February 19, 2011, 03:46:03 PM
what this will do?

Once you have done with this update.

Admin will not get the blocks. But once you have made the edit , we need to reconfigure agian the roles under simple portal block page.
Title: Re: Hiding Blocks for Admin
Post by: rocknroller on February 19, 2011, 05:30:38 PM
what this will do?

Once you have done with this update.

Admin will not get the blocks. But once you have made the edit , we need to reconfigure agian the roles under simple portal block page.

admin will not get the blocks at all? Or just if ti is not selected in the block permisions?
Title: Re: Hiding Blocks for Admin
Post by: AngelinaBelle on February 20, 2011, 10:02:53 AM
Just if admin is chosen not to see the block in permissions.
You can try the change, and if you don't like it, go back to the previous version of the file.
 
 
Title: Re: Hiding Blocks for Admin
Post by: rocknroller on February 20, 2011, 02:05:07 PM
Just if admin is chosen not to see the block in permissions.
You can try the change, and if you don't like it, go back to the previous version of the file.

i can not find this code in Subs-Portal.php, can anybody update this for SP 2.3.2?

 
Code: [Select]
   if (allowedTo('sp_moderate'))
      return true;
Title: Re: Hiding Blocks for Admin
Post by: AngelinaBelle on February 21, 2011, 08:50:50 AM
Search for
Code: [Select]
if (allowedTo('sp_admin'))
Title: Re: Hiding Blocks for Admin
Post by: rocknroller on February 21, 2011, 01:14:38 PM
thank you AngelinaBelle, when modification is acticevd I can not see blocks in the admin panel.

is this it what this do?
Title: Re: Hiding Blocks for Admin
Post by: AngelinaBelle on February 21, 2011, 01:59:13 PM
I'm sorry. My advice was wrong. 
Now, I don't know the answer.
Title: Re: Hiding Blocks for Admin
Post by: rocknroller on February 21, 2011, 03:58:05 PM
I am sorry I was not well expressed, you helped me a lot.

When I uploaded the modification, blocks related to guests are missing, but I made membergroup Admin SP and made it invisible. Then I have all the blocks related to guest set permissions and include new membergroup Admin SP. Now when i want edit those blocks in my profile settings add additional group Admin SP. and that is it.
When i dont want look in block for guests, then remove additional group Admin SP.

sorry for my bad english, AngelinaBelle  8)
Title: Re: Hiding Blocks for Admin
Post by: AngelinaBelle on February 22, 2011, 04:20:51 PM
Is this working for you?
Title: Re: Hiding Blocks for Admin
Post by: rocknroller on February 22, 2011, 05:37:32 PM
Is this working for you?

Yes, it works.  :)
Title: Re: Hiding Blocks for Admin
Post by: AngelinaBelle on February 22, 2011, 07:23:57 PM
Good!
Title: Re: Hiding Blocks for Admin
Post by: KittyKat on April 21, 2011, 02:42:55 AM
It is like the board permissions in SMF too.
SimplePortal 2.3.8 © 2008-2024, SimplePortal