I had always wanted to try my hands at writing a Wordpress plugin but with the vast variety of plugins available, there appears to be little need for yet another plugin developer. Until I saw the list of wanted plugins by Lorelle. I decided to pick on the easiest plugin - Blog Status Announcement or Alert.

Feature List

  • easily switch on and off through Admin Options
  • display message without editing theme files (above 1st post or through widget)
  • display different message to different roles/users
  • timer to switch on and off announcement (only in WP 2.1 and above)

Screenshot

Genki Announcement Options Panel

Installation

1. Upload plugin folder and activate plugin
2. Go to Admin Panel > Options > Genki Announcement.

Announcement Status
- Show above first post (requires the_post() function in theme, most themes should have this)
- Show in Widget (requires Widgets Plugin)
- Show where I insert the <?php genki_announcement ?> template function (requires editing of theme)

Message
- Single message for all roles/users
- Different message for different roles/users (enter message into respective field)

Date to switch on & off announcement
- Format = YYYY-MM-DD hh:mm e.g 2007-08-18 13:59
- Leave blank to turn off announcement manually
- This feature only works in Wordpress 2.1

Upgrade

1. Deactivate plugin
2. Remove genki_announcement.php file.
3. Upload genki_announcement folder to the plugins directory
4. Activate plugin

Changelog

Version 1.1

  • Display above first post
  • Display using widget
  • Timer to switch off
  • Display different message to different roles/users
  • Remove css styling using .genki_announce class

Version 1.2

  • Option to set border and background color of frame
  • Preview of announcement message
  • timer to switch on announcement (only in WP 2.1 and above)
  • Gettext-able by Masayan
  • Japanese translation by Masayan

Version 1.3

  • tinymce added
  • Turkish translation by Baris Unver
  • French translation by Marie
  • display announcement only once when using the option “Show above first post”. announcement may still show up in the wrong place but should increase the chance of this option working.

Version 1.4

  • tinymce removed
  • Fix: Different Message for Different Users/Roles feature

License

This plugin is released under the Creative Commons GNU GPL.

Download

Name: Genki Announcement
Size: 60,08 kBytes
FileType: .zip-File
Downloads: 2447
[Download Now]

Tips & Tricks

When I use the “Show Above First Post” option, the announcement appear in more than 1 place. How can I fix it?
When using this option, the announcement will show whenever The_Loop is called. One example is the Recent Posts widget. No solution for this yet. You can workaround this by using the “Show Where I insert the < ?php genki_announcement ?>..” and manually insert the function into your theme.

[For version 1.2 and below]I’m using the plugin in WPMU where security concerns are paramaount. I do not want my users to post javascript in the announcement box. How can I disable javascript?
In line 60, look for

stripslashes(get_option('genki_announcement_msgsubscribers'))

and replace with

apply_filters('comment_text', stripslashes(get_option('genki_announcement_msgsubscribers')))

Repeat for line 61-72, taking note the slight difference in genki_announcement_xxxxxx.

[For version 1.3]I want to be able to insert javascript into the announcement? How?
Go to line 282, and insert 2 additional lines of code (in bold) as below

height : "150",
extended_valid_elements :"script[charset|defer|language|src|type],noscript[class|dir<ltr?rtl|id|lang|style|title]",
entities : ""

});

Need Help?

Much as I want to provide free support, there are only 24 hours a day.
So if you need a chunk of my time, I’m available for hire.

Featured Resources: When trying to choose a flash web design from some web template, it usually gets difficult because of the variety. Same goes for some of the best web host companies around. Even the new softwares coming in the market, a microsoft training could prove useful. Maybe you should also try your hand at SY0-101 and 640-801. One of the easiest ways for your blog marketing is pay per click program.


What's Next?

» Share This (Social Bookmarks/Email)
» Subscribe to Feed
» Subscribe to Email
» Leave a Comment

Related Posts:
» WP Plugin Update: Genki Announcement 1.2
» WP Plugin Update: Genki Announcement 1.1
» Localization of WP Plugin: Genki Announcement

» Newer Post: Facelift for My Blog
« Previous Post: OneNews feature update