\n"); echo ("".$question['Question_Name'].":
\n"); echo("".$question['Question_Description']."
\n"); $answerList = mysql_query("SELECT * FROM gforum_SurveyAnswer WHERE Question_ID_FK = ". $question['Question_ID']." ORDER BY Answer_Votes DESC;"); $totalVotes = 0; while($answer = mysql_fetch_array($answerList)) { echo ($answer['Answer_Name'].": ".$answer['Answer_Votes']."
\n"); $totalVotes = $totalVotes + $answer['Answer_Votes']; } echo("Total votes in this category: ".$totalVotes."
\n"); //echo ("No Vote
"); echo ("\n"); } $tsNow = time(); $tsWeek = time() - (7 * 24 * 60 * 60); $tsMonth = time() - (30 * 24 * 60 * 60); $tsSixMonth = time() - (182.5 * 24 * 60 * 60); echo("

Forum Stats


"); $row = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT(user_id_fk)) AS users FROM gforum_Post WHERE post_time < '".$tsNow."' AND post_time > '".$tsWeek."';")); echo("Number of users who have posted in the past seven days: ".$row['users']."
\n"); $row = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT(user_id_fk)) AS users FROM gforum_Post WHERE post_time < '".$tsNow."' AND post_time > '".$tsMonth."';")); echo("Number of users who have posted in the past thirty days: ".$row['users']."
\n"); $row = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT(user_id_fk)) AS users FROM gforum_Post WHERE post_time < '".$tsNow."' AND post_time > '".$tsSixMonth."';")); echo("Number of users who have posted in the past six months: ".$row['users']."
\n"); ?>