' . $msg_status . '
');
}
$widget_title = get_option('ad_rows_125_title');
$ad1_url = get_option('ad_rows_125_ad1_url');
$ad1_img = get_option('ad_rows_125_ad1_img');
$ad2_url = get_option('ad_rows_125_ad2_url');
$ad2_img = get_option('ad_rows_125_ad2_img');
$ad3_url = get_option('ad_rows_125_ad3_url');
$ad3_img = get_option('ad_rows_125_ad3_img');
$ad4_url = get_option('ad_rows_125_ad4_url');
$ad4_img = get_option('ad_rows_125_ad4_img');
$ad5_url = get_option('ad_rows_125_ad5_url');
$ad5_img = get_option('ad_rows_125_ad5_img');
$ad6_url = get_option('ad_rows_125_ad6_url');
$ad6_img = get_option('ad_rows_125_ad6_img');
echo <<
Ad Rows 125
END;
}
//Widget
class ad_rows_125 extends WP_Widget {
function ad_rows_125() {
$widget_options = array( 'classname' => 'widget_ad_rows_125', 'description' => __( 'Display your ads.', 'ad-rows-125' ) );
$this->WP_Widget( 'ad-rows-125', __( 'Ad Rows 125', 'ad-rows-125' ), $widget_options );
wp_enqueue_style('ad-rows-125', plugins_url('/css/add-rows-125.css',__FILE__) );
}
function widget($args, $instance) {
extract($args, EXTR_SKIP);
$title = get_option('ad_rows_125_title');
$ads = array();
if(get_option('ad_rows_125_ad1_url')) {
$ads[] = array (
'img' => get_option('ad_rows_125_ad1_img'),
'link' => get_option('ad_rows_125_ad1_url')
);
}
if(get_option('ad_rows_125_ad2_url')) {
$ads[] = array (
'img' => get_option('ad_rows_125_ad2_img'),
'link' => get_option('ad_rows_125_ad2_url')
);
}
if(get_option('ad_rows_125_ad3_url')) {
$ads[] = array (
'img' => get_option('ad_rows_125_ad3_img'),
'link' => get_option('ad_rows_125_ad3_url')
);
}
if(get_option('ad_rows_125_ad4_url')) {
$ads[] = array (
'img' => get_option('ad_rows_125_ad4_img'),
'link' => get_option('ad_rows_125_ad4_url')
);
}
if(get_option('ad_rows_125_ad5_url')) {
$ads[] = array (
'img' => get_option('ad_rows_125_ad5_img'),
'link' => get_option('ad_rows_125_ad5_url')
);
}
if(get_option('ad_rows_125_ad6_url')) {
$ads[] = array (
'img' => get_option('ad_rows_125_ad6_img'),
'link' => get_option('ad_rows_125_ad6_url')
);
}
$i = 1;
$ad_num = count($ads);
echo $before_widget;
if($title) {
echo $before_title . $title . $after_title;
}
echo '';
echo $after_widget;
}
function form($instance) {
$defaults = '';
?>
Setup this widget in Settings > Ad Rows 125