function __construct() { /* Variables */ $this->widget_title = __('AC SEC: Popular Posts', 'justwrite'); $this->widget_id = 'popular-posts-big'; /* Settings */ $widget_ops = array('classname' => 'sp-popular', 'description' => 'This widget is used to display popular posts in a podium style ranking.'); /* Control settings */ $control_ops = array('width' => NULL, 'height' => NULL, 'id_base' => 'ac-widget-' . $this->widget_id); /* Create the widget */ parent::__construct('ac-widget-' . $this->widget_id, $this->widget_title, $widget_ops, $control_ops); /* Set some widget defaults */ $this->defaults = array('title' => '', 'show_pos' => true, 'show_date' => true, 'show_cat' => false, 'show_com' => true, 'css_no_mt' => true, 'css_no_mb' => true, 'css_b_top' => false, 'css_b_bot' => false, 'css_p_top' => false); }
function __construct() { /* Variables */ $this->widget_title = __('AC SEC: Archives', 'justwrite'); $this->widget_id = 'extended-archives'; /* Settings */ $widget_ops = array('classname' => 'sa-archives', 'description' => 'This is used to display monthly archives by year.'); /* Control settings */ $control_ops = array('width' => NULL, 'height' => NULL, 'id_base' => 'ac-widget-' . $this->widget_id); /* Create the widget */ parent::__construct('ac-widget-' . $this->widget_id, $this->widget_title, $widget_ops, $control_ops); /* Set some widget defaults */ $this->defaults = array('title' => '', 'css_no_mt' => true, 'css_no_mb' => true, 'css_b_top' => false, 'css_b_bot' => false, 'css_p_top' => false, 'css_p_bot' => false); }
function __construct() { /* Variables */ $this->widget_title = __('AC SEC: Advertising', 'justwrite'); $this->widget_id = 'mainad'; /* Settings */ $widget_ops = array('classname' => 'sa-mainad', 'description' => 'This is used to display an ad, any size, centered'); /* Control settings */ $control_ops = array('width' => NULL, 'height' => NULL, 'id_base' => 'ac-widget-' . $this->widget_id); /* Create the widget */ parent::__construct('ac-widget-' . $this->widget_id, $this->widget_title, $widget_ops, $control_ops); /* Set some widget defaults */ $this->defaults = array('ad_code' => '', 'css_no_mt' => true, 'css_no_mb' => true, 'css_no_bg' => true, 'css_b_top' => false, 'css_b_bot' => false, 'css_p_top' => false, 'css_p_bot' => false); }
function __construct() { /* Variables */ $this->widget_title = __('AC SEC: Social Profiles', 'justwrite'); $this->widget_id = 'social-profiles'; /* Settings */ $widget_ops = array('classname' => 'sp-social', 'description' => 'This is used to display links to your social profiles.'); /* Control settings */ $control_ops = array('width' => NULL, 'height' => NULL, 'id_base' => 'ac-widget-' . $this->widget_id); /* Create the widget */ parent::__construct('ac-widget-' . $this->widget_id, $this->widget_title, $widget_ops, $control_ops); /* Set some widget defaults */ $this->defaults = array('title' => '', 'twitter' => '', 'twitter_anc' => '', 'facebook' => '', 'facebook_anc' => '', 'google-plus' => '', 'google-plus_anc' => '', 'rss' => '', 'rss_anc' => '', 'youtube' => '', 'youtube_anc' => '', 'instagram' => '', 'instagram_anc' => '', 'flickr' => '', 'flickr_anc' => '', 'tumblr' => '', 'tumblr_anc' => '', 'vk' => '', 'vk_anc' => '', 'pinterest' => '', 'pinterest_anc' => '', 'linkedin' => '', 'linkedin_anc' => '', 'dribbble' => '', 'dribbble_anc' => '', 'github' => '', 'github_anc' => '', 'css_no_mt' => true, 'css_no_mb' => true, 'css_b_top' => false, 'css_b_bot' => false, 'css_p_top' => false, 'css_p_bot' => false); /* Profiles */ $this->profiles = array('twitter' => array('label' => __('Twitter URI', 'justwrite'), 'anchor' => 'twitter_anc'), 'facebook' => array('label' => __('Facebook URI', 'justwrite'), 'anchor' => 'facebook_anc'), 'google-plus' => array('label' => __('Google Plus URI', 'justwrite'), 'anchor' => 'google-plus_anc'), 'rss' => array('label' => __('RSS URI', 'justwrite'), 'anchor' => 'rss_anc'), 'youtube' => array('label' => __('Youtube URI', 'justwrite'), 'anchor' => 'youtube_anc'), 'instagram' => array('label' => __('Instagram URI', 'justwrite'), 'anchor' => 'instagram_anc'), 'flickr' => array('label' => __('Flickr URI', 'justwrite'), 'anchor' => 'flickr_anc'), 'tumblr' => array('label' => __('Tumblr URI', 'justwrite'), 'anchor' => 'tumblr_anc'), 'vk' => array('label' => __('VK URI', 'justwrite'), 'anchor' => 'vk_anc'), 'pinterest' => array('label' => __('Pinterest URI', 'justwrite'), 'anchor' => 'pinterest_anc'), 'linkedin' => array('label' => __('LinkedIn URI', 'justwrite'), 'anchor' => 'linkedin_anc'), 'dribbble' => array('label' => __('Dribbble URI', 'justwrite'), 'anchor' => 'dribbble_anc'), 'github' => array('label' => __('GitHub URI', 'justwrite'), 'anchor' => 'github_anc')); }
function form($instance) { // Parse $instance $instance_defaults = $this->defaults; $instance = wp_parse_args($instance, $instance_defaults); extract($instance, EXTR_SKIP); // $instance Defaults $show_date = isset($instance['show_date']) ? (bool) $instance['show_date'] : false; $show_cat = isset($instance['show_cat']) ? (bool) $instance['show_cat'] : false; $show_com = isset($instance['show_com']) ? (bool) $instance['show_com'] : false; $show_auth = isset($instance['show_auth']) ? (bool) $instance['show_auth'] : false; $show_excerpt = isset($instance['show_excerpt']) ? (bool) $instance['show_excerpt'] : false; $css_nmt = isset($instance['css_no_mt']) ? (bool) $instance['css_no_mt'] : false; $css_nmb = isset($instance['css_no_mb']) ? (bool) $instance['css_no_mb'] : false; $css_bot = isset($instance['css_b_top']) ? (bool) $instance['css_b_top'] : false; $css_bob = isset($instance['css_b_bot']) ? (bool) $instance['css_b_bot'] : false; $css_pat = isset($instance['css_p_top']) ? (bool) $instance['css_p_top'] : false; ?> <p> <label for="<?php echo $this->get_field_id('title'); ?> "><?php esc_html_e('Section title:', 'justwrite'); ?> </label> <input class="widefat ac-builder-widget-title" id="<?php echo $this->get_field_id('title'); ?> " name="<?php echo $this->get_field_name('title'); ?> " type="text" value="<?php echo esc_attr($instance['title']); ?> "/> </p> <?php $protitle = esc_html__('Pro Features', 'justwrite'); $getpro = esc_html__('Upgrade Now', 'justwrite'); $asdf = esc_html__('to enable them + many more', 'justwrite'); $lines = array(esc_html__('Some options are disabled:', 'justwrite'), esc_html__('- Show excerpt;', 'justwrite'), esc_html__('- Offset number;', 'justwrite')); parent::ac_promo_info($lines, $protitle, $getpro, $asdf); ?> <p> <label for="<?php echo $this->get_field_id('typeselect'); ?> "><?php _e('Display:', 'justwrite'); ?> </label> <select name="<?php echo $this->get_field_name('typeselect'); ?> " id="<?php echo $this->get_field_id('typeselect'); ?> " class="widefat ac-select-type"> <option value="featured"<?php selected($instance['typeselect'], 'featured'); ?> ><?php _e('Featured posts', 'justwrite'); ?> </option> <option value="posts"<?php selected($instance['typeselect'], 'posts'); ?> ><?php _e('Latest posts', 'justwrite'); ?> </option> <option value="category"<?php selected($instance['typeselect'], 'category'); ?> ><?php _e('Category posts', 'justwrite'); ?> </option> </select> </p> <p class="ac-display-category-field" style="display: none;"> <label for="<?php echo $this->get_field_id('category'); ?> "><?php esc_html_e('Select a category:', 'justwrite'); ?> </label> <?php wp_dropdown_categories(array('orderby' => 'title', 'hide_empty' => true, 'name' => $this->get_field_name('category'), 'id' => $this->get_field_id('category'), 'class' => 'widefat', 'selected' => $instance['category'])); ?> </p> <p> <label for="<?php echo $this->get_field_id('posts_nr'); ?> "><?php esc_html_e('Number of posts (more than 3):', 'justwrite'); ?> </label> <input class="widefat" id="<?php echo $this->get_field_id('posts_nr'); ?> " name="<?php echo $this->get_field_name('posts_nr'); ?> " type="text" value="<?php echo esc_attr($instance['posts_nr']); ?> "/> </p> <p> <label for="<?php echo $this->get_field_id('offset'); ?> "><?php esc_html_e('Offset (number of posts to "displace" or pass over):', 'justwrite'); ?> </label> <input disabled class="widefat" id="<?php echo $this->get_field_id('offset'); ?> " name="<?php echo $this->get_field_name('offset'); ?> " type="text" value="<?php echo esc_attr($instance['offset']); ?> "/> </p> <p> <b><?php _e('Display options:', 'justwrite'); ?> </b><br /> <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('show_date'); ?> " name="<?php echo $this->get_field_name('show_date'); ?> "<?php checked($show_date); ?> /> <label for="<?php echo $this->get_field_id('show_date'); ?> "><?php _e('Show date', 'justwrite'); ?> </label><br /> <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('show_cat'); ?> " name="<?php echo $this->get_field_name('show_cat'); ?> "<?php checked($show_cat); ?> /> <label for="<?php echo $this->get_field_id('show_cat'); ?> "><?php _e('Show category', 'justwrite'); ?> </label><br /> <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('show_auth'); ?> " name="<?php echo $this->get_field_name('show_auth'); ?> "<?php checked($show_auth); ?> /> <label for="<?php echo $this->get_field_id('show_auth'); ?> "><?php _e('Show author', 'justwrite'); ?> </label><br /> <input disabled type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('show_excerpt'); ?> " name="<?php echo $this->get_field_name('show_excerpt'); ?> "<?php checked($show_excerpt); ?> /> <label for="<?php echo $this->get_field_id('show_excerpt'); ?> "><?php _e('Show excerpt', 'justwrite'); ?> </label><br /> <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('show_com'); ?> " name="<?php echo $this->get_field_name('show_com'); ?> "<?php checked($show_com); ?> /> <label for="<?php echo $this->get_field_id('show_com'); ?> "><?php _e('Show # comments', 'justwrite'); ?> </label> </p> <p> <b><?php _e('Styling options:', 'justwrite'); ?> </b><br /> <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('css_no_mt'); ?> " name="<?php echo $this->get_field_name('css_no_mt'); ?> "<?php checked($css_nmt); ?> /> <label for="<?php echo $this->get_field_id('css_no_mt'); ?> "><?php _e('Remove top margin', 'justwrite'); ?> </label><br /> <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('css_no_mb'); ?> " name="<?php echo $this->get_field_name('css_no_mb'); ?> "<?php checked($css_nmb); ?> /> <label for="<?php echo $this->get_field_id('css_no_mb'); ?> "><?php _e('Remove bottom margin', 'justwrite'); ?> </label><br /> <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('css_b_top'); ?> " name="<?php echo $this->get_field_name('css_b_top'); ?> "<?php checked($css_bot); ?> /> <label for="<?php echo $this->get_field_id('css_b_top'); ?> "><?php _e('Add border top', 'justwrite'); ?> </label><br /> <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('css_b_bot'); ?> " name="<?php echo $this->get_field_name('css_b_bot'); ?> "<?php checked($css_bob); ?> /> <label for="<?php echo $this->get_field_id('css_b_bot'); ?> "><?php _e('Add border bottom', 'justwrite'); ?> </label><br /> <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('css_p_top'); ?> " name="<?php echo $this->get_field_name('css_p_top'); ?> "<?php checked($css_pat); ?> /> <label for="<?php echo $this->get_field_id('css_p_top'); ?> "><?php _e('Add padding top', 'justwrite'); ?> </label> </p> <?php }
function form($instance) { // Parse $instance $instance_defaults = $this->defaults; $instance = wp_parse_args($instance, $instance_defaults); extract($instance, EXTR_SKIP); // $instance Defaults $show_more = isset($instance['show_more']) ? (bool) $instance['show_more'] : false; $show_rss = isset($instance['show_rss']) ? (bool) $instance['show_rss'] : false; $show_date = isset($instance['show_date']) ? (bool) $instance['show_date'] : false; $show_coms = isset($instance['show_coms']) ? (bool) $instance['show_coms'] : false; $show_auth = isset($instance['show_auth']) ? (bool) $instance['show_auth'] : false; $css_nmt = isset($instance['css_no_mt']) ? (bool) $instance['css_no_mt'] : false; $css_nmb = isset($instance['css_no_mb']) ? (bool) $instance['css_no_mb'] : false; $css_bot = isset($instance['css_b_top']) ? (bool) $instance['css_b_top'] : false; $css_bob = isset($instance['css_b_bot']) ? (bool) $instance['css_b_bot'] : false; $css_pat = isset($instance['css_p_top']) ? (bool) $instance['css_p_top'] : false; ?> <p> <label for="<?php echo $this->get_field_id('title'); ?> "><?php esc_html_e('Section title:', 'justwrite'); ?> </label> <input class="widefat ac-builder-widget-title" id="<?php echo $this->get_field_id('title'); ?> " name="<?php echo $this->get_field_name('title'); ?> " type="text" value="<?php echo esc_attr($instance['title']); ?> "/> </p> <?php $protitle = esc_html__('Pro Features', 'justwrite'); $getpro = esc_html__('Upgrade Now', 'justwrite'); $asdf = esc_html__('to enable them + many more', 'justwrite'); $lines = array(esc_html__('Some options are disabled:', 'justwrite'), esc_html__('- Offset number;', 'justwrite')); parent::ac_promo_info($lines, $protitle, $getpro, $asdf); ?> <p> <label for="<?php echo $this->get_field_id('category_1'); ?> "><?php esc_html_e('1st column category', 'justwrite'); ?> </label> <?php wp_dropdown_categories(array('orderby' => 'title', 'hide_empty' => true, 'name' => $this->get_field_name('category_1'), 'id' => $this->get_field_id('category_1'), 'class' => 'widefat', 'selected' => $instance['category_1'])); ?> </p> <p> <label for="<?php echo $this->get_field_id('category_2'); ?> "><?php esc_html_e('2nd column category', 'justwrite'); ?> </label> <?php wp_dropdown_categories(array('orderby' => 'title', 'hide_empty' => true, 'name' => $this->get_field_name('category_2'), 'id' => $this->get_field_id('category_2'), 'class' => 'widefat', 'selected' => $instance['category_2'])); ?> </p> <p> <label for="<?php echo $this->get_field_id('category_3'); ?> "><?php esc_html_e('3rd column category', 'justwrite'); ?> </label> <?php wp_dropdown_categories(array('orderby' => 'title', 'hide_empty' => true, 'name' => $this->get_field_name('category_3'), 'id' => $this->get_field_id('category_3'), 'class' => 'widefat', 'selected' => $instance['category_3'])); ?> </p> <p> <label for="<?php echo $this->get_field_id('category_4'); ?> "><?php esc_html_e('4th column category', 'justwrite'); ?> </label> <?php wp_dropdown_categories(array('orderby' => 'title', 'hide_empty' => true, 'name' => $this->get_field_name('category_4'), 'id' => $this->get_field_id('category_4'), 'class' => 'widefat', 'selected' => $instance['category_4'])); ?> </p> <p> <label for="<?php echo $this->get_field_id('posts_nr'); ?> "><?php esc_html_e('Number of posts (3 or more):', 'justwrite'); ?> </label> <input class="widefat" id="<?php echo $this->get_field_id('posts_nr'); ?> " name="<?php echo $this->get_field_name('posts_nr'); ?> " type="text" value="<?php echo esc_attr($instance['posts_nr']); ?> "/> </p> <p> <label for="<?php echo $this->get_field_id('offset'); ?> "><?php esc_html_e('Offset (number of posts to "displace" or pass over):', 'justwrite'); ?> </label> <input disabled class="widefat" id="<?php echo $this->get_field_id('offset'); ?> " name="<?php echo $this->get_field_name('offset'); ?> " type="text" value="<?php echo esc_attr($instance['offset']); ?> "/> </p> <p> <b><?php _e('Display options:', 'justwrite'); ?> </b><br /> <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('show_more'); ?> " name="<?php echo $this->get_field_name('show_more'); ?> "<?php checked($show_more); ?> /> <label for="<?php echo $this->get_field_id('show_more'); ?> "><?php _e('Show "More Articles" button', 'justwrite'); ?> </label><br /> <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('show_rss'); ?> " name="<?php echo $this->get_field_name('show_rss'); ?> "<?php checked($show_rss); ?> /> <label for="<?php echo $this->get_field_id('show_rss'); ?> "><?php _e('Show "RSS" button', 'justwrite'); ?> </label><br /> <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('show_date'); ?> " name="<?php echo $this->get_field_name('show_date'); ?> "<?php checked($show_date); ?> /> <label for="<?php echo $this->get_field_id('show_date'); ?> "><?php _e('Show date', 'justwrite'); ?> </label><br /> <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('show_auth'); ?> " name="<?php echo $this->get_field_name('show_auth'); ?> "<?php checked($show_auth); ?> /> <label for="<?php echo $this->get_field_id('show_auth'); ?> "><?php _e('Show author', 'justwrite'); ?> </label><br /> <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('show_coms'); ?> " name="<?php echo $this->get_field_name('show_coms'); ?> "<?php checked($show_coms); ?> /> <label for="<?php echo $this->get_field_id('show_coms'); ?> "><?php _e('Show comments number', 'justwrite'); ?> </label> </p> <p> <b><?php _e('Styling options:', 'justwrite'); ?> </b><br /> <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('css_no_mt'); ?> " name="<?php echo $this->get_field_name('css_no_mt'); ?> "<?php checked($css_nmt); ?> /> <label for="<?php echo $this->get_field_id('css_no_mt'); ?> "><?php _e('Remove top margin', 'justwrite'); ?> </label><br /> <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('css_no_mb'); ?> " name="<?php echo $this->get_field_name('css_no_mb'); ?> "<?php checked($css_nmb); ?> /> <label for="<?php echo $this->get_field_id('css_no_mb'); ?> "><?php _e('Remove bottom margin', 'justwrite'); ?> </label><br /> <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('css_b_top'); ?> " name="<?php echo $this->get_field_name('css_b_top'); ?> "<?php checked($css_bot); ?> /> <label for="<?php echo $this->get_field_id('css_b_top'); ?> "><?php _e('Add border top', 'justwrite'); ?> </label><br /> <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('css_b_bot'); ?> " name="<?php echo $this->get_field_name('css_b_bot'); ?> "<?php checked($css_bob); ?> /> <label for="<?php echo $this->get_field_id('css_b_bot'); ?> "><?php _e('Add border bottom', 'justwrite'); ?> </label><br /> <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('css_p_top'); ?> " name="<?php echo $this->get_field_name('css_p_top'); ?> "<?php checked($css_pat); ?> /> <label for="<?php echo $this->get_field_id('css_p_top'); ?> "><?php _e('Add padding top', 'justwrite'); ?> </label> </p> <?php }