query($sql); $row = mysql_fetch_assoc($result); $level = $row["value"]; if ($level) { $sql = "SELECT * FROM Article WHERE status = 'A' AND publication_date <= NOW() AND level = ".$level." ORDER BY RAND() LIMIT ".($middle_max+$right_max).""; $array_articles = db_getFromDBBySQL("article", $sql); } if ($array_articles) { $i=0; $articleindex = array(); if (count($array_articles) < ($middle_max+$right_max)) { $middle_max = floor(count($array_articles)/2); $right_max = floor(count($array_articles)/2); if (count($array_articles) > ($middle_max+$right_max)) { if ((count($array_articles) - ($middle_max+$right_max)) == 1) { $right_max++; } } if ($middle_max == 0) { $middle_max = 1; $right_max = 0; } if ($middle_img > $middle_max) $middle_img = $middle_max; if ($right_img > $right_max) $right_img = $right_max; } foreach ($array_articles as $article) { $imageObj = new Image($article->getNumber("image_id")); if ($imageObj->imageExists()) { if ($middle_index < $middle_img) { $articlesmiddle[$middle_index] = $article; $middle_index++; $articleindex[] = $i; } elseif ($right_index < $right_img) { $articlesright[$right_index] = $article; $right_index++; $articleindex[] = $i; } } $i++; } $i=0; foreach ($array_articles as $article) { if (!in_array($i, $articleindex)) { if ($middle_index < $middle_max) { $articlesmiddle[$middle_index] = $article; $middle_index++; } elseif ($right_index < $right_max) { $articlesright[$right_index] = $article; $right_index++; } } $i++; } } # ---------------------------------------------------------------------------------------------------- # HEADER # ---------------------------------------------------------------------------------------------------- $extrastyle = array(DEFAULT_URL."/layout/article_front.css", DEFAULT_URL."/layout/article_color.css"); $banner_section = "article"; $headertag_title = "About 55 Retirement Community Living Blog"; $headertag_description = "Blog about 55 retirement community living and how to and where to retire. Active Adult commmunities lifestyles"; $headertag_keywords = "about 55 retirement, about 55 blog, articles, how to retire, retirement living, where to live, retire, community, 55 community"; include(EDIRECTORY_ROOT."/layout/header.php"); ?>
retrieveContentByType("Article Home"); if ($content) { echo "
".$content."
"; } ?> getString("friendly_url").".html"; } else { $detailLink = "".DEFAULT_URL."/Article/articledetail.php?id=".$article->getNumber("id"); } ?>
getNumber("image_id")); if ($imageObj->imageExists()) { ?>getTag(true, IMAGE_ARTICLE_FULL_WIDTH, IMAGE_ARTICLE_FULL_HEIGHT, $article->getString("title")); ?>getString("image_attribute")) || ($article->getString("image_caption"))) { echo "".$article->getString("image_attribute"); if (($article->getString("image_attribute")) && ($article->getString("image_caption"))) echo " - "; echo $article->getString("image_caption").""; } } ?>