page_title) != "") print("\t
" . stripslashes($pageObj->page_title) . "
\n\n"); print("
" . stripslashes($pageObj->page_text) . "
\n\n"); // PRINT LATEST 6 STORIES APPROVED if ($_GET['page_id'] == 1) { $limit = 6; $latestQuery = "SELECT DISTINCT a.*, b.photo AS authImg "; $latestQuery.= "FROM sl35_articles a, sl35_editors b "; $latestQuery.= "WHERE a.written_by=b.id "; $latestQuery.= "AND a.active='Yes' "; $latestQuery.= "AND a.approved='Yes' "; $latestQuery.= "ORDER BY a.date_approved DESC "; $latestQuery.= "LIMIT $limit "; $latestResult = mysql_query($latestQuery, $dbLink); if (mysql_num_rows($latestResult) > 0) { print("\t
Latest News
\n"); $startPos = 1; while($artObj = mysql_fetch_object($latestResult)) { ($startPos == 0) ? $startPos = 1: $startPos = 0; $articles .= story_grab($artObj, $startPos); $articles .= "\t
\n\n"; } print($articles); } } // DATE EDITOR FEED FOR PAGE #8 Dates to Remember /* CREATE TABLE sl35_dates ( id int(10) unsigned auto_increment, written_by int(10) unsigned, title varchar(200), event_date int(11) unsigned, active enum('Yes','No') NOT NULL DEFAULT 'Yes', KEY id (id) ) TYPE=MyISAM ; */ if ($_GET['page_id'] == 8) { $dateQuery = "SELECT * FROM sl35_dates WHERE event_date>=" . mktime(0,0,0,date('n'),date('j')-1,date('Y')) . " AND active='Yes' ORDER BY event_date "; $dateResult = mysql_query($dateQuery, $dbLink); if (mysql_num_rows($dateResult) > 0) { print("\t\n"); $thisMonth = ""; while($dateObj = mysql_fetch_object($dateResult)) { if ($thisMonth != date('F Y',$dateObj->event_date)) { print("\t\n"); $thisMonth = date('F Y',$dateObj->event_date); } print("\t"); if ((date('G',$dateObj->event_date) > 0) OR (date('i',$dateObj->event_date) > 0)) { $time = date('g:ia',$dateObj->event_date); } else { $time = " "; } print(""); print("\n"); } print("\t
" . date('F Y',$dateObj->event_date) . "
" . date('l jS',$dateObj->event_date) . "" . $time . "" . stripslashes($dateObj->title) . "
\n"); } } // REGULAR STORIES AND LATEST STORIES IF $_GET['page_id'] == 1 $artQuery = "SELECT a.*, b.firstname, b.surname, b.photo "; $artQuery.= "FROM sl35_articles a, sl35_editors b "; $artQuery.= "WHERE a.categories LIKE '%" . $_GET['page_id'] . "%' "; $artQuery.= "AND a.written_by=b.id "; $artQuery.= "AND a.approved='Yes' "; $artQuery.= "AND a.active='Yes' "; $artQuery.= "ORDER BY a.date_approved DESC "; $artResult = mysql_query($artQuery, $dbLink); $picposition = 1; while ($artRow = mysql_fetch_array($artResult)) { print("\t
\n"); ($picposition == 1) ? $picposition=0: $picposition=1; if (is_file('_admin/userfiles/articles/' . $artRow['cover_art'])) { $URLlink = '_admin/userfiles/articles/' . $artRow['cover_art']; } else { if (is_file('_admin/userfiles/editors/' . $artRow['photo'])) { $URLlink = '_admin/userfiles/editors/' . $artRow['photo']; } else { $randImage = array('bananas.jpg','christmastree.jpg','giraffe.jpg','munch.jpg'); $URLlink = "_admin/userfiles/images/" . $randImage[rand(0,count($randImage)-1)]; } } // NOTE: maybe an anchor to all articles written by author print("\t\n"); print("\t\n"); print("\t
\n"); if ($picposition == 0) { print("\t\n"); } else { print("\t\n"); } print("\t" . $artRow['title'] . "
\n"); if (($artRow['written_by'] == 0) AND ($artRow['written_by2'] != "")) { print("\tBy: " . stripslashes($artRow['written_by2']) . "
\n"); } else { print("\tBy: " . $artRow['firstname'] . " " . $artRow['surname'] . "
\n"); } print("\t" . $artRow['content'] . "\n"); print("\tDate: " . date('l, jS F, Y g:ia',$artRow['date_approved']) . "\n"); print("\t
\n"); } include('footer.php'); ?>