MyBB Community Forums

Full Version: MyAlerts
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Beautiful plugin. I'll be currently using this for my new forum.
How can one make MyAlerts notification flash red when there are notifications?

Right now it turns a miserly red... which some users might not notice. I think it would be better if one could do some kind of CSS that causes it to dim/flash a hue of reds or something like that.

I hope someone understands what I mean.

lol don't mind the lame text:

[Image: flashing_text.gif]

I tried this but it didn't work:

.newAlerts > a {
	color:red !important;
    -webkit-animation: blink .75s linear infinite !important;;
    -moz-animation: blink .75s linear infinite !important;;
    -ms-animation: blink .75s linear infinite !important;;
    -o-animation: blink .75s linear infinite !important;;
    animation: blink .75s linear infinite !important;;
}
@-webkit-keyframes newAlerts > a {
    0% { opacity: 1; }
    50% { opacity: 1; }
    50.01% { opacity: 0; }
    100% { opacity: 0; }
}

@-moz-keyframes newAlerts > a {
    0% { opacity: 1; }
    50% { opacity: 1; }
    50.01% { opacity: 0; }
    100% { opacity: 0; }
}

@-ms-keyframes newAlerts > a {
    0% { opacity: 1; }
    50% { opacity: 1; }
    50.01% { opacity: 0; }
    100% { opacity: 0; }
}

@-o-keyframes newAlerts > a {
    0% { opacity: 1; }
    50% { opacity: 1; }
    50.01% { opacity: 0; }
    100% { opacity: 0; }
}

@keyframes newAlerts > a {
    0% { opacity: 1; }
    50% { opacity: 1; }
    50.01% { opacity: 0; }
    100% { opacity: 0; }
}

Based on:
http://visualidiot.com/articles/css3
and
http://visualidiot.com/files/real-world.css





Okay ladies and gentlemen! I figured it out:

.newAlerts > a {
color:red !important;
font-weight:bold;
    -webkit-animation-name: blinker;
    -webkit-animation-duration: 1s;
    -webkit-animation-timing-function: linear;
    -webkit-animation-iteration-count: infinite;
    
    -moz-animation-name: blinker;
    -moz-animation-duration: 1s;
    -moz-animation-timing-function: linear;
    -moz-animation-iteration-count: infinite;
    
    animation-name: blinker;
    animation-duration: 1s;
    animation-timing-function: linear;
    animation-iteration-count: infinite;

    -ms-animation-name: blinker;
    -ms-animation-duration: 1s;
    -ms-animation-timing-function: linear;
    -ms-animation-iteration-count: infinite;

    -o-animation-name: blinker;
    -o-animation-duration: 1s;
    -o-animation-timing-function: linear;
    -o-animation-iteration-count: infinite;
}

@-moz-keyframes blinker {  
    0% { opacity: 1.0; }
    50% { opacity: 0.0; }
    100% { opacity: 1.0; }
}

@-webkit-keyframes blinker {  
    0% { opacity: 1.0; }
    50% { opacity: 0.0; }
    100% { opacity: 1.0; }
}

@keyframes blinker {  
    0% { opacity: 1.0; }
    50% { opacity: 0.0; }
    100% { opacity: 1.0; }
}

I think this should come from factory haha! I hope people like this! Tested in firefox and chrome only

I added
    -ms-animation-name: blinker;
    -ms-animation-duration: 1s;
    -ms-animation-timing-function: linear;
    -ms-animation-iteration-count: infinite;

    -o-animation-name: blinker;
    -o-animation-duration: 1s;
    -o-animation-timing-function: linear;
    -o-animation-iteration-count: infinite;

But I am not sure if they are valid

Based off of:

http://stackoverflow.com/questions/16344...-with-css3

and

http://jsfiddle.net/umz8t/458/





Okay ladies and gentlemen! I figured it out:

.newAlerts > a {
color:red !important;
font-weight:bold;
    -webkit-animation-name: blinker;
    -webkit-animation-duration: 1s;
    -webkit-animation-timing-function: linear;
    -webkit-animation-iteration-count: infinite;
    
    -moz-animation-name: blinker;
    -moz-animation-duration: 1s;
    -moz-animation-timing-function: linear;
    -moz-animation-iteration-count: infinite;
    
    animation-name: blinker;
    animation-duration: 1s;
    animation-timing-function: linear;
    animation-iteration-count: infinite;

    -ms-animation-name: blinker;
    -ms-animation-duration: 1s;
    -ms-animation-timing-function: linear;
    -ms-animation-iteration-count: infinite;

    -o-animation-name: blinker;
    -o-animation-duration: 1s;
    -o-animation-timing-function: linear;
    -o-animation-iteration-count: infinite;
}

@-moz-keyframes blinker {  
    0% { opacity: 1.0; }
    50% { opacity: 0.0; }
    100% { opacity: 1.0; }
}

@-webkit-keyframes blinker {  
    0% { opacity: 1.0; }
    50% { opacity: 0.0; }
    100% { opacity: 1.0; }
}

@keyframes blinker {  
    0% { opacity: 1.0; }
    50% { opacity: 0.0; }
    100% { opacity: 1.0; }
}

I think this should come from factory haha! I hope people like this! Tested in firefox and chrome only

I added
    -ms-animation-name: blinker;
    -ms-animation-duration: 1s;
    -ms-animation-timing-function: linear;
    -ms-animation-iteration-count: infinite;

    -o-animation-name: blinker;
    -o-animation-duration: 1s;
    -o-animation-timing-function: linear;
    -o-animation-iteration-count: infinite;

But I am not sure if they are valid

Based off of:

http://stackoverflow.com/questions/16344...-with-css3

and

http://jsfiddle.net/umz8t/458/
This is the issue I am facing right now. As you can see from the following image, instead of showing Alerts (0) is takes my dropdown link and replaces itself. Is this just a conflict in jquery?

[Image: 516a31d57512e109bf819c80b748efac.png]
That's odd. It might well be a conflict between the MyAlerts dropdown JavaScript and your template's. Could I get a link and test account?
Sure, Ill PM you the details now. Please reply to any further correspondence via PM.
Ok, I have a problem -
Background: I have a board and a test board. Both use the same database, different prefixes. Both have latest mybb version installed.
On my test board myAlerts work fine.
On my public board I get an error when I try to update alert settings /usercp.php?action=alert_settings

(full error attached)
The following warnings occurred:
Warning [2] Illegal string offset 'rep' - Line: 574 - File: inc/plugins/myalerts.php PHP 5.4.21 (Linux)

I'm using latest github myalerts version.

As I had myalerts some time ago on my public board, I tried to clean up files:
  • I tried deleting all myalert files from server
  • and checking database for leftover myalert tables:

    alerts, alert_settings, alert_settings_values.

  • I checked templates for leftover myalerts strings as well
  • I run Daily Cleanup and Hourly Cleanup tasks
but after cleaning and reinstalling myalerts plugin, problem still existed.

Is there anything else I can do? Something I'm missing?

EDIT:
We found a workaround for this:
in function "function myalerts_global()" around line 573 we added:
		if (!is_array($mybb->user['myalerts_settings']))
			$mybb->user['myalerts_settings'] = array();
That fixed this error, but we are still confused why this plugin works on test board out of the box and doesn't - on the main board.
Looks like the default settings might be missing from the alert_settings table. Can you check the contents of that table?
Hey Euan T. Love this plugin. I am just having an issue with it as an admin user.

Before I installed the plugin, it would display my mod and admin cp buttons next to each other.

[attachment=31309]

With it installed, it isn't doing that. It is just showing the mod cp button.

[attachment=31307]

If I edit the template and put the admin link into the admin welcome block I get 2 admin cp links.

[attachment=31308]

Just wondering if you had any ideas or pointers. Can't seem to figure out what is causing this.

TIA

Chris

I've attached 3 screen shots to show what is happening.

EDIT:

Issue resolved. I had to go into the templates and readd the {admincp} to the right place as the placeholder for my alerts had moved it.
(2014-04-05, 10:28 AM)Euan T Wrote: [ -> ].
Hi, the alert on this site is completely broken!
Test account
User: quality
Pass: quality

alerts.css
.unreadAlerts {
	display: inline-block;
}

.usercp_nav_myalerts {
	background:url(images/usercp/transmit_blue.png) no-repeat left center;
}
.usercp_nav_myalerts_delete_all {
	background:url(images/usercp/delete.png) no-repeat left center;
}
.usercp_nav_myalerts_delete_read {
	background:url(images/usercp/bin.png) no-repeat left center;
}

.newAlerts > a {
	color:red !important;
}

.myalerts_popup ol {
	list-style:none;
	margin:0;
	padding:0;
}
	.myalerts_popup li {
		min-height:24px;
		padding:2px 4px;
		border-bottom:1px solid #D4D4D4;
	}
	.myalerts_popup li .avatar {
		float:left;
		height:24px;
		width:24px;
	}
	.myalerts_popup li .alertContent {
		margin-left:30px;
		font-size:11px;
	}
	.unreadAlert {
		font-weight:bold;
		background:#FFFBD9;
	}

.myalerts_popup_wrapper{
	position:relative;
}

.myalerts_popup_wrapper .myalerts_popup {
	background:#fff;
	width:350px;
	max-width:350px;
	box-shadow:0 0 10px rgba(0,0,0,0.2);
	position:absolute;
	left:0;
	z-index:9999;
}
	.myalerts_popup .popupTitle {
		font-weight:bold;
		margin:0 2px;
		padding:2px;
		border-bottom:1px solid #D4D4D4;
	}
	.myalerts_popup .popupFooter {
		padding:4px;
		background:#EFEFEF;
		box-shadow:inset 0 1px 0 0 rgba(255,255,255,0.2);
	}
(2014-04-06, 08:19 AM)jayy Wrote: [ -> ]
(2014-04-05, 10:28 AM)Euan T Wrote: [ -> ].
Hi, the alert on this site is completely broken!
Test account
User: quality
Pass: quality

alerts.css
.unreadAlerts {
	display: inline-block;
}

.usercp_nav_myalerts {
	background:url(images/usercp/transmit_blue.png) no-repeat left center;
}
.usercp_nav_myalerts_delete_all {
	background:url(images/usercp/delete.png) no-repeat left center;
}
.usercp_nav_myalerts_delete_read {
	background:url(images/usercp/bin.png) no-repeat left center;
}

.newAlerts > a {
	color:red !important;
}

.myalerts_popup ol {
	list-style:none;
	margin:0;
	padding:0;
}
	.myalerts_popup li {
		min-height:24px;
		padding:2px 4px;
		border-bottom:1px solid #D4D4D4;
	}
	.myalerts_popup li .avatar {
		float:left;
		height:24px;
		width:24px;
	}
	.myalerts_popup li .alertContent {
		margin-left:30px;
		font-size:11px;
	}
	.unreadAlert {
		font-weight:bold;
		background:#FFFBD9;
	}

.myalerts_popup_wrapper{
	position:relative;
}

.myalerts_popup_wrapper .myalerts_popup {
	background:#fff;
	width:350px;
	max-width:350px;
	box-shadow:0 0 10px rgba(0,0,0,0.2);
	position:absolute;
	left:0;
	z-index:9999;
}
	.myalerts_popup .popupTitle {
		font-weight:bold;
		margin:0 2px;
		padding:2px;
		border-bottom:1px solid #D4D4D4;
	}
	.myalerts_popup .popupFooter {
		padding:4px;
		background:#EFEFEF;
		box-shadow:inset 0 1px 0 0 rgba(255,255,255,0.2);
	}

Looks like you have the JavaScript in your header twice. Remove one of the copies. Then change your CSS to the following:

.unreadAlerts {
	display: inline-block;
}

.usercp_nav_myalerts {
	background:url(images/usercp/transmit_blue.png) no-repeat left center;
}
.usercp_nav_myalerts_delete_all {
	background:url(images/usercp/delete.png) no-repeat left center;
}
.usercp_nav_myalerts_delete_read {
	background:url(images/usercp/bin.png) no-repeat left center;
}

.newAlerts > a {
	color:red !important;
}

.myalerts_popup_wrapper a {
    color: #fff;
}

.myalerts_popup, .myalerts_popup a {
    color: #000;
}

.myalerts_popup ol {
	list-style:none;
	margin:0;
	padding:0;
}
	.myalerts_popup li {
		min-height:24px;
		padding:2px 4px;
		border-bottom:1px solid #D4D4D4;
	}
	.myalerts_popup li .avatar {
		float:left;
		height:24px;
		width:24px;
	}
	.myalerts_popup li .alertContent {
		margin-left:30px;
		font-size:11px;
	}
	.unreadAlert {
		font-weight:bold;
		background:#FFFBD9;
	}

.myalerts_popup_wrapper{
	position:relative;
}

.myalerts_popup_wrapper .myalerts_popup {
	background:#fff;
	width:350px;
	max-width:350px;
	box-shadow:0 0 10px rgba(0,0,0,0.2);
	position:absolute;
	left:0;
	z-index:9999;
}
	.myalerts_popup .popupTitle {
		font-weight:bold;
		margin:0 2px;
		padding:2px;
		border-bottom:1px solid #D4D4D4;
	}
	.myalerts_popup .popupFooter {
		padding:4px;
		background:#EFEFEF;
		box-shadow:inset 0 1px 0 0 rgba(255,255,255,0.2);
	}