Shoutbox by Siropu

Shoutbox by Siropu [Paid] 2.0.0

No permission to buy (€14.99)
Hello and thank you !

I have updated the add-on (last release : 1.3.4 ) but i don't see the options for user age restriction & minimum time between shouts.
 

Attachments

  • Screenshot_3.webp
    Screenshot_3.webp
    27.9 KB · Views: 10
  • Screenshot_4.webp
    Screenshot_4.webp
    22.7 KB · Views: 10
Unit is in years.

I did that in namespace Siropu\Shoutbox\XF\Entity to have the required age in day

Code:
     public function hasRequiredAge()
     {
          $visitor = \XF::visitor();
          //$minAge  = \XF::options()->siropuShoutboxMinAge;

          if ($visitor->user_id && $visitor->Profile)
          {
                $interval = now() - $visitor->register_date; // register_date (timestamp)
              
                if ($interval > 86400 * 3) { // seniority of the account in seconds
                    return false;
                }
          }

          return true;
     }


For those who want to display a message to users who are not able to use the shoutbox let pass the parameter required_age in namespace Siropu\Shoutbox\Widget , i did like that.

Code:
    public function render()
    {
        $visitor = \XF::visitor();

        if ($visitor->hasPermission('siropuShoutbox', 'view'))
        {
            return $this->renderer('siropu_shoutbox', [
                'shoutbox' => $this->getShoutboxParams(['height' => $this->options['height'], 'required_age' => $visitor->hasRequiredAge() ]),
                'title'    => $this->getTitle() ?: \XF::phrase('siropu_shoutbox')
            ]);
        }
    }

then in siropu_shoutbox template you can do something like that...


Code:
<xf:if is="$shoutbox.required_age">
    siropu_shoutbox_template...
<xf:else />
    <div class="alert-danger">
        You cannot use the shoutbox, you need to be registered since XX days/seconds
    </div>
</xf:if>

This is good for you ?
I can do better ?
 
The change you made has nothing to do with the actual option. The age refers to the user age based on the date of birth.
 
What are you looking for exactly? The only parameters used by the shoutbox are the ones that you can see in the siropu_shoutbox template.
 
Hi, silly issue - smiley shortcuts don't convert into images, text shortcuts are displayed instead, and there's no smileys button even if I enable it. What am I doing wrong?
 
OK, great add-on, thank you for developing it.
Got two suggestions:
  1. It's styled as a node whether it's displayed on top/bottom of nodes list or in sidebar. I'd like it even more if it were styled as a sidebar widget, when it's in sidebar.
  2. I'd like the option to hide/remove time stamps. Clutters the view on small screens/widgets.
 
On all devices?
Whichever is easier. Ideally I'd like timestamps to disappear if the box width is less than, say, 300px (because of device screen size, or because it's a sidebar widget, or because the user resized their window, whichever the case). If that's too much of a headache - then just an option to remove them altogether, on all devices.

PS: same suggestion for Chat 2 addon :)
 
Top Bottom