Интернет-журнал'; include ("inc/nameh.inc"); //nameh($nameh); ################################### $magcontent = 0; if(!empty($id) and empty($magview)) { $id0 = explode(".",$id); //echo "

".$id0[0]."

"; $rubname = rubnamefile($id0[0]); if (!empty($rubname)) { if (!empty($id0[1])) {$view = filedb($id);} if (!empty($id0[1]) and empty($view) and file_exists($patharticle.$id0[0]."/".$id0[1].".txt")) { $nameh .= " >> ".$rubname.""; nameh($nameh); include($patharticle.$id0[0]."/".$id0[1].".txt"); $magview = 1; } // if !view and file_exists //echo "".$patharticle.$id0[0]."/".$id0[1]."txt"; elseif (empty($view)) { $nameh .= " >> ".$rubname.""; nameh($nameh); $magview = rubcontent($id0[0]);} } // if rubname else { $nameh .= " >> ".$rubname.""; nameh($nameh); rubcontent(); $magview = 1;} } // elseif elseif (!empty($view) and empty($magview)) {$magview = magview($view);} else {nameh($nameh); rubcontent();} include ('inc/bottom.inc'); } else {include('magazine.old.phtml');} ############ functions ############# function magview($view) { $return = 0; if (!empty($view)) { global $patharticle; ### проверка view только на цифры $temp = mysql_query("SELECT id, rub FROM magazine WHERE allfile='".$view."' LIMIT 1"); $id = mysql_fetch_row($temp); $id = $id[0]; $mag = article($id,$patharticle); if (!empty($mag) and file_exists($patharticle."all/".$mag[allfile].".txt")) { $mag[text] = ''; global $nameh; $rub = rubname($mag[rub]); $rubname = rubnamefile($rub); $nameh .= " >> ".$rubname.""; nameh($nameh); echo "

".$mag[subject]."

"; /* ************* *********** */ global $nowday, $nowmonth, $mname, $wday; $date = explode("-",$mag[date_b]); global $mname, $wday; $day = $date[2]; $mon = $date[1]; $year = $date[0]; settype($mon, 'integer'); settype($day, 'integer'); settype($year, 'integer'); if (!empty($mag[author])) { echo "

".$mag[author]."".$day." ".$mname[$mon]." ".$year."

"; } else { echo "

Новость от Chicken.Kiev".$day." ".$mname[$mon]." ".$year."

"; } echo "\n".'
'."\n"; include($patharticle."all/".$mag[allfile].".txt"); echo '
'; return 1; } // if mag } // if view ####### просмотр статьи новой БД - конец return $return; } // end function ?>