function cff_settings_page()
{
    //Which extensions are active?
    //Is individual extension active || is Smash License extensions bundle active?
    $cff_ext_options = get_option('cff_extensions_status');
    //Set extensions in extensions plugin all to false by default
    $cff_extensions_multifeed_active = false;
    $cff_extensions_date_range_active = false;
    $cff_extensions_featured_post_active = false;
    $cff_extensions_album_active = false;
    $cff_extensions_lightbox_active = false;
    if (WPW_SL_ITEM_NAME == 'Custom Facebook Feed WordPress Plugin Smash') {
        //Set page variables
        if (isset($cff_ext_options['cff_extensions_multifeed_active'])) {
            $cff_extensions_multifeed_active = $cff_ext_options['cff_extensions_multifeed_active'];
        }
        if (isset($cff_ext_options['cff_extensions_date_range_active'])) {
            $cff_extensions_date_range_active = $cff_ext_options['cff_extensions_date_range_active'];
        }
        if (isset($cff_ext_options['cff_extensions_featured_post_active'])) {
            $cff_extensions_featured_post_active = $cff_ext_options['cff_extensions_featured_post_active'];
        }
        if (isset($cff_ext_options['cff_extensions_album_active'])) {
            $cff_extensions_album_active = $cff_ext_options['cff_extensions_album_active'];
        }
        if (isset($cff_ext_options['cff_extensions_lightbox_active'])) {
            $cff_extensions_lightbox_active = $cff_ext_options['cff_extensions_lightbox_active'];
        }
    }
    is_plugin_active('cff-multifeed/cff-multifeed.php') || $cff_extensions_multifeed_active ? $cff_ext_multifeed_active = true : ($cff_ext_multifeed_active = false);
    is_plugin_active('cff-date-range/cff-date-range.php') || $cff_extensions_date_range_active ? $cff_ext_date_active = true : ($cff_ext_date_active = false);
    is_plugin_active('cff-featured-post/cff-featured-post.php') || $cff_extensions_featured_post_active ? $cff_featured_post_active = true : ($cff_featured_post_active = false);
    is_plugin_active('cff-album/cff-album.php') || $cff_extensions_album_active ? $cff_album_active = true : ($cff_album_active = false);
    is_plugin_active('cff-lightbox/cff-lightbox.php') || $cff_extensions_lightbox_active ? $cff_lightbox_active = true : ($cff_lightbox_active = false);
    //Declare variables for fields
    $hidden_field_name = 'cff_submit_hidden';
    $show_access_token = 'cff_show_access_token';
    $access_token = 'cff_access_token';
    $page_id = 'cff_page_id';
    $cff_page_type = 'cff_page_type';
    $num_show = 'cff_num_show';
    $cff_post_limit = 'cff_post_limit';
    $cff_show_others = 'cff_show_others';
    $cff_cache_time = 'cff_cache_time';
    $cff_cache_time_unit = 'cff_cache_time_unit';
    $cff_locale = 'cff_locale';
    //Extensions
    $cff_date_from = 'cff_date_from';
    $cff_date_until = 'cff_date_until';
    $cff_featured_post_id = 'cff_featured_post_id';
    $cff_lightbox = 'cff_lightbox';
    // Read in existing option value from database
    $show_access_token_val = get_option($show_access_token);
    $access_token_val = get_option($access_token);
    $page_id_val = get_option($page_id);
    $cff_page_type_val = get_option($cff_page_type);
    $num_show_val = get_option($num_show, '5');
    $cff_post_limit_val = get_option($cff_post_limit);
    $cff_show_others_val = get_option($cff_show_others);
    $cff_cache_time_val = get_option($cff_cache_time, '1');
    $cff_cache_time_unit_val = get_option($cff_cache_time_unit, 'hours');
    $cff_locale_val = get_option($cff_locale, 'en_US');
    //Timezone
    $defaults = array('cff_timezone' => 'America/Chicago');
    $options = wp_parse_args(get_option('cff_style_settings'), $defaults);
    $cff_timezone = $options['cff_timezone'];
    //Extensions
    $cff_date_from_val = get_option($cff_date_from);
    $cff_date_until_val = get_option($cff_date_until);
    $cff_featured_post_id_val = get_option($cff_featured_post_id);
    $cff_lightbox_val = get_option($cff_lightbox);
    // See if the user has posted us some information. If they did, this hidden field will be set to 'Y'.
    if (isset($_POST[$hidden_field_name]) && $_POST[$hidden_field_name] == 'Y') {
        // Read their posted value
        isset($_POST[$show_access_token]) ? $show_access_token_val = $_POST[$show_access_token] : ($show_access_token_val = '');
        isset($_POST[$access_token]) ? $access_token_val = $_POST[$access_token] : ($access_token_val = '');
        isset($_POST[$page_id]) ? $page_id_val = $_POST[$page_id] : ($page_id_val = '');
        isset($_POST[$cff_page_type]) ? $cff_page_type_val = $_POST[$cff_page_type] : ($cff_page_type_val = '');
        isset($_POST[$num_show]) ? $num_show_val = $_POST[$num_show] : ($num_show_val = '');
        isset($_POST[$cff_post_limit]) ? $cff_post_limit_val = $_POST[$cff_post_limit] : ($cff_post_limit_val = '');
        isset($_POST[$cff_show_others]) ? $cff_show_others_val = $_POST[$cff_show_others] : ($cff_show_others_val = '');
        isset($_POST[$cff_cache_time]) ? $cff_cache_time_val = $_POST[$cff_cache_time] : ($cff_cache_time_val = '');
        isset($_POST[$cff_cache_time_unit]) ? $cff_cache_time_unit_val = $_POST[$cff_cache_time_unit] : ($cff_cache_time_unit_val = '');
        isset($_POST[$cff_locale]) ? $cff_locale_val = $_POST[$cff_locale] : ($cff_locale_val = '');
        if (isset($_POST['cff_timezone'])) {
            $cff_timezone = $_POST['cff_timezone'];
        }
        //Extensions
        isset($_POST[$cff_date_from]) ? $cff_date_from_val = $_POST[$cff_date_from] : ($cff_date_from_val = '');
        isset($_POST[$cff_date_until]) ? $cff_date_until_val = $_POST[$cff_date_until] : ($cff_date_until_val = '');
        isset($_POST[$cff_featured_post_id]) ? $cff_featured_post_id_val = $_POST[$cff_featured_post_id] : ($cff_featured_post_id_val = '');
        isset($_POST[$cff_lightbox]) ? $cff_lightbox_val = $_POST[$cff_lightbox] : ($cff_lightbox_val = '');
        // Save the posted value in the database
        update_option($show_access_token, $show_access_token_val);
        update_option($access_token, $access_token_val);
        update_option($page_id, $page_id_val);
        update_option($cff_page_type, $cff_page_type_val);
        update_option($num_show, $num_show_val);
        update_option($cff_post_limit, $cff_post_limit_val);
        update_option($cff_show_others, $cff_show_others_val);
        update_option($cff_cache_time, $cff_cache_time_val);
        update_option($cff_cache_time_unit, $cff_cache_time_unit_val);
        update_option($cff_locale, $cff_locale_val);
        $options['cff_timezone'] = $cff_timezone;
        update_option('cff_style_settings', $options);
        //Extensions
        update_option($cff_date_from, $cff_date_from_val);
        update_option($cff_date_until, $cff_date_until_val);
        update_option($cff_featured_post_id, $cff_featured_post_id_val);
        update_option($cff_lightbox, $cff_lightbox_val);
        //Delete ALL transients
        global $wpdb;
        $table_name = $wpdb->prefix . "options";
        $wpdb->query("\r\n            DELETE\r\n            FROM {$table_name}\r\n            WHERE `option_name` LIKE ('%\\_transient\\_cff\\_%')\r\n            ");
        $wpdb->query("\r\n            DELETE\r\n            FROM {$table_name}\r\n            WHERE `option_name` LIKE ('%\\_transient\\_cff\\_ej\\_%')\r\n            ");
        $wpdb->query("\r\n            DELETE\r\n            FROM {$table_name}\r\n            WHERE `option_name` LIKE ('%\\_transient\\_cff\\_tle\\_%')\r\n            ");
        $wpdb->query("\r\n            DELETE\r\n            FROM {$table_name}\r\n            WHERE `option_name` LIKE ('%\\_transient\\_cff\\_album\\_%')\r\n            ");
        $wpdb->query("\r\n            DELETE\r\n            FROM {$table_name}\r\n            WHERE `option_name` LIKE ('%\\_transient\\_timeout\\_cff\\_%')\r\n            ");
        // Put an settings updated message on the screen
        ?>
    <div class="updated"><p><strong><?php 
        _e('Settings saved.', 'custom-facebook-feed');
        ?>
</strong></p></div>
    <?php 
    }
    ?>
 
    <div id="cff-admin" class="wrap">
        <div id="header">
            <h2><?php 
    _e('Custom Facebook Feed Settings');
    ?>
</h2>
        </div>

        <?php 
    cff_expiration_notice();
    ?>

        <?php 
    $cff_active_tab = isset($_GET['tab']) ? $_GET['tab'] : 'configuration';
    ?>
        <h2 class="nav-tab-wrapper">
            <a href="?page=cff-top&amp;tab=configuration" class="nav-tab <?php 
    echo $cff_active_tab == 'configuration' ? 'nav-tab-active' : '';
    ?>
"><?php 
    _e('Configuration');
    ?>
</a>
            <a href="?page=cff-style" class="nav-tab"><?php 
    _e('Customize');
    ?>
</a>
            <a href="?page=cff-top&amp;tab=license" class="nav-tab <?php 
    echo $cff_active_tab == 'license' ? 'nav-tab-active' : '';
    ?>
"><?php 
    _e('License');
    ?>
</a>
            <a href="?page=cff-top&amp;tab=support" class="nav-tab <?php 
    echo $cff_active_tab == 'support' ? 'nav-tab-active' : '';
    ?>
"><?php 
    _e('Support');
    ?>
</a>
        </h2>

        <?php 
    if ($cff_active_tab == 'configuration') {
        //Start Extensions tab
        ?>

        <form name="form1" method="post" action="">
            <input type="hidden" name="<?php 
        echo $hidden_field_name;
        ?>
" value="Y">
            <br />
            <h3><?php 
        _e('Configuration');
        ?>
</h3>
            <table class="form-table">
                <tbody>
                    <tr valign="top">
                        <th scope="row">
                            <?php 
        if ($cff_ext_multifeed_active) {
            ?>
                            <?php 
            _e('Facebook Page IDs');
            ?>
<br /><i style="color: #666; font-size: 11px;"><?php 
            _e('Separate multiple IDs with commas</i>');
            ?>
</th>
                            <?php 
        } else {
            ?>
                            <?php 
            _e('Facebook Page ID<br /><i style="font-weight: normal; font-size: 12px;">ID of your Facebook Page or Group</i>');
            ?>
</th>
                            <?php 
        }
        ?>
                        <td>

                            <?php 
        if ($cff_ext_multifeed_active) {
            ?>
                            <textarea name="cff_page_id" id="cff_page_id" style="width: 390px;" rows="3" /><?php 
            esc_attr_e($page_id_val);
            ?>
</textarea>
                            <?php 
        } else {
            ?>
                            <input name="cff_page_id" id="cff_page_id" type="text" value="<?php 
            esc_attr_e($page_id_val);
            ?>
" size="45" />
                            <?php 
        }
        ?>

                            &nbsp;<a class="cff-tooltip-link" href="JavaScript:void(0);"><?php 
        _e("What's my Page ID?");
        ?>
</a>
                            <br /><i style="color: #666; font-size: 11px;"><?php 
        _e("Eg. 1234567890123");
        ?>
</i>
                            <div class="cff-tooltip cff-more-info">
                                <ul>
                                    <li><?php 
        _e('If you have a Facebook <b>page</b> with a URL like this: <code>https://www.facebook.com/your_page_name</code> then the Page ID is just <b>your_page_name</b>. If your page URL is structured like this: <code>https://www.facebook.com/pages/your_page_name/123654123654123</code> then the Page ID is actually the number at the end, so in this case <b>123654123654123</b>.</li>');
        ?>
                                    <li><?php 
        _e('If you have a Facebook <b>group</b> then use <a href="http://lookup-id.com/" target="_blank" title="Find my ID">this tool</a> to find your ID.');
        ?>
</li>
                                    <li><?php 
        _e('You can copy and paste your ID into the <a href="http://smashballoon.com/custom-facebook-feed/demo/" target="_blank">demo</a> to test it.');
        ?>
</li>
                                </ul>
                            </div>
                        </td>
                    </tr>
                    
                    <?php 
        if ($cff_featured_post_active) {
            echo cff_featured_post_options($cff_featured_post_id_val);
        }
        ?>

                    <tr valign="top">
                        <th scope="row" style="padding-bottom: 10px;"><?php 
        _e('Enter my own Access Token <i style="font-weight: normal; font-size: 12px;">This is Recommended</i>');
        ?>
</th>
                        <td>
                            <input name="cff_show_access_token" type="checkbox" id="cff_show_access_token" <?php 
        if ($show_access_token_val == true) {
            echo "checked";
        }
        ?>
 />&nbsp;<a class="cff-tooltip-link" href="JavaScript:void(0);"><?php 
        _e("What is this?");
        ?>
</a>
                            <p class="cff-tooltip cff-more-info"><?php 
        _e("A Facebook Access Token is not required to use this plugin, but we recommend it so that you're not reliant on the token built into the plugin. If you have your own token then you can check this box and enter it here. To get your own Access Token you can follow these <a href='https://smashballoon.com/custom-facebook-feed/access-token/' target='_blank'>step-by-step instructions</a>");
        ?>
.</p>
                        </td>
                    </tr>

                    <tr valign="top" class="cff-access-token-hidden">
                        <th scope="row" style="padding-bottom: 10px;"><?php 
        _e('Facebook Access Token');
        ?>
</th>
                        <td>
                            <input name="cff_access_token" id="cff_access_token" type="text" value="<?php 
        esc_attr_e($access_token_val);
        ?>
" size="45" />

                            <div class="cff-notice cff-profile-error cff-access-token">
                                <?php 
        _e("<p>This doesn't appear to be an Access Token. Please be sure that you didn't enter your App Secret instead of your Access Token.<br />Your App ID and App Secret are used to obtain your Access Token; simply paste them into the fields in the last step of the <a href='https://smashballoon.com/custom-facebook-feed/access-token/' target='_blank'>Access Token instructions</a> and click '<b>Get my Access Token</b>'.</p>");
        ?>
                            </div>
                        </td>
                    </tr>

                </tbody>
            </table>
            <hr />
            <table class="form-table">
                <tbody>
                    <h3><?php 
        _e('Settings');
        ?>
</h3>
                    <tr valign="top" class="cff-page-type">
                        <th scope="row"><?php 
        _e('Is this a page, group or profile?');
        ?>
</th>
                        <td>
                            <select name="cff_page_type">
                                <option value="page" <?php 
        if ($cff_page_type_val == "page") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Page');
        ?>
</option>
                                <option value="group" <?php 
        if ($cff_page_type_val == "group") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Group');
        ?>
</option>
                                <option value="profile" <?php 
        if ($cff_page_type_val == "profile") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Profile');
        ?>
</option>
                            </select>
                            <div class="cff-notice cff-profile-error cff-page-type">
                                <?php 
        _e("<p>Due to Facebook's privacy policy you're not able to display posts from a personal profile, only from a public page or group.</p><p>If you're using a profile to represent a business, organization, product, public figure or the like, then Facebook recommends <a href='http://www.facebook.com/help/175644189234902/' target='_blank'>converting your profile to a page</a>. There are many advantages to using pages over profiles, and once you've converted then the plugin will be able to successfully retrieve and display all of your posts.</p>");
        ?>
                            </div>
                        </td>
                    </tr>

                    <tr valign="top" class="cff-page-options">
                        <th scope="row"><?php 
        _e('Show posts on my page by:');
        ?>
</th>
                        <td>

                            <select name="cff_show_others" id="cff_show_others" style="width: 250px;">
                                <option value="me" <?php 
        if ($cff_show_others_val == 'me') {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Only the page owner (me)');
        ?>
</option>
                                <option value="others" <?php 
        if ($cff_show_others_val == 'others') {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Page owner + other people');
        ?>
</option>
                                <option value="onlyothers" <?php 
        if ($cff_show_others_val == 'onlyothers') {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Only other people');
        ?>
</option>
                            </select>

                            <p id="cff-others-only" style="font-size: 12px;"><b>Note:</b> Only displaying posts by other people works by retrieving your posts from Facebook and then filtering out the posts by the page owner. If this option doesn't display many posts then you can retrieve more by setting the post limit option (below) to a higher number.</p>

                        </td>
                    </tr>

                    <?php 
        if ($cff_ext_date_active) {
            echo cff_ext_date_options($cff_date_from_val, $cff_date_until_val);
        }
        ?>


                    <tr valign="top">
                        <th scope="row"><?php 
        _e('Number of posts to display');
        ?>
</th>
                        <td>
                            <input name="cff_num_show" type="text" value="<?php 
        esc_attr_e($num_show_val);
        ?>
" size="4" />
                            <i style="color: #666; font-size: 11px;">Eg. 5</i> <a class="cff-tooltip-link" href="JavaScript:void(0);"><?php 
        _e("Why aren't this many posts showing up?");
        ?>
</a>
                            <p class="cff-tooltip cff-more-info"><?php 
        _e("If too many posts are being filtered out then you may need to set the 'Change the post limit' option below to be 10-15 higher than the amount of posts you want to display.");
        ?>
</p>
                        </td>
                    </tr>

                    <tr valign="top">
                        <th scope="row"><?php 
        _e('Change the post limit');
        ?>
</th>
                        <td>
                            <input name="cff_post_limit" type="text" value="<?php 
        esc_attr_e($cff_post_limit_val);
        ?>
" size="4" />
                            <i style="color: #666; font-size: 11px;">Eg. 30</i> <a class="cff-tooltip-link" href="JavaScript:void(0);"><?php 
        _e('What does this mean?');
        ?>
</a>
                            <p class="cff-tooltip cff-more-info"><?php 
        _e("The 'limit' is the number of posts retrieved from the Facebook API. By default the plugin retrieves 7 posts more from the Facebook API than you specify in the 'Number of posts to display' field above, as some posts are filtered out. You can alter how many posts are retrieved by manually setting this value. If you choose to retrieve a high number of posts then it will take longer for Facebook to return the posts when the plugin checks for new ones.");
        ?>
</p>
                        </td>
                    </tr>
                    
                    <tr valign="top">
                        <th scope="row"><?php 
        _e('Check for new Facebook posts every');
        ?>
</th>
                        <td>
                            <input name="cff_cache_time" type="text" value="<?php 
        esc_attr_e($cff_cache_time_val);
        ?>
" size="4" />
                            <select name="cff_cache_time_unit">
                                <option value="minutes" <?php 
        if ($cff_cache_time_unit_val == "minutes") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Minutes');
        ?>
</option>
                                <option value="hours" <?php 
        if ($cff_cache_time_unit_val == "hours") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Hours');
        ?>
</option>
                                <option value="days" <?php 
        if ($cff_cache_time_unit_val == "days") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Days');
        ?>
</option>
                            </select>
                            <a class="cff-tooltip-link" href="JavaScript:void(0);"><?php 
        _e('What does this mean?');
        ?>
</a>
                            <p class="cff-tooltip cff-more-info"><?php 
        _e('Your Facebook posts and comments data is temporarily cached by the plugin in your WordPress database. You can choose how long this data should be cached for. If you set the time to 60 minutes then the plugin will clear the cached data after that length of time, and the next time the page is viewed it will check for new data.');
        ?>
</p>
                        </td>
                    </tr>

                    <tr valign="top">
                        <th scope="row"><?php 
        _e('Localization');
        ?>
</th>
                        <td>
                            <select name="cff_locale">
                                <option value="af_ZA" <?php 
        if ($cff_locale_val == "af_ZA") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Afrikaans');
        ?>
</option>
                                <option value="ar_AR" <?php 
        if ($cff_locale_val == "ar_AR") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Arabic');
        ?>
</option>
                                <option value="az_AZ" <?php 
        if ($cff_locale_val == "az_AZ") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Azerbaijani');
        ?>
</option>
                                <option value="be_BY" <?php 
        if ($cff_locale_val == "be_BY") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Belarusian');
        ?>
</option>
                                <option value="bg_BG" <?php 
        if ($cff_locale_val == "bg_BG") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Bulgarian');
        ?>
</option>
                                <option value="bn_IN" <?php 
        if ($cff_locale_val == "bn_IN") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Bengali');
        ?>
</option>
                                <option value="bs_BA" <?php 
        if ($cff_locale_val == "bs_BA") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Bosnian');
        ?>
</option>
                                <option value="ca_ES" <?php 
        if ($cff_locale_val == "ca_ES") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Catalan');
        ?>
</option>
                                <option value="cs_CZ" <?php 
        if ($cff_locale_val == "cs_CZ") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Czech');
        ?>
</option>
                                <option value="cy_GB" <?php 
        if ($cff_locale_val == "cy_GB") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Welsh');
        ?>
</option>
                                <option value="da_DK" <?php 
        if ($cff_locale_val == "da_DK") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Danish');
        ?>
</option>
                                <option value="de_DE" <?php 
        if ($cff_locale_val == "de_DE") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('German');
        ?>
</option>
                                <option value="el_GR" <?php 
        if ($cff_locale_val == "el_GR") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Greek');
        ?>
</option>
                                <option value="en_GB" <?php 
        if ($cff_locale_val == "en_GB") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('English (UK)');
        ?>
</option>
                                <option value="en_PI" <?php 
        if ($cff_locale_val == "en_PI") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('English (Pirate)');
        ?>
</option>
                                <option value="en_UD" <?php 
        if ($cff_locale_val == "en_UD") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('English (Upside Down)');
        ?>
</option>
                                <option value="en_US" <?php 
        if ($cff_locale_val == "en_US") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('English (US)');
        ?>
</option>
                                <option value="eo_EO" <?php 
        if ($cff_locale_val == "eo_EO") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Esperanto');
        ?>
</option>
                                <option value="es_ES" <?php 
        if ($cff_locale_val == "es_ES") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Spanish (Spain)');
        ?>
</option>
                                <option value="es_LA" <?php 
        if ($cff_locale_val == "es_LA") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Spanish');
        ?>
</option>
                                <option value="et_EE" <?php 
        if ($cff_locale_val == "et_EE") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Estonian');
        ?>
</option>
                                <option value="eu_ES" <?php 
        if ($cff_locale_val == "eu_ES") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Basque');
        ?>
</option>
                                <option value="fa_IR" <?php 
        if ($cff_locale_val == "fa_IR") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Persian');
        ?>
</option>
                                <option value="fb_LT" <?php 
        if ($cff_locale_val == "fb_LT") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Leet Speak');
        ?>
</option>
                                <option value="fi_FI" <?php 
        if ($cff_locale_val == "fi_FI") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Finnish');
        ?>
</option>
                                <option value="fo_FO" <?php 
        if ($cff_locale_val == "fo_FO") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Faroese');
        ?>
</option>
                                <option value="fr_CA" <?php 
        if ($cff_locale_val == "fr_CA") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('French (Canada)');
        ?>
</option>
                                <option value="fr_FR" <?php 
        if ($cff_locale_val == "fr_FR") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('French (France)');
        ?>
</option>
                                <option value="fy_NL" <?php 
        if ($cff_locale_val == "fy_NL") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Frisian');
        ?>
</option>
                                <option value="ga_IE" <?php 
        if ($cff_locale_val == "ga_IE") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Irish');
        ?>
</option>
                                <option value="gl_ES" <?php 
        if ($cff_locale_val == "gl_ES") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Galician');
        ?>
</option>
                                <option value="he_IL" <?php 
        if ($cff_locale_val == "he_IL") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Hebrew');
        ?>
</option>
                                <option value="hi_IN" <?php 
        if ($cff_locale_val == "hi_IN") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Hindi');
        ?>
</option>
                                <option value="hr_HR" <?php 
        if ($cff_locale_val == "hr_HR") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Croatian');
        ?>
</option>
                                <option value="hu_HU" <?php 
        if ($cff_locale_val == "hu_HU") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Hungarian');
        ?>
</option>
                                <option value="hy_AM" <?php 
        if ($cff_locale_val == "hy_AM") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Armenian');
        ?>
</option>
                                <option value="id_ID" <?php 
        if ($cff_locale_val == "id_ID") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Indonesian');
        ?>
</option>
                                <option value="is_IS" <?php 
        if ($cff_locale_val == "is_IS") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Icelandic');
        ?>
</option>
                                <option value="it_IT" <?php 
        if ($cff_locale_val == "it_IT") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Italian');
        ?>
</option>
                                <option value="ja_JP" <?php 
        if ($cff_locale_val == "ja_JP") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Japanese');
        ?>
</option>
                                <option value="ka_GE" <?php 
        if ($cff_locale_val == "ka_GE") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Georgian');
        ?>
</option>
                                <option value="km_KH" <?php 
        if ($cff_locale_val == "km_KH") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Khmer');
        ?>
</option>
                                <option value="ko_KR" <?php 
        if ($cff_locale_val == "ko_KR") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Korean');
        ?>
</option>
                                <option value="ku_TR" <?php 
        if ($cff_locale_val == "ku_TR") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Kurdish');
        ?>
</option>
                                <option value="la_VA" <?php 
        if ($cff_locale_val == "la_VA") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Latin');
        ?>
</option>
                                <option value="lt_LT" <?php 
        if ($cff_locale_val == "lt_LT") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Lithuanian');
        ?>
</option>
                                <option value="lv_LV" <?php 
        if ($cff_locale_val == "lv_LV") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Latvian');
        ?>
</option>
                                <option value="mk_MK" <?php 
        if ($cff_locale_val == "mk_MK") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Macedonian');
        ?>
</option>
                                <option value="ml_IN" <?php 
        if ($cff_locale_val == "ml_IN") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Malayalam');
        ?>
</option>
                                <option value="ms_MY" <?php 
        if ($cff_locale_val == "ms_MY") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Malay');
        ?>
</option>
                                <option value="nb_NO" <?php 
        if ($cff_locale_val == "nb_NO") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Norwegian (bokmal)');
        ?>
</option>
                                <option value="ne_NP" <?php 
        if ($cff_locale_val == "ne_NP") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Nepali');
        ?>
</option>
                                <option value="nl_NL" <?php 
        if ($cff_locale_val == "nl_NL") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Dutch');
        ?>
</option>
                                <option value="nn_NO" <?php 
        if ($cff_locale_val == "nn_NO") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Norwegian (nynorsk)');
        ?>
</option>
                                <option value="pa_IN" <?php 
        if ($cff_locale_val == "pa_IN") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Punjabi');
        ?>
</option>
                                <option value="pl_PL" <?php 
        if ($cff_locale_val == "pl_PL") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Polish');
        ?>
</option>
                                <option value="ps_AF" <?php 
        if ($cff_locale_val == "ps_AF") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Pashto');
        ?>
</option>
                                <option value="pt_BR" <?php 
        if ($cff_locale_val == "pt_BR") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Portuguese (Brazil)');
        ?>
</option>
                                <option value="pt_PT" <?php 
        if ($cff_locale_val == "pt_PT") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Portuguese (Portugal)');
        ?>
</option>
                                <option value="ro_RO" <?php 
        if ($cff_locale_val == "ro_RO") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Romanian');
        ?>
</option>
                                <option value="ru_RU" <?php 
        if ($cff_locale_val == "ru_RU") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Russian');
        ?>
</option>
                                <option value="sk_SK" <?php 
        if ($cff_locale_val == "sk_SK") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Slovak');
        ?>
</option>
                                <option value="sl_SI" <?php 
        if ($cff_locale_val == "sl_SI") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Slovenian');
        ?>
</option>
                                <option value="sq_AL" <?php 
        if ($cff_locale_val == "sq_AL") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Albanian');
        ?>
</option>
                                <option value="sr_RS" <?php 
        if ($cff_locale_val == "sr_RS") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Serbian');
        ?>
</option>
                                <option value="sv_SE" <?php 
        if ($cff_locale_val == "sv_SE") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Swedish');
        ?>
</option>
                                <option value="sw_KE" <?php 
        if ($cff_locale_val == "sw_KE") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Swahili');
        ?>
</option>
                                <option value="ta_IN" <?php 
        if ($cff_locale_val == "ta_IN") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Tamil');
        ?>
</option>
                                <option value="te_IN" <?php 
        if ($cff_locale_val == "te_IN") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Telugu');
        ?>
</option>
                                <option value="th_TH" <?php 
        if ($cff_locale_val == "th_TH") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Thai');
        ?>
</option>
                                <option value="tl_PH" <?php 
        if ($cff_locale_val == "tl_PH") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Filipino');
        ?>
</option>
                                <option value="tr_TR" <?php 
        if ($cff_locale_val == "tr_TR") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Turkish');
        ?>
</option>
                                <option value="uk_UA" <?php 
        if ($cff_locale_val == "uk_UA") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Ukrainian');
        ?>
</option>
                                <option value="vi_VN" <?php 
        if ($cff_locale_val == "vi_VN") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Vietnamese');
        ?>
</option>
                                <option value="zh_CN" <?php 
        if ($cff_locale_val == "zh_CN") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Simplified Chinese (China)');
        ?>
</option>
                                <option value="zh_HK" <?php 
        if ($cff_locale_val == "zh_HK") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Traditional Chinese (Hong Kong)');
        ?>
</option>
                                <option value="zh_TW" <?php 
        if ($cff_locale_val == "zh_TW") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Traditional Chinese (Taiwan)');
        ?>
</option>
                            </select>
                            <i style="color: #666; font-size: 11px;"><?php 
        _e('Select a language');
        ?>
</i>
                        </td>
                    </tr>

                    <tr>
                        <th><label for="cff_timezone" class="bump-left"><?php 
        _e('Timezone');
        ?>
</label></th>
                            <td>
                                <select name="cff_timezone" style="width: 300px;">
                                    <option value="Pacific/Midway" <?php 
        if ($cff_timezone == "Pacific/Midway") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT-11:00) Midway Island, Samoa');
        ?>
</option>
                                    <option value="America/Adak" <?php 
        if ($cff_timezone == "America/Adak") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT-10:00) Hawaii-Aleutian');
        ?>
</option>
                                    <option value="Etc/GMT+10" <?php 
        if ($cff_timezone == "Etc/GMT+10") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT-10:00) Hawaii');
        ?>
</option>
                                    <option value="Pacific/Marquesas" <?php 
        if ($cff_timezone == "Pacific/Marquesas") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT-09:30) Marquesas Islands');
        ?>
</option>
                                    <option value="Pacific/Gambier" <?php 
        if ($cff_timezone == "Pacific/Gambier") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT-09:00) Gambier Islands');
        ?>
</option>
                                    <option value="America/Anchorage" <?php 
        if ($cff_timezone == "America/Anchorage") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT-09:00) Alaska');
        ?>
</option>
                                    <option value="America/Ensenada" <?php 
        if ($cff_timezone == "America/Ensenada") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT-08:00) Tijuana, Baja California');
        ?>
</option>
                                    <option value="Etc/GMT+8" <?php 
        if ($cff_timezone == "Etc/GMT+8") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT-08:00) Pitcairn Islands');
        ?>
</option>
                                    <option value="America/Los_Angeles" <?php 
        if ($cff_timezone == "America/Los_Angeles") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT-08:00) Pacific Time (US & Canada)');
        ?>
</option>
                                    <option value="America/Denver" <?php 
        if ($cff_timezone == "America/Denver") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT-07:00) Mountain Time (US & Canada)');
        ?>
</option>
                                    <option value="America/Chihuahua" <?php 
        if ($cff_timezone == "America/Chihuahua") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT-07:00) Chihuahua, La Paz, Mazatlan');
        ?>
</option>
                                    <option value="America/Dawson_Creek" <?php 
        if ($cff_timezone == "America/Dawson_Creek") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT-07:00) Arizona');
        ?>
</option>
                                    <option value="America/Belize" <?php 
        if ($cff_timezone == "America/Belize") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT-06:00) Saskatchewan, Central America');
        ?>
</option>
                                    <option value="America/Cancun" <?php 
        if ($cff_timezone == "America/Cancun") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT-06:00) Guadalajara, Mexico City, Monterrey');
        ?>
</option>
                                    <option value="Chile/EasterIsland" <?php 
        if ($cff_timezone == "Chile/EasterIsland") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT-06:00) Easter Island');
        ?>
</option>
                                    <option value="America/Chicago" <?php 
        if ($cff_timezone == "America/Chicago") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT-06:00) Central Time (US & Canada)');
        ?>
</option>
                                    <option value="America/New_York" <?php 
        if ($cff_timezone == "America/New_York") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT-05:00) Eastern Time (US & Canada)');
        ?>
</option>
                                    <option value="America/Havana" <?php 
        if ($cff_timezone == "America/Havana") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT-05:00) Cuba');
        ?>
</option>
                                    <option value="America/Bogota" <?php 
        if ($cff_timezone == "America/Bogota") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT-05:00) Bogota, Lima, Quito, Rio Branco');
        ?>
</option>
                                    <option value="America/Caracas" <?php 
        if ($cff_timezone == "America/Caracas") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT-04:30) Caracas');
        ?>
</option>
                                    <option value="America/Santiago" <?php 
        if ($cff_timezone == "America/Santiago") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT-04:00) Santiago');
        ?>
</option>
                                    <option value="America/La_Paz" <?php 
        if ($cff_timezone == "America/La_Paz") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT-04:00) La Paz');
        ?>
</option>
                                    <option value="Atlantic/Stanley" <?php 
        if ($cff_timezone == "Atlantic/Stanley") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT-04:00) Faukland Islands');
        ?>
</option>
                                    <option value="America/Campo_Grande" <?php 
        if ($cff_timezone == "America/Campo_Grande") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT-04:00) Brazil');
        ?>
</option>
                                    <option value="America/Goose_Bay" <?php 
        if ($cff_timezone == "America/Goose_Bay") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT-04:00) Atlantic Time (Goose Bay)');
        ?>
</option>
                                    <option value="America/Glace_Bay" <?php 
        if ($cff_timezone == "America/Glace_Bay") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT-04:00) Atlantic Time (Canada)');
        ?>
</option>
                                    <option value="America/St_Johns" <?php 
        if ($cff_timezone == "America/St_Johns") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT-03:30) Newfoundland');
        ?>
</option>
                                    <option value="America/Araguaina" <?php 
        if ($cff_timezone == "America/Araguaina") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT-03:00) UTC-3');
        ?>
</option>
                                    <option value="America/Montevideo" <?php 
        if ($cff_timezone == "America/Montevideo") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT-03:00) Montevideo');
        ?>
</option>
                                    <option value="America/Miquelon" <?php 
        if ($cff_timezone == "America/Miquelon") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT-03:00) Miquelon, St. Pierre');
        ?>
</option>
                                    <option value="America/Godthab" <?php 
        if ($cff_timezone == "America/Godthab") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT-03:00) Greenland');
        ?>
</option>
                                    <option value="America/Argentina/Buenos_Aires" <?php 
        if ($cff_timezone == "America/Argentina/Buenos_Aires") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT-03:00) Buenos Aires');
        ?>
</option>
                                    <option value="America/Sao_Paulo" <?php 
        if ($cff_timezone == "America/Sao_Paulo") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT-03:00) Brasilia');
        ?>
</option>
                                    <option value="America/Noronha" <?php 
        if ($cff_timezone == "America/Noronha") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT-02:00) Mid-Atlantic');
        ?>
</option>
                                    <option value="Atlantic/Cape_Verde" <?php 
        if ($cff_timezone == "Atlantic/Cape_Verde") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT-01:00) Cape Verde Is.');
        ?>
</option>
                                    <option value="Atlantic/Azores" <?php 
        if ($cff_timezone == "Atlantic/Azores") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT-01:00) Azores');
        ?>
</option>
                                    <option value="Europe/Belfast" <?php 
        if ($cff_timezone == "Europe/Belfast") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT) Greenwich Mean Time : Belfast');
        ?>
</option>
                                    <option value="Europe/Dublin" <?php 
        if ($cff_timezone == "Europe/Dublin") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT) Greenwich Mean Time : Dublin');
        ?>
</option>
                                    <option value="Europe/Lisbon" <?php 
        if ($cff_timezone == "Europe/Lisbon") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT) Greenwich Mean Time : Lisbon');
        ?>
</option>
                                    <option value="Europe/London" <?php 
        if ($cff_timezone == "Europe/London") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT) Greenwich Mean Time : London');
        ?>
</option>
                                    <option value="Africa/Abidjan" <?php 
        if ($cff_timezone == "Africa/Abidjan") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT) Monrovia, Reykjavik');
        ?>
</option>
                                    <option value="Europe/Amsterdam" <?php 
        if ($cff_timezone == "Europe/Amsterdam") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna');
        ?>
</option>
                                    <option value="Europe/Belgrade" <?php 
        if ($cff_timezone == "Europe/Belgrade") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague');
        ?>
</option>
                                    <option value="Europe/Brussels" <?php 
        if ($cff_timezone == "Europe/Brussels") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT+01:00) Brussels, Copenhagen, Madrid, Paris');
        ?>
</option>
                                    <option value="Africa/Algiers" <?php 
        if ($cff_timezone == "Africa/Algiers") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT+01:00) West Central Africa');
        ?>
</option>
                                    <option value="Africa/Windhoek" <?php 
        if ($cff_timezone == "Africa/Windhoek") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT+01:00) Windhoek');
        ?>
</option>
                                    <option value="Asia/Beirut" <?php 
        if ($cff_timezone == "Asia/Beirut") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT+02:00) Beirut');
        ?>
</option>
                                    <option value="Africa/Cairo" <?php 
        if ($cff_timezone == "Africa/Cairo") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT+02:00) Cairo');
        ?>
</option>
                                    <option value="Asia/Gaza" <?php 
        if ($cff_timezone == "Asia/Gaza") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT+02:00) Gaza');
        ?>
</option>
                                    <option value="Africa/Blantyre" <?php 
        if ($cff_timezone == "Africa/Blantyre") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT+02:00) Harare, Pretoria');
        ?>
</option>
                                    <option value="Asia/Jerusalem" <?php 
        if ($cff_timezone == "Asia/Jerusalem") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT+02:00) Jerusalem');
        ?>
</option>
                                    <option value="Europe/Minsk" <?php 
        if ($cff_timezone == "Europe/Minsk") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT+02:00) Minsk');
        ?>
</option>
                                    <option value="Asia/Damascus" <?php 
        if ($cff_timezone == "Asia/Damascus") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT+02:00) Syria');
        ?>
</option>
                                    <option value="Europe/Moscow" <?php 
        if ($cff_timezone == "Europe/Moscow") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT+03:00) Moscow, St. Petersburg, Volgograd');
        ?>
</option>
                                    <option value="Africa/Addis_Ababa" <?php 
        if ($cff_timezone == "Africa/Addis_Ababa") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT+03:00) Nairobi');
        ?>
</option>
                                    <option value="Asia/Tehran" <?php 
        if ($cff_timezone == "Asia/Tehran") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT+03:30) Tehran');
        ?>
</option>
                                    <option value="Asia/Dubai" <?php 
        if ($cff_timezone == "Asia/Dubai") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT+04:00) Abu Dhabi, Muscat');
        ?>
</option>
                                    <option value="Asia/Yerevan" <?php 
        if ($cff_timezone == "Asia/Yerevan") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT+04:00) Yerevan');
        ?>
</option>
                                    <option value="Asia/Kabul" <?php 
        if ($cff_timezone == "Asia/Kabul") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT+04:30) Kabul');
        ?>
</option>
                                    <option value="Asia/Yekaterinburg" <?php 
        if ($cff_timezone == "Asia/Yekaterinburg") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT+05:00) Ekaterinburg');
        ?>
</option>
                                    <option value="Asia/Tashkent" <?php 
        if ($cff_timezone == "Asia/Tashkent") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT+05:00) Tashkent');
        ?>
</option>
                                    <option value="Asia/Kolkata" <?php 
        if ($cff_timezone == "Asia/Kolkata") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT+05:30) Chennai, Kolkata, Mumbai, New Delhi');
        ?>
</option>
                                    <option value="Asia/Katmandu" <?php 
        if ($cff_timezone == "Asia/Katmandu") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT+05:45) Kathmandu');
        ?>
</option>
                                    <option value="Asia/Dhaka" <?php 
        if ($cff_timezone == "Asia/Dhaka") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT+06:00) Astana, Dhaka');
        ?>
</option>
                                    <option value="Asia/Novosibirsk" <?php 
        if ($cff_timezone == "Asia/Novosibirsk") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT+06:00) Novosibirsk');
        ?>
</option>
                                    <option value="Asia/Rangoon" <?php 
        if ($cff_timezone == "Asia/Rangoon") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT+06:30) Yangon (Rangoon)');
        ?>
</option>
                                    <option value="Asia/Bangkok" <?php 
        if ($cff_timezone == "Asia/Bangkok") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT+07:00) Bangkok, Hanoi, Jakarta');
        ?>
</option>
                                    <option value="Asia/Krasnoyarsk" <?php 
        if ($cff_timezone == "Asia/Krasnoyarsk") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT+07:00) Krasnoyarsk');
        ?>
</option>
                                    <option value="Asia/Hong_Kong" <?php 
        if ($cff_timezone == "Asia/Hong_Kong") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT+08:00) Beijing, Chongqing, Hong Kong, Urumqi');
        ?>
</option>
                                    <option value="Asia/Irkutsk" <?php 
        if ($cff_timezone == "Asia/Irkutsk") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT+08:00) Irkutsk, Ulaan Bataar');
        ?>
</option>
                                    <option value="Australia/Perth" <?php 
        if ($cff_timezone == "Australia/Perth") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT+08:00) Perth');
        ?>
</option>
                                    <option value="Australia/Eucla" <?php 
        if ($cff_timezone == "Australia/Eucla") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT+08:45) Eucla');
        ?>
</option>
                                    <option value="Asia/Tokyo" <?php 
        if ($cff_timezone == "Asia/Tokyo") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT+09:00) Osaka, Sapporo, Tokyo');
        ?>
</option>
                                    <option value="Asia/Seoul" <?php 
        if ($cff_timezone == "Asia/Seoul") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT+09:00) Seoul');
        ?>
</option>
                                    <option value="Asia/Yakutsk" <?php 
        if ($cff_timezone == "Asia/Yakutsk") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT+09:00) Yakutsk');
        ?>
</option>
                                    <option value="Australia/Adelaide" <?php 
        if ($cff_timezone == "Australia/Adelaide") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT+09:30) Adelaide');
        ?>
</option>
                                    <option value="Australia/Darwin" <?php 
        if ($cff_timezone == "Australia/Darwin") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT+09:30) Darwin');
        ?>
</option>
                                    <option value="Australia/Brisbane" <?php 
        if ($cff_timezone == "Australia/Brisbane") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT+10:00) Brisbane');
        ?>
</option>
                                    <option value="Australia/Hobart" <?php 
        if ($cff_timezone == "Australia/Hobart") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT+10:00) Sydney');
        ?>
</option>
                                    <option value="Asia/Vladivostok" <?php 
        if ($cff_timezone == "Asia/Vladivostok") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT+10:00) Vladivostok');
        ?>
</option>
                                    <option value="Australia/Lord_Howe" <?php 
        if ($cff_timezone == "Australia/Lord_Howe") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT+10:30) Lord Howe Island');
        ?>
</option>
                                    <option value="Etc/GMT-11" <?php 
        if ($cff_timezone == "Etc/GMT-11") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT+11:00) Solomon Is., New Caledonia');
        ?>
</option>
                                    <option value="Asia/Magadan" <?php 
        if ($cff_timezone == "Asia/Magadan") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT+11:00) Magadan');
        ?>
</option>
                                    <option value="Pacific/Norfolk" <?php 
        if ($cff_timezone == "Pacific/Norfolk") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT+11:30) Norfolk Island');
        ?>
</option>
                                    <option value="Asia/Anadyr" <?php 
        if ($cff_timezone == "Asia/Anadyr") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT+12:00) Anadyr, Kamchatka');
        ?>
</option>
                                    <option value="Pacific/Auckland" <?php 
        if ($cff_timezone == "Pacific/Auckland") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT+12:00) Auckland, Wellington');
        ?>
</option>
                                    <option value="Etc/GMT-12" <?php 
        if ($cff_timezone == "Etc/GMT-12") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT+12:00) Fiji, Kamchatka, Marshall Is.');
        ?>
</option>
                                    <option value="Pacific/Chatham" <?php 
        if ($cff_timezone == "Pacific/Chatham") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT+12:45) Chatham Islands');
        ?>
</option>
                                    <option value="Pacific/Tongatapu" <?php 
        if ($cff_timezone == "Pacific/Tongatapu") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT+13:00) Nuku\'alofa');
        ?>
</option>
                                    <option value="Pacific/Kiritimati" <?php 
        if ($cff_timezone == "Pacific/Kiritimati") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('(GMT+14:00) Kiritimati');
        ?>
</option>
                                </select>
                            </td>
                        </tr>

                    <?php 
        if ($cff_lightbox_active) {
            echo cff_lightbox_options($cff_lightbox_val);
        }
        ?>

                </tbody>
            </table>
            <?php 
        submit_button();
        ?>
        </form>
        
        <hr />
        <h3><?php 
        _e('Displaying your Feed');
        ?>
</h3>
        <p><?php 
        _e("Copy and paste this shortcode directly into the page, post or widget where you'd like the feed to show up:");
        ?>
</p>
        <input type="text" value="[custom-facebook-feed]" size="22" readonly="readonly" onclick="this.focus();this.select()" title="<?php 
        _e('To copy, click the field then press Ctrl + C (PC) or Cmd + C (Mac).');
        ?>
" />
        
        <hr />
        <h3><?php 
        _e('Customizing your Feed');
        ?>
</h3>
        <p><?php 
        _e("Use the <a href='admin.php?page=cff-style'>Customize</a> page to customize your feed.");
        ?>
</p>

        <hr />
        <h3><?php 
        _e('Mulitple Feeds');
        ?>
</h3>
        <p><?php 
        _e("If you're displaying multiple feeds and want to use different settings in each one then you can override the options on the Settings and Customize pages directly in the shortcode like so:");
        ?>
</p>
        <code>[custom-facebook-feed id=smashballoon num=3 layout=thumb height=500px]</code>

        <p><a href="http://smashballoon.com/custom-facebook-feed/docs/shortcodes/" target="_blank"><?php 
        _e('See a full list of shortcode options');
        ?>
</a></p>


        <hr />
        <h3><?php 
        _e('Like the plugin? Help spread the word!');
        ?>
</h3>

        <!-- TWITTER -->
        <a href="https://twitter.com/share" class="twitter-share-button" data-url="https://smashballoon.com/custom-facebook-feed/" data-text="Display your Facebook posts on your site your way using the Custom Facebook Feed WordPress plugin!" data-via="smashballoon" data-dnt="true">Tweet</a>
        <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
        <style type="text/css">
        #twitter-widget-0{ float: left; width: 100px !important; }
        .IN-widget{ margin-right: 20px; }
        </style>

        <!-- FACEBOOK -->
        <div id="fb-root" style="display: none;"></div>
        <script>(function(d, s, id) {
          var js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) return;
          js = d.createElement(s); js.id = id;
          js.src = "//connect.facebook.net/en_GB/sdk.js#xfbml=1&appId=640861236031365&version=v2.0";
          fjs.parentNode.insertBefore(js, fjs);
        }(document, 'script', 'facebook-jssdk'));</script>
        <div class="fb-like" data-href="https://smashballoon.com/custom-facebook-feed/" data-layout="button_count" data-action="like" data-show-faces="false" data-share="true" style="display: block; float: left; margin-right: 20px;"></div>

        <!-- LINKEDIN -->
        <script src="//platform.linkedin.com/in.js" type="text/javascript">
          lang: en_US
        </script>
        <script type="IN/Share" data-url="https://smashballoon.com/custom-facebook-feed/"></script>

        <!-- GOOGLE + -->
        <script src="https://apis.google.com/js/platform.js" async defer></script>
        <div class="g-plusone" data-size="medium" data-href="https://smashballoon.com/custom-facebook-feed/"></div>



    <?php 
    }
    //End config tab
    ?>

    <?php 
    if ($cff_active_tab == 'license') {
        //Start License tab
        ?>

    <?php 
        $cff_license = trim(get_option('cff_license_key'));
        $cff_status = get_option('cff_license_status');
        ?>

        <form method="post" action="options.php">
    
            <?php 
        settings_fields('cff_license');
        ?>

            <?php 
        // data to send in our API request
        $cff_api_params = array('edd_action' => 'check_license', 'license' => $cff_license, 'item_name' => urlencode(WPW_SL_ITEM_NAME));
        // Call the custom API.
        $cff_response = wp_remote_get(add_query_arg($cff_api_params, WPW_SL_STORE_URL), array('timeout' => 60, 'sslverify' => false));
        // decode the license data
        $cff_license_data = (array) json_decode(wp_remote_retrieve_body($cff_response));
        //Store license data in db unless the data comes back empty as wasn't able to connect to our website to get it
        if (!empty($cff_license_data)) {
            update_option('cff_license_data', $cff_license_data);
        }
        ?>

            <br />
            <table class="form-table">
                <tbody>
                    <tr valign="top">   
                        <th scope="row" valign="top"><?php 
        _e('Custom Facebook Feed Pro');
        ?>
</th>
                        <td>
                            <input id="cff_license_key" name="cff_license_key" type="text" class="regular-text" value="<?php 
        esc_attr_e($cff_license);
        ?>
" />
                            <?php 
        if (false !== $cff_license) {
            ?>
                                <?php 
            if ($cff_status !== false && $cff_status == 'valid') {
                ?>
                                    <?php 
                wp_nonce_field('cff_nonce', 'cff_nonce');
                ?>
                                    <input type="submit" class="button-secondary" name="cff_license_deactivate" value="<?php 
                _e('Deactivate License');
                ?>
"/>
                                    
                                    <?php 
                if ($cff_license_data['license'] == 'expired') {
                    ?>
                                        <span style="color:red;"><?php 
                    _e('Expired');
                    ?>
</span>
                                    <?php 
                } else {
                    ?>
                                        <span style="color:green;"><?php 
                    _e('Active');
                    ?>
</span>
                                    <?php 
                }
                ?>

                                <?php 
            } else {
                wp_nonce_field('cff_nonce', 'cff_nonce');
                ?>
                                    <input type="submit" class="button-secondary" name="cff_license_activate" value="<?php 
                _e('Activate License');
                ?>
"/>
                                    
                                    <?php 
                if ($cff_license_data['license'] == 'expired') {
                    ?>
                                        <span style="color:red;"><?php 
                    _e('Expired');
                    ?>
</span>
                                    <?php 
                } else {
                    ?>
                                        <span style="color:red;"><?php 
                    _e('Inactive');
                    ?>
</span>
                                    <?php 
                }
                ?>

                                <?php 
            }
            ?>
                            <?php 
        }
        ?>
                            <br />
                            <i style="color: #666; font-size: 11px;"><?php 
        _e('The license key you received when purchasing the plugin.');
        ?>
</i>
                            <?php 
        global $cff_download_id;
        ?>
                            <p style="font-size: 13px;"><a href='https://smashballoon.com/checkout/?edd_license_key=<?php 
        echo trim($cff_license);
        ?>
&amp;download_id=<?php 
        echo $cff_download_id;
        ?>
' target='_blank'><?php 
        _e("Renew your license");
        ?>
</a>&nbsp;&nbsp;&nbsp;&middot;<a class="cff-tooltip-link" href="JavaScript:void(0);"><?php 
        _e("Upgrade your license");
        ?>
</a>
                            </p>
                            
                            <div class="cff-tooltip cff-more-info">
                                <?php 
        _e("<p>You can upgrade your license in two ways:</p>\r\n                                <p>&bull;&nbsp; Log into <a href='https://smashballoon.com/account' target='_blank'>your Account</a> and click on the 'Upgrade my License' tab<br />\r\n                                &bull;&nbsp; <a href='https://smashballoon.com/contact/' target='_blank'>Contact us directly</a></p>");
        ?>
                            </div>
                        </td>
                    </tr>

                    <?php 
        do_action('cff_admin_license');
        ?>

                </tbody>
            </table>
            <?php 
        submit_button();
        ?>
        
        </form>

    <?php 
    }
    ?>

    <?php 
    if ($cff_active_tab == 'support') {
        //Start Support tab
        ?>

        <br />
        <h3><?php 
        _e('FAQs and Troubleshooting');
        ?>
</h3>
        <p>Having trouble getting the plugin to work? Try the links below:</p>
        <ul>
        <li>- <?php 
        _e('<a href="http://smashballoon.com/custom-facebook-feed/faq/general/" target="_blank">General Questions</a>');
        ?>
</li>
        <li>- <?php 
        _e('<a href="http://smashballoon.com/custom-facebook-feed/faq/setup/" target="_blank">Setting Up &amp; Displaying your Feed</a>');
        ?>
</li>
        <li>- <?php 
        _e('<a href="http://smashballoon.com/custom-facebook-feed/faq/troubleshooting/" target="_blank">Troubleshooting &amp; Common Support Questions</a>');
        ?>
</li>
        </ul>
        <br />
        <h3>Documentation</h3>
        <p>Need help setting up, configuring or customizing the plugin? Check out the links below:</p>
        <ul>
        <li>- <?php 
        _e('<a href="http://smashballoon.com/custom-facebook-feed/docs/wordpress/" target="_blank">Installation and Configuration</a>');
        ?>
</li>
        <li>- <?php 
        _e('<a href="http://smashballoon.com/custom-facebook-feed/docs/shortcodes/" target="_blank">Shortcode Reference</a>');
        ?>
</li>
        <li>- <?php 
        _e('<a href="http://smashballoon.com/custom-facebook-feed/docs/snippets/" target="_blank">Custom CSS and JavaScript Snippets</a>');
        ?>
</li>
        </ul>

        <br />
        <p><?php 
        _e('Still need help? <a href="http://smashballoon.com/custom-facebook-feed/support/" target="_blank">Request support</a>. Please include your <b>System Info</b> below with all support requests.');
        ?>
</p>

        <br />
        <h3><?php 
        _e('System Info &nbsp; <i style="color: #666; font-size: 11px; font-weight: normal;">Click the text below to select all</i>');
        ?>
</h3>

        <?php 
        $access_token = get_option($access_token);
        if ($access_token == '' || empty($access_token)) {
            $access_token = '352340714888355|DtZ_FQ12HFzarCLCiNl0Ck2DdD8';
        }
        ?>
        <?php 
        $posts_json = cff_fetchUrl("https://graph.facebook.com/" . get_option(trim($page_id)) . "/feed?access_token=" . trim($access_token) . "&limit=1");
        ?>

        <textarea readonly="readonly" onclick="this.focus();this.select()" title="To copy, click the field then press Ctrl + C (PC) or Cmd + C (Mac)." style="width: 70%; height: 500px; white-space: pre; font-family: Menlo,Monaco,monospace;">
## SITE/SERVER INFO: ##
Plugin Version:           <?php 
        echo WPW_SL_ITEM_NAME . "\n";
        ?>
Site URL:                 <?php 
        echo site_url() . "\n";
        ?>
Home URL:                 <?php 
        echo home_url() . "\n";
        ?>
WordPress Version:        <?php 
        echo get_bloginfo('version') . "\n";
        ?>
PHP Version:              <?php 
        echo PHP_VERSION . "\n";
        ?>
Web Server Info:          <?php 
        echo $_SERVER['SERVER_SOFTWARE'] . "\n";
        ?>
PHP allow_url_fopen:      <?php 
        echo ini_get('allow_url_fopen') ? "Yes" . "\n" : "No" . "\n";
        ?>
PHP cURL:                 <?php 
        echo is_callable('curl_init') ? "Yes" . "\n" : "No" . "\n";
        ?>
JSON:                     <?php 
        echo function_exists("json_decode") ? "Yes" . "\n" : "No" . "\n";
        ?>
SSL Stream:               <?php 
        echo in_array('https', stream_get_wrappers()) ? "Yes" . "\n" : "No" . "\n";
        ?>

## ACTIVE PLUGINS: ##
<?php 
        $plugins = get_plugins();
        $active_plugins = get_option('active_plugins', array());
        foreach ($plugins as $plugin_path => $plugin) {
            // If the plugin isn't active, don't show it.
            if (!in_array($plugin_path, $active_plugins)) {
                continue;
            }
            echo $plugin['Name'] . ': ' . $plugin['Version'] . "\n";
        }
        ?>

## PLUGIN SETTINGS: ##
Use own Access Token:   <?php 
        echo get_option('cff_show_access_token') . "\n";
        ?>
Access Token:           <?php 
        echo get_option('cff_access_token') . "\n";
        ?>
Page ID:                <?php 
        echo get_option('cff_page_id') . "\n";
        ?>
Page Type:              <?php 
        echo get_option('cff_page_type') . "\n";
        ?>
Number of Posts:        <?php 
        echo get_option('cff_num_show') . "\n";
        ?>
Post Limit:             <?php 
        echo get_option('cff_post_limit') . "\n";
        ?>
Show Posts by:          <?php 
        echo get_option('cff_show_others') . "\n";
        ?>
Cache Time:             <?php 
        echo get_option('cff_cache_time') . "\n";
        ?>
Cache Unit:             <?php 
        echo get_option('cff_cache_time_unit') . "\n";
        ?>
Locale:                 <?php 
        echo get_option('cff_locale') . "\n";
        ?>
Timezone:               <?php 
        $options = get_option('cff_style_settings', array());
        echo $options['cff_timezone'] . "\n";
        ?>

## EXTENSIONS: ##
Extensions Plugin:      <?php 
        echo get_option('cff_extensions_status') . "\n";
        ?>
Date Range From:        <?php 
        echo get_option('cff_date_from') . "\n";
        ?>
Date Range Until:       <?php 
        echo get_option('cff_date_until') . "\n";
        ?>
Featured Post:          <?php 
        echo get_option('cff_featured_post_id') . "\n";
        ?>
Lightbox:               <?php 
        echo get_option('cff_lightbox') . "\n";
        ?>

## CUSTOMIZE: ##
cff_ajax => <?php 
        echo get_option('cff_ajax') . "\n";
        ?>
cff_preserve_settings => <?php 
        echo get_option('cff_preserve_settings') . "\n";
        ?>
cff_title_length => <?php 
        echo get_option('cff_title_length') . "\n";
        ?>
cff_body_length => <?php 
        echo get_option('cff_body_length') . "\n";
        while (list($key, $val) = each($options)) {
            echo "{$key} => {$val}\n";
        }
        ?>

## FACEBOOK API RESPONSE: ##
<?php 
        echo $posts_json;
        ?>
        </textarea>

    <?php 
    }
    ?>

        
<?php 
}
function cff_settings_page()
{
    //Which extensions are active?
    //Is individual extension active || is Smash License extensions bundle active?
    $cff_ext_options = get_option('cff_extensions_status');
    //Set extensions in extensions plugin all to false by default
    $cff_extensions_multifeed_active = false;
    $cff_extensions_date_range_active = false;
    $cff_extensions_featured_post_active = false;
    $cff_extensions_album_active = false;
    $cff_extensions_lightbox_active = false;
    if (WPW_SL_ITEM_NAME == 'Custom Facebook Feed WordPress Plugin Smash') {
        //Set page variables
        if (isset($cff_ext_options['cff_extensions_multifeed_active'])) {
            $cff_extensions_multifeed_active = $cff_ext_options['cff_extensions_multifeed_active'];
        }
        if (isset($cff_ext_options['cff_extensions_date_range_active'])) {
            $cff_extensions_date_range_active = $cff_ext_options['cff_extensions_date_range_active'];
        }
        if (isset($cff_ext_options['cff_extensions_featured_post_active'])) {
            $cff_extensions_featured_post_active = $cff_ext_options['cff_extensions_featured_post_active'];
        }
        if (isset($cff_ext_options['cff_extensions_album_active'])) {
            $cff_extensions_album_active = $cff_ext_options['cff_extensions_album_active'];
        }
        if (isset($cff_ext_options['cff_extensions_lightbox_active'])) {
            $cff_extensions_lightbox_active = $cff_ext_options['cff_extensions_lightbox_active'];
        }
    }
    is_plugin_active('cff-multifeed/cff-multifeed.php') || $cff_extensions_multifeed_active ? $cff_ext_multifeed_active = true : ($cff_ext_multifeed_active = false);
    is_plugin_active('cff-date-range/cff-date-range.php') || $cff_extensions_date_range_active ? $cff_ext_date_active = true : ($cff_ext_date_active = false);
    is_plugin_active('cff-featured-post/cff-featured-post.php') || $cff_extensions_featured_post_active ? $cff_featured_post_active = true : ($cff_featured_post_active = false);
    is_plugin_active('cff-album/cff-album.php') || $cff_extensions_album_active ? $cff_album_active = true : ($cff_album_active = false);
    is_plugin_active('cff-lightbox/cff-lightbox.php') || $cff_extensions_lightbox_active ? $cff_lightbox_active = true : ($cff_lightbox_active = false);
    //Declare variables for fields
    $hidden_field_name = 'cff_submit_hidden';
    $show_access_token = 'cff_show_access_token';
    $access_token = 'cff_access_token';
    $page_id = 'cff_page_id';
    $cff_page_type = 'cff_page_type';
    $num_show = 'cff_num_show';
    $cff_post_limit = 'cff_post_limit';
    $cff_show_others = 'cff_show_others';
    $cff_cache_time = 'cff_cache_time';
    $cff_cache_time_unit = 'cff_cache_time_unit';
    $cff_locale = 'cff_locale';
    //Extensions
    $cff_date_from = 'cff_date_from';
    $cff_date_until = 'cff_date_until';
    $cff_featured_post_id = 'cff_featured_post_id';
    $cff_lightbox = 'cff_lightbox';
    // Read in existing option value from database
    $show_access_token_val = get_option($show_access_token);
    $access_token_val = get_option($access_token);
    $page_id_val = get_option($page_id);
    $cff_page_type_val = get_option($cff_page_type);
    $num_show_val = get_option($num_show, '5');
    $cff_post_limit_val = get_option($cff_post_limit);
    $cff_show_others_val = get_option($cff_show_others);
    $cff_cache_time_val = get_option($cff_cache_time, '1');
    $cff_cache_time_unit_val = get_option($cff_cache_time_unit, 'hours');
    $cff_locale_val = get_option($cff_locale, 'en_US');
    //Extensions
    $cff_date_from_val = get_option($cff_date_from);
    $cff_date_until_val = get_option($cff_date_until);
    $cff_featured_post_id_val = get_option($cff_featured_post_id);
    $cff_lightbox_val = get_option($cff_lightbox);
    // See if the user has posted us some information. If they did, this hidden field will be set to 'Y'.
    if (isset($_POST[$hidden_field_name]) && $_POST[$hidden_field_name] == 'Y') {
        // Read their posted value
        isset($_POST[$show_access_token]) ? $show_access_token_val = $_POST[$show_access_token] : ($show_access_token_val = '');
        isset($_POST[$access_token]) ? $access_token_val = $_POST[$access_token] : ($access_token_val = '');
        isset($_POST[$page_id]) ? $page_id_val = $_POST[$page_id] : ($page_id_val = '');
        isset($_POST[$cff_page_type]) ? $cff_page_type_val = $_POST[$cff_page_type] : ($cff_page_type_val = '');
        isset($_POST[$num_show]) ? $num_show_val = $_POST[$num_show] : ($num_show_val = '');
        isset($_POST[$cff_post_limit]) ? $cff_post_limit_val = $_POST[$cff_post_limit] : ($cff_post_limit_val = '');
        isset($_POST[$cff_show_others]) ? $cff_show_others_val = $_POST[$cff_show_others] : ($cff_show_others_val = '');
        isset($_POST[$cff_cache_time]) ? $cff_cache_time_val = $_POST[$cff_cache_time] : ($cff_cache_time_val = '');
        isset($_POST[$cff_cache_time_unit]) ? $cff_cache_time_unit_val = $_POST[$cff_cache_time_unit] : ($cff_cache_time_unit_val = '');
        isset($_POST[$cff_locale]) ? $cff_locale_val = $_POST[$cff_locale] : ($cff_locale_val = '');
        //Extensions
        isset($_POST[$cff_date_from]) ? $cff_date_from_val = $_POST[$cff_date_from] : ($cff_date_from_val = '');
        isset($_POST[$cff_date_until]) ? $cff_date_until_val = $_POST[$cff_date_until] : ($cff_date_until_val = '');
        isset($_POST[$cff_featured_post_id]) ? $cff_featured_post_id_val = $_POST[$cff_featured_post_id] : ($cff_featured_post_id_val = '');
        isset($_POST[$cff_lightbox]) ? $cff_lightbox_val = $_POST[$cff_lightbox] : ($cff_lightbox_val = '');
        // Save the posted value in the database
        update_option($show_access_token, $show_access_token_val);
        update_option($access_token, $access_token_val);
        update_option($page_id, $page_id_val);
        update_option($cff_page_type, $cff_page_type_val);
        update_option($num_show, $num_show_val);
        update_option($cff_post_limit, $cff_post_limit_val);
        update_option($cff_show_others, $cff_show_others_val);
        update_option($cff_cache_time, $cff_cache_time_val);
        update_option($cff_cache_time_unit, $cff_cache_time_unit_val);
        update_option($cff_locale, $cff_locale_val);
        //Extensions
        update_option($cff_date_from, $cff_date_from_val);
        update_option($cff_date_until, $cff_date_until_val);
        update_option($cff_featured_post_id, $cff_featured_post_id_val);
        update_option($cff_lightbox, $cff_lightbox_val);
        //Delete the transient for the main page ID
        delete_transient('cff_posts_json_' . $page_id_val);
        delete_transient('cff_feed_json_' . $page_id_val);
        delete_transient('cff_events_json_' . $page_id_val);
        //Delete ALL transients
        global $wpdb;
        $table_name = $wpdb->prefix . "options";
        $wpdb->query("\r\n            DELETE\r\n            FROM {$table_name}\r\n            WHERE `option_name` LIKE ('%cff\\_posts\\_json\\_%')\r\n            ");
        $wpdb->query("\r\n            DELETE\r\n            FROM {$table_name}\r\n            WHERE `option_name` LIKE ('%cff\\_feed\\_json\\_%')\r\n            ");
        $wpdb->query("\r\n            DELETE\r\n            FROM {$table_name}\r\n            WHERE `option_name` LIKE ('%cff\\_events\\_json\\_%')\r\n            ");
        $wpdb->query("\r\n            DELETE\r\n            FROM {$table_name}\r\n            WHERE `option_name` LIKE ('%cff\\_timeline\\_event\\_json\\_%')\r\n            ");
        $wpdb->query("\r\n            DELETE\r\n            FROM {$table_name}\r\n            WHERE `option_name` LIKE ('%cff\\_album\\_json\\_%')\r\n            ");
        // Put an settings updated message on the screen
        ?>
    <div class="updated"><p><strong><?php 
        _e('Settings saved.', 'custom-facebook-feed');
        ?>
</strong></p></div>
    <?php 
    }
    ?>
 
    <div id="cff-admin" class="wrap">
        <div id="header">
            <h2><?php 
    _e('Custom Facebook Feed Settings');
    ?>
</h2>
        </div>

        <?php 
    cff_expiration_notice();
    ?>

        <?php 
    $cff_active_tab = isset($_GET['tab']) ? $_GET['tab'] : 'configuration';
    ?>
        <h2 class="nav-tab-wrapper">
            <a href="?page=cff-top&amp;tab=configuration" class="nav-tab <?php 
    echo $cff_active_tab == 'configuration' ? 'nav-tab-active' : '';
    ?>
"><?php 
    _e('Configuration');
    ?>
</a>
            <a href="?page=cff-style" class="nav-tab"><?php 
    _e('Customize');
    ?>
</a>
            <a href="?page=cff-top&amp;tab=license" class="nav-tab <?php 
    echo $cff_active_tab == 'license' ? 'nav-tab-active' : '';
    ?>
"><?php 
    _e('License');
    ?>
</a>
            <a href="?page=cff-top&amp;tab=support" class="nav-tab <?php 
    echo $cff_active_tab == 'support' ? 'nav-tab-active' : '';
    ?>
"><?php 
    _e('Support');
    ?>
</a>
        </h2>

        <?php 
    if ($cff_active_tab == 'configuration') {
        //Start Extensions tab
        ?>

        <form name="form1" method="post" action="">
            <input type="hidden" name="<?php 
        echo $hidden_field_name;
        ?>
" value="Y">
            <br />
            <h3><?php 
        _e('Configuration');
        ?>
</h3>
            <table class="form-table">
                <tbody>
                    <tr valign="top">
                        <th scope="row">
                            <?php 
        if ($cff_ext_multifeed_active) {
            ?>
                            <?php 
            _e('Facebook Page IDs');
            ?>
<br /><i style="color: #666; font-size: 11px;"><?php 
            _e('Separate multiple IDs with commas</i>');
            ?>
</th>
                            <?php 
        } else {
            ?>
                            <?php 
            _e('Facebook Page ID<br /><i style="font-weight: normal; font-size: 12px;">ID of your Facebook Page or Group</i>');
            ?>
</th>
                            <?php 
        }
        ?>
                        <td>

                            <?php 
        if ($cff_ext_multifeed_active) {
            ?>
                            <textarea name="cff_page_id" id="cff_page_id" style="width: 390px;" rows="3" /><?php 
            esc_attr_e($page_id_val);
            ?>
</textarea>
                            <?php 
        } else {
            ?>
                            <input name="cff_page_id" id="cff_page_id" type="text" value="<?php 
            esc_attr_e($page_id_val);
            ?>
" size="45" />
                            <?php 
        }
        ?>

                            &nbsp;<a class="cff-tooltip-link" href="JavaScript:void(0);"><?php 
        _e("What's my Page ID?");
        ?>
</a>
                            <br /><i style="color: #666; font-size: 11px;"><?php 
        _e("Eg. 1234567890123");
        ?>
</i>
                            <div class="cff-tooltip cff-more-info">
                                <ul>
                                    <li><?php 
        _e('If you have a Facebook <b>page</b> with a URL like this: <code>https://www.facebook.com/your_page_name</code> then the Page ID is just <b>your_page_name</b>. If your page URL is structured like this: <code>https://www.facebook.com/pages/your_page_name/123654123654123</code> then the Page ID is actually the number at the end, so in this case <b>123654123654123</b>.</li>');
        ?>
                                    <li><?php 
        _e('If you have a Facebook <b>group</b> then use <a href="http://lookup-id.com/" target="_blank" title="Find my ID">this tool</a> to find your ID.');
        ?>
</li>
                                    <li><?php 
        _e('You can copy and paste your ID into the <a href="http://smashballoon.com/custom-facebook-feed/demo/" target="_blank">demo</a> to test it.');
        ?>
</li>
                                </ul>
                            </div>
                        </td>
                    </tr>
                    
                    <?php 
        if ($cff_featured_post_active) {
            echo cff_featured_post_options($cff_featured_post_id_val);
        }
        ?>

                    <tr valign="top">
                        <th scope="row" style="padding-bottom: 10px;"><?php 
        _e('Enter my own Access Token <i style="font-weight: normal; font-size: 12px;">This is Optional</i>');
        ?>
</th>
                        <td>
                            <input name="cff_show_access_token" type="checkbox" id="cff_show_access_token" <?php 
        if ($show_access_token_val == true) {
            echo "checked";
        }
        ?>
 />&nbsp;<a class="cff-tooltip-link" href="JavaScript:void(0);"><?php 
        _e("What is this?");
        ?>
</a>
                            <p class="cff-tooltip cff-more-info"><?php 
        _e("A Facebook Access Token is not required to use this plugin, but if you have your own that you'd like to use then you can check this box and enter it here. To get your own Access Token you can follow these <a href='https://smashballoon.com/custom-facebook-feed/access-token/' target='_blank'>step-by-step instructions</a>");
        ?>
.</p>
                        </td>
                    </tr>

                    <tr valign="top" class="cff-access-token-hidden">
                        <th scope="row" style="padding-bottom: 10px;"><?php 
        _e('Facebook Access Token');
        ?>
</th>
                        <td>
                            <input name="cff_access_token" id="cff_access_token" type="text" value="<?php 
        esc_attr_e($access_token_val);
        ?>
" size="45" />

                            <div class="cff-notice cff-profile-error cff-access-token">
                                <?php 
        _e("<p>This doesn't appear to be an Access Token. Please be sure that you didn't enter your App Secret instead of your Access Token.<br />Your App ID and App Secret are used to obtain your Access Token; simply paste them into the fields in the last step of the <a href='https://smashballoon.com/custom-facebook-feed/access-token/' target='_blank'>Access Token instructions</a> and click '<b>Get my Access Token</b>'.</p>");
        ?>
                            </div>
                        </td>
                    </tr>

                </tbody>
            </table>
            <hr />
            <table class="form-table">
                <tbody>
                    <h3><?php 
        _e('Settings');
        ?>
</h3>
                    <tr valign="top" class="cff-page-type">
                        <th scope="row"><?php 
        _e('Is this a page, group or profile?');
        ?>
</th>
                        <td>
                            <select name="cff_page_type">
                                <option value="page" <?php 
        if ($cff_page_type_val == "page") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Page');
        ?>
</option>
                                <option value="group" <?php 
        if ($cff_page_type_val == "group") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Group');
        ?>
</option>
                                <option value="profile" <?php 
        if ($cff_page_type_val == "profile") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Profile');
        ?>
</option>
                            </select>
                            <div class="cff-notice cff-profile-error cff-page-type">
                                <?php 
        _e("<p>Due to Facebook's privacy policy you're not able to display posts from a personal profile, only from a public page or group.</p><p>If you're using a profile to represent a business, organization, product, public figure or the like, then Facebook recommends <a href='http://www.facebook.com/help/175644189234902/' target='_blank'>converting your profile to a page</a>. There are many advantages to using pages over profiles, and once you've converted then the plugin will be able to successfully retrieve and display all of your posts.</p>");
        ?>
                            </div>
                        </td>
                    </tr>

                    <tr valign="top" class="cff-page-options">
                        <th scope="row"><?php 
        _e('Show posts on my page by:');
        ?>
</th>
                        <td>

                            <select name="cff_show_others" id="cff_show_others" style="width: 250px;">
                                <option value="me" <?php 
        if ($cff_show_others_val == 'me') {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Only the page owner (me)');
        ?>
</option>
                                <option value="others" <?php 
        if ($cff_show_others_val == 'others') {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Page owner + other people');
        ?>
</option>
                                <option value="onlyothers" <?php 
        if ($cff_show_others_val == 'onlyothers') {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Only other people');
        ?>
</option>
                            </select>

                            <p id="cff-others-only" style="font-size: 12px;"><b>Note:</b> Only displaying posts by other people works by retrieving your posts from Facebook and then filtering out the posts by the page owner. If this option doesn't display many posts then you can retrieve more by setting the post limit option (below) to a higher number.</p>

                        </td>
                    </tr>

                    <?php 
        if ($cff_ext_date_active) {
            echo cff_ext_date_options($cff_date_from_val, $cff_date_until_val);
        }
        ?>


                    <tr valign="top">
                        <th scope="row"><?php 
        _e('Number of posts to display');
        ?>
</th>
                        <td>
                            <input name="cff_num_show" type="text" value="<?php 
        esc_attr_e($num_show_val);
        ?>
" size="4" />
                            <i style="color: #666; font-size: 11px;">Eg. 5</i> <a class="cff-tooltip-link" href="JavaScript:void(0);"><?php 
        _e("Why aren't this many posts showing up?");
        ?>
</a>
                            <p class="cff-tooltip cff-more-info"><?php 
        _e("If too many posts are being filtered out then you may need to set the 'Change the post limit' option below to be 10-15 higher than the amount of posts you want to display.");
        ?>
</p>
                        </td>
                    </tr>

                    <tr valign="top">
                        <th scope="row"><?php 
        _e('Change the post limit');
        ?>
</th>
                        <td>
                            <input name="cff_post_limit" type="text" value="<?php 
        esc_attr_e($cff_post_limit_val);
        ?>
" size="4" />
                            <i style="color: #666; font-size: 11px;">Eg. 30</i> <a class="cff-tooltip-link" href="JavaScript:void(0);"><?php 
        _e('What does this mean?');
        ?>
</a>
                            <p class="cff-tooltip cff-more-info"><?php 
        _e("The 'limit' is the number of posts retrieved from the Facebook API. By default the plugin retrieves 7 posts more from the Facebook API than you specify in the 'Number of posts to display' field above, as some posts are filtered out. You can alter how many posts are retrieved by manually setting this value. If you choose to retrieve a high number of posts then it will take longer for Facebook to return the posts when the plugin checks for new ones.");
        ?>
</p>
                        </td>
                    </tr>
                    
                    <tr valign="top">
                        <th scope="row"><?php 
        _e('Check for new Facebook posts every');
        ?>
</th>
                        <td>
                            <input name="cff_cache_time" type="text" value="<?php 
        esc_attr_e($cff_cache_time_val);
        ?>
" size="4" />
                            <select name="cff_cache_time_unit">
                                <option value="minutes" <?php 
        if ($cff_cache_time_unit_val == "minutes") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Minutes');
        ?>
</option>
                                <option value="hours" <?php 
        if ($cff_cache_time_unit_val == "hours") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Hours');
        ?>
</option>
                                <option value="days" <?php 
        if ($cff_cache_time_unit_val == "days") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Days');
        ?>
</option>
                            </select>
                            <a class="cff-tooltip-link" href="JavaScript:void(0);"><?php 
        _e('What does this mean?');
        ?>
</a>
                            <p class="cff-tooltip cff-more-info"><?php 
        _e('Your Facebook posts and comments data is temporarily cached by the plugin in your WordPress database. You can choose how long this data should be cached for. If you set the time to 60 minutes then the plugin will clear the cached data after that length of time, and the next time the page is viewed it will check for new data.');
        ?>
</p>
                        </td>
                    </tr>

                    <tr valign="top">
                        <th scope="row"><?php 
        _e('Localization');
        ?>
</th>
                        <td>
                            <select name="cff_locale">
                                <option value="af_ZA" <?php 
        if ($cff_locale_val == "af_ZA") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Afrikaans');
        ?>
</option>
                                <option value="ar_AR" <?php 
        if ($cff_locale_val == "ar_AR") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Arabic');
        ?>
</option>
                                <option value="az_AZ" <?php 
        if ($cff_locale_val == "az_AZ") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Azerbaijani');
        ?>
</option>
                                <option value="be_BY" <?php 
        if ($cff_locale_val == "be_BY") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Belarusian');
        ?>
</option>
                                <option value="bg_BG" <?php 
        if ($cff_locale_val == "bg_BG") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Bulgarian');
        ?>
</option>
                                <option value="bn_IN" <?php 
        if ($cff_locale_val == "bn_IN") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Bengali');
        ?>
</option>
                                <option value="bs_BA" <?php 
        if ($cff_locale_val == "bs_BA") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Bosnian');
        ?>
</option>
                                <option value="ca_ES" <?php 
        if ($cff_locale_val == "ca_ES") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Catalan');
        ?>
</option>
                                <option value="cs_CZ" <?php 
        if ($cff_locale_val == "cs_CZ") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Czech');
        ?>
</option>
                                <option value="cy_GB" <?php 
        if ($cff_locale_val == "cy_GB") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Welsh');
        ?>
</option>
                                <option value="da_DK" <?php 
        if ($cff_locale_val == "da_DK") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Danish');
        ?>
</option>
                                <option value="de_DE" <?php 
        if ($cff_locale_val == "de_DE") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('German');
        ?>
</option>
                                <option value="el_GR" <?php 
        if ($cff_locale_val == "el_GR") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Greek');
        ?>
</option>
                                <option value="en_GB" <?php 
        if ($cff_locale_val == "en_GB") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('English (UK)');
        ?>
</option>
                                <option value="en_PI" <?php 
        if ($cff_locale_val == "en_PI") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('English (Pirate)');
        ?>
</option>
                                <option value="en_UD" <?php 
        if ($cff_locale_val == "en_UD") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('English (Upside Down)');
        ?>
</option>
                                <option value="en_US" <?php 
        if ($cff_locale_val == "en_US") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('English (US)');
        ?>
</option>
                                <option value="eo_EO" <?php 
        if ($cff_locale_val == "eo_EO") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Esperanto');
        ?>
</option>
                                <option value="es_ES" <?php 
        if ($cff_locale_val == "es_ES") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Spanish (Spain)');
        ?>
</option>
                                <option value="es_LA" <?php 
        if ($cff_locale_val == "es_LA") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Spanish');
        ?>
</option>
                                <option value="et_EE" <?php 
        if ($cff_locale_val == "et_EE") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Estonian');
        ?>
</option>
                                <option value="eu_ES" <?php 
        if ($cff_locale_val == "eu_ES") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Basque');
        ?>
</option>
                                <option value="fa_IR" <?php 
        if ($cff_locale_val == "fa_IR") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Persian');
        ?>
</option>
                                <option value="fb_LT" <?php 
        if ($cff_locale_val == "fb_LT") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Leet Speak');
        ?>
</option>
                                <option value="fi_FI" <?php 
        if ($cff_locale_val == "fi_FI") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Finnish');
        ?>
</option>
                                <option value="fo_FO" <?php 
        if ($cff_locale_val == "fo_FO") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Faroese');
        ?>
</option>
                                <option value="fr_CA" <?php 
        if ($cff_locale_val == "fr_CA") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('French (Canada)');
        ?>
</option>
                                <option value="fr_FR" <?php 
        if ($cff_locale_val == "fr_FR") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('French (France)');
        ?>
</option>
                                <option value="fy_NL" <?php 
        if ($cff_locale_val == "fy_NL") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Frisian');
        ?>
</option>
                                <option value="ga_IE" <?php 
        if ($cff_locale_val == "ga_IE") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Irish');
        ?>
</option>
                                <option value="gl_ES" <?php 
        if ($cff_locale_val == "gl_ES") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Galician');
        ?>
</option>
                                <option value="he_IL" <?php 
        if ($cff_locale_val == "he_IL") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Hebrew');
        ?>
</option>
                                <option value="hi_IN" <?php 
        if ($cff_locale_val == "hi_IN") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Hindi');
        ?>
</option>
                                <option value="hr_HR" <?php 
        if ($cff_locale_val == "hr_HR") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Croatian');
        ?>
</option>
                                <option value="hu_HU" <?php 
        if ($cff_locale_val == "hu_HU") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Hungarian');
        ?>
</option>
                                <option value="hy_AM" <?php 
        if ($cff_locale_val == "hy_AM") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Armenian');
        ?>
</option>
                                <option value="id_ID" <?php 
        if ($cff_locale_val == "id_ID") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Indonesian');
        ?>
</option>
                                <option value="is_IS" <?php 
        if ($cff_locale_val == "is_IS") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Icelandic');
        ?>
</option>
                                <option value="it_IT" <?php 
        if ($cff_locale_val == "it_IT") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Italian');
        ?>
</option>
                                <option value="ja_JP" <?php 
        if ($cff_locale_val == "ja_JP") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Japanese');
        ?>
</option>
                                <option value="ka_GE" <?php 
        if ($cff_locale_val == "ka_GE") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Georgian');
        ?>
</option>
                                <option value="km_KH" <?php 
        if ($cff_locale_val == "km_KH") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Khmer');
        ?>
</option>
                                <option value="ko_KR" <?php 
        if ($cff_locale_val == "ko_KR") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Korean');
        ?>
</option>
                                <option value="ku_TR" <?php 
        if ($cff_locale_val == "ku_TR") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Kurdish');
        ?>
</option>
                                <option value="la_VA" <?php 
        if ($cff_locale_val == "la_VA") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Latin');
        ?>
</option>
                                <option value="lt_LT" <?php 
        if ($cff_locale_val == "lt_LT") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Lithuanian');
        ?>
</option>
                                <option value="lv_LV" <?php 
        if ($cff_locale_val == "lv_LV") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Latvian');
        ?>
</option>
                                <option value="mk_MK" <?php 
        if ($cff_locale_val == "mk_MK") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Macedonian');
        ?>
</option>
                                <option value="ml_IN" <?php 
        if ($cff_locale_val == "ml_IN") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Malayalam');
        ?>
</option>
                                <option value="ms_MY" <?php 
        if ($cff_locale_val == "ms_MY") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Malay');
        ?>
</option>
                                <option value="nb_NO" <?php 
        if ($cff_locale_val == "nb_NO") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Norwegian (bokmal)');
        ?>
</option>
                                <option value="ne_NP" <?php 
        if ($cff_locale_val == "ne_NP") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Nepali');
        ?>
</option>
                                <option value="nl_NL" <?php 
        if ($cff_locale_val == "nl_NL") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Dutch');
        ?>
</option>
                                <option value="nn_NO" <?php 
        if ($cff_locale_val == "nn_NO") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Norwegian (nynorsk)');
        ?>
</option>
                                <option value="pa_IN" <?php 
        if ($cff_locale_val == "pa_IN") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Punjabi');
        ?>
</option>
                                <option value="pl_PL" <?php 
        if ($cff_locale_val == "pl_PL") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Polish');
        ?>
</option>
                                <option value="ps_AF" <?php 
        if ($cff_locale_val == "ps_AF") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Pashto');
        ?>
</option>
                                <option value="pt_BR" <?php 
        if ($cff_locale_val == "pt_BR") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Portuguese (Brazil)');
        ?>
</option>
                                <option value="pt_PT" <?php 
        if ($cff_locale_val == "pt_PT") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Portuguese (Portugal)');
        ?>
</option>
                                <option value="ro_RO" <?php 
        if ($cff_locale_val == "ro_RO") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Romanian');
        ?>
</option>
                                <option value="ru_RU" <?php 
        if ($cff_locale_val == "ru_RU") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Russian');
        ?>
</option>
                                <option value="sk_SK" <?php 
        if ($cff_locale_val == "sk_SK") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Slovak');
        ?>
</option>
                                <option value="sl_SI" <?php 
        if ($cff_locale_val == "sl_SI") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Slovenian');
        ?>
</option>
                                <option value="sq_AL" <?php 
        if ($cff_locale_val == "sq_AL") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Albanian');
        ?>
</option>
                                <option value="sr_RS" <?php 
        if ($cff_locale_val == "sr_RS") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Serbian');
        ?>
</option>
                                <option value="sv_SE" <?php 
        if ($cff_locale_val == "sv_SE") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Swedish');
        ?>
</option>
                                <option value="sw_KE" <?php 
        if ($cff_locale_val == "sw_KE") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Swahili');
        ?>
</option>
                                <option value="ta_IN" <?php 
        if ($cff_locale_val == "ta_IN") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Tamil');
        ?>
</option>
                                <option value="te_IN" <?php 
        if ($cff_locale_val == "te_IN") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Telugu');
        ?>
</option>
                                <option value="th_TH" <?php 
        if ($cff_locale_val == "th_TH") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Thai');
        ?>
</option>
                                <option value="tl_PH" <?php 
        if ($cff_locale_val == "tl_PH") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Filipino');
        ?>
</option>
                                <option value="tr_TR" <?php 
        if ($cff_locale_val == "tr_TR") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Turkish');
        ?>
</option>
                                <option value="uk_UA" <?php 
        if ($cff_locale_val == "uk_UA") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Ukrainian');
        ?>
</option>
                                <option value="vi_VN" <?php 
        if ($cff_locale_val == "vi_VN") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Vietnamese');
        ?>
</option>
                                <option value="zh_CN" <?php 
        if ($cff_locale_val == "zh_CN") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Simplified Chinese (China)');
        ?>
</option>
                                <option value="zh_HK" <?php 
        if ($cff_locale_val == "zh_HK") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Traditional Chinese (Hong Kong)');
        ?>
</option>
                                <option value="zh_TW" <?php 
        if ($cff_locale_val == "zh_TW") {
            echo 'selected="selected"';
        }
        ?>
 ><?php 
        _e('Traditional Chinese (Taiwan)');
        ?>
</option>
                            </select>
                            <i style="color: #666; font-size: 11px;"><?php 
        _e('Select a language');
        ?>
</i>
                        </td>
                    </tr>

                    <?php 
        if ($cff_lightbox_active) {
            echo cff_lightbox_options($cff_lightbox_val);
        }
        ?>

                </tbody>
            </table>
            <?php 
        submit_button();
        ?>
        </form>
        <hr />
        <h3><?php 
        _e('Displaying your Feed');
        ?>
</h3>
        <p><?php 
        _e("Copy and paste this shortcode directly into the page, post or widget where you'd like the feed to show up:");
        ?>
</p>
        <input type="text" value="[custom-facebook-feed]" size="22" readonly="readonly" onclick="this.focus();this.select()" title="<?php 
        _e('To copy, click the field then press Ctrl + C (PC) or Cmd + C (Mac).');
        ?>
" />
        <hr />
        <h3><?php 
        _e('Customizing your Feed');
        ?>
</h3>
        <p><?php 
        _e("Use the <a href='admin.php?page=cff-style'>Customize</a> page to customize your feed. If you're displaying multiple feeds then you can override your settings directly in the shortcode like so:");
        ?>
</p>
        <p>[custom-facebook-feed num=3 layout=thumb height=500px]</p>
        <p><a href="http://smashballoon.com/custom-facebook-feed/docs/shortcodes/" target="_blank"><?php 
        _e('See a full list of shortcode options');
        ?>
</a></p>

    <?php 
    }
    //End config tab
    ?>

    <?php 
    if ($cff_active_tab == 'license') {
        //Start License tab
        ?>

    <?php 
        $cff_license = trim(get_option('cff_license_key'));
        $cff_status = get_option('cff_license_status');
        ?>

        <form method="post" action="options.php">
    
            <?php 
        settings_fields('cff_license');
        ?>

            <?php 
        // data to send in our API request
        $cff_api_params = array('edd_action' => 'check_license', 'license' => $cff_license, 'item_name' => urlencode(WPW_SL_ITEM_NAME));
        // Call the custom API.
        $cff_response = wp_remote_get(add_query_arg($cff_api_params, WPW_SL_STORE_URL), array('timeout' => 60, 'sslverify' => false));
        // decode the license data
        $cff_license_data = (array) json_decode(wp_remote_retrieve_body($cff_response));
        //Store license data in db unless the data comes back empty as wasn't able to connect to our website to get it
        if (!empty($cff_license_data)) {
            update_option('cff_license_data', $cff_license_data);
        }
        ?>

            <br />
            <table class="form-table">
                <tbody>
                    <tr valign="top">   
                        <th scope="row" valign="top"><?php 
        _e('Custom Facebook Feed Pro');
        ?>
</th>
                        <td>
                            <input id="cff_license_key" name="cff_license_key" type="text" class="regular-text" value="<?php 
        esc_attr_e($cff_license);
        ?>
" />
                            <?php 
        if (false !== $cff_license) {
            ?>
                                <?php 
            if ($cff_status !== false && $cff_status == 'valid') {
                ?>
                                    <?php 
                wp_nonce_field('cff_nonce', 'cff_nonce');
                ?>
                                    <input type="submit" class="button-secondary" name="cff_license_deactivate" value="<?php 
                _e('Deactivate License');
                ?>
"/>
                                    
                                    <?php 
                if ($cff_license_data['license'] == 'expired') {
                    ?>
                                        <span style="color:red;"><?php 
                    _e('Expired');
                    ?>
</span>
                                    <?php 
                } else {
                    ?>
                                        <span style="color:green;"><?php 
                    _e('Active');
                    ?>
</span>
                                    <?php 
                }
                ?>

                                <?php 
            } else {
                wp_nonce_field('cff_nonce', 'cff_nonce');
                ?>
                                    <input type="submit" class="button-secondary" name="cff_license_activate" value="<?php 
                _e('Activate License');
                ?>
"/>
                                    
                                    <?php 
                if ($cff_license_data['license'] == 'expired') {
                    ?>
                                        <span style="color:red;"><?php 
                    _e('Expired');
                    ?>
</span>
                                    <?php 
                } else {
                    ?>
                                        <span style="color:red;"><?php 
                    _e('Inactive');
                    ?>
</span>
                                    <?php 
                }
                ?>

                                <?php 
            }
            ?>
                            <?php 
        }
        ?>
                            <br />
                            <i style="color: #666; font-size: 11px;"><?php 
        _e('The license key you received when purchasing the plugin.');
        ?>
</i>
                            <?php 
        global $cff_download_id;
        ?>
                            <p style="font-size: 13px;"><a href='https://smashballoon.com/checkout/?edd_license_key=<?php 
        echo trim($cff_license);
        ?>
&amp;download_id=<?php 
        echo $cff_download_id;
        ?>
' target='_blank'><?php 
        _e("Renew your license");
        ?>
</a>&nbsp;&nbsp;&nbsp;&middot;<a class="cff-tooltip-link" href="JavaScript:void(0);"><?php 
        _e("Upgrade your license");
        ?>
</a>
                            </p>
                            
                            <div class="cff-tooltip cff-more-info">
                                <?php 
        _e("<p>You can upgrade your license in two ways:</p>\r\n                                <p>&bull;&nbsp; Log into <a href='https://smashballoon.com/account' target='_blank'>your Account</a> and click on the 'Upgrade my License' tab<br />\r\n                                &bull;&nbsp; <a href='https://smashballoon.com/contact/' target='_blank'>Contact us directly</a></p>");
        ?>
                            </div>
                        </td>
                    </tr>

                    <?php 
        do_action('cff_admin_license');
        ?>

                </tbody>
            </table>
            <?php 
        submit_button();
        ?>
        
        </form>

    <?php 
    }
    ?>

    <?php 
    if ($cff_active_tab == 'support') {
        //Start Support tab
        ?>

        <br />
        <h3><?php 
        _e('FAQs and Troubleshooting');
        ?>
</h3>
        <p>Having trouble getting the plugin to work? Try the links below:</p>
        <ul>
        <li>- <?php 
        _e('<a href="http://smashballoon.com/custom-facebook-feed/faq/general/" target="_blank">General Questions</a>');
        ?>
</li>
        <li>- <?php 
        _e('<a href="http://smashballoon.com/custom-facebook-feed/faq/setup/" target="_blank">Setting Up &amp; Displaying your Feed</a>');
        ?>
</li>
        <li>- <?php 
        _e('<a href="http://smashballoon.com/custom-facebook-feed/faq/troubleshooting/" target="_blank">Troubleshooting &amp; Common Support Questions</a>');
        ?>
</li>
        </ul>
<br />
        <h3>Documentation</h3>
        <p>Need help setting up, configuring or customizing the plugin? Check out the links below:</p>
        <ul>
        <li>- <?php 
        _e('<a href="http://smashballoon.com/custom-facebook-feed/docs/wordpress/" target="_blank">Installation and Configuration</a>');
        ?>
</li>
        <li>- <?php 
        _e('<a href="http://smashballoon.com/custom-facebook-feed/docs/shortcodes/" target="_blank">Shortcode Reference</a>');
        ?>
</li>
        <li>- <?php 
        _e('<a href="http://smashballoon.com/custom-facebook-feed/docs/snippets/" target="_blank">Custom CSS and JavaScript Snippets</a>');
        ?>
</li>
        </ul>

        <br />
        <p><?php 
        _e('Still need help? <a href="http://smashballoon.com/custom-facebook-feed/support/" target="_blank">Request support</a>.');
        ?>
</p>

        <br />
        <h3><?php 
        _e('System Info');
        ?>
</h3>
        <p>PHP Version:          <b><?php 
        echo PHP_VERSION . "\n";
        ?>
</b></p>
        <p>Web Server Info:      <b><?php 
        echo $_SERVER['SERVER_SOFTWARE'] . "\n";
        ?>
</b></p>
        <p>PHP allow_url_fopen:  <b><?php 
        echo ini_get('allow_url_fopen') ? "<span style='color: green;'>Yes</span>" : "<span style='color: red;'>No</span>";
        ?>
</b></p>
        <p>PHP cURL:             <b><?php 
        echo is_callable('curl_init') ? "<span style='color: green;'>Yes</span>" : "<span style='color: red;'>No</span>";
        ?>
</b></p>
        <p>JSON:                 <b><?php 
        echo function_exists("json_decode") ? "<span style='color: green;'>Yes</span>" : "<span style='color: red;'>No</span>";
        ?>
</b></p>

        <button class="button secondary-button" id="cff-api-test">Test connection to Facebook API</button>
        
        <div id="cff-api-test-result">
            <?php 
        $access_token = get_option($access_token);
        if ($access_token == '' || empty($access_token)) {
            $access_token = '611606915581035|RdRHbHtrHseQw4C7SDUBFWIrJLA';
        }
        ?>
            <?php 
        $posts_json = cff_fetchUrl("https://graph.facebook.com/" . get_option(trim($page_id)) . "/feed?access_token=" . trim($access_token) . "&limit=1");
        ?>
            <textarea readonly="readonly" onclick="this.focus();this.select()" title="To copy, click the field then press Ctrl + C (PC) or Cmd + C (Mac)."><?php 
        echo $posts_json;
        ?>
</textarea>
        </div>

    <?php 
    }
    ?>
        
        
<?php 
}