= ".$whichPublishedOn." AND ess_id != ".$whichId." AND ess_status = 'P' "; $queryRel .= "ORDER BY ess_published_on ASC LIMIT 1)"; if ( $mysql_result = mysqli_query($DBLink, $queryRel) ) { while ( $row = mysqli_fetch_assoc($mysql_result) ) { switch ( $row["ess_rel"] ) { case "prev": $metaRelPrev = STP_FULL_URL."articles/".$row["ess_slug"]."/"; $prev_rel = "prev"; $prev_url = $metaRelPrev; $prev_ess_title = $row["ess_title"]; $prev_ess_excerpt = $row["ess_excerpt"]; $prev_ess_published_on = $row["ess_published_on"]; break; case "next": $metaRelNext = STP_FULL_URL."articles/".$row["ess_slug"]."/"; $next_rel = "next"; $next_url = $metaRelNext; $next_ess_title = $row["ess_title"]; $next_ess_excerpt = $row["ess_excerpt"]; $next_ess_published_on = $row["ess_published_on"]; break; } } } } else { $error404 = true; } } if ($error404 == true ) { header($_SERVER["SERVER_PROTOCOL"].' 404 Not Found'); include("err404.php"); exit; } // -- Get 1 image for Twitter card, Pinterest and Facebook... $query = "SELECT * FROM tk_essays "; $query .= "WHERE ess_slug = '".$_GET["ess_slug"]."'"; $mysql_result = mysqli_query($DBLink, $query); if ( $row = mysqli_fetch_assoc($mysql_result) ) { if ( preg_match_all("/\[ESSAY_(MEDIA|PHOTO) ID=\"(.*)\"( COVER)?\]/smU", $row["ess_content"], $matches, PREG_SET_ORDER) ) { $tagFull = $tagType = $tagID = $tagCover = ""; while ( list($foundIdx, $foundTag) = each($matches) ) { list($tagFull, $tagType, $tagID) = $foundTag; if ( isset($foundTag[3]) ) { switch ($tagType) { case "MEDIA": $query = "SELECT * FROM tk_media WHERE media_id = '".$tagID."'"; $mysql_result = mysqli_query($DBLink, $query); if ( $row = mysqli_fetch_assoc($mysql_result) ) { // -- FB meta tags... $metaFile = STP_URL_CACHE_ESSAYS.preg_replace ("/.(jpe?g|png)/i", "_w_".STP_SOCIAL_IMG_SIZE.".$1", $row["media_filename"]); $metaOGImage = "\n"; $metaOGImageWidth = "\n"; $metaOGImageHeight = "\n"; $metaPublishedOn = $whichPublishedOn; $metaModifiedOn = $whichModifiedOn; // -- Twitter meta tags... $metaTwitterImage = "\n"; // -- Pinterest image path... $metaFile = STP_URL_CACHE_ESSAYS.preg_replace ("/.(jpe?g|png)/i", "_w_800.$1", $row["media_filename"]); $widthPinterestImage = 800; $heightPinterestImage = round(800/$row["media_aspect_ratio"]); $pathPinterestImage .= $metaFile; $schemaImg = $metaFile; $schemaImgWidth = $widthPinterestImage; $schemaImgHeight = $heightPinterestImage; } break; case "PHOTO": $query = "SELECT * FROM tk_photo"; $query .= " WHERE photo_id = '".$tagID."'"; $mysql_result = mysqli_query($DBLink, $query); if ( $row = mysqli_fetch_assoc($mysql_result) ) { // -- FB meta tags... $metaFile = STP_URL_CACHE_PHOTOS.preg_replace ("/.(jpe?g|png)/i", "_w_".STP_SOCIAL_IMG_SIZE.".$1", $row["photo_filename"]); $metaOGImage = "\n"; $metaOGImageWidth = "\n"; $metaOGImageHeight = "\n"; $metaPublishedOn = $whichPublishedOn; $metaModifiedOn = $whichModifiedOn; // -- Twitter meta tags... $metaTwitterImage = "\n"; // -- Pinterest image path... $metaFile = STP_URL_CACHE_PHOTOS.preg_replace ("/.(jpe?g|png)/i", "_w_800.$1", $row["photo_filename"]); $widthPinterestImage = 800; $heightPinterestImage = round(800/$row["photo_aspect_ratio"]); $pathPinterestImage = $metaFile; $schemaImg = $metaFile; $schemaImgWidth = $widthPinterestImage; $schemaImgHeight = $heightPinterestImage; } break; } } } } } // -- Fancy logo... fancyLogo(); ?> " /> " />

Un article ...