PluginProbe
Loading Page with Loading Screen / 1.0.86
Loading Page with Loading Screen v1.0.86
1.2.8 1.0.92 1.0.93 1.0.94 1.0.95 1.0.96 1.1.0 1.1.1 1.1.10 1.1.11 1.1.12 1.1.13 1.1.14 1.1.15 1.1.16 1.1.17 1.1.18 1.1.19 1.1.2 1.1.20 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 All 46 releases
loading-page / banner.php

banner.php in Loading Page with Loading Screen 1.0.86, at banner.php

108 lines 6.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 global $codepeople_promote_banner_plugins;
3 if(empty($codepeople_promote_banner_plugins)) $codepeople_promote_banner_plugins = array();
4 if(!function_exists( 'codepeople_add_promote_banner' ))
5 {
6 function codepeople_add_promote_banner($wp_admin_bar)
7 {
8 global $codepeople_promote_banner_plugins;
9
10 if(
11 empty($codepeople_promote_banner_plugins) ||
12 !is_admin() ||
13 !current_user_can( 'manage_options' )
14 ) return;
15
16 $screen = get_current_screen();
17 if ( $screen->post_type == 'post' || $screen->post_type == 'page' ) return;
18
19 // Take action over the banner
20 if(isset($_POST['codepeople_promote_banner_nonce']) && wp_verify_nonce($_POST['codepeople_promote_banner_nonce'], __FILE__))
21 {
22 if(
23 !empty($_POST['codepeople_promote_banner_plugin']) &&
24 !empty($codepeople_promote_banner_plugins[$_POST['codepeople_promote_banner_plugin']])
25 )
26 {
27 set_transient( 'codepeople_promote_banner_'.sanitize_text_field($_POST['codepeople_promote_banner_plugin']), -1, 0);
28 if(
29 !empty($_POST['codepeople_promote_banner_action']) &&
30 $_POST['codepeople_promote_banner_action'] == 'set-review' &&
31 !empty($codepeople_promote_banner_plugins[$_POST['codepeople_promote_banner_plugin']]['plugin_url'])
32 )
33 {
34 print '<script>document.location.href="'.str_replace('&amp;','&',esc_js($codepeople_promote_banner_plugins[$_POST['codepeople_promote_banner_plugin']]['plugin_url'])).'";</script>';
35 }
36 }
37 }
38
39 $minimum_days = 86400*7;
40 $now = time();
41
42 foreach($codepeople_promote_banner_plugins as $plugin_slug => $plugin_data )
43 {
44 $value = get_transient( 'codepeople_promote_banner_'.$plugin_slug );
45 if( $value === false )
46 {
47 $value = $now;
48 set_transient( 'codepeople_promote_banner_'.$plugin_slug, $value, 0 );
49 }
50
51 if($minimum_days <= abs($now-$value) && 0<$value*1)
52 {
53 ?>
54 <style>
55 #codepeople-review-banner{width:calc( 100% - 20px );width:-webkit-calc( 100% - 20px );width:-moz-calc( 100% - 20px );width:-o-calc( 100% - 20px );border:10px solid #1582AB;background:#FFF;display:table;}
56 #codepeople-review-banner form{float:left; padding:0 5px;}
57 #codepeople-review-banner .codepeople-review-banner-picture{width:120px;padding:10px 10px 10px 10px;float:left;text-align:center;}
58 #codepeople-review-banner .codepeople-review-banner-content{float: left;padding:10px;width: calc( 100% - 160px );width: -webkit-calc( 100% - 160px );width: -moz-calc( 100% - 160px );width: -o-calc( 100% - 160px );}
59 #codepeople-review-banner .codepeople-review-banner-buttons{padding-top:20px;}
60 #codepeople-review-banner .no-thank-button,
61 #codepeople-review-banner .main-button{height: 28px;border-width:1px;border-style:solid;border-radius:5px;text-decoration: none;}
62 #codepeople-review-banner .main-button{background: #0085ba;border-color: #0073aa #006799 #006799;-webkit-box-shadow: 0 1px 0 #006799;box-shadow: 0 1px 0 #006799;color: #fff;text-decoration: none;text-shadow: 0 -1px 1px #006799,1px 0 1px #006799,0 1px 1px #006799,-1px 0 1px #006799;}
63 #codepeople-review-banner .no-thank-button {color: #555;border-color: #cccccc;background: #f7f7f7;-webkit-box-shadow: 0 1px 0 #cccccc;box-shadow: 0 1px 0 #cccccc;vertical-align: top;}
64 #codepeople-review-banner .main-button:hover,#codepeople-review-banner .main-button:focus{background: #008ec2;border-color: #006799;color: #fff;}
65 #codepeople-review-banner .no-thank-button:hover,
66 #codepeople-review-banner .no-thank-button:focus{background: #fafafa;border-color: #999;color: #23282d;}
67 @media screen AND (max-width:760px)
68 {
69 #codepeople-review-banner{position:relative;top:50px;}
70 #codepeople-review-banner .codepeople-review-banner-picture{display:none;}
71 #codepeople-review-banner .codepeople-review-banner-content{width:calc( 100% - 20px );width:-webkit-calc( 100% - 20px );width:-moz-calc( 100% - 20px );width:-o-calc( 100% - 20px );}
72 }
73 </style>
74 <div id="codepeople-review-banner">
75 <div class="codepeople-review-banner-picture">
76 <img alt="" src="https://secure.gravatar.com/avatar/c0662edcefb5a4e2ab12803856ba2358?s=150&amp;d=mm&amp;r=g" style="width:80px;">
77 </div>
78 <div class="codepeople-review-banner-content">
79 <div class="codepeople-review-banner-text">
80 <p><strong>Want to help to the development of the "<?php print $plugin_data[ 'plugin_name' ]; ?>" plugin?</strong> The main features of this plugin are provided free of charge. We need your help to continue developing it and adding new features. If you want to help with the development please <span style="color:#1582AB;font-weight:bold;">add a review to support it</span>. Thank you!</p>
81 </div>
82 <div class="codepeople-review-banner-buttons">
83 <form method="post" target="_blank">
84 <button class="main-button" onclick="jQuery(this).closest('[id=\'codepeople-review-banner\']').hide();">Publish a Review</button>
85 <input type="hidden" name="codepeople_promote_banner_plugin" value="<?php echo esc_attr($plugin_slug); ?>" />
86 <input type="hidden" name="codepeople_promote_banner_action" value="set-review" />
87 <input type="hidden" name="codepeople_promote_banner_nonce" value="<?php echo wp_create_nonce(__FILE__); ?>" />
88 </form>
89 <form method="post">
90 <button class="no-thank-button">No Thanks</button>
91 <input type="hidden" name="codepeople_promote_banner_plugin" value="<?php echo esc_attr($plugin_slug); ?>" />
92 <input type="hidden" name="codepeople_promote_banner_action" value="not-thanks" />
93 <input type="hidden" name="codepeople_promote_banner_nonce" value="<?php echo wp_create_nonce(__FILE__); ?>" />
94 </form>
95 <div style="clear:both;display:block;"></div>
96 </div>
97 <div style="clear:both;"></div>
98 </div>
99 <div style="clear:both;"></div>
100 </div>
101 <?php
102 return;
103 }
104 }
105 }
106 add_action( 'admin_bar_menu', 'codepeople_add_promote_banner' );
107 } // End codepeople_promote_banner block
108 ?>