<?php
$orderby = 'rating'; #sort by ratings
$newsorder = 'ASC' #ascending order
include 'news/index.php';
?>
<?php
$orderby = 'views'; #sort by view count
$newsorder = 'DESC'; #descending order, also default
include 'news/index.php';
?>
$sql = "SELECT title, story, shortstory, author, origauthor, ip, timestamp, allowcomments, short, approved, viewcount, rating, archivedate, neverarchive, archived, id, $newsusers.user, $newsusers.profile_image AS profileimage, $newsaccess.name AS accessname FROM $newstable LEFT JOIN $newsusers ON $newstable.author = $newsusers.uid LEFT JOIN $newsaccess ON $newsusers.access = $newsaccess.uid WHERE approved = '1' $f $u AND archived = '0' ORDER BY $orderby $newsorder LIMIT $start, $amounttoshow";
$sql = "SELECT title, story, shortstory, author, origauthor, ip, timestamp, allowcomments, short, approved, viewcount, rating, archivedate, neverarchive, archived, id, $newsusers.user, $newsusers.profile_image AS profileimage, $newsaccess.name AS accessname FROM $newstable LEFT JOIN $newsusers ON $newstable.author = $newsusers.uid LEFT JOIN $newsaccess ON $newsusers.access = $newsaccess.uid WHERE approved = '1' $f $u AND archived = '0' AND timestamp <= '" . time() . "' ORDER BY $orderby $newsorder LIMIT $start, $amounttoshow";