collapse

* Simple Portal Archived Forum

This is an Archive Forum.

The content in this forum may be out-of-date or have been superseded by newer information, and links in forum pages to other sites may not work.
This forum contains archives for future reference.

Visit our thread at Simple Machines Forum for current support.

SMF 2.1 users: EhPortal is a ported version of Simple Portal specifically designed for the SMF 2.1 branch.
Please visit web-develop.ca to download EhPortal and for its support.

* User Info

 
 
Welcome, Guest. Please login or register.

* Who's Online

  • Dot Guests: 397
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • {OCS}MasterSeal: Yup, Still adore SP
    April 21, 2019, 07:08:06 PM
  • {OCS}MasterSeal: STILL love SP :)
    November 24, 2018, 05:05:50 AM
  • ♦ Ninja ZX-10RR ♦: <3 aegersz
    September 13, 2018, 03:36:09 PM
  • aegersz: I STILL <3 LOVE SimplePortal
    September 13, 2018, 07:11:39 AM
  • aegersz: o LOVE you guys - Simple Portal rocks !
    May 09, 2018, 05:18:59 AM
  • Chen Zhen: our apologies for the site being down.. please read server issues topic
    March 22, 2018, 05:32:38 AM
  • {OCS}MasterSeal: LOL PLEASE forget I just posted that. I found the answer in my own dang post back in 2015. lol sorry!
    July 04, 2017, 10:47:55 PM
  • {OCS}MasterSeal: I know this SB isnt' for support, but I just have a general question. Who would I contact to find out where SP stores its block info? Is it DB driven or files? I searched the site but came up with nothing. probably my fault any insight is appreciated.
    July 04, 2017, 10:43:36 PM
  • ♦ Ninja ZX-10RR ♦: Excuse me but what does Simpleportal have to deal with that?
    February 05, 2017, 08:21:14 PM
  • WhiteEagle: of course IMHO that site appears to be dead :(
    February 04, 2017, 01:08:05 PM
  • WhiteEagle: If I can get that, then I'll use it for that site...
    February 04, 2017, 01:07:35 PM
  • WhiteEagle: decided to not use SMF for any projects, unless I can get a copy of the premium version of the fanfiction archive plugin
    February 04, 2017, 01:06:54 PM
  • expertdecisions: cloudflare
    January 28, 2017, 08:01:47 AM
  • aegersz: SM release 2.0.13 !
    January 12, 2017, 06:00:13 AM
  • raffo: Tks Emanuele, even if I didn't understand the fix :D
    November 07, 2016, 02:01:20 AM
  • emanuele: [link]
    November 01, 2016, 12:43:50 PM
  • emanuele: raffo: the English support board is a good place. ;)
    November 01, 2016, 12:43:38 PM
  • raffo: Where can I find the fix for the shoutbox?
    November 01, 2016, 05:06:09 AM
  • {OCS}MasterSeal: To the SP team, I make a point to come here and thank you as much as possible for your work.  so again, THANK YOU!
    October 28, 2016, 10:38:05 AM
  • emanuele: That's indeed funny, the limit is present only in the patch and not the full install.
    October 22, 2016, 06:14:58 PM

* Recent Posts

Adding Forums Button to Nav bar by jirapon
[August 01, 2019, 09:07:12 AM]


Re: Board Icons by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 04:03:41 PM]


MOVED: Czech translation???? by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 03:04:51 PM]


Board Icons by jirapon
[July 30, 2019, 07:28:44 AM]


Re: Thankyou Simpleportal, by ♦ Ninja ZX-10RR ♦
[July 29, 2019, 09:41:29 AM]

Welcome to SimplePortal.net! You can download SimplePortal from the Downloads Area!

Author Topic: Muted users not allowed to shout in shoutbox.  (Read 10360 times)

0 Members and 1 Guest are viewing this topic.

Offline Uardo

  • Semi Newbie
  • *
  • Posts: 10
  • Gender: Male
    • xCode
  • SMF Version: 2.0.10
  • SP Version: 2.3.6
Muted users not allowed to shout in shoutbox.
« on: August 31, 2015, 09:44:58 AM »
Hello evryone,

I am asking if it is possible to make it so users who are muted cannot shout in shoutbox, they already cannot send PMs or post on boards, would be great if someone can show us a way to make it so they can't shout in shoutbox.

Thank you for your time.

Offline ♦ Ninja ZX-10RR ♦

  • Spammer Hammer
  • Support
  • *
  • Posts: 1193
  • Gender: Male
  • Sniper Legends
    • Virtual Interactive Games Entertainment™
  • SMF Version: 2.0.13
  • SP Version: 2.3.6
  • Elkarte Version: 1.0.6
Re: Muted users not allowed to shout in shoutbox.
« Reply #1 on: August 31, 2015, 10:20:58 AM »
Hi Uardo,

I think it has been answered before, but I can't find it at the moment. Basically the way to proceed is to create a membergroup that has *denied* permission to see the shoutbox block, and assign it when necessary.
If you need moderators to be able to assign that membergroup without giving them the "Manage and assign membergroup" permission, you can simply add them as moderators for the banned membergroup.
Hope you don't mind if I move this to Support as coding is not involved ;)

Hint: you can also create a block only visible to the banned membergroup, with some text telling them they have been banned from the shoutbox (which is what I did on my own forum).

Regards
Have you tried SimplePortal Documentation before asking? ;)
F.A.Q.  English Support  |  Blocks Support
Fancy Feature idea ?!  |  Blocks Requests
Themes & Graphics

? My job! ?No PMs for support unless it's a paid request. Thank you! :)#OpIsis

Offline Uardo

  • Semi Newbie
  • *
  • Posts: 10
  • Gender: Male
    • xCode
  • SMF Version: 2.0.10
  • SP Version: 2.3.6
Re: Muted users not allowed to shout in shoutbox.
« Reply #2 on: August 31, 2015, 11:59:49 AM »
Actually creating a membergroup that has denied permission to see the shoutbox block would be a pain and a really hard work, since we have to assign it manually whenever they are muted and remove from membergroup when they are unmuted, i am talking about forums that have over 10,000 users and many of them getting muted daily, imagine having to check everyday if someone is muted or if someone's mute expired.

I am looking for a simple code that would not allow muted users to shout, I don't know much about coding but it should be something like that:

If user muted, not_allowed_to {shout at shoutbox}

I don't know which template to modify, what to replace or add, that's why i am asking!

Regards,
Uardo!




Offline ♦ Ninja ZX-10RR ♦

  • Spammer Hammer
  • Support
  • *
  • Posts: 1193
  • Gender: Male
  • Sniper Legends
    • Virtual Interactive Games Entertainment™
  • SMF Version: 2.0.13
  • SP Version: 2.3.6
  • Elkarte Version: 1.0.6
Re: Muted users not allowed to shout in shoutbox.
« Reply #3 on: August 31, 2015, 12:15:26 PM »
And that is unfortunately the same thing I said, it works in the same way :/ The closest thing we have is this: http://simpleportal.net/index.php?topic=11714.0 but I'm pretty sure it's not *exactly* what you want either.
Have you tried SimplePortal Documentation before asking? ;)
F.A.Q.  English Support  |  Blocks Support
Fancy Feature idea ?!  |  Blocks Requests
Themes & Graphics

? My job! ?No PMs for support unless it's a paid request. Thank you! :)#OpIsis

Offline ccbtimewiz

  • Hero Member
  • *****
  • Posts: 2185
  • Gender: Male
  • $("div.content:dd").hide();
  • SMF Version: None
  • SP Version: None
  • Elkarte Version: None
  • EhPortal Version: None
Re: Muted users not allowed to shout in shoutbox.
« Reply #4 on: August 31, 2015, 10:02:07 PM »
You can check if they can send PMs. If they can't send a PM, then reject their shout.

Open /Sources/PortalShoutbox.php

Find:
Code: [Select]
if (!empty($_REQUEST['shout']))
{
checkSession('request');

is_not_guest();

Replace with:
Code: [Select]
if (!empty($_REQUEST['shout']))
{
checkSession('request');

is_not_guest();
isAllowedTo('pm_send');

This will result in an fatal error if someone tries to make a shout when they don't have permission to send a pm.

Offline ♦ Ninja ZX-10RR ♦

  • Spammer Hammer
  • Support
  • *
  • Posts: 1193
  • Gender: Male
  • Sniper Legends
    • Virtual Interactive Games Entertainment™
  • SMF Version: 2.0.13
  • SP Version: 2.3.6
  • Elkarte Version: 1.0.6
Re: Muted users not allowed to shout in shoutbox.
« Reply #5 on: September 01, 2015, 05:22:30 AM »
Didn't think of that, it could work, even if personally I don't like fatal error thingies.
Have you tried SimplePortal Documentation before asking? ;)
F.A.Q.  English Support  |  Blocks Support
Fancy Feature idea ?!  |  Blocks Requests
Themes & Graphics

? My job! ?No PMs for support unless it's a paid request. Thank you! :)#OpIsis

Offline Uardo

  • Semi Newbie
  • *
  • Posts: 10
  • Gender: Male
    • xCode
  • SMF Version: 2.0.10
  • SP Version: 2.3.6
Re: Muted users not allowed to shout in shoutbox.
« Reply #6 on: September 01, 2015, 06:50:29 AM »
Muted users are not allowed to send PMs. I tried that and it worked, they couldn't shout and i didn't get any error.

I made it so some users couldn't send PMs, and told them to shout while they weren't muted they couldn't but didn't get any fatal error at all.
While you are muted you cannot shout, even that you are allowed to type but when you press enter it keeps reloading and shout does not appear, is it possible so when you press enter after shouting you will get a message "You are not allowed to shout because you're muted" or something like that, if not no problem!

Thank you for your time and efforts.
Regards,
Uardo

Offline ccbtimewiz

  • Hero Member
  • *****
  • Posts: 2185
  • Gender: Male
  • $("div.content:dd").hide();
  • SMF Version: None
  • SP Version: None
  • Elkarte Version: None
  • EhPortal Version: None
Re: Muted users not allowed to shout in shoutbox.
« Reply #7 on: September 01, 2015, 10:52:00 AM »
Hmm.

In that case, revert my edits above and try this;

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

if (!allowedTo('pm_send'))
{
$_REQUEST['shout'] = '';
$context['can_shout'] = false;
}

Open /Themes/default/PortalShoutbox.template.php

Find:
Code: [Select]
if (!empty($shoutbox['warning']))
echo '
<li class="shoutbox_warning smalltext">', $shoutbox['warning'], '</li>';

Replace with:
Code: [Select]
if (!allowedTo('pm_send'))
$shoutbox['warning'] = 'Sorry, but you are banned from using the shoutbox!';

if (!empty($shoutbox['warning']))
echo '
<li class="shoutbox_warning smalltext">', $shoutbox['warning'], '</li>';
« Last Edit: September 02, 2015, 01:24:05 AM by Sayaka Maizono »

Offline Uardo

  • Semi Newbie
  • *
  • Posts: 10
  • Gender: Male
    • xCode
  • SMF Version: 2.0.10
  • SP Version: 2.3.6
Re: Muted users not allowed to shout in shoutbox.
« Reply #8 on: September 01, 2015, 12:21:22 PM »
When i try to add this
Code: [Select]
if (!allowedTo('pm_send']))
$shoutbox['warning'] = 'Sorry, but you are banned from using the shoutbox!';

Shoutbox and some other blocks does not appear anymore even for users who are not muted.

Offline ccbtimewiz

  • Hero Member
  • *****
  • Posts: 2185
  • Gender: Male
  • $("div.content:dd").hide();
  • SMF Version: None
  • SP Version: None
  • Elkarte Version: None
  • EhPortal Version: None
Re: Muted users not allowed to shout in shoutbox.
« Reply #9 on: September 01, 2015, 12:26:50 PM »
That's strange, try this:

Code: [Select]
if (allowedTo('pm_send']) == false)

Offline Uardo

  • Semi Newbie
  • *
  • Posts: 10
  • Gender: Male
    • xCode
  • SMF Version: 2.0.10
  • SP Version: 2.3.6
Re: Muted users not allowed to shout in shoutbox.
« Reply #10 on: September 01, 2015, 12:30:39 PM »
Same problem again.

Offline ccbtimewiz

  • Hero Member
  • *****
  • Posts: 2185
  • Gender: Male
  • $("div.content:dd").hide();
  • SMF Version: None
  • SP Version: None
  • Elkarte Version: None
  • EhPortal Version: None
Re: Muted users not allowed to shout in shoutbox.
« Reply #11 on: September 01, 2015, 06:59:24 PM »
You are editing the PortalShoutbox.template.php file right?

Offline Uardo

  • Semi Newbie
  • *
  • Posts: 10
  • Gender: Male
    • xCode
  • SMF Version: 2.0.10
  • SP Version: 2.3.6
Re: Muted users not allowed to shout in shoutbox.
« Reply #12 on: September 01, 2015, 08:18:04 PM »
Yes i am.

It's ok if it cannot be done!
« Last Edit: September 01, 2015, 08:35:41 PM by Uardo »

Offline ccbtimewiz

  • Hero Member
  • *****
  • Posts: 2185
  • Gender: Male
  • $("div.content:dd").hide();
  • SMF Version: None
  • SP Version: None
  • Elkarte Version: None
  • EhPortal Version: None
Re: Muted users not allowed to shout in shoutbox.
« Reply #13 on: September 01, 2015, 09:00:36 PM »
Let's try it this way then. Make sure to revert all my previous edits.

Open /Sources/PortalShoutbox.php

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

if (!allowedTo('pm_send'))
{
$_REQUEST['shout'] = '';
$context['banned_from_shoutbox'] = true;
$context['can_shout'] = false;
}
else
$context['banned_from_shoutbox'] = false;

Open /Themes/default/PortalShoutbox.template.php

Find:
Code: [Select]
function template_shoutbox_embed($shoutbox)
{
global $context, $scripturl, $settings, $txt;

Replace with:
Code: [Select]
function template_shoutbox_embed($shoutbox)
{
global $context, $scripturl, $settings, $txt;

if ($context['banned_from_shoutbox'])
$shoutbox['warning'] = 'Sorry, but you are banned from using the shoutbox!';

Offline Uardo

  • Semi Newbie
  • *
  • Posts: 10
  • Gender: Male
    • xCode
  • SMF Version: 2.0.10
  • SP Version: 2.3.6
Re: Muted users not allowed to shout in shoutbox.
« Reply #14 on: September 01, 2015, 09:29:01 PM »
I tried it but the warning message "Sorry, but you are banned from using the shoutbox!" does not appear. The good thing is that this time muted users can see shoutbox and other blocks.

The warning should appear just like "Your last shout was less than 2 seconds ago. Please try again later." message but it isn't.

Offline ccbtimewiz

  • Hero Member
  • *****
  • Posts: 2185
  • Gender: Male
  • $("div.content:dd").hide();
  • SMF Version: None
  • SP Version: None
  • Elkarte Version: None
  • EhPortal Version: None
Re: Muted users not allowed to shout in shoutbox.
« Reply #15 on: September 02, 2015, 01:09:37 AM »
Could you check your error log and tell me if you see any undefined indexes for "banned_from_shoutbox"?

Offline Uardo

  • Semi Newbie
  • *
  • Posts: 10
  • Gender: Male
    • xCode
  • SMF Version: 2.0.10
  • SP Version: 2.3.6
Re: Muted users not allowed to shout in shoutbox.
« Reply #16 on: September 02, 2015, 04:15:07 AM »
http://puu.sh/jXaLF/4a68abb107.png

Line 102 is this:    if ($context['banned_from_shoutbox'])

Offline ccbtimewiz

  • Hero Member
  • *****
  • Posts: 2185
  • Gender: Male
  • $("div.content:dd").hide();
  • SMF Version: None
  • SP Version: None
  • Elkarte Version: None
  • EhPortal Version: None
Re: Muted users not allowed to shout in shoutbox.
« Reply #17 on: September 02, 2015, 08:28:22 PM »
Sorry, I don't mean to drag this on forever. Revert all previous edits.

Open /Sources/PortalShoutbox.php

Find:
Code: [Select]
if (!empty($_REQUEST['shout']))
{

Replace with:
Code: [Select]
// Can they send a PM on the boards? If not, empty out their request...
if (!allowedTo('pm_send'))
$_REQUEST['shout'] = '';

if (!empty($_REQUEST['shout']))
{

This will make any shout they try and make empty.

Open /Themes/default/PortalShoutbox.template.php

Find:
Code: [Select]
function template_shoutbox_embed($shoutbox)
{
global $context, $scripturl, $settings, $txt;

Replace with:
Code: [Select]
function template_shoutbox_embed($shoutbox)
{
global $context, $scripturl, $settings, $txt;

if (!allowedTo('pm_send') && $context['user']['is_logged'])
{
$context['can_shout'] = false;
$shoutbox['warning'] = 'Sorry, but you are banned from using the shoutbox!';
}
« Last Edit: September 03, 2015, 12:59:48 PM by Sayaka Maizono »

Offline Uardo

  • Semi Newbie
  • *
  • Posts: 10
  • Gender: Male
    • xCode
  • SMF Version: 2.0.10
  • SP Version: 2.3.6
Re: Muted users not allowed to shout in shoutbox.
« Reply #18 on: September 03, 2015, 04:28:04 AM »
Thank you, really appreciated.

Marking this as solved!


Edit: I just realized that guests can see the warning that muted users see in shoutbox..
« Last Edit: September 03, 2015, 12:53:32 PM by Uardo »

Offline ccbtimewiz

  • Hero Member
  • *****
  • Posts: 2185
  • Gender: Male
  • $("div.content:dd").hide();
  • SMF Version: None
  • SP Version: None
  • Elkarte Version: None
  • EhPortal Version: None
Re: Muted users not allowed to shout in shoutbox.
« Reply #19 on: September 03, 2015, 01:00:04 PM »
Adjusted it, forgot that guests can't send PMs lol.