/*==================================================================*\ ###################################################################### # eDirectory 4.0.1 - Licence Number L62338e2 # # ------------------------------------------------------------------ # # Copyright 2005 Arca Solutions, Inc. All Rights Reserved. # # # # This file may not be redistributed in whole or part. # # # # ---------------- eDirectory IS NOT FREE SOFTWARE ----------------- # # # # http://www.edirectory.com | http://www.edirectory.com/license.html # ###################################################################### \*==================================================================*/ # ---------------------------------------------------------------------------------------------------- # * FILE: /conf/preconfig.inc.php # ---------------------------------------------------------------------------------------------------- error_reporting(E_ALL ^ E_NOTICE); # ---------------------------------------------------------------------------------------------------- # SUPPORT HTACCESS # ---------------------------------------------------------------------------------------------------- define(SUPPORT_HTACCESS, true); # ---------------------------------------------------------------------------------------------------- # INCLUDE GENERAL CONFIG # ---------------------------------------------------------------------------------------------------- include("config.inc.php"); ?> /*==================================================================*\ ###################################################################### # eDirectory 4.0.1 - Licence Number L62338e2 # # ------------------------------------------------------------------ # # Copyright 2005 Arca Solutions, Inc. All Rights Reserved. # # # # This file may not be redistributed in whole or part. # # # # ---------------- eDirectory IS NOT FREE SOFTWARE ----------------- # # # # http://www.edirectory.com | http://www.edirectory.com/license.html # ###################################################################### \*==================================================================*/ # ---------------------------------------------------------------------------------------------------- # * FILE: /articles.php # ---------------------------------------------------------------------------------------------------- # ---------------------------------------------------------------------------------------------------- # LOAD CONFIG # ---------------------------------------------------------------------------------------------------- include("./conf/loadconfig.inc.php"); # ---------------------------------------------------------------------------------------------------- # VALIDATE FEATURE # ---------------------------------------------------------------------------------------------------- if (ARTICLE_FEATURE != "on") { exit; } # ---------------------------------------------------------------------------------------------------- # CODE # ---------------------------------------------------------------------------------------------------- //$*_index = 0; // current * article index //$*_img = 0; // number of * article with image //$*_max = 3; // max * article $middle_index = 0; $right_index = 0; $middle_img = 1; $right_img = 2; $middlemax = $middle_max = 4; $rightmax = $right_max = 4; $sql = "SELECT value FROM ArticleLevel WHERE detail = 'y' ORDER BY value DESC LIMIT 1"; $dbObj = db_getDBObject(); $result = $dbObj->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"; include(EDIRECTORY_ROOT."/layout/header.php"); ?>
include("articlesearch.php"); ?> include("articlecategories.php"); ?>if(GOOGLE_ADS_ENABLED == "on") { echo "
"; include(INCLUDES_DIR."/code/google_ads.php"); echo " "; } ?>
$contentObj = new Content(); $content = $contentObj->retrieveContentByType("Article Home"); if ($content) { echo "".$content.""; } ?> if ($articlesmiddle) { $i=0; foreach ($articlesmiddle as $article) { ?> if ($i == 0) { ?>$imageObj = new Image($article->getNumber("image_id")); if ($imageObj->imageExists()) { ?>" class="mainImage"> echo $imageObj->getTag(true, IMAGE_ARTICLE_FULL_WIDTH, IMAGE_ARTICLE_FULL_HEIGHT, $article->getString("title")); ?> if (($article->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").""; } } ?>} else { ?>">=$article->getString("title")?> if ($article->getString("author")) echo "by ".$article->getString("author").""; ?>
=$article->getString("abstract")?> ">read more
} ?> $i++; } } ?>">=$article->getString("title")?> if ($article->getString("author")) echo "by ".$article->getString("author").""; ?>
=$article->getString("abstract")?> ">read more
if ($articlesright) { $i=0; foreach ($articlesright as $article) { ?> if ($i == 0) { ?>$imageObj = new Image($article->getNumber("image_id")); if ($imageObj->imageExists()) { ?>"> echo $imageObj->getTag(true, IMAGE_FEATURED_ARTICLE_WIDTH, IMAGE_FEATURED_ARTICLE_HEIGHT, $article->getString("title")); ?> } ?>} else { ?>">=$article->getString("title")?> if ($article->getString("author")) echo "by ".$article->getString("author").""; ?>
=substr($article->getString("abstract"), 0, 200)."..."?> ">read more
if ($i < $right_img) { ?> $imageObj = new Image($article->getNumber("image_id")); if ($imageObj->imageExists()) { ?>"> echo $imageObj->getTag(true, IMAGE_FEATURED_ARTICLE_WIDTH, IMAGE_FEATURED_ARTICLE_HEIGHT, $article->getString("title")); ?> } ?> } ?>} ?> $i++; } } ?>">=$article->getString("title")?> if ($article->getString("author")) echo "by ".$article->getString("author").""; ?>
=substr($article->getString("abstract"), 0, 200)."..."?> ">read more
if (BANNER_FEATURE == "on") { ?> $banner_section = "article"; $banner = system_showBanner("FEATURED", $category_id, $banner_section, $amount = 2); if ($banner) { ?>} ?> } ?> if (BANNER_FEATURE == "on") { ?> $banner_section = "article"; $banner = system_showBanner("TEXT_AD", $category_id, $banner_section, $amount = 1); if ($banner) { ?> } ?> } ?>Advertisers
=$banner?>