die('Error:' . $db->error()); } $headline = array(); while ($headline[] = $db->fetcharray()) { } $db->freeresult(); // get the dateline of the headline news.. $day = $headline[0]->published_day; $month = $headline[0]->published_month; $year = $headline[0]->published_year; $articleID = $headline[0]->articleID; $fullstory = '<p><a href="view_article.php?articleID=' . $articleID . '" >FULLSTORY >></a></p>'; /** * Get the set of images of the article...( its better to have 1 image per article,, ok na!!) */ $imagesets = getArticle_imageSets($headline[0]->articleID); if (count($imagesets) > 1) { $photo = ''; $photo .= '<div id="column2">'; for ($i = 0; $i < count($imagesets) - 1; $i++) { foreach ($imagesets as $field => $value) { if ($field == 'article_imgID') { $photo .= '<img src="' . makeRelativePath($imagesets[$i]->image_filename, 7) . '" alt="" width="199" height="240">'; $photo .= '<p class="photocaption2">' . $imagesets[$i]->image_captions . '</p>'; $photo .= '<p class="photocaption2">Photo by: ' . $imagesets[$i]->image_photographer_author . '</p>'; } } } $photo .= '</div>'; } else { $photo = '';
for ($i = 0; $i < $totalcategories; $i++) { foreach ($categories as $field => $values) { if ($field == 'categoryID') { $categoryID = $categories[$i]->categoryID; } } $article_category = getLiveArticleOnCategory($categoryID, $day, $month, $year, ''); $n = count($article_category) - 1; //print "$categoryID=$n,"; if ($n > 0) { $subsections .= '<div id="subsections"><h1 class="captions">' . $categories[$i]->category_name . '</h1>'; $subsections .= '<ul id="subsection">'; for ($j = 0; $j < $n; $j++) { foreach ($article_category as $field => $values) { if ($field == 'articleID') { $img = getArticle_imageSets($article_category[$j]->articleID); if ($j == 0) { if (count($img) - 1 > 0) { // if image found, make it a thumbnail $subsections .= '<li>'; $subsections .= '<img alt="' . $img[0]->image_alttext . '" src="' . makeRelativePath($img[0]->image_filename, 7) . '" width="59" height="75" class="imageleft">'; //$subsections .= '<a href="' . VIEW_ARTICLE_URL2 . $article_category[$j]->articleID . '">' . strip_tags($article_category[$j]->title) . '</a>'; $subsections .= '<b />' . strip_tags($article_category[$j]->title); $subsections .= '<a href="' . VIEW_ARTICLE_URL2 . $article_category[$j]->articleID . '">'; //$subsections .= '<p class="graytext">'. makeAShortIntro( strip_tags($article_category[$j]->article_body ) ) . '</p>'; $subsections .= '<p class="graytext">' . makeAShortIntro(strip_tags($article_category[$j]->article_body)) . '</p>'; $subsections .= '</a>'; $subsections .= '</li>'; } else { $subsections .= '<li>'; $subsections .= '<b />' . strip_tags($article_category[$j]->title);
$categories = array(); while ($categories[] = $db->fetcharray()) { } $totalcategories = count($categories); $categorylist = ''; for ($i = 0; $i < $totalcategories - 1; $i++) { foreach ($categories as $field => $value) { if ($field == 'category_name') { $categorylist .= '<li><a href="' . VIEW_CATEGORY_URL . $categories[$i]->categoryID . '">' . $categories[$i]->category_name . '</a></li>'; } } } /** * Get the set of images of the article...( its better to have 1 image per article,, ok na!!) */ $imagesets = getArticle_imageSets($view_article[0]->articleID); if (count($imagesets) > 1) { $photo = ''; $photo .= '<div id="column2">'; for ($i = 0; $i < count($imagesets) - 1; $i++) { foreach ($imagesets as $field => $value) { if ($field == 'article_imgID') { //$photo .= '<div class="thumbnail">'; $photo .= '<img src="' . makeRelativePath($imagesets[$i]->image_filename, 7) . '" alt="" width="199" height="240" >'; $photo .= '<p class="photocaption2">' . $imagesets[$i]->image_captions . '</p>'; $photo .= '<p class="photocaption2">Photo by: ' . $imagesets[$i]->image_photographer_author . '</p>'; //$photo .= '</div>'; } } } $photo .= '</div>';