JBar – Jquery Bar

27 Dec 2009

Flash messages or notification messages are very essential part of every update/edit or delete operations. We either use ajax update messages like “You account has been updated” or “Your photo has been successfully deleted”

Here, a new plugin of jQuery can be used to display the flash messages like twitter. (see twitter’s settings page)

I added some more functions to this plugin to display the notification in different context, say information, warning or error message. The function show_flash(‘message here’); can be used for this purpose. Second parameter is the type of message. For example, show_flash(‘Error in deleting file’, ‘error’) OR  show_flash(‘Email address entered is invalid’, ‘warning’)

If you use sessions to save flash message , for example in codeigniter $this->session->set_flashdata(‘message’,'hello’); you can use this plugin to display them by adding a php code in the footer  (or header) of every page

<?php if($this->session->flashdata(‘message’) != ” )  : ?>

<script>show_flash(‘<?= $this->session->flashdata(‘message’) ?>’)</script>

<?php endif; ?>

Here you can download the full source code:  http://www.sajithmr.me/downloads/jbar.zip

Screen shot 2009-12-27 at 11.30.12

Thanks

Sajith

Tags: , , , , , , , , , , , , ,

· · · ◊ ◊ ◊ · · ·

Below is a simple php code to sanitise an input message . The function has 3 parameters, depending on the parameter the input is parsed to filter.

200477351-001

function sanitize_message( $message , $email = true, $numbers = true, $url = true )
{

$message = strip_tags( $message );

if($email)
{
//strip email address
$email_regexp = "[_A-Za-z0-9-]+(\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*(\.[A-Za-z]{2,3})";
$message = ereg_replace($email_regexp, 'XXX', $message);
}

if($numbers)
{
//strip all numerical values
$number_regexp = "[0-9]";
$message = ereg_replace($number_regexp, 'XXX', $message);
}

//eliminate url from message
if($url)
{

$url_regexp = "(https?://)?(www\.)?([a-zA-z0-9\.])*[a-zA-Z0-9]*\.[a-z]{2,3}";
$message = ereg_replace($url_regexp, 'XXX', $message);
}

//eliminate all the bad words
$bad_words = array("f**k", "son of a b***h");
$message = str_ireplace($bad_words, 'XXX', $message);

return $message;

}

Tags: , , , , , , , ,

· · · ◊ ◊ ◊ · · ·

Today i published my new wordpress plugin, which control user navigation. The plugin name is “Close Warning”.

It prompts the user a confirmation message before they close the browser window or tab. After that a lightweight window popup jumps up with your preset announcement or message  (in richtext format)

The Advantages >>

  1. You can avoid the accidental close of browser window
  2. You can tell or mention any message or offers before they navigate away from your website
  3. It works not only on closing, but in any type of external navigation (Internal navigation is screened out from this warning)
  4. Since it is built on lightweight window support, your message or warning appears very eye-catchy

You can download the plugin from : http://www.sajithmr.com/downloads/onclose-warning.zip

Screen Shot - Warning before close

Screen Shot - Warning before close

From the setting page, you can set your rich text message or warning / offer . See the screen shot:

Warning Before Closing

Warning Before Closing

Please feel free to mail me regarding any clarification and upgrade to admin@sajithmr.com

Regards

Sajith

Tags: , , , , , ,

· · · ◊ ◊ ◊ · · ·

Wordpress Announcement Plugin

Do you wanna inform any important news or message to your readers ? Here is a simple plugin, WordPress Announcement Plugin.

Download the plugin from : http://downloads.wordpress.org/plugin/announcement.zip

Go to Admin > Plugin > and activate announcement plugin. After that, go to options and select Announcement. By default the plugin will be inactive. You have to set your announcement and activate the announcement by checking ‘Active’ checkbox.

Never Forgot to Run the Announcement. By Default the Announcement will be inactive

Enough !!! You visitors can now see your announcement. It will be displayed only one time for a particular user .

(If you want to see the announcement again, for testing purpose, Clear browser cookies, or atleast cookies from your blog. Otherwise you have to wait another 24 hours to play the announcement again)

The plugin is created with cute design and animation. It will never interrupt your blog reader.

Regards

Sajith

Tags: , , , , , ,

· · · ◊ ◊ ◊ · · ·

وظائف 2011 تحويل العملات برامج برنامج تسريع التحميل برنامج الفلاش برنامج محول الصوتيات عربي hotel 2011 زيادة رواتب العساكر 1431