'Twitter Profile', 'user' => 'twitter', 'number' => '4', 'height' => '300', 'width' => '230', 'shellbg' => 'fbfaf2', 'shellcol' => 'b3b3b3', 'tweetbg' => 'fbfaf2', 'tweetcol' => 'b3b3b3', 'tweetlink' => '8a8a8a', 'scrollbar' => 'false', 'live' => 'false', 'hashtags' => 'false', 'timestamp' => 'true', 'avatars' => 'false', 'behavior' => 'all', 'loop' => 'false', 'twitterlogo' => 'true' ); if ($width == 'auto') { $width = "'auto'"; } // Our Widget Title echo $before_widget; echo $before_title; echo $title; echo $after_title; //Our Widget Content echo " "; echo $after_widget; } // Settings form function Twitter_control() { // Get options $options = get_option("widget_Twitter"); // options exist? if not set defaults if ( !is_array( $options ) ) $options = array( 'title' => 'Twitter Profile', 'user' => 'twitter', 'number' => '4', 'height' => '300', 'width' => '230', 'shellbg' => 'fbfaf2', 'shellcol' => 'b3b3b3', 'tweetbg' => 'fbfaf2', 'tweetcol' => 'b3b3b3', 'tweetlink' => '8a8a8a', 'scrollbar' => 'false', 'live' => 'false', 'hashtags' => 'false', 'timestamp' => 'true', 'avatars' => 'false', 'behavior' => 'all', 'loop' => 'false', 'twitterlogo' => 'true' ); // form posted? if ($_POST['Twitter-Submit']) { // Remember to sanitize and format use input appropriately. $options['title'] = strip_tags(stripslashes($_POST['Twitter-Title'])); $options['user'] = strip_tags(stripslashes($_POST['Twitter-User'])); $options['number'] = strip_tags(stripslashes($_POST['Twitter-TwittNumber'])); $options['height'] = strip_tags(stripslashes($_POST['Twitter-Height'])); $options['width'] = strip_tags(stripslashes($_POST['Twitter-Width'])); $options['shellbg'] = strip_tags(stripslashes($_POST['Twitter-Shellbg'])); $options['shellcol'] = strip_tags(stripslashes($_POST['Twitter-Shellcol'])); $options['tweetbg'] = strip_tags(stripslashes($_POST['Twitter-Tweetbg'])); $options['tweetcol'] = strip_tags(stripslashes($_POST['Twitter-Tweetcol'])); $options['tweetlink'] = strip_tags(stripslashes($_POST['Twitter-Tweetlink'])); $options['scrollbar'] = strip_tags(stripslashes($_POST['Twitter-Scrollbar'])); $options['live'] = strip_tags(stripslashes($_POST['Twitter-live'])); $options['hashtags'] = strip_tags(stripslashes($_POST['Twitter-hashtags'])); $options['timestamp'] = strip_tags(stripslashes($_POST['Twitter-timestamp'])); $options['avatars'] = strip_tags(stripslashes($_POST['Twitter-avatars'])); $options['behavior'] = strip_tags(stripslashes($_POST['Twitter-behavior'])); $options['loop'] = strip_tags(stripslashes($_POST['Twitter-Loop'])); $options['twitterlogo'] = strip_tags(stripslashes($_POST['Twitter-Logo'])); // update our options update_option("widget_Twitter", $options); } // Get options for form fields to show $title = htmlspecialchars($options['title'], ENT_QUOTES); $user = htmlspecialchars($options['user'], ENT_QUOTES); $number = htmlspecialchars($options['number'], ENT_QUOTES); $height = htmlspecialchars($options['height'], ENT_QUOTES); $width = htmlspecialchars($options['width'], ENT_QUOTES); $shellbg = htmlspecialchars($options['shellbg'], ENT_QUOTES); $shellcol = htmlspecialchars($options['shellcol'], ENT_QUOTES); $tweetbg = htmlspecialchars($options['tweetbg'], ENT_QUOTES); $tweetcol = htmlspecialchars($options['tweetcol'], ENT_QUOTES); $tweetlink = htmlspecialchars($options['tweetlink'], ENT_QUOTES); $scrollbar = htmlspecialchars($options['scrollbar'], ENT_QUOTES); $live = htmlspecialchars($options['live'], ENT_QUOTES); $hashtags = htmlspecialchars($options['hashtags'], ENT_QUOTES); $timestamp = htmlspecialchars($options['timestamp'], ENT_QUOTES); $avatars = htmlspecialchars($options['avatars'], ENT_QUOTES); $behavior = htmlspecialchars($options['behavior'], ENT_QUOTES); $loop = htmlspecialchars($options['loop'], ENT_QUOTES); $twitterlogo = htmlspecialchars($options['twitterlogo'], ENT_QUOTES); // Widget options ?>








value="true" />   name="Twitter-Logo" value="false" />


px



px




















value="true" />   name="Twitter-Scrollbar" value="false" />


value="true" />   value="false" />


value="true" />   value="false" />


value="true" />   value="false" />


value="true" />   value="false" />





value="true" />   name="Twitter-Loop" value="false" />

'; } // Register a widget function Twitter_init(){ register_sidebar_widget(__('Twitter'), 'widget_Twitter'); register_widget_control( 'Twitter', 'Twitter_control', 250, 200 ); } // Hide twitter logo - variables and action $options = get_option("widget_Twitter"); $twitterlogo = $options['twitterlogo']; if($twitterlogo == 'false'){ add_action('wp_head', 'HideLogo'); } add_action("plugins_loaded", "Twitter_init"); // Load plugin translation global $plugin_dir; load_plugin_textdomain('atpw', null, $plugin_dir . '/languages/'); ?>