here. * Author: MaxBlogPress * Author URI: http://www.maxblogpress.com * * License: GNU General Public License * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * Copyright (C) 2007 www.maxblogpress.com * * This is the improved version of "Breukie's Archives Widget" plugin by Arnold Breukhoven * */ $mbpamw_path = preg_replace('/^.*wp-content[\\\\\/]plugins[\\\\\/]/', '', __FILE__); $mbpamw_path = str_replace('\\','/',$mbpamw_path); $mbpamw_dir = substr($mban_path,0,strrpos($mbpamw_path,'/')); $mbpamw_siteurl = get_bloginfo('wpurl'); $mbpamw_siteurl = (strpos($mbpamw_siteurl,'http://') === false) ? get_bloginfo('siteurl') : $mbpamw_siteurl; $mbpamw_fullpath = $mbpamw_siteurl.'/wp-content/plugins/'.$mbpamw_dir.''; $mbpamw_fullpath = $mbpamw_fullpath.'archive-manage-widget/'; $mbpamw_abspath = str_replace("\\","/",ABSPATH); define('MBP_AMW_ABSPATH', $mbpamw_path); define('MBP_AMW_LIBPATH', $mbpamw_fullpath); define('MBP_AMW_SITEURL', $mbpamw_siteurl); define('MBP_AMW_NAME', 'Archive Manage Widget'); define('MBP_AMW_VERSION', '1.0'); define('MBP_AMW_LIBPATH', $mbpamw_fullpath); global $wp_version; if ($wp_version > '2.3') { function mbp_amw_options() { add_options_page('Archive Manage Widget', 'Archive Manage Widget', 10, __FILE__, 'mbp_amw_activate'); } function mbp_amw_activate() { $mbp_amw_activate = get_option('mbp_amw_activate'); $reg_msg = ''; $mbp_amw_msg = ''; $form_1 = 'mbp_amw_reg_form_1'; $form_2 = 'mbp_amw_reg_form_2'; // Activate the plugin if email already on list if ( trim($_GET['mbp_onlist']) == 1 ) { $mbp_amw_activate = 2; update_option('mbp_amw_activate', $mbp_amw_activate); $reg_msg = 'Thank you for registering the plugin. It has been activated'; } // If registration form is successfully submitted if ( ((trim($_GET['submit']) != '' && trim($_GET['from']) != '') || trim($_GET['submit_again']) != '') && $mbp_amw_activate != 2 ) { update_option('mbp_amw_name', $_GET['name']); update_option('mbp_amw_email', $_GET['from']); $mbp_amw_activate = 1; update_option('mbp_amw_activate', $mbp_amw_activate); } if ( intval($mbp_amw_activate) == 0 ) { // First step of plugin registration global $userdata; mbp_amwRegisterStep1($form_1,$userdata); } else if ( intval($mbp_amw_activate) == 1 ) { // Second step of plugin registration $name = get_option('mbp_amw_name'); $email = get_option('mbp_amw_email'); mbp_amwRegisterStep2($form_2,$name,$email); } else if ( intval($mbp_amw_activate) == 2 ) { // Options page if ( trim($reg_msg) != '' ) { echo '

'.$reg_msg.'

'; } } if($mbp_amw_activate != '' && !$_GET['submit']) { ?>

How to use it    Community

You have already registered. Please go to the Widgets section to enable and configure the widget.

$widget_args ); $widget_args = wp_parse_args( $widget_args, array( 'number' => -1 ) ); extract( $widget_args, EXTR_SKIP ); $options = get_option('widget_amw'); if ( !isset($options[$number]) ) return; //check if registered or not $mbp_amw_activate = get_option('mbp_amw_activate'); if ($mbp_amw_activate == '') { echo "Please register in the admin panel to activate the `Archive Manage Widget` widget"; } else { ?>
" . $title . "
"; echo '