Get("News_View"); if(!is_numeric($NewsView)) { $NewsView = $News_AllValue; } $News_SortField = $objConfig->Get('News_SortField'); if( !strlen($News_SortField) ) $News_SortField = 'Priority'; $News_SortOrder = $objConfig->Get('News_SortOrder'); if( !strlen($News_SortOrder) ) $News_SortOrder = 'desc'; $Perpage_News = (int)$objConfig->Get("Perpage_News"); if(!$Perpage_News) $Perpage_News="'all'"; if($NewsView == $News_AllValue) { $News_ShowAll = 1; } else $News_ShowAll = 0; if($News_ShowAll) { $News_Filter = ""; $News_View=127; } else { $Status = array(); $Mod = array(); if($NewsView & $Bit_Pending) $Status[] = STATUS_PENDING; if($NewsView & $Bit_Active) $Status[] = STATUS_ACTIVE; if($NewsView & $Bit_Disabled) $Status[] = STATUS_DISABLED; if(count($Status)) { $NewsFilter .= " AND (Status IN (".implode(",",$Status).") "; } else $NewsFilter .= " AND ((Status=-1) "; if($NewsView & $Bit_Ed) { $NewsFilter .= " OR (EditorsPick=1) "; } if($NewsView & $Bit_New) { $cutoff = adodb_date("U") - ($objConfig->Get("News_NewDays") * 86400); $NewsFilter .= " OR (CreatedOn > ".$cutoff.") OR (NewItem=1) "; } if($NewsView & $Bit_Pop) { $cutoff = GetPopValue(); if($cutoff>0) $NewsFilter .= " OR (CachedRating >= ".$cutoff.") "; $NewsFilter .= "OR (PopItem=1) "; } if($NewsView & $Bit_Hot) { $cutoff = GetNewsHotValue(); if($cutoff>0) $NewsFilter .= " OR (Hits >= ".$cutoff.") "; $NewsFilter .= "OR (HotItem=1) "; } if($NewsView & $Bit_Archived) $NewsFilter .= " OR (Archived=1) "; if($NewsView & $Bit_LeadCat) $NewsFilter .= " OR (LeadCatStory=1)"; if($NewsView & $Bit_FrontLead) $NewsFilter .= " OR (LeadStory=1)"; $NewsFilter .= ")"; } $list = $objSession->GetVariable("SearchWord"); $NewsSearch = (strlen($list)>0 && $SearchType =="News" || $SearchType=="all") || (strlen($list)==0); $objArticleList->Clear(); if($NewsSearch) { if(strlen($list)==0) { $objArticleList->LoadArticles("CategoryId=".$objCatList->CurrentCategoryID().$NewsFilter,$objConfig->Get("News_SortField")." ".$objConfig->Get("News_SortOrder")); } else { $SearchQuery = $objArticleList->AdminSearchWhereClause($list); if(strlen($SearchQuery)) { $SearchQuery = " (".$SearchQuery.")"; if(strlen($CatScopeClause)) $SearchQuery .= " AND ".$CatScopeClause; $objArticleList->LoadArticles($SearchQuery.$NewsFilter,$objConfig->Get("News_SortField")." ".$objConfig->Get("News_SortOrder")); } else $objArticleList->LoadArticles("CategoryId=".$objCatList->CurrentCategoryID().$NewsFilter,$objConfig->Get("News_SortField")." ".$objConfig->Get("News_SortOrder")); } if(strlen($NewsFilter)>0) { $CatTotal = TableCount($objArticleList->SourceTable," CategoryId=".$objCatList->CurrentCategoryID(),TRUE); } else $CatTotal = $objArticleList->QueryItemCount; $caption = language("la_ItemTab_News"); $ItemTabs->AddTab(language("la_ItemTab_News"),"news",$objArticleList->QueryItemCount, $m_tab_News_hide,$CatTotal); $TotalItemCount += $objLinkList->QueryItemCount; $lang_Leading = language("la_Text_Leading"); $lang_Archived = language("la_Text_Archived"); $lang_Title = language("la_Prompt_Title"); $lang_Excerpt = language("la_prompt_ArticleExcerpt"); $lang_Author = language("la_prompt_Author"); $lang_Body = language("la_prompt_ArticleBody"); $lang_StartDate = language("la_prompt_StartDate"); $lang_ArchiveDate = language("la_prompt_ArchiveDate"); $lang_Catlead = language("la_prompt_LeadCat"); $lang_FrontLead = language("la_prompt_FrontLead"); $lang_Articles = language("la_Text_Articles"); } print << var News_SortField = '$News_SortField'; var News_SortOrder = '$News_SortOrder'; var News_Perpage = $Perpage_News; var NewsView = $NewsView; var NewsTitle = '$caption'; //News Related language vars var lang_Leading = '$lang_Leading'; var lang_Archived = '$lang_Archived'; var lang_Title = '$lang_Title'; var lang_Author = '$lang_Author'; var lang_Body = '$lang_Body'; var lang_Excerpt = '$lang_Excerpt'; var lang_StartDate = '$lang_StartDate'; var lang_ArchiveDate = '$lang_ArchiveDate'; var lang_CatLead = "$lang_Catlead"; var lang_FrontLead = "$lang_FrontLead"; var lang_Articles = "$lang_Articles"; var News_Paste = false; function News_SortMenu() { sub_menu_sorting_sub = new Menu(NewsTitle); sub_menu_sorting_sub.addMenuItem(lang_Asc,"config_val('News_SortOrder','asc');",RadioIsSelected(News_SortOrder,'asc')); sub_menu_sorting_sub.addMenuItem(lang_Desc,"config_val('News_SortOrder','desc');",RadioIsSelected(News_SortOrder,'desc')); sub_menu_sorting_sub.addMenuSeparator(); sub_menu_sorting_sub.addMenuItem(lang_Default,"config_val('News_SortField','Title');",""); sub_menu_sorting_sub.addMenuItem(lang_Title,"config_val('News_SortField','Title');",RadioIsSelected(News_SortField,'Title')); sub_menu_sorting_sub.addMenuItem(lang_Author,"config_val('News_SortField','Author');",RadioIsSelected(News_SortField,'Author')); sub_menu_sorting_sub.addMenuItem(lang_Body,"config_val('News_SortField','Body');",RadioIsSelected(News_SortField,'Body')); sub_menu_sorting_sub.addMenuItem(lang_Excerpt,"config_val('News_SortField','Excerpt');",RadioIsSelected(News_SortField,'Excerpt')); sub_menu_sorting_sub.addMenuItem(lang_CreatedOn,"config_val('News_SortField','CreatedOn');",RadioIsSelected(News_SortField,'CreatedOn')); sub_menu_sorting_sub.addMenuItem(lang_StartDate,"config_val('News_SortField','StartDate');",RadioIsSelected(News_SortField,'StartDate')); sub_menu_sorting_sub.addMenuItem(lang_ArchiveDate,"config_val('News_SortField','EndOn');",RadioIsSelected(News_SortField,'EndOn')); sub_menu_sorting_sub.addMenuItem(lang_Rating,"config_val('News_SortField','CachedRating');",RadioIsSelected(News_SortField,'CachedRating')); sub_menu_sorting_sub.addMenuItem(lang_Votes,"config_val('News_SortField','CachedVotesQty');",RadioIsSelected(News_SortField,'CachedVotesQty')); sub_menu_sorting_sub.addMenuItem(lang_Views,"config_val('News_SortField','CachedHits');",RadioIsSelected(News_SortField,'CachedHits')); return sub_menu_sorting_sub; } function News_FilterMenu() { menu_filter = new Menu(NewsTitle); menu_filter.addMenuItem(lang_All,"config_val('News_View', $News_AllValue);",NewsView==$News_AllValue); menu_filter.addMenuItem(lang_None,"config_val('News_View', 0);",NewsView==0); menu_filter.addMenuSeparator(); menu_filter.addMenuItem(lang_Active,"FlipBit('News_View',NewsView,6);",BitStatus(NewsView,6)); menu_filter.addMenuItem(lang_Pending,"FlipBit('News_View',NewsView,5);", BitStatus(NewsView,5)); menu_filter.addMenuItem(lang_Disabled,"FlipBit('News_View',NewsView,4);",BitStatus(NewsView,4)); menu_filter.addMenuSeparator(); menu_filter.addMenuItem(lang_New,"FlipBit('News_View',NewsView,3);",BitStatus(NewsView,3)); menu_filter.addMenuItem(lang_Pop,"FlipBit('News_View',NewsView,1);",BitStatus(NewsView,1)); menu_filter.addMenuItem(lang_Hot,"FlipBit('News_View',NewsView,2);",BitStatus(NewsView,2)); menu_filter.addMenuItem(lang_EdPick,"FlipBit('News_View',NewsView,0);",BitStatus(NewsView,0)); menu_filter.addMenuItem(lang_CatLead,"FlipBit('News_View',NewsView,8);",BitStatus(NewsView,8)); menu_filter.addMenuItem(lang_FrontLead,"FlipBit('News_View',NewsView,9);",BitStatus(NewsView,9)); menu_filter.addMenuItem(lang_Archived,"FlipBit('News_View',NewsView,7);",BitStatus(NewsView,7)); //menu_filter.addMenuSeparator(); //menu_filter.addMenuItem(lang_Archived,"FlipBit('News_View',NewsView,7);",BitStatus(NewsView,7)); return menu_filter; } function News_SelectMenu() { menu_select = new Menu(NewsTitle); menu_select.addMenuItem(lang_All,"javascript:selectAll('"+activeTab.id+"');",""); menu_select.addMenuItem(lang_Unselect,"javascript:unselectAll('"+activeTab.id+"');",""); menu_select.addMenuItem(lang_Invert,"javascript:invert('"+activeTab.id+"');",""); return menu_select; } function News_PerPageMenu() { caption = lang_Articles +" "+lang_PerPage; menu_results = new Menu(caption); menu_results.addMenuItem("10","config_val('Perpage_News', '10');",RadioIsSelected(News_Perpage,10)); menu_results.addMenuItem("20","config_val('Perpage_News', '20');",RadioIsSelected(News_Perpage,20)); menu_results.addMenuItem("50","config_val('Perpage_News', '50');",RadioIsSelected(News_Perpage,50)); menu_results.addMenuItem("100","config_val('Perpage_News', '100');",RadioIsSelected(News_Perpage,100)); menu_results.addMenuItem("500","config_val('Perpage_News', '500');",RadioIsSelected(News_Perpage,500)); return menu_results; } END; ?>