return "<p class='footer'>Analysis thanks to <a href='https://github.com/jdbevan/140History'>140History</a> by Jon Bevan</p>\n"; } function styling() { return "body { font-family: Arial; font-size: 10pt; }\n.footer { clear: both; padding-top: 20px; }\n.hashtags { float: left; }\n.hashtags thead tr th { text-align: left; background-color: #E0E0E0; }\n.hashtags tbody tr:nth-child(2n) { background-color: #F0F0F0; }\n.hashtags th, .hashtags td { padding: 5px; }"; } function htmlPage($title, $content) { echo "<!DOCTYPE html>\n<html>\n<head>\n\t<title>{$title}</title>\n\t<style>\n"; echo styling(); echo "</style>\n\t<script type=\"text/javascript\" src=\"https://www.google.com/jsapi\"></script>\n</head>\n<body>\n"; echo $content; echo footer(); echo "</body>\n</html>\n"; } $content = tableOfHashtags($all_hashtags); $content .= graphOfTweetsByDay($all_tweets); $content .= graphOfTweetsByHour($all_tweets); $content .= graphOfTweetsByWeekDay($all_tweets); htmlPage($username . " tweet analysis", $content); exit; echo "#\n# Here are all your hashtags in order\n#\n"; if (count($all_hashtags) > 0) { arsort($all_hashtags); print_r($all_hashtags); } echo "\n\n"; echo "#\n# Here are all your tweets in order\n#\n"; foreach ($all_tweets as $tweet) { echo $tweet['id'], "\t", $tweet['pubDate'], "\t", $tweet['content'], "\t", $tweet['link'], "\t", $tweet['source'], "\n"; }
} } elseif ($_POST[action] != 'signup' && $_POST[action] != 'login') { $view = true; } if ($view) { $page = tabForm() . ($_GET['view'] == 'signup' ? signUpForm() : logInForm()); $title = $GLOBALS[LOCALE][$GLOBALS[LANG]][$_GET['view'] == 'signup' ? 'SIGNUP_TITLE' : 'LOGIN']; } else { switch ($_POST['action']) { case 'signup': if (signUp($db, $_POST[name], $_POST[day], $_POST[month], $_POST[year], $_POST[location], $_POST[status], $_POST[education], $_POST[expirience], $_POST[phone], $_POST[email], $_POST[description], $_POST[new_password], $_POST[verify_password], $GLOBALS[LANG])) { header('Location: index.php'); } else { header('Location: index.php?view=signup'); } break; case 'login': if (logIn($db, $_POST[email], $_POST[password])) { header('Location: index.php'); } else { header('Location: index.php?view=login'); } break; } } } else { $page = errorServer(); } ob_clean(); print htmlPage($title, $page); ob_end_flush();