MyBB Community Forums

Full Version: [MyCode] Css Notice Tags
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I use this as-well on my forum, thought some people may want this.

Expression:
\[notice=([a-z]+?)\](.*?)\[/notice\]

Replacement:
<span class="$1">$2</span>

Examples:
[notice=alert]Your Text Here[/notice]
[notice=approved]Your Text Here[/notice]
[notice=attention]Your Text Here[/notice]
[notice=camera]Your Text Here[/notice]
[notice=cart]Your Text Here[/notice]
[notice=doc]Your Text Here[/notice]
[notice=download]Your Text Here[/notice]
[notice=media]Your Text Here[/notice]
[notice=note]Your Text Here[/notice]
[notice=notice]Your Text Here[/notice]

Goto: Templates & Styles > Your Theme > global.css

Add this to the very bottom:
span.attention, span.notice, span.alert, span.download, span.approved, span.media, span.note, span.cart, span.camera, span.doc {display: block;padding: 8px 10px 8px 36px;margin: 15px 0;}
span.attention {color: #B79000;border: 1px solid #E7BD72;background: #FFF3A3 url('images/notices/attention.png') 10px 50% no-repeat;}
span.notice {color: #648434;border: 1px solid #9BCC54;background: #CDEFA6 url('images/notices/notice.png') 10px 50% no-repeat;}
span.alert {color: #CF3738;border: 1px solid #FFACAD;background: #FFD5D5 url('images/notices/alert.png') 10px 50% no-repeat;}
span.download {color: #1C6B8B;border: 1px solid #6ABCE2;background: #A8CDE3 url('images/notices/download.png') 10px 50% no-repeat;}
span.approved {color: #666;border: 1px solid #a8a8a8;background: #ccc url('images/notices/approved.png') 10px 50% no-repeat;}
span.media {color: #C76E34;border: 1px solid #FFBB65;background: #FFE0B6 url('images/notices/media.png') 10px 50% no-repeat;}
span.note {color: #B79000;border: 1px solid #E7BD72;background: #FFF3A3 url('images/notices/note.png') 10px 50% no-repeat;}
span.cart {color: #666;border: 1px solid #C5C5C5;background: #E6E6E6 url('images/notices/cart.png') 10px 50% no-repeat;}
span.camera {color: #666;border: 1px solid #C5C5C5;background: #E6E6E6 url('images/notices/camera.png') 10px 50% no-repeat;}
span.doc {color: #C76E34;border: 1px solid #FFBB65;background: #FFE0B6 url('images/notices/doc.png') 10px 50% no-repeat;}

Screen shot:
http://i48.tinypic.com/25smwx1.png

Save it then, upload the notices folder to your images folder.
Great MyCode. Smile
Nice, thanks for sharing! Smile
Brilliant, good job.!
Np, glad you guys like it.
how can i restrict permission to use it. for example i want only staff to use this.
(2010-08-09, 07:29 PM)ProVirus Wrote: [ -> ]how can i restrict permission to use it. for example i want only staff to use this.

You would need a plugin.
(2010-08-10, 09:03 AM)N.Malcolm Wrote: [ -> ]
(2010-08-09, 07:29 PM)ProVirus Wrote: [ -> ]how can i restrict permission to use it. for example i want only staff to use this.

You would need a plugin.

yes that was obvious, still there isnt any plugin for that.
it would be too easy if there was a [mod] warning from moderator [/mod] tag.
I just created a plugin to change permissions on custom mycode.
(2010-08-10, 09:14 AM)ProVirus Wrote: [ -> ]yes that was obvious, still there isnt any plugin for that.
it would be too easy if there was a [mod] warning from moderator [/mod] tag.

Yes, there is @ MyBB Central. You could easily modify that.

Pages: 1 2