SimplePortal

Development => Feature Requests => Topic started by: BPLive on October 03, 2011, 05:38:07 PM

Title: [shoutbox] Post Permission
Post by: BPLive on October 03, 2011, 05:38:07 PM
For the first time I used the shoutbox and advertised it so members can use it during a live concert event and comment.  It was highly successful with 6000 shouts in 2 days. One day leading to the Rock In Rio event and then day of the concert. I don't want anymore shouts and the history has much good information and band members and site users can read it like an archive.

I want to now make this shoutbox read only....  so it archives the successful event. This could only be done if there was a permission for shout posts.  Could be by group.   :(

Below are a couple other threads that I found from others that could use this feature. I find it important.

http://simpleportal.net/index.php?topic=6078.msg35640#msg35640

http://simpleportal.net/index.php?topic=3352.0

If I can make my shoutbox read only right now in 2.3.3  please let me know how I can. Then I can archive the shoutbox chat events (turn off refresh etc) and show the history etc. and then the shout boxes would be highly useful for me. It would be fun for members of the site to look forward to upcoming shout events for concerts for this band and then users would stay online reading the archived events later.
Title: Re: [shoutbox] Post Permission
Post by: [SiNaN] on October 04, 2011, 05:54:11 AM
Sources/PortalBlocks.php

Code: (Find) [Select]
$context['can_shout'] = $context['user']['is_logged'];
Code: (Replace) [Select]
$context['can_shout'] = $context['user']['is_logged'];
if (in_array($shoutbox['id'], array(1, 2, 3)))
$context['can_shout'] = false;

Sources/PortalShoutbox.php

Code: (Find) [Select]
is_not_guest();
Code: (Replace) [Select]
is_not_guest();

if (in_array($shoutbox_id, array(1, 2, 3)))
fatal_error('You cannot shout!', false);

You need to change 1, 2, 3 as the id of shoutbox (comma separated) to make read-only.
Title: Re: [shoutbox] Post Permission
Post by: BPLive on October 04, 2011, 11:28:15 AM
thank you SiNaN

I found the code in Sources/PortalShoutbox.php

but not in PortalBlocks.php  <  I attached it
Title: Re: [shoutbox] Post Permission
Post by: [SiNaN] on October 04, 2011, 11:45:26 AM
That's because you have made an incorrect change. Take the changes you've made back and follow my post carefully. The first change is in PortalBlocks.php and the second one is in PortalShoutbox.php. You've mixed them.
Title: Re: [shoutbox] Post Permission
Post by: BPLive on October 04, 2011, 01:21:16 PM
Did that when I just woke up.  but I still think I can't find the code

Code: [Select]
$context['can_shout'] = $context['user']['is_logged'];
I'll dl source code to make sure


edit: ok downloaded the source code and made the changes and reup'd it.  :D  thanks a lot.  Still would be a great feature.
Title: Re: [shoutbox] Post Permission
Post by: [SiNaN] on October 05, 2011, 03:51:38 AM
Yeah, it's something to consider indeed.
SimplePortal 2.3.8 © 2008-2024, SimplePortal