$activeRepost = $obj->checkRepost($getPosts[$i]['id'], $_SESSION['authenticated']); //============ REPOST SESSION CURRENT if ($activeRepost == 1) { $spanRepost = ' repostedSpan'; $textRepost = $_SESSION['LANG']['reposted']; } else { $spanRepost = null; $textRepost = $_SESSION['LANG']['repost']; } if (isset($_SESSION['authenticated']) && $getPosts[$i]['user'] != $_SESSION['authenticated']) { $repostIcon = '<li><a data-rep="' . $_SESSION['LANG']['repost'] . '" data-rep-active="' . $_SESSION['LANG']['reposted'] . '" class="repost_button repostIcon ' . $spanRepost . '" data="' . $getPosts[$i]['id'] . '" data-token="' . $getPosts[$i]['token_id'] . '"> <span class="fa fa-retweet myicon-right"></span> ' . $textRepost . ' </a></li>'; } $widthPhoto = _Function::getWidth('../../upload/' . $getPosts[$i]['photo']); if ($widthPhoto >= 600) { $thumbPic = 'thumb/600-600-'; } else { $thumbPic = null; } $url_slideshare = preg_replace('#^https?:#', '', rtrim($getPosts[$i]['doc_url'], '/')); //==== PHOTO if ($getPosts[$i]['photo'] != '') { $media = "<a data-view='" . $_SESSION['LANG']['details'] . " →' data-url=" . $urlStatus . " class='galeryAjax cboxElement link-img' href='" . URL_BASE . "upload/" . $getPosts[$i]['photo'] . "'><img class='photoPost img-responsive' src='" . URL_BASE . $thumbPic . "upload/" . $getPosts[$i]['photo'] . "'></a>"; } else { if ($getPosts[$i]['video_site'] == 'vimeo') { $media = '<div class="embed-responsive embed-responsive-4by3"> <iframe class="embed-responsive-item" src="https://player.vimeo.com/video/' . $getPosts[$i]['video_code'] . '" width="450" height="360" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></div>'; } else { if ($getPosts[$i]['video_site'] == 'youtube') { $media = '<div class="embed-responsive embed-responsive-4by3"> <iframe class="embed-responsive-item" height="360" src="https://www.youtube.com/embed/' . $getPosts[$i]['video_code'] . '" allowfullscreen></iframe></div>';
/* DATA VIDEO */ if (isset($_POST['video']) && $_POST['video'] != '' && $isValidYoutube == 1 || isset($_POST['video']) && $_POST['video'] != '' && $isValidVimeoURL == 1) { echo ' ' . $dataVideo; } ?> </p> <?php } ?> <!-- ******* MEDIA ******** --> <?php //Class $mediaGet = $obj->getMedia_2($response); $widthPhoto = _Function::getWidth('../../upload/' . $mediaGet[0]['photo']); if ($widthPhoto >= 600) { $thumbPic = 'thumb/600-600-'; } else { $thumbPic = null; } $url_slideshare = preg_replace('#^https?:#', '', rtrim($mediaGet[0]['doc_url'], '/')); //==== PHOTO if ($mediaGet[0]['photo'] != '') { $media = "<a data-view='" . $_SESSION['LANG']['details'] . " →' data-url=" . $urlStatus . " class='galeryAjax cboxElement link-img' href='" . URL_BASE . "upload/" . $mediaGet[0]['photo'] . "'><img class='photoPost img-responsive' src='" . URL_BASE . $thumbPic . "upload/" . $mediaGet[0]['photo'] . "'></a>"; } else { if ($mediaGet[0]['video_site'] == 'vimeo') { $media = '<div class="embed-responsive embed-responsive-4by3"> <iframe class="embed-responsive-item" src="https://player.vimeo.com/video/' . $mediaGet[0]['video_code'] . '" width="450" height="360" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></div>'; } else { if ($mediaGet[0]['video_site'] == 'youtube') { $media = '<div class="embed-responsive embed-responsive-4by3"> <iframe class="embed-responsive-item" height="360" src="https://www.youtube.com/embed/' . $mediaGet[0]['video_code'] . '" allowfullscreen></iframe></div>';
$activeRepost = $obj->checkRepost($key['id'], $_SESSION['authenticated']); //============ REPOST SESSION CURRENT if ($activeRepost == 1) { $spanRepost = ' repostedSpan'; $textRepost = $_SESSION['LANG']['reposted']; } else { $spanRepost = null; $textRepost = $_SESSION['LANG']['repost']; } /* * ------------------------------------------------- * If the picture is larger than 440 pixels, * show the thumbnail * ------------------------------------------------- */ $widthPhoto = _Function::getWidth('../../upload/' . $key['photo']); if ($widthPhoto >= 600) { $thumbPic = 'thumb/600-600-'; } else { $thumbPic = null; } /* * ------------------------------------- * POST DETAILS / EXPAND / FAVS ETC * ------------------------------------- */ include 'post_details.php'; } //<<<--- Foreach } //<<<---- $countPosts != 0
$bg_old = $path_bg . $infoUser->bg; $defaults = array('0.jpg', '1.jpg', '2.jpg', '3.jpg', '4.jpg', '5.jpg', '6.jpg', '7.jpg', '8.jpg', '9.jpg', '10.jpg', '11.jpg', '12.jpg', '13.jpg', '14.jpg', '15.jpg'); if (isset($session_id)) { $valid_formats = array("jpg", "JPG", "jpeg", "png", "x-png", "gif", "pjpeg"); if (isset($_POST) && $_SERVER['REQUEST_METHOD'] == "POST") { $name = $_FILES['photo']['name']; $size = $_FILES['photo']['size']; if (strlen($name)) { $ext = pathinfo($name); if (in_array($ext['extension'], $valid_formats)) { if ($size < 1500 * 1500) { $photo_post = 'bg_' . strtolower($infoUser->username) . "_" . $session_id . "" . _Function::randomString(5, FALSE, TRUE, FALSE) . "." . strtolower($ext['extension']); $tmp = $_FILES['photo']['tmp_name']; if (move_uploaded_file($tmp, $path . $photo_post)) { //=============== 440 px =================// $width = _Function::getWidth($path . $photo_post); $height = _Function::getHeight($path . $photo_post); $scale = 1; $uploaded = _Function::resizeImage($path . $photo_post, $width, $height, $scale, $path . $photo_post); //<=// PHOTO LARGE =//> $photo_post_id = $photo_post; //==================================================// //= * COPY FOLDER AVATAR / * =// //==================================================// if (file_exists($path . $photo_post) && isset($photo_post_id)) { copy($path . $photo_post, $path_bg . $photo_post); unlink($path . $photo_post); } //<--- IF FILE EXISTS #2 //<<<-- Delete old image -->>>/ if (file_exists($bg_old) && $infoUser->bg != '' && !in_array($infoUser->bg, $defaults)) {
} else { $verified = null; } //============ FAVORITES if ($key['favoriteUser'] == 1) { $classFav = 'favorited'; $spanFav = ' title="' . $_SESSION['LANG']['trash'] . ' ' . $_SESSION['LANG']['favorite'] . '"'; $spanAbsolute = '<span class="add_fav"></span>'; $textFav = $_SESSION['LANG']['favorited']; } else { $classFav = null; $spanFav = null; $spanAbsolute = null; $textFav = $_SESSION['LANG']['favorite']; } $widthPhoto = _Function::getWidth(URL_BASE . 'upload/' . $key['photo']); if ($widthPhoto >= 600) { $thumbPic = 'thumb/600-600-'; } else { $thumbPic = null; } /* Url */ $urlStatus = URL_BASE . $key['username'] . '/status/' . $key['id']; $activeRepost = $obj->checkRepost($key['id'], $_SESSION['authenticated']); //============ REPOST SESSION CURRENT if ($activeRepost == 1) { $spanRepost = ' repostedSpan'; $textRepost = $_SESSION['LANG']['reposted']; } else { $spanRepost = null; $textRepost = $_SESSION['LANG']['repost'];
$size = $_FILES['photo']['size']; if (strlen($name)) { $ext = pathinfo($name); if (in_array($ext['extension'], $valid_formats)) { if ($size < 2250 * 2250) { $randomHash = _Function::randomString(5, FALSE, TRUE, FALSE); $photo_post = 'cover_' . strtolower($infoUser->username) . "_" . $session_id . "" . $randomHash . "." . strtolower($ext['extension']); $photo_large = 'large_cover_' . strtolower($infoUser->username) . "_" . $session_id . "" . $randomHash . "." . strtolower($ext['extension']); $tmp = $_FILES['photo']['tmp_name']; $dimensionsImage = getimagesize($tmp); $widthImage = $dimensionsImage[0]; $heightImage = $dimensionsImage[1]; if ($widthImage >= 400 && $heightImage >= 200) { if (move_uploaded_file($tmp, $path . $photo_large)) { //=============== Image Large =================// $width = _Function::getWidth($path . $photo_large); $height = _Function::getHeight($path . $photo_large); $max_width = '1500'; if ($width < $height) { $max_width = '800'; } if ($width > $max_width) { $scale = $max_width / $width; $uploaded = _Function::resizeImage($path . $photo_large, $width, $height, $scale, $path . $photo_large); } else { $scale = 1; $uploaded = _Function::resizeImage($path . $photo_large, $width, $height, $scale, $path . $photo_large); } _Function::resizeImageFixed($path . $photo_large, 860, 260, $path . $photo_post); //<=// PHOTO LARGE =//> $photo_post_id = $photo_post;