PDA

View Full Version : Alert when Mailbox is Full


gsk8
10-19-2018, 04:50 PM
Hey all!

Is there anything nifty to let folks know when their PM storage is full? Most are overlooking the default.

I like and use this mod (https://vbulletin.org/forum/showthread.php?t=262898) when folks get a new PM. It would be cool to have something similar for folks who are nearing their storage limit. Is there anything out there like that? I did a search and wasn't able to find anything :)

scottkoz20
10-19-2018, 05:12 PM
You can use a Notice from the AdminCP and choose the option for "User's private message storage is between X% and Y% full"

for the Notice - use the following Hey {username} - Your PM Mailbox is 90% or more filled at this time. Please delete some of your older messages before your box is filled.

MarkFL
10-19-2018, 05:52 PM
Let's try this...create a new plugin hooked at "notifications_list" and give it the title "PM Quota Past Threshold" with the following Plugin PHP Code:

global $vbulletin;
$threshold = 0.25;

if ($vbulletin->userinfo['pmtotal']/$vbulletin->userinfo['permissions']['pmquota'] > $threshold)
{
$template_name = 'header';
$t_temp = $vbulletin->templatecache[$template_name];
$find = '/(<li class="welcomelink">.*?<\/li>)/';
$t_temp = preg_replace($find, '$1' .'<li style="padding: 3px 4px; color: #ffffff; font-weight: bold;">Your PM quota is over ' . $threshold*100 . '% capacity!</li>', $t_temp);
$vbulletin->templatecache[$template_name] = $t_temp;
}

You can change the value of 0.25 for the variable $threshold to suit your liking. Once you see how this looks, we can make any tweaks to it you like. :)

gsk8
10-19-2018, 06:16 PM
Thanks Scott and Mark!

--------------- Added 1539980719 at 1539980719 ---------------

What's depressing is that folks using the mobile version (i.e. Tapatalk) cannot see "Notices". Only Announcements. Tapatalk won't fix it. ForumRunner is gone....

MarkFL
10-20-2018, 12:56 AM
Thanks Scott and Mark!

--------------- Added 1539980719 at 1539980719 ---------------

What's depressing is that folks using the mobile version (i.e. Tapatalk) cannot see "Notices". Only Announcements. Tapatalk won't fix it. ForumRunner is gone....

I don't know if Tapatalk bypasses the hook I'm using (I think it bypasses most PHP plugin hooks), but I have turned my code into a product with settings to allow you to turn it on/off and to set the percentage threshold. If you install this product, then delete the plugin I posted above first before installing this product.

The message is in a phrase to you can edit it if you like.

scottkoz20
10-20-2018, 02:05 AM
Tapatalk bypasses a number of hooks as it's really looking at the forums generally in the app. So this mod is not going to appear on there.

However, I have a suggestion. I can see where the notification is going to get lost in the "noise" at the top of the forum. As a suggestion, I think a better location for this would be in the notifications area (see image attached).

Just a thought

MarkFL
10-20-2018, 02:50 AM
Tapatalk bypasses a number of hooks as it's really looking at the forums generally in the app. So this mod is not going to appear on there.

However, I have a suggestion. I can see where the notification is going to get lost in the "noise" at the top of the forum. As a suggestion, I think a better location for this would be in the notifications area (see image attached).

Just a thought

I am attaching an updated product that gives you a choice in the settings whether to display the alert next to the welcome as in the original, or to display the alert as a notification. :)

scottkoz20
10-20-2018, 11:32 AM
I am attaching an updated product that gives you a choice in the settings whether to display the alert next to the welcome as in the original, or to display the alert as a notification. :)

clean and simple

:up:

gsk8
10-20-2018, 06:28 PM
When I brought up Tapatalk, I should have been more clear. It doesn't show "Notices". The ones you make under "Notice" manager. :)

On another note with Tapatalk (or anything other than full site version)

If you are not logged in and you click on an "ANNOUNCEMENT", it will go to some random post and not the actual announcement. Very frustrating. I've sent them emails, but no responses.

CAG CheechDogg
10-23-2018, 08:03 AM
Good stuff Mark ...