Файл: RootPanel 1.7.0 FreeCode/RootPanel 1.7.0 FreeCode/news.php
Строк: 50
<?
session_set_cookie_params(86400);
session_start();
$full_home_path = dirname(__FILE__);
require_once($full_home_path."/_rootload.php");
mconnect();
validateUser();
if (!EnableLanguages()) { error("Can not load languages."); mclose(); exit; }
if (!GetCurrentCurrency()) { print $_lang[ErrorGetCurrentCurrency]; mclose(); exit; }
head('utf-8',$_lang[NewsTitle]);
print "<H1 class=pagetitle>".$_lang[NewsTitle]."</H1><hr class=hr>";
$id=@intval($id);
if ($id) {
$r = GetNewsById($id);
if ($r) {
$r->content = preg_replace("/rn/ui", "<BR>", $r->content);
print "<B>".mydate($r->data)."</b><BR><B class="news_title">".$r->title."</B><BR><BR>".htmlDecode($r->content)."<BR><BR><BR>";
print "<A class=rootlink href=news.php>".$_lang[NewsSeeAllNews]."</a>";
} else {
print $_lang[NewsErrorNotFound];
}
} else {
$news = GetNews();
if ($news) {
while ($r = mysql_fetch_object($news)) {
$r->content = preg_replace("/rn/ui", "<BR>", $r->content);
print "<B>".mydate($r->data)."</B><BR><B class="news_title">".$r->title."</B><BR><BR>".htmlDecode($r->content)."<BR><BR><BR>";
}
}
}
foot('utf-8');
mclose();
?>