=')) {
return;
}
}
deactivate_plugins(basename(__FILE__)); // Deactivate ourself
wp_die("The base SFC plugin must be activated before this plugin will run.");
}
register_activation_hook(__FILE__, 'sfc_live_stream_activation_check');
function get_sfc_livestream($args='') {
$args = wp_parse_args($args, array(
'width' => '200',
'height' => '400',
));
extract($args);
return '';
}
function sfc_livestream($args='') {
echo get_sfc_livestream($args);
}
function sfc_live_stream_shortcode($atts) {
$args = shortcode_atts(array(
'width' => '200',
'height' => '400',
), $atts);
return get_sfc_livestream($args);
}
add_shortcode('fb-livestream', 'sfc_live_stream_shortcode');
class SFC_Live_Stream_Widget extends WP_Widget {
function SFC_Live_Stream_Widget() {
$widget_ops = array('classname' => 'widget_sfc-livestream', 'description' => 'Facebook Live Stream');
$this->WP_Widget('sfc-livestream', 'Facebook Live Stream (SFC)', $widget_ops);
}
function widget($args, $instance) {
$options = get_option('sfc_options');
extract( $args );
$title = apply_filters('widget_title', $instance['title']);
$width = intval($instance['width']);
$height = intval($instance['height']);
?>
'', 'width'=>200, 'height'=>400 ) );
$instance['title'] = strip_tags($new_instance['title']);
$instance['width'] = intval($new_instance['width']);
if ($instance['width'] < 200) $instance['width'] = 200;
$instance['height'] = intval($new_instance['height']);
if ($instance['height'] < 400) $instance['height'] = 400;
return $instance;
}
function form($instance) {
$instance = wp_parse_args( (array) $instance, array( 'title' => '', 'width'=>200, 'height'=>400 ) );
$title = strip_tags($instance['title']);
$connections = intval($instance['connections']);
$width = intval($instance['width']);
$height = intval($instance['height']);
$stream = $instance['stream'] ? true : false;
?>