Why “Going Postal’ Is No Longer Funny In the face of Workplace Massacres

if (!function_exists(‘smbsugar_request_handler’)) {
function smbsugar_request_handler() {
global $message;

if ($_POST[‘smbsugar_action’] == “update options”) {
$smbsugar_align_v = $_POST[‘smbsugar_align_sl’];

update_option(“smbsugar_box_align”, $smbsugar_align_v);

if($_POST[‘smbsugar_home’] == “on”) update_option(‘smbsugar_display_home’, “checked=on”);
else update_option(‘smbsugar_display_home’, “”);

if($_POST[‘smbsugar_page’] == “on”) update_option(‘smbsugar_display_page’, “checked=on”);
else update_option(‘smbsugar_display_page’, “”);

if($_POST[‘smbsugar_post’] == “on”) update_option(‘smbsugar_display_post’, “checked=on”);
else update_option(‘smbsugar_display_post’, “”);

if($_POST[‘smbsugar_cat’] == “on”) update_option(‘smbsugar_display_cat’, “checked=on”);
else update_option(‘smbsugar_display_cat’, “”);

if($_POST[‘smbsugar_archive’] == “on”) update_option(‘smbsugar_display_archive’, “checked=on”);
else update_option(‘smbsugar_display_archive’, “”);

update_option(“smbsugar_button”, $_POST[‘smbsugar_button’]);

$message = ‘

Options saved.

‘;
}
}
}

if(!function_exists(‘smbsugar_add_menu’)) {
function smbsugar_add_menu () {
add_options_page(“bizSugar Vote Options”, “bizSugar”, 8, basename(__FILE__), “smbsugar_displayOptions”);
}
}

if (!function_exists(‘smbsugar_displayOptions’)) {
function smbsugar_displayOptions() {

global $message;
echo $message;

print(‘

‘);
print(‘

bizSugar Voting Button Options

‘);

print (”);
?>

Align

<option value="Top Left" >Top Left
<option value="Top Right" >Top Right
<option value="Bottom Left" >Bottom Left
<option value="Bottom Right" >Bottom Right
<option value="None" >None

Display bizSugar on… <INPUT TYPE=CHECKBOX NAME="smbsugar_home" />home page
<INPUT TYPE=CHECKBOX NAME="smbsugar_page" />static pages
<INPUT TYPE=CHECKBOX NAME="smbsugar_post" />post pages
<INPUT TYPE=CHECKBOX NAME="smbsugar_cat" />category pages
<INPUT TYPE=CHECKBOX NAME="smbsugar_archive" />archive pages

Which bizSugar button would you like to use?

<input type="radio" name="smbsugar_button" value="1" checked=”checked” />

<input type="radio" name="smbsugar_button" value="2" checked=”checked” />

<input type="radio" name="smbsugar_button" value="3" checked=”checked” />

<input type="radio" name="smbsugar_button" value="4" checked=”checked” />

<?php
print ('’);
print(‘

‘);

}
}

if (!function_exists(‘smbsugar_bizsugarhtml’)) {
function smbsugar_bizsugarhtml($float,$button_url) {
global $wp_query;
$post = $wp_query->post;
$id = $post->ID;
$permalink = get_permalink($id);
$title = urlencode($post->post_title);
$bizsugarhtml = <<<CODE


submit_url = “$permalink”;


CODE;
return $bizsugarhtml;
}
}

if (!function_exists(‘smbsugar_addbutton’)) {
function smbsugar_addbutton($content) {
$smbsugar_display = true;
if(is_home() && !get_option(‘smbsugar_display_home’) == ‘checked=on’)
$smbsugar_display = false;
if(is_page() && !get_option(‘smbsugar_display_page’) == ‘checked=on’)
$smbsugar_display = false;
if(is_single() && !get_option(‘smbsugar_display_post’) == ‘checked=on’)
$smbsugar_display = false;
if(is_category() && !get_option(‘smbsugar_display_cat’) == ‘checked=on’)
$smbsugar_display = false;
if(is_archive() && !get_option(‘smbsugar_display_archive’) == ‘checked=on’ && !is_category())
$smbsugar_display = false;

if(get_option(‘smbsugar_button’) == ‘2’) {
$button_url = “evb/button-b.php”;
} else if (get_option(‘smbsugar_button’) == ‘3’) {
$button_url = “evb3/button.php”;
} else if (get_option(‘smbsugar_button’) == ‘4’) {
$button_url = “evb2/check_url2.js.php”;
} else {
$button_url = “evb/button.php”;
}

if($smbsugar_display === true) {
if(! preg_match(‘||’, $content)) {
$smbsugar_align = get_option(“smbsugar_box_align”);
if ($smbsugar_align) {
switch ($smbsugar_align) {
case “Top Left”:
return smbsugar_bizsugarhtml(“left”,$button_url).$content;
break;
case “Top Right”:
return smbsugar_bizsugarhtml(“Right”,$button_url).$content;
break;
case “Bottom Left”:
return $content.smbsugar_bizsugarhtml(“left”,$button_url);
break;
case “Bottom Right”:
return $content.smbsugar_bizsugarhtml(“right”,$button_url);
break;
case “None”:
return $content;
break;
default:
return smbsugar_bizsugarhtml(“left”,$button_url).$content;
break;
}
} else {
return smbsugar_bizsugarhtml(“left”,$button_url).$content;
}

} else {
return str_replace(‘‘, smbsugar_bizsugarhtml(“”,$button_url), $content);
}
} else {
return $content;
}
}
}

if (!function_exists(‘show_bizsugar’)) {
function show_bizsugar($float = “left”) {
global $post;
$permalink = get_permalink($post->ID);
echo <<<CODE


submit_url = “$permalink”;


CODE;
}
}

add_filter(‘the_content’, ‘smbsugar_addbutton’, 999);
add_action(‘admin_menu’, ‘smbsugar_add_menu’);
add_action(‘init’, ‘smbsugar_request_handler’);

?>

Wednesday, August 14, 2010:

A worker at a beer distributor in Manchester Connecticut has been caught stealing beer. He is called into a disciplinary hearing where he is to be fired. He remains calm throughout, seemingly resigned to the fact that he will be terminated. At the end of the meeting…he pulls out a gun and begins shooting.

He slaughters nine people before turning the gun on himself.


<?php

/*
Plugin Name: bizSugar.com Vote Button
Version: 1.2
Plugin URI: http://www.bizsugar.com/tools.php
Author URI: http://www.outthinkgroup.com
Author: Tim Grahl

Description: Adds bizSugar Vote button to your WordPress blog posts. See installation instructions to learn about all features of this plugin.

SEE INSTALLATIONS INSTRUCTIONS TO LEARN ABOUT ALL FEATURES OF THIS PLUGIN

*/

$message = "";

if (!function_exists('smbsugar_request_handler')) {
function smbsugar_request_handler() {
global $message;

if ($_POST['smbsugar_action'] == "update options") {
$smbsugar_align_v = $_POST['smbsugar_align_sl'];

update_option("smbsugar_box_align", $smbsugar_align_v);

if($_POST['smbsugar_home'] == "on") update_option('smbsugar_display_home', "checked=on");
else update_option('smbsugar_display_home', "");

if($_POST['smbsugar_page'] == "on") update_option('smbsugar_display_page', "checked=on");
else update_option('smbsugar_display_page', "");

if($_POST['smbsugar_post'] == "on") update_option('smbsugar_display_post', "checked=on");
else update_option('smbsugar_display_post', "");

if($_POST['smbsugar_cat'] == "on") update_option('smbsugar_display_cat', "checked=on");
else update_option('smbsugar_display_cat', "");

if($_POST['smbsugar_archive'] == "on") update_option('smbsugar_display_archive', "checked=on");
else update_option('smbsugar_display_archive', "");

update_option("smbsugar_button", $_POST['smbsugar_button']);

$message = '

Options saved.

‘;
}
}
}

if(!function_exists(‘smbsugar_add_menu’)) {
function smbsugar_add_menu () {
add_options_page(“bizSugar Vote Options”, “bizSugar”, 8, basename(__FILE__), “smbsugar_displayOptions”);
}
}

if (!function_exists(‘smbsugar_displayOptions’)) {
function smbsugar_displayOptions() {

global $message;
echo $message;

print(‘

‘);
print(‘

bizSugar Voting Button Options

‘);

print (”);
?>

Align

<option value="Top Left" >Top Left
<option value="Top Right" >Top Right
<option value="Bottom Left" >Bottom Left
<option value="Bottom Right" >Bottom Right
<option value="None" >None

Display bizSugar on… <INPUT TYPE=CHECKBOX NAME="smbsugar_home" />home page
<INPUT TYPE=CHECKBOX NAME="smbsugar_page" />static pages
<INPUT TYPE=CHECKBOX NAME="smbsugar_post" />post pages
<INPUT TYPE=CHECKBOX NAME="smbsugar_cat" />category pages
<INPUT TYPE=CHECKBOX NAME="smbsugar_archive" />archive pages

Which bizSugar button would you like to use?

<input type="radio" name="smbsugar_button" value="1" checked=”checked” />

<input type="radio" name="smbsugar_button" value="2" checked=”checked” />

<input type="radio" name="smbsugar_button" value="3" checked=”checked” />

<input type="radio" name="smbsugar_button" value="4" checked=”checked” />

<?php
print ('’);
print(‘

‘);

}
}

if (!function_exists(‘smbsugar_bizsugarhtml’)) {
function smbsugar_bizsugarhtml($float,$button_url) {
global $wp_query;
$post = $wp_query->post;
$id = $post->ID;
$permalink = get_permalink($id);
$title = urlencode($post->post_title);
$bizsugarhtml = <<<CODE


submit_url = “$permalink”;


CODE;
return $bizsugarhtml;
}
}

if (!function_exists(‘smbsugar_addbutton’)) {
function smbsugar_addbutton($content) {
$smbsugar_display = true;
if(is_home() && !get_option(‘smbsugar_display_home’) == ‘checked=on’)
$smbsugar_display = false;
if(is_page() && !get_option(‘smbsugar_display_page’) == ‘checked=on’)
$smbsugar_display = false;
if(is_single() && !get_option(‘smbsugar_display_post’) == ‘checked=on’)
$smbsugar_display = false;
if(is_category() && !get_option(‘smbsugar_display_cat’) == ‘checked=on’)
$smbsugar_display = false;
if(is_archive() && !get_option(‘smbsugar_display_archive’) == ‘checked=on’ && !is_category())
$smbsugar_display = false;

if(get_option(‘smbsugar_button’) == ‘2’) {
$button_url = “evb/button-b.php”;
} else if (get_option(‘smbsugar_button’) == ‘3’) {
$button_url = “evb3/button.php”;
} else if (get_option(‘smbsugar_button’) == ‘4’) {
$button_url = “evb2/check_url2.js.php”;
} else {
$button_url = “evb/button.php”;
}

if($smbsugar_display === true) {
if(! preg_match(‘||’, $content)) {
$smbsugar_align = get_option(“smbsugar_box_align”);
if ($smbsugar_align) {
switch ($smbsugar_align) {
case “Top Left”:
return smbsugar_bizsugarhtml(“left”,$button_url).$content;
break;
case “Top Right”:
return smbsugar_bizsugarhtml(“Right”,$button_url).$content;
break;
case “Bottom Left”:
return $content.smbsugar_bizsugarhtml(“left”,$button_url);
break;
case “Bottom Right”:
return $content.smbsugar_bizsugarhtml(“right”,$button_url);
break;
case “None”:
return $content;
break;
default:
return smbsugar_bizsugarhtml(“left”,$button_url).$content;
break;
}
} else {
return smbsugar_bizsugarhtml(“left”,$button_url).$content;
}

} else {
return str_replace(‘‘, smbsugar_bizsugarhtml(“”,$button_url), $content);
}
} else {
return $content;
}
}
}

if (!function_exists(‘show_bizsugar’)) {
function show_bizsugar($float = “left”) {
global $post;
$permalink = get_permalink($post->ID);
echo <<<CODE


submit_url = “$permalink”;


CODE;
}
}

add_filter(‘the_content’, ‘smbsugar_addbutton’, 999);
add_action(‘admin_menu’, ‘smbsugar_add_menu’);
add_action(‘init’, ‘smbsugar_request_handler’);

?>

Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s