=".time().")"; } else { $listexp = ""; } function listnews($var){ global $rows, $locale, $db_prefix, $rowstart, $listexp, $numofnews, $year, $month, $day, $PHP_SELF; if ($rows !=0) { echo "
"; echo ""; echo ""; for ($i=$rowstart;$var[$i];$i++) { $result2 = dbquery( "SELECT tn.*, tu.user_id,user_name FROM ".DB_PREFIX."news tn LEFT JOIN ".DB_PREFIX."users tu ON tn.news_name=tu.user_id WHERE news_id=$var[$i] AND (news_start='0'||news_start<=".time().") $listexp GROUP BY news_id ORDER BY news_datestamp ASC" ); $data = dbarray($result2); echo ""; if ($i == $rowstart + ($numofnews - 1)) { break; } } echo "
".$locale['NA_011']."".$locale['NA_012']." ".$locale['NA_013']."".$locale['NA_002']."
".$data['news_subject']." ".$data['user_name']." ".date('d.m.Y', $data[news_datestamp])." ".$data['news_reads']."
"; } else { echo "

".$locale['NA_014']."

\n"; } } opentable($locale['NA_001']); $splityears = array(); $result = dbquery("SELECT * FROM ".DB_PREFIX."news ORDER BY news_datestamp ASC"); if (dbrows($result)!=0) { while ($date = dbarray($result)){ $allyears = date('Y', $date[news_datestamp]); array_push($splityears, $allyears); } $yearsnum = array_count_values($splityears); $years = array_unique($splityears); $years = array_merge($years); echo ". ".$locale['NA_005']."
"; echo ". ".$locale['NA_006']."
"; echo ". ".$locale['NA_008']."
"; echo "
"; for ($i=0;$years[$i];$i++) { echo ". $years[$i] (".$yearsnum[$years[$i]].")
"; } closetable(); if ($listtype == "last") { tablebreak(); opentable($locale['NA_010']); $newslastweek = array(); $result = dbquery("SELECT * FROM ".DB_PREFIX."news ORDER BY news_datestamp $newsorder"); if (!$rowstart) $rowstart = 0; if (!$pre) $pre = 7; $weektime = mktime(0, 0, 0, date("m") , date("d")-$pre, date("Y")); while ($date = dbarray($result)){ $newstime = $date[news_datestamp]; if ($newstime >= $weektime){ $newsid = $date[news_id]; array_push($newslastweek, $newsid); } } $rows = count($newslastweek); listnews($newslastweek); echo "
\n".makePageNav($rowstart,$numofnews,$rows,3,"$PHP_SELF?listtype=last&pre=$pre&")."\n
\n"; closetable(); } elseif (isset($year)) { tablebreak(); opentable($year); $splitmonths = array(); $result = dbquery("SELECT * FROM ".DB_PREFIX."news ORDER BY news_datestamp ASC"); while ($date = dbarray($result)){ $allyears = date('Y', $date[news_datestamp]); if ($allyears == $year){ $allmonths = date('F', $date[news_datestamp]); array_push($splitmonths, $allmonths); } } $monthsnum = array_count_values($splitmonths); $months = array_unique($splitmonths); $months = array_merge($months); $rows = count($months); if ($rows !=0) { for ($i=0;$months[$i];$i++) { echo ". $months[$i] (".$monthsnum[$months[$i]].") - (".$locale['NA_004'].")
"; } } else { echo "

".$locale['NA_015']."

\n"; } closetable(); if ($listtype == "bymonth") { tablebreak(); opentable($month); $newsbymonth = array(); $result = dbquery("SELECT * FROM ".DB_PREFIX."news ORDER BY news_datestamp $newsorder"); if (!$rowstart) $rowstart = 0; while ($date = dbarray($result)){ $allyears = date('Y', $date[news_datestamp]); $allmonths = date('F', $date[news_datestamp]); if ($allmonths == $month && $allyears == $year){ $newsid = $date[news_id]; array_push($newsbymonth, $newsid); } } $rows = count($newsbymonth); listnews($newsbymonth); echo "
\n".makePageNav($rowstart,$numofnews,$rows,3,"$PHP_SELF?listtype=bymonth&year=$year&month=$month&")."\n
\n"; closetable(); } elseif (isset($month)) { tablebreak(); opentable($month); $splitdays = array(); $result = dbquery("SELECT * FROM ".DB_PREFIX."news ORDER BY news_datestamp ASC"); while ($date = dbarray($result)){ $allyears = date('Y', $date[news_datestamp]); $allmonths = date('F', $date[news_datestamp]); if ($allmonths == $month && $allyears == $year){ $alldays = date('d', $date[news_datestamp]); array_push($splitdays, $alldays); } } $daysnum = array_count_values($splitdays); $days = array_unique($splitdays); $days = array_merge($days); $rows = count($days); if ($rows !=0) { for ($i=0;$days[$i];$i++) { if ( $days[$i] == 1 or $days[$i] == 21 or $days[$i] == 31) { $sub = "st"; } elseif ( $days[$i] == 2 or $days[$i] == 22) { $sub = "nd"; } elseif ( $days[$i] == 3 or $days[$i] == 23) { $sub = "rd"; } else { $sub = "th"; } echo ". $days[$i]$sub (".$daysnum[$days[$i]].")
"; } } else { echo "

".$locale['NA_009']."

\n"; } closetable(); } if (isset($day)) { tablebreak(); opentable($day); $news = array(); $result = dbquery("SELECT * FROM ".DB_PREFIX."news ORDER BY news_datestamp $newsorder"); if (!$rowstart) $rowstart = 0; while ($date = dbarray($result)){ $allyears = date('Y', $date[news_datestamp]); $allmonths = date('F', $date[news_datestamp]); $alldays = date('d', $date[news_datestamp]); if ($alldays == $day && $allmonths == $month && $allyears == $year){ $newsid = $date[news_id]; array_push($news, $newsid); } } $rows = count($news); listnews($news); echo "
\n".makePageNav($rowstart,$numofnews,$rows,3,"$PHP_SELF?listtype=bymonth&year=$year&month=$month&day=$day&")."\n
\n"; closetable(); } } } else { echo "

".$locale['NA_003']."

\n"; closetable(); } include BASEDIR."side_right.php"; include BASEDIR."footer.php"; ?>