bws_plugin_banner_timeout

The Google Sitemap by BestWebSoft bws plugin banner timeout function.

Description

bws_plugin_banner_timeout( $plugin_key, $plugin_prefix, (string) $plugin_name, (bool) $banner_url = false ); 

Parameters (4)

0. $plugin_key
The plugin key.
1. $plugin_prefix
The plugin prefix.
2. $plugin_name (string)
The plugin name.
3. $banner_url — Optional. (bool) => false
The banner url.

Usage

  1. if ( !function_exists( 'bws_plugin_banner_timeout' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'google-sitemap-by-bestwebsoft/bws_menu/bws_functions.php'; 
  3.  
  4. // The plugin key. 
  5. $plugin_key = null; 
  6.  
  7. // The plugin prefix. 
  8. $plugin_prefix = null; 
  9.  
  10. // The plugin name. 
  11. $plugin_name = ''; 
  12.  
  13. // The banner url. 
  14. $banner_url = false; 
  15.  
  16. // NOTICE! Understand what this does before running. 
  17. $result = bws_plugin_banner_timeout($plugin_key, $plugin_prefix, $plugin_name, $banner_url); 
  18.  

Defined (1)

The function is defined in the following location(s).

/bws_menu/bws_functions.php  
  1. function bws_plugin_banner_timeout( $plugin_key, $plugin_prefix, $plugin_name, $banner_url = false ) { 
  2. global $bstwbsftwppdtplgns_options, $bstwbsftwppdtplgns_cookie_add; 
  3. if ( isset( $bstwbsftwppdtplgns_options['time_out'][ $plugin_key ] ) && ( strtotime( $bstwbsftwppdtplgns_options['time_out'][ $plugin_key ] ) < strtotime( date("m/d/Y") . '+1 month' ) ) && ( strtotime( $bstwbsftwppdtplgns_options['time_out'][ $plugin_key ] ) > strtotime( date("m/d/Y") ) ) ) { 
  4. if ( ! isset( $bstwbsftwppdtplgns_cookie_add ) ) { 
  5. echo '<script type="text/javascript" src="' . plugins_url( 'js/c_o_o_k_i_e.js', __FILE__ ) . '"></script>'; 
  6. $bstwbsftwppdtplgns_cookie_add = true; 
  7. } ?> 
  8. <script type="text/javascript"> 
  9. (function($) { 
  10. $(document).ready( function() { 
  11. var hide_message = $.cookie( "<?php echo $plugin_prefix; ?>_timeout_hide_banner_on_plugin_page" ); 
  12. if ( hide_message == "true" ) { 
  13. $( ".<?php echo $plugin_prefix; ?>_message" ).css( "display", "none" ); 
  14. } else { 
  15. $( ".<?php echo $plugin_prefix; ?>_message" ).css( "display", "block" ); 
  16. $( ".<?php echo $plugin_prefix; ?>_close_icon" ).click( function() { 
  17. $( ".<?php echo $plugin_prefix; ?>_message" ).css( "display", "none" ); 
  18. $.cookie( "<?php echo $plugin_prefix; ?>_timeout_hide_banner_on_plugin_page", "true", { expires: 30 } ); 
  19. }); 
  20. }); 
  21. })(jQuery); 
  22. </script> 
  23. <div class="updated" style="padding: 0; margin: 0; border: none; background: none;"> 
  24. <div class="<?php echo $plugin_prefix; ?>_message bws_banner_on_plugin_page bws_banner_timeout" style="display:none;"> 
  25. <button class="<?php echo $plugin_prefix; ?>_close_icon close_icon notice-dismiss bws_hide_settings_notice" title="<?php _e( 'Close notice', 'bestwebsoft' ); ?>"></button> 
  26. <div class="icon"> 
  27. <img title="" src="<?php echo $banner_url; ?>" alt="" /> 
  28. </div> 
  29. <div class="text"><?php _e( "You license for", 'bestwebsoft' ); ?> <strong><?php echo $plugin_name; ?></strong> <?php echo __( "expires on", 'bestwebsoft' ) . ' ' . $bstwbsftwppdtplgns_options['time_out'][ $plugin_key ] . ' ' . __( "and you won't be granted TOP-PRIORITY SUPPORT or UPDATES.", 'bestwebsoft' ); ?> <a target="_new" href="http://support.bestwebsoft.com/entries/53487136"><?php _e( "Learn more", 'bestwebsoft' ); ?></a></div> 
  30. </div>  
  31. </div> 
  32. <?php }