コード例 #1
0
 public static function counter_sm_short($atts = array())
 {
     if (rs_wpss_is_admin_sproc()) {
         return NULL;
     }
     global $wpss_wid_inst;
     if (!isset($wpss_wid_inst)) {
         $wpss_wid_inst = 0;
     }
     ++$wpss_wid_inst;
     $counter_sm_option = $atts['style'];
     $counter_sm_option_max = 5;
     $counter_sm_option_min = 1;
     if (empty($counter_sm_option) || $counter_sm_option > $counter_sm_option_max || $counter_sm_option < $counter_sm_option_min) {
         $counter_sm_option = 1;
     }
     /***
      * Display Small Counter
      * Implementation: [spamshieldcountersm style=1] or [spamshieldcountersm] where "style" is 1-5
      ***/
     $spamshield_count = !empty($atts['spamshield_count']) ? $atts['spamshield_count'] : rs_wpss_number_format(rs_wpss_count());
     $counter_sm_div_height = array('0', '50', '50', '50', '50', '50');
     $counter_sm_count_padding_top = array('0', '11', '11', '11', '11', '11');
     $wpss_shortcode_content = '';
     $wpss_shortcode_content .= WPSS_EOL . WPSS_EOL;
     $wpss_shortcode_content .= '<style type="text/css">' . WPSS_EOL;
     $wpss_shortcode_content .= '#rs_wpss_counter_sm_wrap_' . $wpss_wid_inst . ' {color:#ffffff;text-decoration:none;width:120px;}' . WPSS_EOL;
     $wpss_shortcode_content .= '#rs_wpss_counter_sm_' . $wpss_wid_inst . ' {background:url(' . WPSS_PLUGIN_COUNTER_URL . '/o/spamshield-counter-sm-bg-' . $counter_sm_option . '.png) no-repeat top left;height:' . $counter_sm_div_height[$counter_sm_option] . 'px;width:120px;overflow:hidden;border-style:none;color:#ffffff;font-family:Arial,Helvetica,sans-serif;font-weight:bold;line-height:100%;text-align:center;padding-top:' . $counter_sm_count_padding_top[$counter_sm_option] . 'px;}' . WPSS_EOL;
     $wpss_shortcode_content .= '</style>' . WPSS_EOL . WPSS_EOL;
     $wpss_shortcode_content .= '<div id="rs_wpss_counter_sm_wrap_' . $wpss_wid_inst . '" >' . WPSS_EOL . "\t";
     $wpss_shortcode_content .= '<div id="rs_wpss_counter_sm_' . $wpss_wid_inst . '" >' . WPSS_EOL;
     $sip1c = substr(WPSS_SERVER_ADDR, 0, 1);
     if ($counter_sm_option >= 1 && $counter_sm_option <= 5) {
         if ($sip1c > '5') {
             $spamshield_counter_title_text = WPSS_Promo_Links::promo_text(9);
         } else {
             $spamshield_counter_title_text = WPSS_Promo_Links::promo_text(10);
         }
         $wpss_shortcode_content .= "\t" . '<strong style="color:#ffffff;font-family:Arial,Helvetica,sans-serif;font-weight:bold;line-height:100%;text-align:center;text-decoration:none;border-style:none;"><a href="' . WPSS_HOME_URL . '" style="color:#ffffff;font-family:Arial,Helvetica,sans-serif;font-weight:bold;text-decoration:none;border-style:none;" target="_blank" rel="external" title="' . $spamshield_counter_title_text . '" >' . WPSS_EOL;
         $wpss_shortcode_content .= "\t" . '<span style="color:#ffffff;font-size:18px !important;line-height:100% !important;font-family:Arial,Helvetica,sans-serif;font-weight:bold;text-decoration:none;border-style:none;">' . $spamshield_count . '</span><br />' . WPSS_EOL;
         $wpss_shortcode_content .= "\t" . '<span style="color:#ffffff;font-size:10px !important;line-height:120% !important;letter-spacing:1px;font-family:Arial,Helvetica,sans-serif;font-weight:bold;text-decoration:none;border-style:none;">' . WPSS_Promo_Links::promo_text(0) . '</span>' . WPSS_EOL;
         $wpss_shortcode_content .= "\t" . '</a></strong>' . WPSS_EOL;
     }
     $wpss_shortcode_content .= "\t" . '</div>' . WPSS_EOL;
     $wpss_shortcode_content .= '</div>' . WPSS_EOL;
     return $wpss_shortcode_content;
 }
コード例 #2
0
 function admin_nag_notices()
 {
     global $current_user;
     $nag_notices = get_user_meta($current_user->ID, 'wpss_nag_notices', TRUE);
     if (!empty($nag_notices)) {
         $nid = $nag_notices['nid'];
         $style = $nag_notices['style'];
         /* 'error'  or 'updated' */
         $spam_count = rs_wpss_count();
         $timenow = time();
         $avg_blk_dly_d = rs_wpss_number_format($this->spam_blocked_daily());
         $est_hrs_ret_d = rs_wpss_number_format($this->est_hrs_returned($spam_count));
         $url = rs_wpss_get_url();
         $query_args = rs_wpss_get_query_args($url);
         $query_str = '?' . http_build_query(array_merge($query_args, array('wpss_hide_nag' => '1', 'nid' => $nid)));
         $query_str_con = 'QUERYSTRING';
         $spamcount_con = 'SPAMCOUNT';
         $spamdaily_con = 'SPAMDAILY';
         $spamhours_con = 'SPAMHOURS';
         $notice = str_replace(array($query_str_con, $spamcount_con, $spamdaily_con, $spamhours_con), array($query_str, rs_wpss_number_format($spam_count), $avg_blk_dly_d, $est_hrs_ret_d), $nag_notices['notice']);
         echo '<div class="' . $style . '"><p>' . $notice . '</p></div>';
     }
 }