• Watch videos at Vodpod and other videos from this collection.
  • Flickr Photos

    engine_shed_01

    The Secret Life of Trees III

    The Nutcracker Ballet

    More Photos
  •  

    July 2006
    M T W T F S S
        Nov »
     12
    3456789
    10111213141516
    17181920212223
    24252627282930
    31  
  • <?php /* Plugin Name: Lib Dem Buttons Description: Adds a sidebar widget to let sites include a Lib Dem campaign buttons. Author: Martin Tod Version: 1.2 Author URI: http://www.martintod.org.uk/blog/ */ /* Version 1.0 (June 25, 2006) Original public version Version 1.1 (July 16, 2006) Fall back to Javascript if readfile fails Version 1.2 (January 3, 2007) Add option to switch off "Get this" link (by Liberal Democrats) */ // Put functions into one big function we'll call at the plugins_loaded // action. This ensures that all required plugin functions are defined. function widget_ldbuttons_init() { // Check for the required plugin functions. This will prevent fatal // errors occurring when you deactivate the dynamic-sidebar plugin. if ( !function_exists('register_sidebar_widget') ) return; // This is the function that outputs our little Google search form. function widget_ldbuttons($args) { // $args is an array of strings that help widgets to conform to // the active theme: before_widget, before_title, after_widget, // and after_title are the array keys. Default tags: li and h2. extract($args); // Each widget can store its own options. We keep strings here. $options = get_option('widget_ldbuttons'); $title = $options['title']; $buttonnumber = $options['buttonnumber']; settype($buttonnumber,"integer"); $text = $options['text']; // Set link $buttonlink = "http://petitions.libdems.org.uk/showButtons.php?format=html"; if(!empty($buttonnumber)) { $buttonlink .="&buttons=$buttonnumber"; } if($text == 'off') { $buttonlink .="&text=off"; } // These lines generate our output. Widgets can be very complex // but as you can see here, they can also be very, very simple. echo $before_widget . $before_title . $title . $after_title; # Here is the code that displays the input box or thank you message $result = @readfile($buttonlink); # If there's an error, then show the javascript version if(empty($result)) { $buttonlink = "http://petitions.libdems.org.uk/showButtons.php"; if(!empty($buttonnumber)) { $buttonlink .="?buttons=$buttonnumber"; } if ($text == 'off') { if (!empty($buttonnumber)) { $buttonlink .="&text=off"; } else { $buttonlink .="?text=off"; } } echo ''; } echo $after_widget; } // This is the function that outputs the form to let the users edit // the widget's title. It's an optional feature that users cry for. function widget_ldbuttons_control() { // Get our options and see if we're handling a form submission. $options = get_option('widget_ldbuttons'); if ( !is_array($options) ) $options = array('title'=>'Lib Dem campaigns', 'buttonnumber'=>'0', 'text'=>'on'); if ( $_POST['ldbuttons-submit'] ) { // Remember to sanitize and format use input appropriately. $options['title'] = strip_tags(stripslashes($_POST['ldbuttons-title'])); $options['buttonnumber'] = strip_tags(stripslashes($_POST['ldbuttons-buttonnumber'])); $options['text'] = strip_tags(stripslashes($_POST['ldbuttons-text'])); update_option('widget_ldbuttons', $options); } // Be sure you format your options to be valid HTML attributes. $title = htmlspecialchars($options['title'], ENT_QUOTES); $buttonnumber = htmlspecialchars($options['buttonnumber'], ENT_QUOTES); $text = htmlspecialchars($options['text'], ENT_QUOTES); // Here is our little form segment. Notice that we don't need a // complete form. This will be embedded into the existing form. echo '

    Title:

    '; echo '

    Number of buttons:'; for ($i=0;$i<11;$i++) { if($i==$buttonnumber){$selectString = ' selected';} else {$selectString ='';} if(empty($i)) {$istring="Default";} else {$istring=$i;} echo ' ".$istring."\n"; } echo '

    '; echo '

    "Get this for your blog" text:
    On
    Off '; echo ''; } // This registers our widget so it appears with the other available // widgets and can be dragged and dropped into any active sidebars. register_sidebar_widget('Lib Dem buttons', 'widget_ldbuttons'); // This registers our optional widget control form. Because of this // our widget will have a button that reveals a 300x100 pixel form. register_widget_control('Lib Dem buttons', 'widget_ldbuttons_control', 300, 200); } // Run our code later in case this loads prior to any required plugins. add_action('plugins_loaded', 'widget_ldbuttons_init'); ?>

  • Meta

  • Top Clicks

    • None

Survival,against the odds!

Having been diagnosed in 1994 makes the above imagery ever more pertinent.  The Hepatitis C Virus (HCV) is a Blood Bourne Virus that silently pervades the liver of each person it ensnares. Unlike Hep A or B there is  currently no vaccine.