foreach ($myarr as $key => $value) {
        $value = trim($value);
        $value = str_replace(" ", "", $value);
        if (is_null($value) || $value == "") {
            unset($myarr[$key]);
        } else {
            $myarr[$key] = $value;
        }
    }
    $myarr = implode(",", array_values($myarr));
    return $myarr;
}
// Process $_POST for form id="tnf_options_form"
if ($_POST["tnf_hidden"] == "Y") {
    $hashtags = create_clean_string($_POST["tnf_hashtags"]);
    $usernames = create_clean_string($_POST["tnf_usernames"]);
    $category = $_POST["tnf_category"];
    $user = $_POST["tnf_user"];
    $post_type = $_POST["tnf_post_type"];
    if ($_POST["tnf_add_news_as_post"] == "Y") {
        $add_news_to_db = "checked";
        $add_news_to_db_boolean = TRUE;
    } else {
        $add_news_to_db = "";
        $add_news_to_db_boolean = FALSE;
    }
    if ($hashtags != "" || $usernames != "") {
        update_option("tnf_hashtags", $hashtags);
        update_option("tnf_usernames", $usernames);
        update_option("tnf_category", $category);
        update_option("tnf_user", $user);
示例#2
0
            unset($myarr[$key]);
        } else {
            $myarr[$key] = $value;
        }
    }
    $myarr = implode(",", array_values($myarr));
    return $myarr;
}
// Process $_POST for form id="tnf_options_form"
if ($_POST["tap_hidden"] == "Y") {
    $hashtags = create_clean_string($_POST["tap_hashtags"]);
    $usernames = create_clean_string($_POST["tap_usernames"]);
    $consumer_key = create_clean_string($_POST["tap_consumer_key"]);
    $consumer_sec = create_clean_string($_POST["tap_consumer_sec"]);
    $access_token = create_clean_string($_POST["tap_access_token"]);
    $access_secret = create_clean_string($_POST["tap_access_secret"]);
    $category = $_POST["tap_category"];
    $user = $_POST["tap_user"];
    if ($_POST["tap_add_news_as_post"] == "Y") {
        $add_news_to_db = "checked";
        $add_news_to_db_boolean = TRUE;
    } else {
        $add_news_to_db = "";
        $add_news_to_db_boolean = FALSE;
    }
    if ($hashtags != "" && $usernames != "") {
        update_option("tap_hashtags", $hashtags);
        update_option("tap_usernames", $usernames);
        update_option("tap_category", $category);
        update_option("tap_consumer_key", $consumer_key);
        update_option("tap_consumer_sec", $consumer_sec);