From 24503e3abe705acde2df159aeae61be0d009f92e Mon Sep 17 00:00:00 2001 From: Starla Insigna Date: Wed, 19 Nov 2008 17:27:03 -0500 Subject: Imported sources --- pages/welcome.php | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 pages/welcome.php (limited to 'pages/welcome.php') diff --git a/pages/welcome.php b/pages/welcome.php new file mode 100644 index 0000000..24fd7ad --- /dev/null +++ b/pages/welcome.php @@ -0,0 +1,81 @@ +adds_block('EXTERNAL',array('exi'=>1)); + +$curID = 0; + +$getpost = "SELECT * FROM updates ORDER BY id DESC LIMIT 0,4"; +$getpost2 = mysql_query($getpost); +while ($getpost3 = mysql_fetch_array($getpost2)) +{ + updatePop($getpost3['id'],'home_views'); + + $page_id = 'updates-' . $getpost3['id']; + $getcomments = "SELECT * FROM comments WHERE page_id = \"" . $page_id . "\" ORDER BY posttime"; + $getcomments2 = mysql_query($getcomments); + $total_post=0; + while ($getcomments3[$total_post] = mysql_fetch_array($getcomments2)) + { + $total_post++; + } + if ($total_post >= 2) + { + $plural = 's'; + } + if ($total_post == 0) + { + $comText = 'No Comments'; + } elseif ($total_post == 1) + { + $comText = '1 Comment'; + } else { + $comText = $total_post . ' Comments'; + } + + $template->add_ref($curID, 'POST', array( 'ID' => $getpost3['id'], + 'YEARID' => ((date('Y',strtotime($getpost3['pubDate']))-2006) % 4), + 'DATE' => date('F dS Y \a\\t g:i:s a',strtotime($getpost3['pubDate'])), + 'MONTH' => date('M',strtotime($getpost3['pubDate'])), + 'DAY' => date('d',strtotime($getpost3['pubDate'])), + 'CODED' => $getpost3['slug'], + 'TITLE' => $getpost3['title'], + 'AUTHOR' => $getpost3['author'], + 'TAG1' => $getpost3['tag1'], + 'TAG2' => $getpost3['tag2'], + 'TAG3' => $getpost3['tag3'], + 'PLURALCOMMENT' => (isset($plural) ? $plural : ''), + 'COMMENTS' => $comText, + 'RATING' => $getpost3['rating'], + 'TEXT' => parseBBCode($getpost3['text']))); + + $curID++; +} + +$template->display(); + +?> -- cgit 1.4.1