/** * Function for setting default options while plgin is activating. */ public static function install() { global $wpdb; require_once dirname(__FILE__) . '/install.php'; if (function_exists('is_multisite') && is_multisite()) { // check if it is a network activation - if so, run the activation function for each blog id $old_blog = $wpdb->blogid; // Get all blog ids $blogids = $wpdb->get_col("SELECT blog_id FROM {$wpdb->blogs}"); foreach ($blogids as $blog_id) { switch_to_blog($blog_id); OSS_Sharing_Install::set_default_options(); } switch_to_blog($old_blog); return; } else { OSS_Sharing_Install::set_default_options(); } }
/** * Render social sharing settings page. */ public static function render_options_page() { global $oss_share_settings; $oss_share_settings = get_option('OpenSocialShare_share_settings'); if (isset($_POST['reset'])) { OSS_Sharing_Install::reset_share_options(); echo '<p style="display:none;" class="oss-alert-box oss-notif">Sharing settings have been reset and default values have been applied to the plug-in</p>'; echo '<script type="text/javascript">jQuery(function(){jQuery(".oss-notif").slideDown().delay(3000).slideUp();});</script>'; } ?> <!-- OSS-wrap --> <div class="wrap oss-wrap cf"> <header> <h2 class="logo"><a href="//www.social9.com?utm_source=WordPress&utm_medium=Refferal&utm_campaign=Plugin" target="_blank">social9</a><em>Simplified Social Share</em></h2> <div class="subscribeMessage"></div> <div class="showPluginHomePopUp"></div> </header> <ul class="oss-options-tab-btns"> <li class="nav-tab oss-active" data-tab="oss_options_tab-1"><?php _e('Horizontal Sharing', 'OpenSocialShare'); ?> </li> <li class="nav-tab" data-tab="oss_options_tab-2"><?php _e('Vertical Sharing', 'OpenSocialShare'); ?> </li> <li class="nav-tab" data-tab="oss_options_tab-3"><?php _e('Advanced Settings', 'OpenSocialShare'); ?> </li> </ul> <div id="oss_options_tabs" class="cf"> <!-- Settings --> <form id="oSSAdvanceSetting" method="post" action="options.php"> <?php settings_fields('opensocialshare_share_settings'); settings_errors(); self::horizontal_settings($oss_share_settings); self::vertical_settings($oss_share_settings); self::advance_settings($oss_share_settings); submit_button('Save changes'); ?> </form> <?php do_action('oss_reset_admin_ui', 'Social Sharing'); ?> </div> <!-- Settings --> <div class="oss-sidebar"> <div class="oss-frame"> <h4><?php _e('Help', 'OpenSocialShare'); ?> </h4> <div> <a target="_blank" href="http://www.social9.com/docs/wordpress-social-share?utm_source=WordPress&utm_medium=Refferal&utm_campaign=Plugin"><?php _e('Plugin Installation, Configuration and Troubleshooting', 'OpenSocialShare'); ?> </a> <a target="_blank" href="http://www.social9.com/features?utm_source=WordPress&utm_medium=Refferal&utm_campaign=Plugin"><?php _e('Social9 Features', 'OpenSocialShare'); ?> </a> </div> </div><!-- oss-frame --> <iframe src="//www.facebook.com/plugins/likebox.php?href=https://www.facebook.com/social9dotcom&width=360&height=200&colorscheme=dark&show_faces=true&header=false&stream=false&show_border=true" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100%; height:161px;" allowtransparency="true"></iframe> </div> </div><!-- End OSS-wrap --> <?php }