'dd_most_popular', 'description' => __('Display unordered list of most popular posts on your site according to the number of comments.', 'dd_most_popular') );
/* Widget control settings. */
$control_ops = array( 'width' => 300, 'height' => 350, 'id_base' => 'dd_most_popular' );
/* Create the widget. */
$this->WP_Widget( 'dd_most_popular', __('DD Most Popular Posts', 'dd_most_popular'), $widget_ops, $control_ops );
}
//Displaying widget
function widget( $args, $instance ) {
global $post;
extract( $args );
// Variables from the widget settings.
$title = apply_filters('widget_title', $instance['title'] );
$count = ctype_digit($instance['count'] )? $instance['count'] : 5;
// Before widget (defined by themes).
echo $before_widget;
// Display the widget title if one was input (before and after defined by themes).
if ( $title )
echo $before_title . $title . $after_title . '
' . $after_widget;
}
//Update the widget settings.
function update( $new_instance, $old_instance ) {
$instance = $old_instance;
/* Strip tags for title and count (important for text inputs). */
$instance['title'] = strip_tags( $new_instance['title'] );
$instance['count'] = strip_tags( $new_instance['count'] );
return $instance;
}
// Displays the widget settings controls on the widget panel.
// Make use of the get_field_id() and get_field_name() function
function form( $instance ) {
// Set up some default widget settings.
$defaults = array(
'title' => __('Most Popular', 'dd_most_popular'),
'count' => __('10', 'dd_most_popular'),
);
$instance = wp_parse_args( (array) $instance, $defaults ); ?>
'dd_social_networks', 'description' => __('Display icons for your social network sites that linkback to your social networking profiles.', 'dd_social_networks') );
/* Widget control settings. */
$control_ops = array( 'width' => 300, 'height' => 350, 'id_base' => 'dd_social_networks' );
/* Create the widget. */
$this->WP_Widget( 'dd_social_networks', __('DD Social Networks', 'dd_social_networks'), $widget_ops, $control_ops );
}
//Displaying widget
function widget( $args, $instance ) {
extract( $args );
// Variables from the widget settings.
$title = apply_filters('widget_title', $instance['title'] );
// Before widget (defined by themes).
echo $before_widget;
// Display the widget title if one was input (before and after defined by themes).
if ( $title )
echo $before_title . $title . $after_title ;
// Display
echo "
";
$i=0; foreach ($instance as $set => $key) {
if ($set != 'title' && $key != '') {
switch ($set) {
case "twitter": $small = "Follow me!"; $name="Twitter"; break;
case "facebook": $small = "find me"; $name="Facebook"; break;
case "flickr" : $small = "My Photos"; $name="Flickr"; break;
case "digg": $small = "my diggs"; $name="Digg"; break;
case "wordpress": $small = "WordPress"; $name="WordPress"; break;
case "linkedin": $small = "Linked In"; $name="LinkedIn"; break;
case "deviantart": $small = "Deviant Art"; $name="DeviantArt"; break;
case "you_tube": $small = "You Tube"; $name="You Tube"; break;
}
echo '';
}
}
echo "
";
/* After widget (defined by themes). */
echo $after_widget;
}
//Update the widget settings.
function update( $new_instance, $old_instance ) {
$instance = $old_instance;
/* Strip tags (important for text inputs). */
$instance['title'] = strip_tags( $new_instance['title'] );
$instance['twitter'] = strip_tags($new_instance['twitter'] );
$instance['facebook'] = strip_tags($new_instance['facebook'] );
$instance['flickr'] = strip_tags($new_instance['flickr'] );
$instance['digg'] = strip_tags($new_instance['digg'] );
$instance['wordpress'] = strip_tags($new_instance['wordpress'] );
$instance['linkedin'] = strip_tags($new_instance['linkedin'] );
$instance['deviantart'] = strip_tags($new_instance['deviantart'] );
$instance['you_tube'] = strip_tags($new_instance['you_tube'] );
return $instance;
}
// Displays the widget settings controls on the widget panel.
// Make use of the get_field_id() and get_field_name() function
function form( $instance ) {
// Set up some default widget settings.
$defaults = array(
'title' => __('Social Networks!', 'dd_social_networks'),
);
$instance = wp_parse_args( (array) $instance, $defaults ); ?>
'dd_recent_comments', 'description' => __('Displays recent comments on your site.', 'dd_recent_comments') );
/* Widget control settings. */
$control_ops = array( 'width' => 300, 'height' => 350, 'id_base' => 'dd_recent_comments' );
/* Create the widget. */
$this->WP_Widget( 'dd_recent_comments', __('DD Recent Comments', 'dd_recent_comments'), $widget_ops, $control_ops );
}
//Displaying widget
function widget( $args, $instance ) {
extract( $args );
// Variables from the widget settings.
$title = apply_filters('widget_title', $instance['title'] );
$count = ctype_digit($instance['count'] )? $instance['count'] : 5;
// Before widget (defined by themes).
echo $before_widget;
// Display the widget title if one was input (before and after defined by themes).
if ( $title )
echo $before_title . $title . $after_title . '
' . $after_widget;
}
//Update the widget settings.
function update( $new_instance, $old_instance ) {
$instance = $old_instance;
/* Strip tags for title and count (important for text inputs). */
$instance['title'] = strip_tags( $new_instance['title'] );
$instance['count'] = strip_tags( $new_instance['count'] );
return $instance;
}
// Displays the widget settings controls on the widget panel.
// Make use of the get_field_id() and get_field_name() function
function form( $instance ) {
// Set up some default widget settings.
$defaults = array(
'title' => __('Recent Comments', 'recent_comments'),
'count' => __('10', 'recent_comments'),
);
$instance = wp_parse_args( (array) $instance, $defaults ); ?>
'subscription', 'description' => __('A widget to display Feedburner E-mail and RSS subscription options.', 'subscription') );
/* Widget control settings. */
$control_ops = array( 'width' => 300, 'height' => 350, 'id_base' => 'subscription-widget' );
/* Create the widget. */
$this->WP_Widget( 'subscription-widget', __('DD Subscription', 'dd_subscription'), $widget_ops, $control_ops );
}
//Displaying widget
function widget( $args, $instance ) {
extract( $args );
// Variables from the widget settings.
$title = apply_filters('widget_title', $instance['title'] );
$emaildesc = $instance['emaildesc'];
$fb_user = $instance['fb_user'];
$feeddesc = $instance['feeddesc'];
$entry_title = apply_filters('widget_entry_title', $instance['entry_title'] );
$comments_title = apply_filters('widget_comments_title', $instance['comments_title']);
// Before widget (defined by themes).
echo $before_widget;
// Display the widget title if one was input (before and after defined by themes).
if ( $title )
echo $before_title . $title . $after_title;
// Display
if ( $emaildesc )
echo '' . $emaildesc. '';
// Display
if ( $fb_user )?>