<div class="post-container">
  <div class="post" id="post-<?php echo $wo['story']['id']; ?>" data-post-id="<?php echo $wo['story']['id'];?>">
    <?php
      if (empty($wo['page'])) {
        $wo['page'] = 'home';
      }
      if ($wo['story']['is_post_pinned'] === true && ($wo['page'] == 'timeline'  || $wo['page'] == 'page' || $wo['page'] == 'group' )) {?>
    <div class="pin-icon" data-toggle="tooltip" title="<?php echo $wo['lang']['pinned_post'];?>">
      <i class="fa fa-bookmark"></i>
    </div>
    <?php } ?>
    <div class="panel panel-white panel-shadow">
      <div class="post-heading">
        <div class="<?php echo Wo_RightToLeft('pull-left');?> image">
          <a href="<?php echo $wo['story']['publisher']['url']; ?>">
          <img src="<?php echo $wo['story']['publisher']['avatar']; ?>" id="updateImage-<?php echo $wo['story']['publisher']['user_id']?>" class="img-rounded avatar" alt="<?php echo $wo['story']['publisher']['name']; ?> profile picture">
          </a>
        </div>
        <div class="<?php echo Wo_RightToLeft('pull-right');?>">
          <?php  if ($wo['story']['admin'] === true) { ?>
          <span class="dropdown">
            <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
            <span class="caret pointer"></span>
            </a>
            <ul class="dropdown-menu post-privacy-menu post-options" role="menu">
              <li>
                <span class="pointer" onclick="Wo_OpenPostEditBox(<?php echo $wo['story']['id']; ?>);">
                <i class="fa fa-pencil progress-icon fa-fw" data-icon="pencil"></i> 
                <?php echo $wo['lang']['edit_post'];?>
                </span>
              </li>
              <li>
                <hr>
              </li>
              <li>
                <span class="pointer" onclick="Wo_OpenPostDeleteBox(<?php echo $wo['story']['id']; ?>);">
                <i class="fa fa-trash-o progress-icon fa-fw" data-icon="trash-o"></i> 
                <?php echo $wo['lang']['delete_post'];?>
                </span>
              </li>
              <?php if (empty($wo['story']['recipient'])) { ?>
              <?php if ($wo['story']['is_group_post'] == false) { ?>
              <li>
                <hr>
              </li>
              <li>
              <?php
              $pin_post_id = $wo['story']['publisher']['id'];
              $pin_post_text = 'profile';
              if (!empty($wo['story']['page_id'])) {
                $pin_post_id = $wo['story']['page_id'];
                $pin_post_text = 'page';
              } else if (!empty($wo['story']['group_id'])) {
                $pin_post_id = $wo['story']['group_id'];
                $pin_post_text = 'group';
              }
              ?>
                <span class="pin-post pointer" onclick="Wo_PinPost(<?php echo $wo['story']['id']; ?>, <?php echo $pin_post_id;?>, '<?php echo $pin_post_text; ?>');">
                <?php if($wo['story']['is_post_pinned'] === true) { ?>
                <i class="fa fa-thumb-tack progress-icon pinned-text fa-fw" data-icon="thumb-tack"></i> <?php echo $wo['lang']['unpin_post'];?>
                <?php } else { ?>
                <i class="fa fa-thumb-tack progress-icon fa-fw" data-icon="thumb-tack"></i> <?php echo $wo['lang']['pin_post'];?>
                <?php } ?>
                </span>
              </li>
              <?php } } ?>
              <?php if (!empty($wo['story']['album_name'])) {?>
              <li>
                <hr>
              </li>
              <li>
                <a href="<?php echo Wo_SeoLink('index.php?tab1=create-album&album=' . $wo['story']['id']);?>">
                <i class="fa fa-camera progress-icon fa-fw"  data-icon="camera"></i> <?php echo $wo['lang']['add_photos'];?>
                </a>
              </li>
              <?php } ?>
              <li>
                <hr>
              </li>
              <li>
                <a href="<?php echo $wo['story']['url'];?>" target="_blank">
                <i class="fa fa-link progress-icon fa-fw"  data-icon="link"></i> <?php echo $wo['lang']['open_post_in_new_tab'];?>
                </a>
              </li>
            </ul>
          </span>
          <?php  } elseif (Wo_IsLogged() === true) { ?>
          <span class="dropdown">
            <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
            <span class="pointer">
            <span class="caret"></span>
            </span>
            </a>
            <ul class="dropdown-menu post-privacy-menu post-options post-recipient" role="menu"  >
              <li>
                <span class="save-post pointer" class="save-post" onclick="Wo_SavePost(<?php echo $wo['story']['id']; ?>);">
                <?php if($wo['story']['is_post_saved'] === true) { ?>
                <i class="fa fa-check progress-icon fa-fw" data-icon="check"></i> <?php echo $wo['lang']['unsave_post'];?>
                <?php } else { ?>
                <i class="fa fa-floppy-o progress-icon fa-fw" data-icon="floppy-o"></i> <?php echo $wo['lang']['save_post'];?>
                <?php } ?>
                </span>
              </li>
              <li>
                <hr>
              </li>
              <li>
                <span  class="report-post pointer" onclick="Wo_ReportPost(<?php echo $wo['story']['id']; ?>);">
                <?php if($wo['story']['is_post_reported'] === true) { ?>
                <i class="fa fa-check progress-icon fa-fw" data-icon="flag"></i> <?php echo $wo['lang']['unreport_post'];?>
                <?php } else { ?>
                <i class="fa fa-flag progress-icon fa-fw" data-icon="flag"></i> <?php echo $wo['lang']['report_post'];?>
                <?php } ?>
                </span>
              </li>
              <li>
                <hr>
              </li>
              <li>
                <a href="<?php echo $wo['story']['url'];?>" target="_blank">
                <i class="fa fa-link progress-icon fa-fw" data-icon="link"></i> <?php echo $wo['lang']['open_post_in_new_tab'];?>
                </a>
              </li>
            </ul>
          </span>
          <?php } ?>
        </div>
        <div class="meta">
          <div class="title h5">
            <span class="user-popover" data-type="<?php echo $wo['story']['publisher']['type']; ?>" data-id="<?php echo $wo['story']['publisher']['id']; ?>">
            <a href="<?php echo $wo['story']['publisher']['url']; ?>">
            <b>
            <?php echo $wo['story']['publisher']['name']; ?> 
            </b>
            </a>
            </span><?php if($wo['story']['publisher']['verified'] == 1) { ?><span class="verified-color"><i class="fa fa-check-circle fa-fw" title="<?php echo $wo['lang']['verified_user'];?>"></i></span>
            <?php } ?>
            <?php if ($wo['story']['recipient_exists'] == true) {  ?>
            <i class="fa fa-arrow-right"></i>
            <span class="user-popover" data-type="<?php echo $wo['story']['recipient']['type']; ?>" data-id='<?php echo $wo['story']['recipient']['id']; ?>'>
            <a href="<?php echo $wo['story']['recipient']['url']; ?>">
            <b>
            <?php echo $wo['story']['recipient']['name']; ?>
            </b>
            </a>
            <?php if($wo['story']['recipient']['verified'] == 1) { ?> <span class="verified-color"><i class="fa fa-check-circle" title="<?php echo $wo['lang']['verified_user'];?>"></i></span>
            <?php } ?>
            </span>
            <?php } ?>
            <?php if ($wo['story']['group_recipient_exists'] == true && $wo['page'] != 'group') {  ?>
            <i class="fa fa-arrow-right"></i>
            <span class="user-popover" data-type="<?php echo $wo['story']['group_recipient']['type']; ?>" data-id='<?php echo $wo['story']['group_recipient']['id']; ?>'>
            <a href="<?php echo $wo['story']['group_recipient']['url']; ?>">
            <b><?php echo $wo['story']['group_recipient']['name']; ?></b>
            </a>
            </span>
            <?php } ?>
            <?php if (!empty($wo['story']['album_name'])) {  ?>
            <small class="small-text"><?php echo $wo['lang']['added_new_photos_to'];?> <b><a href="<?php echo $wo['story']['url']; ?>"><?php echo $wo['story']['album_name']; ?></a></b></small>
            <?php } ?>
            <?php 
              if($wo['story']['postType'] == 'profile_picture') { 
                 $changed_profile_pic_lang = $wo['lang']['changed_profile_picture_male'];
                 if ($wo['story']['publisher']['gender'] == 'female') {
                    $changed_profile_pic_lang = $wo['lang']['changed_profile_picture_female'];
                 } else {
                    $changed_profile_pic_lang = $wo['lang']['changed_profile_picture_male'];
                 }
                 echo $changed_profile_pic_lang;
              } 
              if($wo['story']['postType'] == 'profile_cover_picture') { 
                 $changed_profile_cover_pic_lang = $wo['lang']['changed_profile_cover_picture_male'];
                 if ($wo['story']['publisher']['gender'] == 'female') {
                    $changed_profile_cover_pic_lang = $wo['lang']['changed_profile_cover_picture_female'];
                 } else {
                    $changed_profile_cover_pic_lang = $wo['lang']['changed_profile_cover_picture_male'];
                 }
                 echo $changed_profile_cover_pic_lang;
              } 
              ?>
            <?php if($wo['story']['via_type'] == 'share') {  ?>
            <small style="color:#a33e40;"><?php echo $wo['story']['via']['name'];?> <?php echo $wo['lang']['shared_this_post'];?></small>
            <?php }  ?>
            <?php 
          $extra_exists = 0;
          if (!empty($wo['story']['postFeeling'])) {
            if (empty($changed_profile_pic_lang) 
              && $wo['story']['via_type'] != 'share'
              && $wo['story']['group_recipient_exists'] != true
              && empty($wo['story']['album_name'])) {
          ?>
          <span class="feeling-text"> <?php echo $wo['lang']['is_feeling'];?> <i class="twa-lg twa twa-<?php echo $wo['story']['postFeelingIcon'];?>"></i> <?php echo $wo['lang'][$wo['story']['postFeeling']];?></span>
          <?php
          } else {
            $extra_exists = 1;
          }
          }
          if (!empty($wo['story']['postTraveling'])) {
            if (empty($changed_profile_pic_lang) 
              && $wo['story']['via_type'] != 'share'
              && $wo['story']['group_recipient_exists'] != true
              && empty($wo['story']['album_name'])) {
          ?>
          <span class="feeling-text"><i class="fa fa-plane"></i> <?php echo $wo['lang']['is_traveling'];?> <?php echo $wo['story']['postTraveling'];?></span>
          <?php
          } else {
            $extra_exists = 1;
          }
          }
          if (!empty($wo['story']['postListening'])) {
            if (empty($changed_profile_pic_lang) 
              && $wo['story']['via_type'] != 'share'
              && $wo['story']['group_recipient_exists'] != true
              && empty($wo['story']['album_name'])) {
          ?>
          <span class="feeling-text"><i class="fa fa-headphones"></i> <?php echo $wo['lang']['is_listening'];?> <?php echo $wo['story']['postListening'];?></span>
          <?php
          } else {
            $extra_exists = 1;
          }
          }
          if (!empty($wo['story']['postPlaying'])) {
            if (empty($changed_profile_pic_lang) 
              && $wo['story']['via_type'] != 'share'
              && $wo['story']['group_recipient_exists'] != true
              && empty($wo['story']['album_name'])) {
          ?>
          <span class="feeling-text"><i class="fa fa-gamepad"></i> <?php echo $wo['lang']['is_playing'];?> <?php echo $wo['story']['postPlaying'];?></span>
          <?php
          } else {
            $extra_exists = 1;
          }
          }
          if (!empty($wo['story']['postWatching'])) {
            if (empty($changed_profile_pic_lang) 
              && $wo['story']['via_type'] != 'share'
              && $wo['story']['group_recipient_exists'] != true
              && empty($wo['story']['album_name'])) {
          ?>
          <span class="feeling-text"><i class="fa fa-eye"></i> <?php echo $wo['lang']['is_watching'];?> <?php echo $wo['story']['postWatching'];?></span>
          <?php
          } else {
            $extra_exists = 1;
          }
          }
          ?>
          </div>
          <h6>
            <span class="time" style="color:#9197a3">
            <i class="fa fa-clock-o"></i>
            <span class="ajax-time" title="<?php echo date('c',$wo['story']['time']); ?>">
            <?php echo Wo_Time_Elapsed_String($wo['story']['time']); ?> 
            </span>
            </span>
            <?php  if ($wo['story']['admin'] === true && $wo['story']['group_recipient_exists'] == false) { ?>
            <?php  if (empty($wo['story']['page_id'])) { ?>
            <span class="dropdown" style="color:#9197a3">
              <span class="dropdown-toggle pointer" data-toggle="dropdown" role="button" aria-expanded="false">
              <span class="pointer post-privacy" style="color:#9197a3">
              <?php  if($wo['story']['postPrivacy'] == 0) { ?>
              <i class="fa fa-globe progress-icon fa-fw" data-toggle="tooltip" title="<?php echo $wo['lang']['everyone'];?>" data-icon="globe"></i>
              <?php  } ?>
              <?php  if($wo['story']['postPrivacy'] == 1) { ?>
              <i class="fa fa-users progress-icon fa-fw" data-toggle="tooltip" title="<?php echo ($wo['config']['connectivitySystem'] == 1) ? $wo['lang']['my_friends'] : $wo['lang']['people_i_follow'];?>" data-icon="user"></i>
              <?php  }  ?>
              <?php  if($wo['story']['postPrivacy'] == 2) { ?>
              <i class="fa fa-user progress-icon fa-fw" data-toggle="tooltip" title="<?php echo ($wo['config']['connectivitySystem'] == 1) ? $wo['lang']['my_friends'] : $wo['lang']['people_follow_me'];?>" data-icon="users"></i>
              <?php  }  ?>
              <?php  if($wo['story']['postPrivacy'] == 3) { ?>
              <i class="fa fa-lock progress-icon fa-fw" data-toggle="tooltip" title="<?php echo $wo['lang']['only_me'];?>" data-icon="lock"></i>
              <?php  }  ?>
              </span>
              <span class="caret" style="color:#9197a3"></span>
              </span>
              <ul class="dropdown-menu post-privacy-menu" role="menu">
                <li>
                  <span class="pointer" onclick="Wo_UpdatePostPrivacy(<?php echo $wo['story']['id']; ?>,3,event);">
                  <i class="fa fa-lock progress-icon fa-fw" data-toggle="tooltip" data-icon="lock"></i> 
                  <?php echo $wo['lang']['only_me'];?>
                  </span>
                </li>
                <li>
                  <hr>
                </li>
                <li>
                  <span class="pointer" onclick="Wo_UpdatePostPrivacy(<?php echo $wo['story']['id']; ?>,0,event);">
                  <i class="fa fa-globe progress-icon fa-fw" data-toggle="tooltip" data-icon="pencil"></i> <?php echo $wo['lang']['everyone'];?>
                  </span>
                </li>
                <li>
                  <hr>
                </li>
                <?php if ($wo['config']['connectivitySystem'] == 1) { ?>
                <li>
                  <span class="pointer" onclick="Wo_UpdatePostPrivacy(<?php echo $wo['story']['id']; ?>,1,event);">
                  <i class="fa fa-users progress-icon fa-fw" data-toggle="tooltip" data-icon="pencil"></i> <?php echo $wo['lang']['my_friends'];?>
                  </span>
                </li>
                <?php } else { ?>
                <li>
                  <span class="pointer" onclick="Wo_UpdatePostPrivacy(<?php echo $wo['story']['id']; ?>,1,event);">
                  <i class="fa fa-user progress-icon fa-fw" data-toggle="tooltip" data-icon="pencil"></i> 
                  <?php echo $wo['lang']['people_i_follow'];?>
                  </span>
                </li>
                <li>
                  <hr>
                </li>
                <li>
                  <span class="pointer" onclick="Wo_UpdatePostPrivacy(<?php echo $wo['story']['id']; ?>,2,event);">
                  <i class="fa fa-users progress-icon fa-fw" data-toggle="tooltip" data-icon="pencil"></i> <?php echo $wo['lang']['people_follow_me'];?>
                  </span>
                </li>
                <?php } ?>
              </ul>
            </span>
            <?php } else { ?>
            <span class="dropdown">
              <span class="dropdown-toggle pointer" data-toggle="dropdown" role="button" aria-expanded="false">
              <span class="pointer post-privacy" style="color:#9197a3">
              <?php  if($wo['story']['postPrivacy'] == 0) { ?>
              <i class="fa fa-globe progress-icon " data-toggle="tooltip" title="<?php echo $wo['lang']['everyone'];?>" data-icon="globe"></i>
              <?php  } ?>
              <?php  if($wo['story']['postPrivacy'] == 2) { ?>
              <i class="fa fa-thumbs-up progress-icon" data-toggle="tooltip" title="Liked My Page" data-icon="thumbs-up"></i>
              <?php  }  ?>
              </span>
              <span class="caret"></span>
              </span>
              <ul class="dropdown-menu post-privacy-menu" role="menu">
                <li>
                  <span class="pointer" onclick="Wo_UpdatePostPrivacy(<?php echo $wo['story']['id']; ?>,0,event);">
                  <i class="fa fa-globe progress-icon" data-toggle="tooltip" data-icon="pencil"></i> <?php echo $wo['lang']['everyone'];?>
                  </span>
                </li>
                <li>
                  <hr>
                </li>
                <li>
                  <span class="pointer" onclick="Wo_UpdatePostPrivacy(<?php echo $wo['story']['id']; ?>,2,event);">
                  <i class="fa fa-thumbs-up progress-icon" data-toggle="tooltip" data-icon="thumbs-up"></i> Liked My Page
                  </span>
                </li>
              </ul>
            </span>
            <?php } ?>
            <?php }  ?>
            <?php if(!empty($wo['story']['postMap'])) { ?>
            <?php if(!empty($wo['story']['postSoundCloud']) || 
              !empty($wo['story']['postVine']) || 
              !empty($wo['story']['postYoutube']) || 
              !empty($wo['story']['postVimeo']) || 
              !empty($wo['story']['postText']) || 
              !empty($wo['story']['postFile']) || 
              !empty($wo['story']['postLink']) || 
              !empty($wo['story']['postFacebook']) || 
              !empty($wo['story']['postDailymotion']) ||
              !empty($wo['story']['album_name'])) { ?>
            <span style="color:#9197a3"> - <i class="fa fa-map-marker"></i> <?php echo $wo['story']['postMap'];?>.</span>
            <?php } ?>
            <?php } else { ?>
            <?php
              $small_icon = '';
              $icon_type = '';
              if(!empty($wo['story']['postVine'])) { 
                 $small_icon = 'vine';
                 $icon_type = 'Vine';
              } else if (!empty($wo['story']['postVimeo'])) {
                 $small_icon = 'vimeo';
                 $icon_type = 'Vimeo';
              } else if (!empty($wo['story']['postFacebook'])) {
                 $small_icon = 'facebook-official';
                 $icon_type = 'Facebook';
              } else if (!empty($wo['story']['postDailymotion'])) {
                 $small_icon = 'film';
                 $icon_type = 'Dailymotion';
              } else if (!empty($wo['story']['postYoutube'])) {
                 $small_icon = 'youtube-square';
                 $icon_type = 'Youtube';
              } else if (!empty($wo['story']['postSoundCloud'])) {
                 $small_icon = 'soundcloud';
                 $icon_type = 'SoundCloud';
              }
              if (!empty($icon_type)) {
              ?>
            <span style="color:#9197a3"> - <i class="fa fa-<?php echo $small_icon; ?>"></i> <?php echo $icon_type; ?></span>
            <?php  } } ?>
          </h6>
        </div>
      </div>
      <div class="post-description">
        <p dir="auto">
        <?php echo $wo['story']['postText']; ?>
        <?php if (!empty($wo['story']['postFeeling']) && $extra_exists == 1) { ?>
        <span class="feeling-text"> — <i class="twa-lg twa twa-<?php echo $wo['story']['postFeelingIcon'];?>"></i> <?php echo $wo['lang']['feeling'];?> <?php echo $wo['lang'][$wo['story']['postFeeling']];?></span>
        <?php } ?>
        <?php if (!empty($wo['story']['postTraveling']) && $extra_exists == 1) { ?>
        <span class="feeling-text"> — <i class="fa fa-plane"></i> <?php echo $wo['lang']['traveling'];?><?php echo $wo['story']['postTraveling'];?></span>
        <?php } ?>
        <?php if (!empty($wo['story']['postWatching']) && $extra_exists == 1) { ?>
        <span class="feeling-text"> — <i class="fa fa-eye"></i> <?php echo $wo['lang']['watching'];?> <?php echo $wo['story']['postWatching'];?></span>
        <?php } ?>
        <?php if (!empty($wo['story']['postPlaying']) && $extra_exists == 1) { ?>
        <span class="feeling-text"> — <i class="fa fa-gamepad"></i> <?php echo $wo['lang']['playing'];?> <?php echo $wo['story']['postPlaying'];?></span>
        <?php } ?>
         <?php if (!empty($wo['story']['postListening']) && $extra_exists == 1) { ?>
        <span class="feeling-text"> — <i class="fa fa-headphones"></i> <?php echo $wo['lang']['listening'];?> <?php echo $wo['story']['postListening'];?></span>
        <?php } ?>
        </p>
        <?php if(!empty($wo['story']['postYoutube'])) {  ?>
        <div class="post-youtube">
          <iframe id="ytplayer" type="text/html" width="100%" height="340" src="https://www.youtube.com/embed/<?php echo $wo['story']['postYoutube']; ?>?autoplay=0"
            frameborder="0"/></iframe>
        </div>
        <?php } ?>
        <?php if(!empty($wo['story']['postVimeo'])) {  ?>
        <div class="post-youtube">
          <iframe src="https://player.vimeo.com/video/<?php echo $wo['story']['postVimeo'];?>?byline=0&portrait=0" width="100%" height="340" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
        </div>
        <?php } ?>
        <?php if(!empty($wo['story']['postFacebook'])) {  ?>
        <div class="post-youtube">
          <iframe src="https://www.facebook.com/video/embed?video_id=<?php echo $wo['story']['postFacebook'];?>" width="100%" height="340" frameborder="0" allowfullscreen></iframe>
        </div>
        <?php } ?>
        <?php if(!empty($wo['story']['postDailymotion'])) {  ?>
        <div class="post-youtube">
          <iframe frameborder="0" width="100%" height="340" src="https://www.dailymotion.com/embed/video/<?php echo $wo['story']['postDailymotion']?>" allowfullscreen></iframe>
        </div>
        <?php } ?>
        <?php if(!empty($wo['story']['postVine'])) {  ?>
        <iframe src="https://vine.co/v/<?php echo $wo['story']['postVine']; ?>/embed/simple" width="100%" height="400" frameborder="0"></iframe>
        <?php } ?>
        <?php if(!empty($wo['story']['postSoundCloud'])) { ?>
        <iframe width="100%" src="https://w.soundcloud.com/player/?url=https://api.soundcloud.com/tracks/<?php echo $wo['story']['postSoundCloud'];?>&auto_play=false"></iframe>
        <?php } ?>
        <?php if(!empty($wo['story']['postMap']) && empty($wo['story']['postText']) && empty($wo['story']['postVine']) && empty($wo['story']['postSoundCloud']) && empty($wo['story']['postVimeo']) && empty($wo['story']['postDailymotion']) && empty($wo['story']['postYoutube']) && empty($wo['story']['postFile'])) { ?>
        <div class="post-map">
          <img src="https://maps.googleapis.com/maps/api/staticmap?center=<?php echo $wo['story']['postMap'];?>&zoom=13&size=600x250&maptype=roadmap&markers=color:red%7C<?php echo $wo['story']['postMap'];?>" width="100%">
        </div>
        <?php } ?>
        <?php if(!empty($wo['story']['postLink']) && empty($wo['story']['postVine']) && empty($wo['story']['postSoundCloud']) && empty($wo['story']['postYoutube']) && empty($wo['story']['postFile'])) { ?>
        <div class="post-fetched-url">
          <a href="<?php echo $wo['story']['postLink'];?>" target="_blank">
            <?php if (!empty($wo['story']['postLinkImage'])) {?>
            <img src="<?php echo $wo['story']['postLinkImage'];?>" class="<?php echo Wo_RightToLeft('pull-left');?>" alt="<?php echo $wo['story']['postLinkTitle'];?>"/>
            <?php } ?>
            <div class="fetched-url-text">
              <h4><?php echo $wo['story']['postLinkTitle'];?></h4>
              <div class="description"><?php echo $wo['story']['postLinkContent'];?></div>
              <div class="url">
                <?php 
                  $parse = parse_url($wo['story']['postLink']);
                  echo $parse['host'];
                  ?>
              </div>
            </div>
            <div class="clear"></div>
        </div>
        </a>
        <?php } ?>
        <?php if(!empty($wo['story']['postFile'])) { ?>
        <div class="post-file">
            <?php
            $media = array(
                'type' => 'post',
                'storyId' => $wo['story']['id'],
                'filename' => $wo['story']['postFile'],
                'name' => $wo['story']['postFileName']
            );
            echo Wo_DisplaySharedFile($media);
            ?>
        </div>
        <?php } ?>
        <?php if (!empty($wo['story']['photo_album'])) {
           $class = '';
           $small = '';
           if (count($wo['story']['photo_album']) == 2) {
                $class = 'width-2';
           }
           if (count($wo['story']['photo_album']) > 1) {
                $small = '_small';
           }
           if (count($wo['story']['photo_album']) > 2) {
                $class = 'width-3';
           }
           $delete = '';
           $onhover = '';
           foreach ($wo['story']['photo_album'] as $photo) {
              if ($wo['story']['admin'] === true) {
                $delete = "<span onclick='Wo_RemoveAlbumImage(" . $photo['post_id'] . "," . $photo['id'] . ");' class='pointer'><i class='fa fa-remove'></i></span>";
                $onhover = "onmouseover='Wo_ShowDeleteButton(" . $photo['post_id'] . "," . $photo['id'] . ")' onmouseleave='Wo_HideDeleteButton(" . $photo['post_id'] . "," . $photo['id'] . ");'";
              }
              echo  "<div class='album-image " . $class . "' id='image-" . $photo['id'] . "' {$onhover}>{$delete}<img src='" . Wo_GetMedia($photo['image_org']) . "' alt='image' class='image-file pointer' onclick='Wo_OpenAlbumLightBox(" . $photo['id'] . ");'></div>";
           }
        } 
        ?>
        <?php if ($wo['story']['multi_image'] == 1) {
           $class = '';
           $small = '';
           if (count($wo['story']['photo_multi']) == 2) {
                $class = 'width-2';
           }
           if (count($wo['story']['photo_multi']) > 1) {
                $small = '_small';
           }
           if (count($wo['story']['photo_multi']) > 2) {
                $class = 'width-3';
           }
           foreach ($wo['story']['photo_multi'] as $photo) {
              echo  "<img src='" . Wo_GetMedia($photo['image_org']) ."' alt='image' class='" . $class . " image-file pointer' onclick='Wo_OpenAlbumLightBox(" . $photo['id'] . ");'>";
           }
        } 
        ?>
        <div class="clear"></div>
        <hr>
        <?php if(Wo_IsLogged() === true) { ?>
        <div class="stats <?php echo Wo_RightToLeft('pull-left');?>">
          <?php echo Wo_LoadPage('buttons/like-wonder');?>
          <div class="btn btn-default stat-item" onclick="Wo_ShowComments(<?php echo $wo['story']['id']; ?>);" title="<?php echo $wo['lang']['comments'];?>">
            <i class="fa fa-comments-o"></i>
            <span id="comments">
            <?php echo $wo['story']['post_comments'];?>
            </span>
          </div>
          <div onclick="Wo_OpenShareBtns(<?php echo $wo['story']['id']; ?>);" class="btn btn-default stat-item" title="<?php echo $wo['lang']['share'];?>">
            <i class="fa fa-share-square-o"></i>
            <span id="shares">
            <?php echo $wo['story']['post_shares'];?>
            </span>
          </div>
        </div>
        <?php } else {  ?>
        <span class="<?php echo Wo_RightToLeft('pull-left');?>"><a href="<?php echo Wo_SeoLink('index.php?tab1=welcome&last_url=' . urlencode($wo['story']['url']));?>"><?php echo $wo['lang']['post_login_requriement'];?></a></span>
        <div class="clear"></div>
        <?php } ?>
        <?php if (Wo_IsLogged() === true) { ?>
        <div class="stats <?php echo Wo_RightToLeft('pull-right');?>">
          <div class="btn btn-default stat-item post-like-status" title="<?php echo $wo['lang']['likes'];?>" onclick="Wo_OpenPostLikedUsers(<?php echo $wo['story']['id'] ?>);">
            <i class="fa fa-thumbs-up progress-icon" data-icon="thumbs-up"></i>
            <span id="likes">
            <?php echo $wo['story']['post_likes'];?>
            </span>
          </div>
          <div class="btn btn-default stat-item post-wonders-status" title="<?php echo ($wo['config']['second_post_button'] == 'wonder') ? $wo['lang']['wonders']: $wo['lang']['dislikes'];?>" onclick="Wo_OpenPostWonderedUsers(<?php echo $wo['story']['id'] ?>);">
            <i class="fa fa-<?php echo $wo['second_post_button_icon'];?> progress-icon" data-icon="exclamation-circle"></i>
            <span id="wonders">
            <?php echo $wo['story']['post_wonders'];?>
            </span>
          </div>
        </div>
        <div class="clear"></div>
        <?php } ?>
      </div>
      <?php if (Wo_IsLogged() === true) { ?>
      <div class="post-footer post-share">
        <div class="bottom">
          <?php  if($wo['story']['admin'] === false && $wo['story']['group_recipient_exists'] == false &&  $wo['story']['postType'] != 'profile_picture') {  ?>
          <div onclick="Wo_RegisterShare(<?php echo $wo['story']['id']; ?>);" title="<?php echo $wo['lang']['share'];?>" data-toggle="tooltip" id="share-button" style="padding:7px;" class="btn btn-default btn-sm<?php echo (Wo_IsShared($wo['story']['id'],$wo['user']['user_id'])) ? ' active': '';?> stat-item" title="Share">
            <i class="fa fa-share-square-o icon"></i>
            <span id="shares">
            <?php echo $wo['story']['post_shares'];?>
            </span>
          </div>
          <?php  } ?>
          <a class="btn social-btn btn-primary btn-twitter btn-sm" href="https://twitter.com/intent/tweet?text=<?php echo $wo['story']['url'];?>" target="_blank">
          <i class="fa fa-twitter"></i>
          </a>
          <a class="btn social-btn btn-danger btn-sm" rel="publisher" href="https://plus.google.com/share?url=<?php echo $wo['story']['url'];?>" target="_blank">
          <i class="fa fa-google-plus"></i>
          </a>
          <a class="btn social-btn btn-primary btn-sm" rel="publisher" href="https://www.facebook.com/sharer/sharer.php?u=<?php echo $wo['story']['url'];?>" target="_blank">
          <i class="fa fa-facebook"></i>
          </a>
        </div>
      </div>
      <div class="post-footer post-likes"></div>
      <div class="clear"></div>
      <div class="post-footer post-wonders"></div>
      <div class="clear"></div>
      <div class="post-footer post-comments" id="post-comments-<?php echo $wo['story']['id']; ?>">
        <div class="post-commet-textarea dropdown">
          <input class="form-control comment-textarea textarea" placeholder="<?php echo $wo['lang']['write_comment'];?>" type="text" onkeyup="Wo_RegisterComment(this.value,<?php echo $wo['story']['id']; ?>,<?php echo $wo['story']['publisher']['user_id']; ?>, event, <?php echo (!empty($wo['story']['publisher']['page_id'])) ? $wo['story']['publisher']['page_id'] : '0'; ?>)" dir="auto">
          <a href="#" class="input-group-btn emo-comment dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false" >
            <span class="btn btn-file">
            <i class="fa fa-smile-o progress-icon" data-icon="file-smile-o"></i>
            </span>
          </a>
          <ul class="dropdown-menu">
            <?php  
            foreach ($wo['emo'] as $code => $name) {
              $code   = $code;
              echo  '<span onclick="Wo_AddEmoToCommentInput(' . $wo["story"]["id"] . ', \'' . $code . '\');"><i class="pointer twa-lg twa twa-' . $name . '"></i></span>'; 
            } 
            ?>
         </ul>
        </div>
        <div id="hidden_inputbox_comment"></div>
        <?php if($wo['story']['post_comments'] > 5 && $wo['story']['limited_comments'] === true) { ?>
        <div class="view-more-wrapper load-more-comments page-margin" onclick="Wo_loadAllComments(<?php echo $wo['story']['id']; ?>);">
          <span>
          <i class="fa fa-arrow-up progress-icon" data-icon="arrow-up"></i> 
          <?php echo $wo['lang']['view_more_comments'];?>
          </span>
        </div>
        <?php } ?>
        <div class="comments-list">
          <span class="comment-container"></span>
          <?php 
            foreach($wo['story']['get_post_comments'] as $wo['comment']) {
              echo Wo_LoadPage('comment/content');
            }
            ?>
        </div>
      </div>
      <?php } ?>
      <?php 
        if (Wo_IsLogged() === true) {
            echo Wo_LoadPage('modals/edit-post');
            echo Wo_LoadPage('modals/delete-post');
        }
        ?>
    </div>
  </div>
</div>
<script type="text/javascript">
$(function () {
  $("#post-<?php echo $wo['story']['id']; ?> .post-description p").readmore({
    speed: 75,
    moreLink: '<a href="#" class="hash"><?php echo $wo["lang"]["read_more"];?></a>',
    lessLink: '<a href="#" class="hash"><?php echo $wo["lang"]["read_less"];?></a>'
  });
  $("#post-<?php echo $wo['story']['id']; ?> .textarea").triggeredAutocomplete({
     hidden: '#hidden_inputbox_comment',
     source: Wo_Ajax_Requests_File() + "?f=mention",
     trigger: "@" 
  });
});
</script>