@include('global.header-links')
@include('partials.sidebar')
@include('partials.header')

Post

@if ($post['post_type'] == 'event')
event_cover

{{$post['event_post']['description']}}

@foreach ($post['event_post']['eventMembers'] as $members)
{{substr($members->user->username, 0, 1)}}
@endforeach
@else
@php function calculateLuminance($color) { $r = hexdec(substr($color, 1, 2)); $g = hexdec(substr($color, 3, 2)); $b = hexdec(substr($color, 5, 2)); return (0.299 * $r + 0.587 * $g + 0.114 * $b) / 255; } $backgroundColor = isset($post['background_color']) ? ($post['background_color'] == 0 ? '#FFFFFF' : $post['background_color']) : '#FFFFFF'; $luminance = calculateLuminance($backgroundColor); if ($luminance > 0.5) { $textColor = "#000000"; } else { $textColor = "#FFFFFF"; } @endphp
{{ $post['parent_id'] != 0 ? (strlen($post['shared_post_content']) > 90000 ? substr($post['shared_post_content'], 0, 90000) . '...' : $post['shared_post_content'] ?? '') : (strlen($post['content']) > 90000 ? substr($post['content'], 0, 90000) . '...' : $post['content'] ?? '') }}
@if (isset($post['media']))
@foreach ($post['media'] as $media) @if ($media['type'] == 'image')
post_media
@endif @if ($media['type'] == 'video')
@endif @endforeach
@endif @if ($post['parent_id'] != 0)
profile_image
{{$post['parent_post']['user']['username']}} @if (isset($post['parent_post']['post_activity_type'], $post['parent_post']['post_activity'])) is {{ ucfirst($post['parent_post']['post_activity_type']) }} {{ ucfirst($post['parent_post']['post_activity']) }} @endif @if (isset($post['parent_post']['tag'], $post['parent_post']['tag']['people'][0])) @php $people = $post['parent_post']['tag']['people']; $firstPerson = ucfirst($people[0]['username']); $othersCount = count($people) >= 2 ? count($people) - 1 : 0; @endphp with {{ $firstPerson }} {{ $othersCount > 0 ? 'and ' . $othersCount . ' others' : '' }} @endif @if (isset($post['parent_post']['tag'], $post['parent_post']['tag']['pedigree'][0])) @php $pedigree = $post['parent_post']['tag']['pedigree']; $firstPedigree = ucfirst($pedigree[0]['full_name']); $othersCountPedigree = count($pedigree) >= 2 ? count($pedigree) - 1 : 0; @endphp and with Pedigree {{ $firstPedigree }} {{ $othersCountPedigree > 0 ? 'and ' . $othersCountPedigree . ' others' : '' }} @endif @if (isset($post['parent_post']['location']['address'], $post['parent_post']['location']['latitude'], $post['parent_post']['location']['longitude'])) - CheckedIn {{$post['parent_post']['location']['address']}} @endif {{$post['parent_post']['created_at']->diffForHumans()}} @if ($post['parent_post']['audience'] == 'public') @if ($post['parent_post']['type'] == 'group') {{$post['parent_post']['group']['name']}} @endif @elseif ($post['parent_post']['audience'] == 'followers') @if ($post['parent_post']['type'] == 'group') {{$post['parent_post']['group']['name']}} @endif @elseif ($post['parent_post']['audience'] == 'followers_of_followers') @if ($post['parent_post']['type'] == 'group') {{$post['parent_post']['group']['name']}} @endif @elseif ($post['parent_post']['audience'] == 'group') @if ($post['parent_post']['type'] == 'group') {{$post['parent_post']['group']['name']}} @endif @endif
@php function calculateLuminanceParentPost($color) { $r_pp = hexdec(substr($color, 1, 2)); $g_pp = hexdec(substr($color, 3, 2)); $b_pp = hexdec(substr($color, 5, 2)); return (0.299 * $r_pp + 0.587 * $g_pp + 0.114 * $b_pp) / 255; } $backgroundColor_pp = isset($post['parent_post']['background_color']) ? $post['parent_post']['background_color'] : '#FFFFFF'; $luminance_pp = calculateLuminanceParentPost($backgroundColor_pp); if ($luminance_pp > 0.5) { $textColor_pp = "#000000"; } else { $textColor_pp = "#FFFFFF"; } @endphp
{{ $post['parent_post']['parent_id'] != 0 ? (strlen($post['parent_post']['shared_post_content']) > 90000 ? substr($post['parent_post']['shared_post_content'], 0, 90000) . '...' : $post['parent_post']['shared_post_content'] ?? '') : (strlen($post['parent_post']['content']) > 90000 ? substr($post['parent_post']['content'], 0, 90000) . '...' : $post['parent_post']['content'] ?? '') }}
@if (isset($post['parent_post']['media']))
@foreach ($post['parent_post']['media'] as $media_pp) @if ($media_pp['type'] == 'image')
post_media
@endif @if ($media_pp['type'] == 'video')
@endif @endforeach
@endif View Full Post
@endif @if (isset($post['tag'], $post['tag']['people'][0])) @endif @if (isset($post['tag'], $post['tag']['pedigree'][0])) @endif
@foreach ($post['comments'] as $comment) @include('admin.posts.comment', ['comment' => $comment, 'mx' => 'mx-0']) @endforeach
@endif
@include('partials.footer')
@include('global.footer-links')