$thankyoumessage

"; else: # Otherwise display the form echo ' '; echo '
'; # If there is an error, show it here $emailValue = "Your email address"; $emailClass = "emailinputmessage"; if($_REQUEST['emailform']=='failure'): $emailValue = "Please correct email"; $emailClass = "emailerrormessage"; # echo 'Please enter a correctly formatted email address
'; endif; # Show get the forename echo '
'; # Show get the surname echo '
'; # Show get the postcode echo '
'; # Now show get the email address echo '
'; # Now get the mobile number (if wanted) echo '

'; # Show the petition number echo ''; # Show the redirect pages echo ''; echo ''; # Now show the final button and close the form echo '
'; endif; /* $url_parts = parse_url(get_bloginfo('home')); 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_ldsupporters_control() { // Get our options and see if we're handling a form submission. $options = get_option('widget_ldsupporters'); if ( !is_array($options) ) $options = array('title'=>'Join the Lib Dem supporters network', 'buttontext'=>'Sign up now!', 'thankyoumessage'=>'Thank you for signing up as a member of the Lib Dem supporters network'); if ( $_POST['ldsupporters-submit'] ) { // Remember to sanitize and format use input appropriately. $options['title'] = strip_tags(stripslashes($_POST['ldsupporters-title'])); $options['buttontext'] = strip_tags(stripslashes($_POST['ldsupporters-buttontext'])); # $options['petition_number'] = strip_tags(stripslashes($_POST['ldsupporters-petition_number'])); $options['thankyoumessage'] = strip_tags(stripslashes($_POST['ldsupporters-thankyoumessage'])); update_option('widget_ldsupporters', $options); } // Be sure you format your options to be valid HTML attributes. $title = htmlspecialchars($options['title'], ENT_QUOTES); $buttontext = htmlspecialchars($options['buttontext'], ENT_QUOTES); # $petition_number = htmlspecialchars($options['petition_number'], ENT_QUOTES); $thankyoumessage = htmlspecialchars($options['thankyoumessage'], 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 '

'; echo '

'; # echo '

'; echo '

'; 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('e-supporters list', 'widget_ldsupporters'); // 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('e-supporters list', 'widget_ldsupporters_control', 300, 200); } // Run our code later in case this loads prior to any required plugins. add_action('plugins_loaded', 'widget_ldsupporters_init'); ?>