| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly | |
| 3 | - | |
| 2 | +if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly | |
| 3 | +} | |
| 4 | 4 | /** |
| 5 | 5 | * @var string $permalink |
| 6 | 6 | * @var string $user_avatar |
| 7 | 7 | * @var string $user_name |
| @@ -6,34 +6,42 @@ | ||
| 6 | 6 | * @var string $user_avatar |
| 7 | 7 | * @var string $user_name |
| 8 | 8 | * @var string $community_name |
| 9 | 9 | * @var string $content |
| 10 | + * @var string $linkColor | |
| 11 | + * @var string $space_name | |
| 12 | + * @var string $title | |
| 10 | 13 | */ |
| 11 | 14 | |
| 15 | +$fluentCommunityLinkColor = !empty($linkColor) ? $linkColor : '#1f3349'; | |
| 16 | +$fluentCommunitySpaceName = $space_name ?? ''; | |
| 17 | +$fluentCommunityTitle = $title ?? ''; | |
| 12 | 18 | ?> |
| 13 | 19 | <table width="100%" cellspacing="0" cellpadding="0" border="0"> |
| 14 | 20 | <tr> |
| 15 | - <td style="text-align: left; font-family: Arial, sans-serif; font-size: 16px; line-height: 1.4; color: #333;"> | |
| 21 | + <td style="font-family: Arial, sans-serif; font-size: 16px; line-height: 1.4; color: #333;"> | |
| 16 | 22 | <table style="margin-bottom: 20px;" cellspacing="0" cellpadding="0" border="0" width="100%"> |
| 17 | 23 | <tr> |
| 18 | - <td align="left"> | |
| 24 | + <td> | |
| 19 | 25 | <table style="margin-bottom: 10px;" cellspacing="0" cellpadding="0" border="0"> |
| 20 | 26 | <tr> |
| 21 | - <td valign="top" style="border-radius: 50%; padding: 0px; vertical-align: top;"> | |
| 27 | + <td valign="top" style="border-radius: 50%; padding: 4px; vertical-align: top; height: 32px; width: 32px;"> | |
| 22 | 28 | <a href="<?php echo esc_url($permalink); ?>"> |
| 23 | - <img alt="" src="<?php echo esc_url($user_avatar); ?>" width="32" height="32" style="border-radius: 50%; display: block;"> | |
| 29 | + <img alt="" src="<?php echo esc_url($user_avatar); ?>" height="32" width="32" style="border-radius: 50%; height: 32px; width: 32px; display: block;"> | |
| 24 | 30 | </a> |
| 25 | 31 | </td> |
| 26 | - <td style="font-family: Arial, sans-serif; font-size: 16px;color: #333; padding-left: 5px; vertical-align: middle;"> | |
| 32 | + <td style="font-family: Arial, sans-serif; font-size: 16px;color: #333; padding: 0 5px; vertical-align: middle;"> | |
| 27 | 33 | <a style="text-decoration: none; color: #333;" href="<?php echo esc_url($permalink); ?>"> |
| 28 | 34 | <span style="font-weight: bold;"><?php echo esc_html($user_name); ?></span> |
| 29 | 35 | </a> |
| 30 | - <?php if($space_name): ?> | |
| 31 | - <span style="font-family: Arial, sans-serif; font-size: 12px; font-weight: normal; margin: 0;"><?php echo esc_html(sprintf(__('in %s', 'fluent-community'), $space_name)); ?></span> | |
| 36 | + <?php if($fluentCommunitySpaceName): ?> | |
| 37 | + <?php /* translators: %s is replaced by the title of the space */ ?> | |
| 38 | + <span style="font-family: Arial, sans-serif; font-size: 12px; font-weight: normal; margin: 0;"><?php echo esc_html(sprintf(__('in %s', 'fluent-community'), $fluentCommunitySpaceName)); ?></span> | |
| 32 | 39 | <?php endif; ?> |
| 33 | 40 | |
| 34 | 41 | <?php if(!empty($timestamp)): ?> |
| 35 | - <p style="font-family: Arial, sans-serif; font-size: 12px; font-weight: normal; margin: 0; margin-bottom: 0px;"><?php echo esc_html(sprintf(__('%s ago', 'fluent-community'), $timestamp)); ?></p> | |
| 42 | + <?php /* translators: %s is replaced by the time ago */ ?> | |
| 43 | + <p style="font-family: Arial, sans-serif; font-size: 12px; font-weight: normal; margin: 0; margin-bottom: 0px;"><?php echo esc_html(sprintf(__('%s ago', 'fluent-community'), $timestamp)); ?></p> | |
| 36 | 44 | <?php endif; ?> |
| 37 | 45 | </td> |
| 38 | 46 | </tr> |
| 39 | 47 | </table> |
| @@ -40,16 +48,16 @@ | ||
| 40 | 48 | </td> |
| 41 | 49 | </tr> |
| 42 | 50 | <tr> |
| 43 | 51 | <td style="padding: 0; line-height: 1.4;font-family: Helvetica, sans-serif;"> |
| 44 | - <?php if($title): ?> | |
| 45 | - <a href="<?php echo esc_url($permalink); ?>" style="color: #1f3349; display: block; overflow: hidden; margin: 0; line-height: 1.2; padding: 0; text-decoration: none;"> | |
| 46 | - <h2 style="color: #1f3349; display: block; font-size: 20px; overflow: hidden; margin: 0 0 10px 0; padding: 0; text-decoration: none;"><?php echo esc_html($title); ?></h2> | |
| 52 | + <?php if($fluentCommunityTitle): ?> | |
| 53 | + <a href="<?php echo esc_url($permalink); ?>" style="color: <?php echo esc_attr($fluentCommunityLinkColor); ?>; display: block; overflow: hidden; margin: 0; line-height: 1.2; padding: 0; text-decoration: none;"> | |
| 54 | + <h2 style="color: <?php echo esc_attr($fluentCommunityLinkColor); ?>; display: block; font-size: 20px; overflow: hidden; margin: 0 0 10px 0; padding: 0; text-decoration: none;"><?php echo esc_html($fluentCommunityTitle); ?></h2> | |
| 47 | 55 | </a> |
| 48 | 56 | <?php endif; ?> |
| 49 | 57 | <?php \FluentCommunity\App\Services\CustomSanitizer::sanitizeRichText($content, true); ?> |
| 50 | 58 | <?php if(!empty($show_read_more)): ?> |
| 51 | - <a href="<?php echo esc_url($permalink); ?>" style="color: #1f3349;text-decoration: none;font-weight: bold;font-size: 14px;"> | |
| 59 | + <a href="<?php echo esc_url($permalink); ?>" style="color: <?php echo esc_attr($fluentCommunityLinkColor); ?>; text-decoration: none; font-weight: bold; font-size: 14px;"> | |
| 52 | 60 | <?php echo esc_html__('...read more', 'fluent-community'); ?> |
| 53 | 61 | </a> |
| 54 | 62 | <?php endif; ?> |
| 55 | 63 | </td> |