<?PHP

error_reporting (E_ALL ^ E_NOTICE);

$cutepath =  __FILE__;
$cutepath = preg_replace( "'\\\show_news\.php'", "", $cutepath);
$cutepath = preg_replace( "'/show_news\.php'", "", $cutepath);

require_once("$cutepath/inc/functions.inc.php");
require_once("$cutepath/data/config.php");

// If we are showing RSS, include some need variables.
if($template == 'rss'){
   include("$cutepath/data/rss_config.php");
}

//----------------------------------
// Check if we are included by PATH
//----------------------------------
if($HTTP_SERVER_VARS["HTTP_ACCEPT"] or $HTTP_SERVER_VARS["HTTP_ACCEPT_CHARSET"] or $HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"] or $HTTP_SERVER_VARS["HTTP_CONNECTION"]){ /* do nothing */ }
elseif(eregi("show_news.php", $PHP_SELF)){
die("<h4>A CuteNews úgy érzékelte, hogy a show_news.php fájlt az URL-en keresztül linkeled.<br>
Ez nem működik, próbáld meg így:</h4><br>
ez <font color=red>HELYTELEN</font> :&nbsp;&nbsp; &lt;?PHP include(\"http://oldalad.hu/cutenews/show_news.php\"); ?&gt;<br>
ez <font color=green>HELYES</font>:&nbsp;&nbsp; &lt;?PHP include(\"cutenews/show_news.php\"); ?&gt;<br>
<br><BR>// <font size=2>ha ezt így csinálod, és ez az üzenet mégis megjelenik, akkor töröld ki ezt a részt a show_news.php fájlból</font>");
}
//----------------------------------
// End of the check
//----------------------------------

if(!isset($subaction) or $subaction == ""){ $subaction = $POST["subaction"]; }

if(!isset($template) or $template == "" or strtolower($template) == "default"){ require_once("$cutepath/data/Default.tpl"); }
else{
        if(file_exists("$cutepath/data/${template}.tpl")){ require("$cutepath/data/${template}.tpl"); }
    else{ die("Hiba!<br>A <b>".htmlspecialchars($template)."</b> nevű sablon nem létezik, figyelj a sablonok nevére, mert kis-nagybetűérzékenyek."); }
}

// Prepare requested categories
if(eregi("[a-z]", $category)){
        die("<b>Hiba</b>!<br>A CuteNews úgy érzékelte, hogy a kategóriákat a nevükkel hívod be (\$category = \"".htmlspecialchars($category)."\";), miközben csak az <b>ID</b>-jükkel lehet.<br>
    példa:<br><blockquote>&lt;?PHP<br>\$category = \"1\";<br>include(\"cutenews/show_news.php\");<br>?&gt;</blockquote>");
}
$category = preg_replace("/ /", "", $category);
$tmp_cats_arr = explode(",", $category);
foreach($tmp_cats_arr as $key=>$value){
    if($value != ""){ $requested_cats[$value] = TRUE; }
}

if($archive == ""){
        $news_file = "$cutepath/data/news.txt";
        $comm_file = "$cutepath/data/comments.txt";
}else{
        $news_file = "$cutepath/data/archives/$archive.news.arch";
        $comm_file = "$cutepath/data/archives/$archive.comments.arch";
}

$allow_add_comment                        = FALSE;
$allow_full_story                        = FALSE;
$allow_active_news                         = FALSE;
$allow_comments                         = FALSE;



//<<<------------ Detarime what user want to do
if( $CN_HALT != TRUE and $static != TRUE and ($subaction == "showcomments" or $subaction == "showfull" or $subaction == "addcomment") and ((!isset($category) or $category == "") or ($requested_cats[$ucat] == TRUE )  ) ){
    if($subaction == "addcomment"){  $allow_add_comment        = TRUE; $allow_comments = TRUE; }
    if($subaction == "showcomments"){ $allow_comments = TRUE; }
    if(($subaction == "showcomments" or $allow_comments == TRUE) and $config_show_full_with_comments == "yes"){$allow_full_story = TRUE; }
    if($subaction == "showfull") $allow_full_story = TRUE;
    if($subaction == "showfull" and $config_show_comments_with_full == "yes") $allow_comments = TRUE;

}
else{
    if($config_reverse_active == "yes"){ $reverse = TRUE; }
        $allow_active_news = TRUE;
}
//----------->>> Detarime what user want to do

require("$cutepath/inc/shows.inc.php");
    if($_GET['archive'] and $_GET['archive'] != ''){ $archive = $_GET['archive']; } // stupid fix ?
unset($static, $template, $requested_cats, $category, $catid, $cat,$reverse, $in_use, $archives_arr, $number, $no_prev, $no_next, $i, $showed, $prev, $used_archives);
?>
<!-- News Powered by CuteNews: http://cutephp.com/ -->