/**
 * Callback function for scheduled event
 *
 * @return  None
 **/
function tnf_hourly_update()
{
    if (get_option("tnf_add_news_to_db")) {
        tnf_get_news(TRUE);
    }
}
} else {
    // Get the options from the wp-options table using get_option($key);
    $hashtags = get_option("tnf_hashtags");
    $usernames = get_option("tnf_usernames");
    $exceptions = get_option("tnf_exceptions");
    $category = get_option("tnf_category");
    $user = get_option("tnf_user");
    $post_type = get_option("tnf_post_type");
    // Add news as post?
    if (get_option("tnf_add_news_to_db")) {
        $add_news_to_db = "checked";
    }
}
// Process $_POST for form id="tnf_get_news_form"
if ($_POST["tnf_get_news_hidden"] == "Y" && get_option("tnf_add_news_to_db")) {
    $retval = tnf_get_news(TRUE);
    $flash_success = $retval . " Tweet(s) added as Posts";
}
// If tnf_add_news_to_db == TRUE get the last 10 log entries
if (get_option("tnf_add_news_to_db")) {
    global $wpdb;
    $sql = "SELECT id, time, comment FROM " . $wpdb->prefix . "tnf_log" . " ORDER BY time DESC LIMIT 5";
    $data = $wpdb->get_results($sql);
}
?>

<?php 
if (!$flash_success == "") {
    ?>
<div class="updated">
    <p><?php