TinyPortal

Development => Support => Topic started by: dimdom on August 26, 2009, 07:13:52 PM

Title: TP 0.9.8 shoutbox permissions
Post by: dimdom on August 26, 2009, 07:13:52 PM
TP 0.9.8
SMF 1.1.10
www.authorway.com/SMF


Hi all,

I would like to know if I could (and how if it is going to be hardcoded) change the shoutbox permissions so no one except the admin (and the moderators perhaps) can post messages.

I would like to use it as an announcements center for my forums and not as a ...shoutbox. :)

Thank you.
Title: Re: TP 0.9.7 shoutbox permissions
Post by: IchBin on August 26, 2009, 07:38:23 PM
TP 0.9.7 is like 3 years old now. I wouldn't have the slightest clue on what options there were back then. I would suggest you at least update to TP 0.9.8. There were some security fixes in that update if I remember right. However, I don't think there are any options like that with even the most current shoutbox. You can't limit to any particular group who can post in the shoutbox. You will probably have to modify the code to manually check for the groups, and then only allow those groups to see the textbox and submit button.
Title: Re: TP 0.9.7 shoutbox permissions
Post by: dimdom on August 26, 2009, 07:50:36 PM
IchBin, sorry, my mistake...

I meant 0.9.8.
Title: Re: TP 0.9.8 shoutbox permissions
Post by: Freddy on August 26, 2009, 07:56:36 PM
I can see possibilities in v1 beta 4, but I don't have a forum with 0.9.8...

I could set one up if you are desperate to stay with 0.9.8  though.
Title: Re: TP 0.9.8 shoutbox permissions
Post by: Crip on August 26, 2009, 07:59:00 PM
I have a 0.98 Portal , anyone  cares to test the ShoutBox ?

Me n my G/F could only see and post in the ShoutBox as she is Global mod ... no one else knows of it.
Title: Re: TP 0.9.8 shoutbox permissions
Post by: Freddy on August 26, 2009, 07:59:39 PM
I'm here dude, just let me know what you want me to do..
Title: Re: TP 0.9.8 shoutbox permissions
Post by: dimdom on August 26, 2009, 08:01:39 PM
OK, can someone give me a clue from where to start (what file) in order to change the permissions?
Title: Re: TP 0.9.8 shoutbox permissions
Post by: Crip on August 26, 2009, 08:05:10 PM
It's all in the permissions .. set it forget it
Title: Re: TP 0.9.8 shoutbox permissions
Post by: Freddy on August 26, 2009, 08:07:52 PM
Sorry I misunderstood, I thought dimdom wanted other people to see it.. ::)
Title: Re: TP 0.9.8 shoutbox permissions
Post by: dimdom on August 26, 2009, 08:11:48 PM
Quote from: Crip on August 26, 2009, 08:05:10 PM
It's all in the permissions .. set it forget it

Crip, what do you mean? The only permission that i can see is the one that permits guest to shout or not....
Title: Re: TP 0.9.8 shoutbox permissions
Post by: Crip on August 26, 2009, 08:55:33 PM
No , go to Admin>>Members>>Member Groups>> You and Gmod ..see now?
Title: Re: TP 0.9.8 shoutbox permissions
Post by: IchBin on August 26, 2009, 09:43:19 PM
So, do you want allow only certain groups to post, and all other groups to read only? I'm not sure I'm clear here either.
Title: Re: TP 0.9.8 shoutbox permissions
Post by: dimdom on August 26, 2009, 09:49:01 PM
Quote from: IchBinâ„¢ on August 26, 2009, 09:43:19 PM
So, do you want allow only certain groups to post, and all other groups to read only? I'm not sure I'm clear here either.

Yes, I would like only the admin to be able to post. All others, only to read.
Title: Re: TP 0.9.8 shoutbox permissions
Post by: Ken. on August 26, 2009, 09:56:37 PM
In TP098 there are no shoutbox permissions in the 'permissions' control panel... to set the member groups who can see the shoutbox you must edit the shoutbox itself.

Admin>TinyPortal>Block Manager>Shoutbox block> edit the groups there.

EDIT: Whoops! Looks like everybody beat me!  :coolsmiley:
Title: Re: TP 0.9.8 shoutbox permissions
Post by: Crip on August 26, 2009, 09:57:26 PM
The others may not even see a ShoutBox i do believe at least the way I set mine ?
Title: Re: TP 0.9.8 shoutbox permissions
Post by: IchBin on August 26, 2009, 10:05:25 PM
Make a backup of the file before you change it. If you screw it up, you will be able to restore. :) If you open the Themes/default/TPortalBlocks.template.php file and change this line:
if(($context['TPortal']['guest_shout']) || (!$context['TPortal']['guest_shout'] && !$context['user']['is_guest']))

To this:
if($context['user']['is_admin'])

That should work I think.
Title: Re: TP 0.9.8 shoutbox permissions
Post by: Crip on August 26, 2009, 10:08:35 PM
code monkey ..
Title: Re: TP 0.9.8 shoutbox permissions
Post by: dimdom on August 26, 2009, 11:35:17 PM
Thanks IchBin.

I ll give a try tomorrow and i ll let you know about the results...   :)
Title: Re: TP 0.9.8 shoutbox permissions
Post by: dimdom on August 27, 2009, 02:12:24 PM
It works!

Thanx once again, IchBin.

Lets say that i would like to add another two specific users next to admin at the code below that you gave us:

if($context['user']['is_admin'])

(admin, user1, user2), able to post in shoutbox.

Can you point me the correct syntax pls?  :P

Title: Re: TP 0.9.8 shoutbox permissions
Post by: IchBin on August 27, 2009, 05:01:20 PM
Are they both in a Global Moderator group or something?

if($context['user']['is_admin'] || $context['user']['id'] == 5 || $context['user']['id'] == 6)

That might work. Exchange the 5 and 6 with the ID's of those users you want.
Title: Re: TP 0.9.8 shoutbox permissions
Post by: dimdom on August 27, 2009, 05:11:28 PM
No, they are just moderators in some threads.

I ll try and I ll give you the results.

Thanx!
Title: Re: TP 0.9.8 shoutbox permissions
Post by: ZarPrime on August 28, 2009, 05:57:11 AM
Quote from: IchBinâ„¢ on August 27, 2009, 05:01:20 PM
Are they both in a Global Moderator group or something?

if($context['user']['is_admin'] || $context['user']['id'] == 5 || $context['user']['id'] == 6)

That might work. Exchange the 5 and 6 with the ID's of those users you want.

Hey Ichbin,

Could this be done for a whole membergroup instead of individual users?  For instance, let's say that group 5 is the Shout group, which are the ones allowed to shout.

ZP
Title: Re: TP 0.9.8 shoutbox permissions
Post by: IchBin on August 28, 2009, 06:08:00 AM
Yep!

if (in_array(5, $user_info['groups']))

5 would be your user group ID. If $user_info['groups'] doesn't work, I "think" $context['user']['groups'] might do the same thing. I can't remember exactly if that exists.
Title: Re: TP 0.9.8 shoutbox permissions
Post by: ZarPrime on August 31, 2009, 05:30:12 PM
Thanks Ichbin,

I'm going to try this out when I get a chance.