Пример #1
0
 public static function get_spaminess_style(Comment $comment)
 {
     if (isset($comment->info->defensio_spaminess) && $comment->status == Comment::status('spam')) {
         $grad_hex = create_function('$s,$e,$i', 'return (($e-$s)*$i)+$s;');
         $start_hex = '#FFD6D7';
         $end_hex = '#F8595D';
         $border = ColorUtils::rgb_hex(array_combine(array('r', 'g', 'b'), array_map($grad_hex, ColorUtils::hex_rgb($start_hex), ColorUtils::hex_rgb($end_hex), array_pad(array(), 3, $comment->info->defensio_spaminess))));
         return "border-left-color:#{$border}; border-right-color:#{$border};";
     } elseif ($comment->status == self::COMMENT_STATUS_QUEUED) {
         return 'border-left: 3px solid #BCCFFF; border-right: 3px solid #BCCFFF;';
     }
     return '';
 }