'BJ_Flickr_Widget', 'description' => __('A widget for your Flickr photos.', 'basejump') ); /* Widget control settings ------------------------------------------------------ */ $control_ops = array( 'width' => 300, 'height' => 350, 'id_base' => 'cj-fickr-widget' ); /* Create the widget ------------------------------------------------------------ */ $this->WP_Widget('BJ_Flickr_Widget', __('Custom Flickr Photos', 'basejump'), $widget_ops, $control_ops); } /* ----------------------------------------------------------------------------------- */ /* Display Widget /*----------------------------------------------------------------------------------- */ function widget($args, $instance) { extract($args); /* Our variables from the widget settings --------------------------------------- */ $title = apply_filters('widget_title', $instance['title']); $flickrID = $instance['flickrID']; $postcount = $instance['postcount']; $type = $instance['type']; $display = $instance['display']; /* Build our output ------------------------------------------------------------- */ echo $before_widget; if ($title) { echo $before_title . $title . $after_title; } if(class_exists('bj_template')) BJ::flickr_badge($flickrID, $postcount, $display, $type); echo $after_widget; } /* ----------------------------------------------------------------------------------- */ /* Update Widget /*----------------------------------------------------------------------------------- */ function update($new_instance, $old_instance) { $instance = $old_instance; /* Strip tags to remove HTML (important for text inputs) ------------------------ */ $instance['title'] = strip_tags($new_instance['title']); $instance['flickrID'] = strip_tags($new_instance['flickrID']); /* No need to strip tags -------------------------------------------------------- */ $instance['postcount'] = $new_instance['postcount']; $instance['type'] = $new_instance['type']; $instance['display'] = $new_instance['display']; return $instance; } /* ----------------------------------------------------------------------------------- */ /* Widget Settings (Displays the widget settings controls on the widget panel) /*----------------------------------------------------------------------------------- */ function form($instance) { /* Set up some default widget settings ------------------------------------------ */ $defaults = array( 'title' => 'My Photostream', 'flickrID' => '10133335@N08', 'postcount' => '9', 'type' => 'user', 'display' => 'latest', ); $instance = wp_parse_args((array) $instance, $defaults); /* Build our form fields ------------------------------------------------------- */ ?>