if ($_POST['action'] == 'Recentactivity_Widget') { $postcount = $_POST['postcount']; $preview = $_POST['preview']; $forum = $_POST['forum']; __wps__do_Recentactivity_Widget($postcount,$preview,$forum); } // Recentactivity_Widget if ($_POST['action'] == 'Alerts_Widget') { $postcount = $_POST['postcount']; __wps__do_Alerts_Widget($postcount); } // Login if ($_POST['action'] == 'doLogin') { global $wpdb, $current_user, $wp_error; if ($_POST['username'] != '') { $creds = array(); $creds['user_login'] = $_POST['username']; $creds['user_password'] = $_POST['password']; $creds['remember'] = true;
function widget( $args, $instance ) { global $wpdb, $current_user; wp_get_current_user(); if (is_user_logged_in()) { extract( $args ); // Get options $wtitle = apply_filters('widget_title', $instance['wtitle'] ); $postcount = apply_filters('widget_postcount', $instance['postcount'] ); // Start widget echo $before_widget; echo $before_title . $wtitle . $after_title; if (get_option(WPS_OPTIONS_PREFIX.'_ajax_widgets') == 'on') { // Parameters for AJAX echo '<div id="__wps__Alerts_Widget">'; echo __('Loading...', WPS_TEXT_DOMAIN); echo '<div id="__wps__Alerts_Widget_postcount" style="display:none">'.$postcount.'</div>'; echo '</div>'; } else { __wps__do_Alerts_Widget($postcount); } // End content echo $after_widget; // End widget } }