SetMetaData(GetMetaData($db, $lang, 1, $content->id)); // // Replace template - if needed if (!empty($content->template) && !$printMode) $template->LoadTemplate($content->template); // // Show the content regardless of it's actual type/content $template->OnContent($content->DisplayHTML($printMode)); if (!$printMode && check_right(USER_PUBLISHER)) { //echo '
'; $template->OnContent(" "); if(!$content->archived) $template->OnContent(""); $template->OnContent('
id}\" class=\"textbutton\">##Edit## ##NewContent##id}\" class=\"textbutton\">##ToArchive##
'); } } else { $template->SetMetaData(GetMetaData($db, $lang, 1, 0)); // Dummy entry to load default meta config $template->OnContent('##ContentNotFound##'); if (!$printMode && check_right(USER_PUBLISHER)) { //echo '
'; $template->OnContent("
##NewContent##
"); } } } elseif (!$printMode && isset($_REQUEST['oldal']) && !empty($_REQUEST['oldal'])) { $oldal = preg_replace('|[^_A-Za-z0-9]|','',$_REQUEST['oldal']); $template->SetMetaData(GetMetaData($db, $lang, 2, $oldal)); if (!empty($oldal) && is_file("_pages/{$oldal}.php")) { $template->StartContentCapture(); include("_pages/{$oldal}.php"); $template->StopContentCapture(); } else { $template->OnContent('##ContentNotFound##'); } } elseif(!$printMode && isset($_REQUEST['cat'])) { $template->SetMetaData(GetMetaData($db, $lang, 3, $_REQUEST['cat'])); // // Show the real category or the archived items? $cat = explode('_', strtoupper($_REQUEST['cat'])); if (isset($cat[1])) { $requestedNodes = getChildCategories($db, $cat[0]); $where_clause = '(c.ID IN (' . implode(',', $requestedNodes) . ')) AND (reg.FValidUntil IS NOT NULL) AND (reg.FValidUntil <= now())'; $title_text = ' (##Archived##)'; } else { $requestedNodes = getChildCategories($db, $cat[0]); $where_clause = '(c.ID IN (' . implode(',', $requestedNodes) . ')) AND (reg.FDate <= now()) AND ((reg.FValidUntil IS NULL) OR (reg.FValidUntil >= now()))'; $title_text = ''; } unset($cat,$requestedNodes); // // Run the query $rs = $db->Query(" SELECT reg.*, UNIX_TIMESTAMP(reg.FDate) AS StartFMT, COALESCE(am.FIntro, a.FIntro) AS Intro, COALESCE(am.FText, a.FText) AS Text, COALESCE(am.FCaption, reg.FCaption) AS Caption, a.FShowInHeadline, c.FShowDate, c.FCode AS CategoryAlias, c.ID AS CatID FROM ###content_registry reg JOIN ###articles a ON reg.ID = a.ID JOIN ###categories c ON a.TCategories_ID = c.ID LEFT OUTER JOIN ###articles_multilingual am JOIN ###lang_languages l ON (l.FCode = '{$lang->CurrentLanguage}') AND (l.ID = am.LanguageID) ON (am.ArticleID = a.ID) WHERE {$where_clause} ORDER BY reg.FValidUntil DESC, Caption ASC "); echo $db->GetLastError(); // // Show results... if(($row = $rs->Fetch()) !== FALSE) { $template->OnContent("

##ArticleCategory::{$row['CatID']}##{$title_text}

\n"); do { $intro = !empty($row['Intro'])?nl2br($row['Intro']):''; if (preg_match('~]+)/?\s*>~', $row['Text'], $found)) { if (preg_match('~src=(?:\'([^\']+)\'|"([^"]+)"|([^\s]+))~', $found[1], $found2)) { $template->OnContent(sprintf('', image_resize_cache(trim(urldecode(implode('',array_slice($found2, 1))),'/'), 200, 75, true))); } } $print = '

'.($row['FShowDate']?'%1$s | ':'') . (strip_tags($row['Text'])==''?'%2$s

':'%2$s').'

%3$s

 

'; $template->OnContent(sprintf( $print, format_date($row['StartFMT']), $row['Caption'], $intro, make_content_url($row) )); } while (($row = $rs->Fetch()) !== FALSE); } else { $template->OnContent("

Ebben a kategóriában nincsen megjeleníthető tartalom

\n"); } $template->OnContent("
\n"); } else header('Location: /'); } else echo 'Nincs kapcsolat az adatbazissal!'; $template->RenderTemplate(); $memory_usage = function_exists('memory_get_usage')?' and by consuming ' . round(memory_get_usage()/1024,1) . ' kilobytes of memory':''; echo ""; if (!$printMode && isset($_SESSION['DEBUG_SQL'])&&($_SESSION['DEBUG_SQL']===true)) { echo '
'; $db->ShowLog(); echo '
'; } ?>