Esempio n. 1
0
    function cntctfrm_plugin_banner()
    {
        global $hook_suffix;
        if ('plugins.php' == $hook_suffix || isset($_REQUEST['page']) && 'contact_form.php' == $_REQUEST['page']) {
            global $cntctfrm_plugin_info, $wp_version, $bstwbsftwppdtplgns_cookie_add, $bstwbsftwppdtplgns_banner_array;
            if ('plugins.php' == $hook_suffix) {
                bws_plugin_banner($cntctfrm_plugin_info, 'cntctfrm', 'contact-form', 'f575dc39cba54a9de88df346eed52101', '77', '//ps.w.org/contact-form-plugin/assets/icon-128x128.png');
            }
            if (empty($bstwbsftwppdtplgns_banner_array)) {
                bws_get_banner_array();
            }
            if (!function_exists('is_plugin_active')) {
                require_once ABSPATH . 'wp-admin/includes/plugin.php';
            }
            $all_plugins = get_plugins();
            $this_banner_prefix = 'cntctfrm_for_ctfrmtdb';
            $this_banner = 'cntctfrm_for_ctfrmtdb_hide_banner_on_plugin_page';
            foreach ($bstwbsftwppdtplgns_banner_array as $key => $value) {
                if ($this_banner == $value[0]) {
                    if (!isset($bstwbsftwppdtplgns_cookie_add)) {
                        echo '<script type="text/javascript" src="' . plugins_url('/bws_menu/js/c_o_o_k_i_e.js', __FILE__) . '"></script>';
                        $bstwbsftwppdtplgns_cookie_add = true;
                    }
                    ?>
					<script type="text/javascript">
						(function($) {
							$(document).ready( function() {
								var hide_message = $.cookie( '<?php 
                    echo $this_banner_prefix;
                    ?>
_hide_banner_on_plugin_page' );
								if ( hide_message == "true" ) {
									$( ".<?php 
                    echo $this_banner_prefix;
                    ?>
_message" ).css( "display", "none" );
								} else {
									$( ".<?php 
                    echo $this_banner_prefix;
                    ?>
_message" ).css( "display", "block" );
								};
								$( ".<?php 
                    echo $this_banner_prefix;
                    ?>
_close_icon" ).click( function() {
									$( ".<?php 
                    echo $this_banner_prefix;
                    ?>
_message" ).css( "display", "none" );
									$.cookie( "<?php 
                    echo $this_banner_prefix;
                    ?>
_hide_banner_on_plugin_page", "true", { expires: 32 } );
								});
							});
						})(jQuery);
					</script>
					<?php 
                    if (!array_key_exists('contact-form-to-db/contact_form_to_db.php', $all_plugins) && !array_key_exists('contact-form-to-db-pro/contact_form_to_db_pro.php', $all_plugins)) {
                        ?>
						<div class="updated" style="padding: 0; margin: 0; border: none; background: none;">
							<div class="cntctfrm_for_ctfrmtdb_message bws_banner_on_plugin_page" style="display: none;">
								<img class="<?php 
                        echo $this_banner_prefix;
                        ?>
_close_icon close_icon" title="" src="<?php 
                        echo plugins_url('bws_menu/images/close_banner.png', __FILE__);
                        ?>
" alt=""/>
								<div class="icon">
									<img title="" src="//ps.w.org/contact-form-to-db/assets/icon-128x128.png" alt="" />
								</div>
								<div class="text">
									<strong>Contact Form to DB</strong> <?php 
                        _e("allows to store your messages to the database.", 'contact_form');
                        ?>
<br />
									<span><?php 
                        _e("Manage messages that have been sent from your website.", 'contact_form');
                        ?>
</span>
								</div>
								<div class="button_div">
									<a class="button" target="_blank" href="http://bestwebsoft.com/products/contact-form-to-db/?k=6ebf0743736411607343ad391dc3b436&pn=77&v=<?php 
                        echo $cntctfrm_plugin_info["Version"];
                        ?>
&amp;wp_v=<?php 
                        echo $wp_version;
                        ?>
"><?php 
                        _e('Learn More', 'contact_form');
                        ?>
</a>
								</div>
							</div>
						</div>
					<?php 
                    }
                    break;
                }
                if (isset($all_plugins[$value[1]]) && $all_plugins[$value[1]]["Version"] >= $value[2] && is_plugin_active($value[1]) && !isset($_COOKIE[$value[0]])) {
                    break;
                }
            }
        }
    }
Esempio n. 2
0
    function bws_plugin_banner($plugin_info, $this_banner_prefix, $link_slug, $link_key, $link_pn, $banner_url_or_slug)
    {
        global $wp_version, $bstwbsftwppdtplgns_cookie_add, $bstwbsftwppdtplgns_banner_array;
        if (empty($bstwbsftwppdtplgns_banner_array)) {
            if (!function_exists('bws_get_banner_array')) {
                require_once dirname(__FILE__) . '/bws_menu.php';
            }
            bws_get_banner_array();
        }
        if (false == strrpos($banner_url_or_slug, '/')) {
            $banner_url_or_slug = '//ps.w.org/' . $banner_url_or_slug . '/assets/icon-128x128.png';
        }
        if (!function_exists('is_plugin_active')) {
            require_once ABSPATH . 'wp-admin/includes/plugin.php';
        }
        $all_plugins = get_plugins();
        $this_banner = $this_banner_prefix . '_hide_banner_on_plugin_page';
        foreach ($bstwbsftwppdtplgns_banner_array as $key => $value) {
            if ($this_banner == $value[0]) {
                if (!isset($bstwbsftwppdtplgns_cookie_add)) {
                    echo '<script type="text/javascript" src="' . plugins_url('js/c_o_o_k_i_e.js', __FILE__) . '"></script>';
                    $bstwbsftwppdtplgns_cookie_add = true;
                }
                ?>
				<script type="text/javascript">
					(function($) {
						$(document).ready( function() {
							var hide_message = $.cookie( '<?php 
                echo $this_banner_prefix;
                ?>
_hide_banner_on_plugin_page' );
							if ( hide_message == "true" ) {
								$( ".<?php 
                echo $this_banner_prefix;
                ?>
_message" ).css( "display", "none" );
							} else {
								$( ".<?php 
                echo $this_banner_prefix;
                ?>
_message" ).css( "display", "block" );
							};
							$( ".<?php 
                echo $this_banner_prefix;
                ?>
_close_icon" ).click( function() {
								$( ".<?php 
                echo $this_banner_prefix;
                ?>
_message" ).css( "display", "none" );
								$.cookie( "<?php 
                echo $this_banner_prefix;
                ?>
_hide_banner_on_plugin_page", "true", { expires: 32 } );
							});
						});
					})(jQuery);
				</script>
				<div class="updated" style="padding: 0; margin: 0; border: none; background: none;">
					<div class="<?php 
                echo $this_banner_prefix;
                ?>
_message bws_banner_on_plugin_page" style="display: none;">
						<img class="<?php 
                echo $this_banner_prefix;
                ?>
_close_icon close_icon" title="" src="<?php 
                echo plugins_url('images/close_banner.png', __FILE__);
                ?>
" alt=""/>
						<div class="icon">
							<img title="" src="<?php 
                echo esc_attr($banner_url_or_slug);
                ?>
" alt="" />
						</div>						
						<div class="text"><?php 
                _e('It’s time to upgrade your', 'bestwebsoft');
                ?>
 <strong><?php 
                echo $plugin_info['Name'];
                ?>
 plugin</strong> <?php 
                _e('to', 'bestwebsoft');
                ?>
 <strong>PRO</strong> <?php 
                _e('version!', 'bestwebsoft');
                ?>
<br />
							<span><?php 
                _e('Extend standard plugin functionality with new great options.', 'bestwebsoft');
                ?>
</span>
						</div>
						<div class="button_div">
							<a class="button" target="_blank" href="http://bestwebsoft.com/products/<?php 
                echo $link_slug;
                ?>
/?k=<?php 
                echo $link_key;
                ?>
&amp;pn=<?php 
                echo $link_pn;
                ?>
&amp;v=<?php 
                echo $plugin_info["Version"];
                ?>
&amp;wp_v=<?php 
                echo $wp_version;
                ?>
"><?php 
                _e('Learn More', 'bestwebsoft');
                ?>
</a>
						</div>
					</div>
				</div>
				<?php 
                break;
            }
            if (isset($all_plugins[$value[1]]) && $all_plugins[$value[1]]["Version"] >= $value[2] && is_plugin_active($value[1]) && !isset($_COOKIE[$value[0]])) {
                break;
            }
        }
    }