where('artid', $artid) ->getOne('article_mapping'); if($postid) { header("Location: " . $postid['permalink']); exit; } else { header("Location: ../pages/index.php"); exit; } $article = new Article($artid, $pageid); # create article object if($article) { $slug_title = slugify($article->getArticleTitle()); $art_url = $GLOBAL_HOSTHTTP_URL . '/photo-story/' . $artid . '/' . $slug_title; $page_url = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; if($art_url != $page_url) { header("Location: " . $art_url); exit; } } if ($article->getArtId() == 0 || (!isArticlesAdmin() && $article->isHidden())) { header("HTTP/1.1 301 Moved Permanently"); header ("Location: $ARTICLE_INDEX_URL"); exit; } if (!$article->isObjValid()) { header ("Location: $ARTICLE_INDEX_URL"); header("HTTP/1.1 301 Moved Permanently"); exit; } ## If not Photo Story if($article->getTypeId()!=12) { header ("Location: news.php?artid=$artid"); header("HTTP/1.1 301 Moved Permanently"); exit; } $srid=36; $category = getPath($srid); $section = new Section ($article->getTypeId()); #get tabination from article object $SUB_APP_ID = $section->getSubAppId(); if (!$type) { $type = $article->getTypeId(); } $images = getArticleImages($article->getArtId(), 'image_order'); if (count($images) <= 0) { header ("Location: updatephotostory.php?artid=".$article->getArtId()); exit; } ## Get images if($fileid) { $index = 0; foreach ($images as $image) { if($index == 0){ $image_id = $image->getresized(); $image_description = $image->getdescription(); } if ($image->getfileuniqueid() == $fileid) { $image_id = $image->getresized(); $image_description = $image->getdescription(); } $index ++; } } else{ $image_id = $images[0]->getresized(); $image_description = $images[0]->getdescription(); } ## Get Listing page $listingpage = $article->getTypeId(); $pdo = getPDO(); $sql = "SELECT `typeid` FROM `article_section_rel` WHERE `artid` = :artid ORDER BY `article_section_rel_id` DESC LIMIT 1"; $assoc = array(':artid' => $artid); try { $stmt = $pdo->prepare($sql); $stmt->execute($assoc); if($row = $stmt->fetch(PDO::FETCH_ASSOC)) { $listingpage = $row['typeid']; } } catch(PDOException $ex) { } $listingpage = $GLOBAL_HOSTHTTP_URL."/articles/index.php?type=".$listingpage."#a"; ## Get Author if($article->getUserid() > 0) { $isRealUserName = false; $thisArticleUser = new User($article->getUserid()); if ($article->getAuthor()) { $author_name = $article->getAuthor(); } else { if($thisArticleUser->getFullname()) { $author_name = "Story and Photos by ".$thisArticleUser->getFullname(); } else { $author_name = "Story and Photos by ".$thisArticleUser->getUsername(); } } } ## Update Views if (!$article->isHidden()) { $article->updateViews(); } ## Title and Facebook tag $h1_tag = ""; $title_tag = ""; $meta_description = ""; $fb_app_id = "198306676966429"; $default_img_alt = ""; $default_img_title = $article->getArticleTitle(); $title_tag .= $article->getArticleTitle()." - Photo Story"; $h1_tag = $article->getArticleTitle(); $default_alt_title = $article->getArticleTitle(); $default_img_alt = htmlspecialchars($article->getArticleTitle()); $title_tag .= " - ".$GLOBAL_PORTAL_NAME; $descrip = strip_tags(strip_tags($article->getDescription(), '

'), '

'); $meta_description= $descrip; $nodropdown=true; $new_name= $title_tag; $new_desc= $descrip; ## Canonical URL //$canonical_url = $art_url; if($artid > 4048) { $canonical_url = $art_url; } else { $canonical_url = "http://".$_SERVER['HTTP_HOST'].'/articles/photo-story.php?artid='.urlencode($article->getArtId()); } $WEBPAGE_TITLE = $title_tag; $meta_keywords = ""; ?> isHidden()) { ?>