public function render_content()
    {
        ?>
        <label>
            <?php 
        if (!empty($this->label)) {
            ?>
            <span class="customize-control-title">
                <?php 
            echo esc_html($this->label);
            ?>
            </span>
            <?php 
        }
        ?>
 
            <?php 
        if (!empty($this->description)) {
            ?>
            <span class="description customize-control-description">
                <?php 
            echo $this->description;
            ?>
            </span>
            <?php 
        }
        ?>
            
            <div class="gk-portfolio-category-selection">
                <ul>
                    <li class="gk-portfolio-fake-checkbox"><input type="checkbox" /></li>
                    
                    <?php 
        wp_category_checklist(0, 0, explode(',', $this->value()), false, new Dziudek_TC_Walker_Category_Checklist($this->id), false);
        ?>
                </ul>
             
                <input type="hidden" id="<?php 
        echo $this->id;
        ?>
" class="gk-portfolio-category-selection-value" <?php 
        $this->link();
        ?>
 value="<?php 
        echo sanitize_text_field($this->value());
        ?>
">
            </div>
        </label>
        <?php 
    }
Esempio n. 2
0
function genesis_category_checklist($name = '', $selected = array())
{
    $name = esc_attr($name);
    //	home link
    if (in_array('home', (array) $selected)) {
        $checked = 'checked';
    } else {
        $checked = '';
    }
    $checkboxes = '<li><label class="selectit"><input type="checkbox" name="' . $name . '[]" value="home" ' . $checked . ' /> Home</label></li>' . "\n";
    //	categories
    ob_start();
    wp_category_checklist(0, 0, $selected, false, '', $checked_on_top = false);
    $checkboxes .= str_replace('name="post_category[]"', 'name="' . $name . '[]"', ob_get_clean());
    echo $checkboxes;
}
function fwp_category_checklist($post_id = 0, $descendents_and_self = 0, $selected_cats = false)
{
    if (function_exists('wp_category_checklist')) {
        wp_category_checklist($post_id, $descendents_and_self, $selected_cats);
    } else {
        // selected_cats is an array of integer cat_IDs / term_ids for
        // the categories that should be checked
        global $post_ID;
        $cats = get_nested_categories();
        // Undo damage from usort() in WP 2.0
        $dogs = array();
        foreach ($cats as $cat) {
            $dogs[$cat['cat_ID']] = $cat;
        }
        foreach ($selected_cats as $cat_id) {
            $dogs[$cat_id]['checked'] = true;
        }
        write_nested_categories($dogs);
    }
}
Esempio n. 4
0
/**
 * Provides plugin-wide options screen.
 *
 * TODO: Eventually, these options should be consolidated logically so as not
 *       to keep cluttering the database with Tumblrize options. Kind of messy.
 */
function tumblrize_options()
{
    ?>
<div class="wrap">
    <h2><img src="http://id.ijulien.com/img/tumblrize.png" alt="Tumblrize" /></h2>

    <form method="post" action="options.php">
        <?php 
    wp_nonce_field('update-options');
    ?>
        <?php 
    if (get_option('tumblrize_tumblr_email') == "") {
        ?>
        <p>Enter your Tumblr email and password to enable Tumblrize to post updates.</p>
        <?php 
    }
    ?>

        <table class="form-table" summary="Tumblrize Plugin Options">
            <tr valign="top">
                <th scope="row"><label for="tumblrize_tumblr_email">Tumblr Email</label></th>
                <td>
                    <input type="text" id="tumblrize_tumblr_email" name="tumblrize_tumblr_email" autocomplete="off" value="<?php 
    echo get_option('tumblrize_tumblr_email');
    ?>
" />
                    <span class="setting-description">Provide a default Tumblr account for authors to use to crosspost content.</span><br />
                    <span class="description">To force users to provide their own credentials, enter <code>NONE</code> here, and in the <em>Tumblr Password</em> field, below.</span>
                </td>
            </tr>

            <tr valign="top">
                <th scope="row"><label for="tumblrize_tumblr_password">Tumblr Password</label></th>
                <td>
                    <input type="password" id="tumblrize_tumblr_password" name="tumblrize_tumblr_password" autocomplete="off" value="<?php 
    echo get_option('tumblrize_tumblr_password');
    ?>
" />
                    <span class="setting-description">Provide the password for the default Tumblr account.</span><br />
                    <span class="description">To force users to provide their own credentials, enter <code>NONE</code> here, and in the <em>Tumblr Email</em> field, above.</span>
                </td>
            </tr>

            <tr valign="top">
                <th scope="row"><label for="tumblrize_tumblr_group">Use Tumblr Group</label></th>
                <td>
                    <input type="text" id="tumblrize_tumblr_group" name="tumblrize_tumblr_group" autocomplete="off" value="<?php 
    echo get_option('tumblrize_tumblr_group');
    ?>
" />
                    <span class="setting-description">Use a domain name; e.g., <code>my-other-blog.tumblr.com</code></span><br />
                    <span class="description">Send to this group on Tumblr by default. Leave blank to send to your default Tumblr blog instead. (Can be overriden on Write Post screen.)</span>
                </td>
            </tr>

            <tr valign="top">
                <th scope="row"><label for="tumblrize_shutoff">Turn Off Tumblrize</label></th>
                <td>
                    <input type="checkbox" id="tumblrize_shutoff" name="tumblrize_shutoff" value="tumblrize_shutoff_on" <?php 
    if (get_option('tumblrize_shutoff') == "tumblrize_shutoff_on") {
        echo 'checked="checked"';
    }
    ?>
 />
                    <span class="description">Disables default crossposting to Tumblr, but will still crosspost to Posterous if "Also send to Posterous?" option is enabled. (Can also be overriden on a per-post basis.)</span>
                </td>
            </tr>

            <tr valign="top">
                <th scope="row"><label for="tumblrize_exclude_cats">Do not crosspost entries in these categories:</label></th>
                <td>
                    <span class="description">Will cause posts in the specificied categories never to be crossposted to Tumblr. This is useful if, for instance, you are creating posts automatically using another plugin and wish to avoid a feedback loop of crossposting back and forth from one service to another.</span>
<?php 
    // TODO: Make this not such a terrible hack job. Really.
    ob_start();
    ?>
                    <ul><?php 
    print wp_category_checklist(0, 0, get_option('tumblrize_exclude_cats'));
    ?>
</ul>
<?php 
    $out = ob_get_contents();
    // Change form appropriately.
    $out = preg_replace('/post_category\\[]/', 'tumblrize_exclude_cats[]', $out);
    ob_end_clean();
    // But hey...this hack job totally works for now.
    print $out;
    ?>
                </td>
            </tr>

            <tr valign="top">
                <th scope="row">
                    <label for="tumblrize_tumblr_posterous">Also send to <a href="http://www.posterous.com/" title="Posterous">Posterous</a>?</label>
                </th>
                <td>
                    <input type="checkbox" id="tumblrize_tumblr_posterous" name="tumblrize_tumblr_posterous" value="posterous" <?php 
    if (get_option('tumblrize_tumblr_posterous') == "posterous") {
        echo 'checked="checked"';
    }
    ?>
 />
                    <span class="description">Enables crossposting to Posterous independently from Tumblr.</span>
                </td>
            </tr>

            <tr valign="top">
                <th scope="row">
                    <label for="tumblrize_notify_me">Also send an email to <strong><?php 
    if (get_option('tumblrize_tumblr_email')) {
        echo get_option('tumblrize_tumblr_email');
    } else {
        echo 'me';
    }
    ?>
</strong>?</label>
                </th>
                <td>
                    <input type="checkbox" id="tumblrize_notify_me" name="tumblrize_notify_me" value="notify_on" <?php 
    if (get_option('tumblrize_notify_me') == "notify_on") {
        echo 'checked="checked"';
    }
    ?>
 />
                    <span class="description">When enabled, Tumblrize will send you an email confirmation each time it successfully crossposts a new post.</span>
                </td>
            </tr>

            <tr valign="top">
                <th scope="row"><label for="tumblrize_add_permalink">Also add link to the original post?</label></th>
                <td>
                    <input type="checkbox" id="tumblrize_add_permalink" name="tumblrize_add_permalink" value="tumblrize_add_permalink_on" <?php 
    if (get_option('tumblrize_add_permalink') == "tumblrize_add_permalink_on") {
        echo 'checked="checked"';
    }
    ?>
 />
                    <span class="description">When enabled, Tumblrize will append a paragraph with a link back to the original post on this blog in any crossposted entries.</span>
                </td>
            </tr>

            <tr valign="top">
                <th scope="row"><label for="tumblrize_tags">Always add these tags?</label>
                <td>
                    <input type="text" id="tumblrize_tags" name="tumblrize_tags" autocomplete="off" value="<?php 
    echo get_option('tumblrize_tags');
    ?>
" />
                    <br /><span class="description">Comma separated list of additional tags to always crosspost. E.g., <code>crossposted,tumblr</code>. Defaults to <code>tumblrize</code> if left blank.</span>
                </td>
            </tr>

            <tr valign="top">
                <th scope="row"><label for="tumblrize_add_post_tags">Add post tags, too?</label></th>
                <td>
                    <input type="checkbox" id="tumblrize_add_post_tags" name="tumblrize_add_post_tags" value="tumblrize_add_post_tags" <?php 
    if (get_option('tumblrize_add_post_tags') == "tumblrize_add_post_tags") {
        echo 'checked="checked"';
    }
    ?>
 />
                    <span class="description">Adds an individual post's tags to the crossposted post in addition to any tags always added, above.</span>
                </td>
            </tr>

            <tr valign="top">
                <th scope="row">
                    <label for="tumblrize_purge_database">Purge Tumblrize options on uninstall?</label>
                </th>
                <td>
                    <input type="checkbox" id="tumblrize_purge_database" name="tumblrize_purge_database" value="tumblrize_purge_database" <?php 
    if (get_option('tumblrize_purge_database', 'tumblrize_purge_database') == "tumblrize_purge_database") {
        echo 'checked="checked"';
    }
    ?>
 />
                    <span class="description">Deletes saved options for this plugin from database when you uninstall Tumblrize.</span>
                </td>
            </tr>
        </table>

        <p style="text-align: center;">We &hearts; <a href="http://www.tumblr.com/">Tumblr</a>. Don't send spam. &mdash; <a href="http://ijulien.com/" title="ijulien" target="_blank">&infin;julien</a> &amp; <a href="http://maymay.net/">Meitar</a></p>

        <input type="hidden" name="action" value="update" />
        <input type="hidden" name="page_options" value="tumblrize_tumblr_email,tumblrize_tumblr_password,tumblrize_tumblr_posterous,tumblrize_notify_me,tumblrize_add_permalink,tumblrize_shutoff,tumblrize_tags,tumblrize_add_post_tags,tumblrize_purge_database,tumblrize_tumblr_group,tumblrize_exclude_cats" />
        <p class="submit">
            <input type="submit" name="Submit" value="<?php 
    _e('Save Changes');
    ?>
" />
        </p>
    </form>
</div><!-- END .wrap -->

<?php 
}
Esempio n. 5
0
    /**
     * Displays the option page
     *
     * @since 3.0
     * @access public
     * @author Arne Brachhold
     */
    function HtmlShowOptionsPage()
    {
        global $wp_version;
        $this->sg->Initate();
        //All output should go in this var which get printed at the end
        $message = "";
        if (isset($_GET['sm_hidedonate'])) {
            $this->sg->SetOption('i_hide_donated', true);
            $this->sg->SaveOptions();
        }
        if (isset($_GET['sm_donated'])) {
            $this->sg->SetOption('i_donated', true);
            $this->sg->SaveOptions();
        }
        if (isset($_GET['sm_hide_note'])) {
            $this->sg->SetOption('i_hide_note', true);
            $this->sg->SaveOptions();
        }
        if (isset($_GET['sm_hidedonors'])) {
            $this->sg->SetOption('i_hide_donors', true);
            $this->sg->SaveOptions();
        }
        if (isset($_GET['sm_donated']) || $this->sg->GetOption('i_donated') === true && $this->sg->GetOption('i_hide_donated') !== true) {
            ?>
			<div class="updated">
				<strong><p><?php 
            _e('Thank you very much for your donation. You help me to continue support and development of this plugin and other free software!', 'sitemap');
            ?>
 <a href="<?php 
            echo $this->sg->GetBackLink() . "&amp;sm_hidedonate=true";
            ?>
"><small style="font-weight:normal;"><?php 
            _e('Hide this notice', 'sitemap');
            ?>
</small></a></p></strong>
			</div>
			<?php 
        } else {
            if ($this->sg->GetOption('i_donated') !== true && $this->sg->GetOption('i_install_date') > 0 && $this->sg->GetOption('i_hide_note') !== true && time() > $this->sg->GetOption('i_install_date') + 60 * 60 * 24 * 30) {
                ?>
			<div class="updated">
				<strong><p><?php 
                echo str_replace("%s", $this->sg->GetRedirectLink("sitemap-donate-note"), __('Thanks for using this plugin! You\'ve installed this plugin over a month ago. If it works and your are satisfied with the results, isn\'t it worth at least one dollar? <a href="%s">Donations</a> help me to continue support and development of this <i>free</i> software! <a href="%s">Sure, no problem!</a>', 'sitemap'));
                ?>
 <a href="<?php 
                echo $this->sg->GetBackLink() . "&amp;sm_hide_note=true";
                ?>
" style="float:right; display:block; border:none;"><small style="font-weight:normal; "><?php 
                _e('No thanks, please don\'t bug me anymore!', 'sitemap');
                ?>
</small></a></p></strong>
				<div style="clear:right;"></div>
			</div>
			<?php 
            }
        }
        if (function_exists("wp_next_scheduled")) {
            $next = wp_next_scheduled('sm_build_cron');
            if ($next) {
                $diff = (time() - $next) * -1;
                if ($diff <= 0) {
                    $diffMsg = __('Your sitemap is being refreshed at the moment. Depending on your blog size this might take some time!', 'sitemap');
                } else {
                    $diffMsg = str_replace("%s", $diff, __('Your sitemap will be refreshed in %s seconds. Depending on your blog size this might take some time!', 'sitemap'));
                }
                ?>
				<div class="updated">
					<strong><p><?php 
                echo $diffMsg;
                ?>
</p></strong>
					<div style="clear:right;"></div>
				</div>
				<?php 
            }
        }
        if (!empty($_REQUEST["sm_rebuild"]) || !empty($_REQUEST["sm_rebuild"])) {
            //Clear any outstanding build cron jobs
            if (function_exists('wp_clear_scheduled_hook')) {
                wp_clear_scheduled_hook('sm_build_cron');
            }
        }
        if (!empty($_REQUEST["sm_rebuild"])) {
            //Pressed Button: Rebuild Sitemap
            check_admin_referer('sitemap');
            if (isset($_GET["sm_do_debug"]) && $_GET["sm_do_debug"] == "true") {
                //Check again, just for the case that something went wrong before
                if (!current_user_can("administrator")) {
                    echo '<p>Please log in as admin</p>';
                    return;
                }
                $oldErr = error_reporting(E_ALL);
                $oldIni = ini_set("display_errors", 1);
                echo '<div class="wrap">';
                echo '<h2>' . __('XML Sitemap Generator for WordPress', 'sitemap') . " " . $this->sg->GetVersion() . '</h2>';
                echo '<p>This is the debug mode of the XML Sitemap Generator. It will show all PHP notices and warnings as well as the internal logs, messages and configuration.</p>';
                echo '<p style="font-weight:bold; color:red; padding:5px; border:1px red solid; text-align:center;">DO NOT POST THIS INFORMATION ON PUBLIC PAGES LIKE SUPPORT FORUMS AS IT MAY CONTAIN PASSWORDS OR SECRET SERVER INFORMATION!</p>';
                echo "<h3>WordPress and PHP Information</h3>";
                echo '<p>WordPress ' . $GLOBALS['wp_version'] . ' with ' . ' DB ' . $GLOBALS['wp_db_version'] . ' on PHP ' . phpversion() . '</p>';
                echo '<p>Plugin version: ' . $this->sg->GetVersion() . ' (' . $this->sg->_svnVersion . ')';
                echo '<h4>Environment</h4>';
                echo "<pre>";
                $sc = $_SERVER;
                unset($sc["HTTP_COOKIE"]);
                print_r($sc);
                echo "</pre>";
                echo "<h4>WordPress Config</h4>";
                echo "<pre>";
                $opts = array();
                if (function_exists('wp_load_alloptions')) {
                    $opts = wp_load_alloptions();
                } else {
                    global $wpdb;
                    $os = $wpdb->get_results("SELECT option_name, option_value FROM {$wpdb->options}");
                    foreach ((array) $os as $o) {
                        $opts[$o->option_name] = $o->option_value;
                    }
                }
                $popts = array();
                foreach ($opts as $k => $v) {
                    //Try to filter out passwords etc...
                    if (preg_match("/(pass|login|pw|secret|user|usr)/si", $v)) {
                        continue;
                    }
                    $popts[$k] = htmlspecialchars($v);
                }
                print_r($popts);
                echo "</pre>";
                echo '<h4>Sitemap Config</h4>';
                echo "<pre>";
                print_r($this->sg->_options);
                echo "</pre>";
                echo '<h3>Errors, Warnings, Notices</h3>';
                echo '<div>';
                $status = $this->sg->BuildSitemap();
                echo '</div>';
                echo '<h3>MySQL Queries</h3>';
                if (defined('SAVEQUERIES') && SAVEQUERIES) {
                    echo '<pre>';
                    var_dump($GLOBALS['wpdb']->queries);
                    echo '</pre>';
                    $total = 0;
                    foreach ($GLOBALS['wpdb']->queries as $q) {
                        $total += $q[1];
                    }
                    echo '<h4>Total Query Time</h4>';
                    echo '<pre>' . count($GLOBALS['wpdb']->queries) . ' queries in ' . round($total, 2) . ' seconds.</pre>';
                } else {
                    echo '<p>Please edit wp-db.inc.php in wp-includes and set SAVEQUERIES to true if you want to see the queries.</p>';
                }
                echo "<h3>Build Process Results</h3>";
                echo "<pre>";
                print_r($status);
                echo "</pre>";
                echo '<p>Done. <a href="' . wp_nonce_url($this->sg->GetBackLink() . "&sm_rebuild=true&sm_do_debug=true", 'sitemap') . '">Rebuild</a> or <a href="' . $this->sg->GetBackLink() . '">Return</a></p>';
                echo '<p style="font-weight:bold; color:red; padding:5px; border:1px red solid; text-align:center;">DO NOT POST THIS INFORMATION ON PUBLIC PAGES LIKE SUPPORT FORUMS AS IT MAY CONTAIN PASSWORDS OR SECRET SERVER INFORMATION!</p>';
                echo '</div>';
                @error_reporting($oldErr);
                @ini_set("display_errors", $oldIni);
                return;
            } else {
                $this->sg->BuildSitemap();
                $redirURL = $this->sg->GetBackLink() . '&sm_fromrb=true';
                //Redirect so the sm_rebuild GET parameter no longer exists.
                @header("location: " . $redirURL);
                //If there was already any other output, the header redirect will fail
                echo '<script type="text/javascript">location.replace("' . $redirUrl . '");</script>';
                echo '<noscript><a href="' . $redirURL . '">Click here to continue</a></noscript>';
                exit;
            }
        } else {
            if (!empty($_POST['sm_update'])) {
                //Pressed Button: Update Config
                check_admin_referer('sitemap');
                if (isset($_POST['sm_b_style']) && $_POST['sm_b_style'] == $this->sg->getDefaultStyle()) {
                    $_POST['sm_b_style_default'] = true;
                    $_POST['sm_b_style'] = '';
                }
                foreach ($this->sg->_options as $k => $v) {
                    //Check vor values and convert them into their types, based on the category they are in
                    if (!isset($_POST[$k])) {
                        $_POST[$k] = "";
                    }
                    // Empty string will get false on 2bool and 0 on 2float
                    //Options of the category "Basic Settings" are boolean, except the filename and the autoprio provider
                    if (substr($k, 0, 5) == "sm_b_") {
                        if ($k == "sm_b_filename" || $k == "sm_b_fileurl_manual" || $k == "sm_b_filename_manual" || $k == "sm_b_prio_provider" || $k == "sm_b_manual_key" || $k == "sm_b_yahookey" || $k == "sm_b_style" || $k == "sm_b_memory") {
                            if ($k == "sm_b_filename_manual" && strpos($_POST[$k], "\\") !== false) {
                                $_POST[$k] = stripslashes($_POST[$k]);
                            }
                            $this->sg->_options[$k] = (string) $_POST[$k];
                        } else {
                            if ($k == "sm_b_location_mode") {
                                $tmp = (string) $_POST[$k];
                                $tmp = strtolower($tmp);
                                if ($tmp == "auto" || ($tmp = "manual")) {
                                    $this->sg->_options[$k] = $tmp;
                                } else {
                                    $this->sg->_options[$k] = "auto";
                                }
                            } else {
                                if ($k == "sm_b_time" || $k == "sm_b_max_posts") {
                                    if ($_POST[$k] == '') {
                                        $_POST[$k] = -1;
                                    }
                                    $this->sg->_options[$k] = intval($_POST[$k]);
                                } else {
                                    if ($k == "sm_i_install_date") {
                                        if ($this->sg->GetOption('i_install_date') <= 0) {
                                            $this->sg->_options[$k] = time();
                                        }
                                    } else {
                                        if ($k == "sm_b_exclude") {
                                            $IDss = array();
                                            $IDs = explode(",", $_POST[$k]);
                                            for ($x = 0; $x < count($IDs); $x++) {
                                                $ID = intval(trim($IDs[$x]));
                                                if ($ID > 0) {
                                                    $IDss[] = $ID;
                                                }
                                            }
                                            $this->sg->_options[$k] = $IDss;
                                        } else {
                                            if ($k == "sm_b_exclude_cats") {
                                                $exCats = array();
                                                if (isset($_POST["post_category"])) {
                                                    foreach ((array) $_POST["post_category"] as $vv) {
                                                        if (!empty($vv) && is_numeric($vv)) {
                                                            $exCats[] = intval($vv);
                                                        }
                                                    }
                                                }
                                                $this->sg->_options[$k] = $exCats;
                                            } else {
                                                $this->sg->_options[$k] = (bool) $_POST[$k];
                                            }
                                        }
                                    }
                                }
                            }
                        }
                        //Options of the category "Includes" are boolean
                    } else {
                        if (substr($k, 0, 6) == "sm_in_") {
                            $this->sg->_options[$k] = (bool) $_POST[$k];
                            //Options of the category "Change frequencies" are string
                        } else {
                            if (substr($k, 0, 6) == "sm_cf_") {
                                $this->sg->_options[$k] = (string) $_POST[$k];
                                //Options of the category "Priorities" are float
                            } else {
                                if (substr($k, 0, 6) == "sm_pr_") {
                                    $this->sg->_options[$k] = (double) $_POST[$k];
                                }
                            }
                        }
                    }
                }
                //No Mysql unbuffered query for WP < 2.2
                if (floatval($wp_version) < 2.2) {
                    $this->sg->SetOption('b_safemode', true);
                }
                //No Wp-Cron for WP < 2.1
                if (floatval($wp_version) < 2.1) {
                    $this->sg->SetOption('b_auto_delay', false);
                }
                //Apply page changes from POST
                $this->sg->_pages = $this->sg->HtmlApplyPages();
                if ($this->sg->SaveOptions()) {
                    $message .= __('Configuration updated', 'sitemap') . "<br />";
                } else {
                    $message .= __('Error while saving options', 'sitemap') . "<br />";
                }
                if ($this->sg->SavePages()) {
                    $message .= __("Pages saved", 'sitemap') . "<br />";
                } else {
                    $message .= __('Error while saving pages', 'sitemap') . "<br />";
                }
            } else {
                if (!empty($_POST["sm_reset_config"])) {
                    //Pressed Button: Reset Config
                    check_admin_referer('sitemap');
                    $this->sg->InitOptions();
                    $this->sg->SaveOptions();
                    $message .= __('The default configuration was restored.', 'sitemap');
                }
            }
        }
        //Print out the message to the user, if any
        if ($message != "") {
            ?>
			<div class="updated"><strong><p><?php 
            echo $message;
            ?>
</p></strong></div><?php 
        }
        ?>
				
		<style type="text/css">
		
		li.sm_hint {
			color:green;
		}
		
		li.sm_optimize {
			color:orange;
		}
		
		li.sm_error {
			color:red;
		}
		
		input.sm_warning:hover {
			background: #ce0000;
			color: #fff;
		}
		
		a.sm_button {
			padding:4px;
			display:block;
			padding-left:25px;
			background-repeat:no-repeat;
			background-position:5px 50%;
			text-decoration:none;
			border:none;
		}
		
		a.sm_button:hover {
			border-bottom-width:1px;
		}

		a.sm_donatePayPal {
			background-image:url(<?php 
        echo $this->sg->GetPluginUrl();
        ?>
img/icon-paypal.gif);
		}
		
		a.sm_donateAmazon {
			background-image:url(<?php 
        echo $this->sg->GetPluginUrl();
        ?>
img/icon-amazon.gif);
		}
		
		a.sm_pluginHome {
			background-image:url(<?php 
        echo $this->sg->GetPluginUrl();
        ?>
img/icon-arne.gif);
		}
		
		a.sm_pluginList {
			background-image:url(<?php 
        echo $this->sg->GetPluginUrl();
        ?>
img/icon-email.gif);
		}
		
		a.sm_pluginSupport {
			background-image:url(<?php 
        echo $this->sg->GetPluginUrl();
        ?>
img/icon-wordpress.gif);
		}
		
		a.sm_pluginBugs {
			background-image:url(<?php 
        echo $this->sg->GetPluginUrl();
        ?>
img/icon-trac.gif);
		}
		
		a.sm_resGoogle {
			background-image:url(<?php 
        echo $this->sg->GetPluginUrl();
        ?>
img/icon-google.gif);
		}
		
		a.sm_resYahoo {
			background-image:url(<?php 
        echo $this->sg->GetPluginUrl();
        ?>
img/icon-yahoo.gif);
		}
		
		a.sm_resBing {
			background-image:url(<?php 
        echo $this->sg->GetPluginUrl();
        ?>
img/icon-bing.gif);
		}
		
		div.sm-update-nag p {
			margin:5px;
		}
		
		</style>
		
		<?php 
        if ($this->mode == 27) {
            ?>
			<style type="text/css">
		
				.sm-padded .inside {
					margin:12px!important;
				}
				.sm-padded .inside ul {
					margin:6px 0 12px 0;
				}
				
				.sm-padded .inside input {
					padding:1px;
					margin:0;
				}
			</style>
				
			<?php 
        } elseif (version_compare($wp_version, "2.5", ">=")) {
            ?>
				<style type="text/css">
					div#moremeta {
						float:right;
						width:200px;
						margin-left:10px;
					}
					div#advancedstuff {
						width:770px;
					}
					div#poststuff {
						margin-top:10px;
					}
					fieldset.dbx-box {
						margin-bottom:5px;
					}
					
					div.sm-update-nag {
						margin-top:10px!important;
					}
				</style>
				<!--[if lt IE 7]>
					<style type="text/css">
						div#advancedstuff {
							width:735px;
						}
					</style>
				<![endif]-->
				
			<?php 
        } else {
            ?>
				<style type="text/css">
					div.updated-message {
						margin-left:0; margin-right:0;
					}
				</style>
			<?php 
        }
        ?>
		
		<div class="wrap" id="sm_div">
			<form method="post" action="<?php 
        echo $this->sg->GetBackLink();
        ?>
">
				<h2><?php 
        _e('XML Sitemap Generator for WordPress', 'sitemap');
        echo " " . $this->sg->GetVersion();
        ?>
 </h2>
		<?php 
        if (function_exists("wp_update_plugins") && (!defined('SM_NO_UPDATE') || SM_NO_UPDATE == false)) {
            wp_update_plugins();
            $file = GoogleSitemapGeneratorLoader::GetBaseName();
            $plugin_data = get_plugin_data(GoogleSitemapGeneratorLoader::GetPluginFile());
            $current = get_option('update_plugins');
            if (isset($current->response[$file])) {
                $r = $current->response[$file];
                ?>
<div id="update-nag" class="sm-update-nag"><?php 
                if (!current_user_can('edit_plugins') || version_compare($wp_version, "2.5", "<")) {
                    printf(__('There is a new version of %1$s available. <a href="%2$s">Download version %3$s here</a>.', 'default'), $plugin_data['Name'], $r->url, $r->new_version);
                } else {
                    if (empty($r->package)) {
                        printf(__('There is a new version of %1$s available. <a href="%2$s">Download version %3$s here</a> <em>automatic upgrade unavailable for this plugin</em>.', 'default'), $plugin_data['Name'], $r->url, $r->new_version);
                    } else {
                        printf(__('There is a new version of %1$s available. <a href="%2$s">Download version %3$s here</a> or <a href="%4$s">upgrade automatically</a>.', 'default'), $plugin_data['Name'], $r->url, $r->new_version, wp_nonce_url("update.php?action=upgrade-plugin&amp;plugin={$file}", 'upgrade-plugin_' . $file));
                    }
                }
                ?>
</div><?php 
            }
        }
        ?>
				
				<?php 
        if (version_compare($wp_version, "2.5", "<")) {
            ?>
				<script type="text/javascript" src="../wp-includes/js/dbx.js"></script>
				<script type="text/javascript">
				//<![CDATA[
				addLoadEvent( function() {
					var manager = new dbxManager('sm_sitemap_meta_33');
					
					//create new docking boxes group
					var meta = new dbxGroup(
						'grabit', 		// container ID [/-_a-zA-Z0-9/]
						'vertical', 	// orientation ['vertical'|'horizontal']
						'10', 			// drag threshold ['n' pixels]
						'no',			// restrict drag movement to container axis ['yes'|'no']
						'10', 			// animate re-ordering [frames per transition, or '0' for no effect]
						'yes', 			// include open/close toggle buttons ['yes'|'no']
						'open', 		// default state ['open'|'closed']
						<?php 
            echo "'" . js_escape(__('open'));
            ?>
', 		// word for "open", as in "open this box"
						<?php 
            echo "'" . js_escape(__('close'));
            ?>
', 		// word for "close", as in "close this box"
						<?php 
            echo "'" . js_escape(__('click-down and drag to move this box'));
            ?>
', // sentence for "move this box" by mouse
						<?php 
            echo "'" . js_escape(__('click to %toggle% this box'));
            ?>
', // pattern-match sentence for "(open|close) this box" by mouse
						<?php 
            echo "'" . js_escape(__('use the arrow keys to move this box'));
            ?>
', // sentence for "move this box" by keyboard
						<?php 
            echo "'" . js_escape(__(', or press the enter key to %toggle% it'));
            ?>
',  // pattern-match sentence-fragment for "(open|close) this box" by keyboard
						'%mytitle%  [%dbxtitle%]' // pattern-match syntax for title-attribute conflicts
						);

					var advanced = new dbxGroup(
						'advancedstuff', 		// container ID [/-_a-zA-Z0-9/]
						'vertical', 		// orientation ['vertical'|'horizontal']
						'10', 			// drag threshold ['n' pixels]
						'yes',			// restrict drag movement to container axis ['yes'|'no']
						'10', 			// animate re-ordering [frames per transition, or '0' for no effect]
						'yes', 			// include open/close toggle buttons ['yes'|'no']
						'open', 		// default state ['open'|'closed']
						<?php 
            echo "'" . js_escape(__('open'));
            ?>
', 		// word for "open", as in "open this box"
						<?php 
            echo "'" . js_escape(__('close'));
            ?>
', 		// word for "close", as in "close this box"
						<?php 
            echo "'" . js_escape(__('click-down and drag to move this box'));
            ?>
', // sentence for "move this box" by mouse
						<?php 
            echo "'" . js_escape(__('click to %toggle% this box'));
            ?>
', // pattern-match sentence for "(open|close) this box" by mouse
						<?php 
            echo "'" . js_escape(__('use the arrow keys to move this box'));
            ?>
', // sentence for "move this box" by keyboard
						<?php 
            echo "'" . js_escape(__(', or press the enter key to %toggle% it'));
            ?>
',  // pattern-match sentence-fragment for "(open|close) this box" by keyboard
						'%mytitle%  [%dbxtitle%]' // pattern-match syntax for title-attribute conflicts
						);
				});
				//]]>
				</script>
				<?php 
        }
        ?>

				<?php 
        if ($this->mode == 27) {
            ?>
				<div id="poststuff" class="metabox-holder has-right-sidebar">
					<div class="inner-sidebar">
						<div id="side-sortables" class="meta-box-sortabless ui-sortable" style="position:relative;">
				<?php 
        } else {
            ?>
				<div id="poststuff">
					<div id="moremeta">
						<div id="grabit" class="dbx-group">
				<?php 
        }
        ?>
				
						<?php 
        $this->HtmlPrintBoxHeader('sm_pnres', __('About this Plugin:', 'sitemap'), true);
        ?>
							<a class="sm_button sm_pluginHome"    href="<?php 
        echo $this->sg->GetRedirectLink('sitemap-home');
        ?>
"><?php 
        _e('Plugin Homepage', 'sitemap');
        ?>
</a>
							<a class="sm_button sm_pluginHome"    href="<?php 
        echo $this->sg->GetRedirectLink('sitemap-feedback');
        ?>
"><?php 
        _e('Suggest a Feature', 'sitemap');
        ?>
</a>
							<a class="sm_button sm_pluginList"    href="<?php 
        echo $this->sg->GetRedirectLink('sitemap-list');
        ?>
"><?php 
        _e('Notify List', 'sitemap');
        ?>
</a>
							<a class="sm_button sm_pluginSupport" href="<?php 
        echo $this->sg->GetRedirectLink('sitemap-support');
        ?>
"><?php 
        _e('Support Forum', 'sitemap');
        ?>
</a>
							<a class="sm_button sm_pluginBugs"    href="<?php 
        echo $this->sg->GetRedirectLink('sitemap-bugs');
        ?>
"><?php 
        _e('Report a Bug', 'sitemap');
        ?>
</a>
							
							<a class="sm_button sm_donatePayPal"  href="<?php 
        echo $this->sg->GetRedirectLink('sitemap-paypal');
        ?>
"><?php 
        _e('Donate with PayPal', 'sitemap');
        ?>
</a>
							<a class="sm_button sm_donateAmazon"  href="<?php 
        echo $this->sg->GetRedirectLink('sitemap-amazon');
        ?>
"><?php 
        _e('My Amazon Wish List', 'sitemap');
        ?>
</a>
							<?php 
        if (__('translator_name', 'sitemap') != 'translator_name') {
            ?>
<a class="sm_button sm_pluginSupport" href="<?php 
            _e('translator_url', 'sitemap');
            ?>
"><?php 
            _e('translator_name', 'sitemap');
            ?>
</a><?php 
        }
        ?>
						<?php 
        $this->HtmlPrintBoxFooter(true);
        ?>
						
						<?php 
        $this->HtmlPrintBoxHeader('sm_smres', __('Sitemap Resources:', 'sitemap'), true);
        ?>
							<a class="sm_button sm_resGoogle"    href="<?php 
        echo $this->sg->GetRedirectLink('sitemap-gwt');
        ?>
"><?php 
        _e('Webmaster Tools', 'sitemap');
        ?>
</a>
							<a class="sm_button sm_resGoogle"    href="<?php 
        echo $this->sg->GetRedirectLink('sitemap-gwb');
        ?>
"><?php 
        _e('Webmaster Blog', 'sitemap');
        ?>
</a>
							
							<a class="sm_button sm_resYahoo"     href="<?php 
        echo $this->sg->GetRedirectLink('sitemap-yse');
        ?>
"><?php 
        _e('Site Explorer', 'sitemap');
        ?>
</a>
							<a class="sm_button sm_resYahoo"     href="<?php 
        echo $this->sg->GetRedirectLink('sitemap-ywb');
        ?>
"><?php 
        _e('Search Blog', 'sitemap');
        ?>
</a>
							
							<a class="sm_button sm_resBing"     href="<?php 
        echo $this->sg->GetRedirectLink('sitemap-lwt');
        ?>
"><?php 
        _e('Webmaster Tools', 'sitemap');
        ?>
</a>
							<a class="sm_button sm_resBing"     href="<?php 
        echo $this->sg->GetRedirectLink('sitemap-lswcb');
        ?>
"><?php 
        _e('Webmaster Center Blog', 'sitemap');
        ?>
</a>
							<br />
							<a class="sm_button sm_resGoogle"    href="<?php 
        echo $this->sg->GetRedirectLink('sitemap-prot');
        ?>
"><?php 
        _e('Sitemaps Protocol', 'sitemap');
        ?>
</a>
							<a class="sm_button sm_resGoogle"    href="<?php 
        echo $this->sg->GetRedirectLink('sitemap-ofaq');
        ?>
"><?php 
        _e('Official Sitemaps FAQ', 'sitemap');
        ?>
</a>
							<a class="sm_button sm_pluginHome"   href="<?php 
        echo $this->sg->GetRedirectLink('sitemap-afaq');
        ?>
"><?php 
        _e('My Sitemaps FAQ', 'sitemap');
        ?>
</a>
						<?php 
        $this->HtmlPrintBoxFooter(true);
        ?>
						
						<?php 
        $this->HtmlPrintBoxHeader('dm_donations', __('Recent Donations:', 'sitemap'), true);
        ?>
											
							<?php 
        if ($this->sg->GetOption('i_hide_donors') !== true) {
            ?>
								<iframe border="0" frameborder="0" scrolling="no" allowtransparency="yes" style="width:100%; height:80px;" src="<?php 
            echo $this->sg->GetRedirectLink('sitemap-donorlist');
            ?>
">
								<?php 
            _e('List of the donors', 'sitemap');
            ?>
								</iframe><br />
								<a href="<?php 
            echo $this->sg->GetBackLink() . "&amp;sm_hidedonors=true";
            ?>
"><small><?php 
            _e('Hide this list', 'sitemap');
            ?>
</small></a><br /><br />
							<?php 
        }
        ?>
							<a style="float:left; margin-right:5px; border:none;" href="javascript:document.getElementById('sm_donate_form').submit();"><img style="vertical-align:middle; border:none; margin-top:2px;" src="<?php 
        echo $this->sg->GetPluginUrl();
        ?>
img/icon-donate.gif" border="0" alt="PayPal" title="Help me to continue support of this plugin :)" /></a>
							<span><small><?php 
        _e('Thanks for your support!', 'sitemap');
        ?>
</small></span>
							<div style="clear:left; height:1px;"></div>
						<?php 
        $this->HtmlPrintBoxFooter(true);
        ?>
				
						</div>
					</div>
					
					<?php 
        if ($this->mode == 27) {
            ?>
						<div class="has-sidebar sm-padded" >
					
							<div id="post-body-content" class="has-sidebar-content">
						
								<div class="meta-box-sortabless">
					<?php 
        } else {
            ?>
						<div id="advancedstuff" class="dbx-group" >
					<?php 
        }
        ?>
					
					<!-- Rebuild Area -->
					<?php 
        $this->HtmlPrintBoxHeader('sm_rebuild', __('Status', 'sitemap'));
        ?>
						<ul>
							<?php 
        //#type $status GoogleSitemapGeneratorStatus
        $status = GoogleSitemapGeneratorStatus::Load();
        if ($status == null) {
            echo "<li>" . str_replace("%s", wp_nonce_url($this->sg->GetBackLink() . "&sm_rebuild=true", 'sitemap'), __('The sitemap wasn\'t built yet. <a href="%s">Click here</a> to build it the first time.', 'sitemap')) . "</li>";
        } else {
            if ($status->_endTime !== 0) {
                if ($status->_usedXml) {
                    if ($status->_xmlSuccess) {
                        $ft = filemtime($status->_xmlPath);
                        echo "<li>" . str_replace("%url%", $status->_xmlUrl, str_replace("%date%", date(get_option('date_format'), $ft) . " " . date(get_option('time_format'), $ft), __("Your <a href=\"%url%\">sitemap</a> was last built on <b>%date%</b>.", 'sitemap'))) . "</li>";
                    } else {
                        echo "<li class=\"sm_error\">" . str_replace("%url%", $this->sg->GetRedirectLink('sitemap-help-files'), __("There was a problem writing your sitemap file. Make sure the file exists and is writable. <a href=\"%url%\">Learn more</a", 'sitemap')) . "</li>";
                    }
                }
                if ($status->_usedZip) {
                    if ($status->_zipSuccess) {
                        $ft = filemtime($status->_zipPath);
                        echo "<li>" . str_replace("%url%", $status->_zipUrl, str_replace("%date%", date(get_option('date_format'), $ft) . " " . date(get_option('time_format'), $ft), __("Your sitemap (<a href=\"%url%\">zipped</a>) was last built on <b>%date%</b>.", 'sitemap'))) . "</li>";
                    } else {
                        echo "<li class=\"sm_error\">" . str_replace("%url%", $this->sg->GetRedirectLink('sitemap-help-files'), __("There was a problem writing your zipped sitemap file. Make sure the file exists and is writable. <a href=\"%url%\">Learn more</a", 'sitemap')) . "</li>";
                    }
                }
                if ($status->_usedGoogle) {
                    if ($status->_gooogleSuccess) {
                        echo "<li>" . __("Google was <b>successfully notified</b> about changes.", 'sitemap') . "</li>";
                        $gt = $status->GetGoogleTime();
                        if ($gt > 4) {
                            echo "<li class=\\sm_optimize\">" . str_replace("%time%", $gt, __("It took %time% seconds to notify Google, maybe you want to disable this feature to reduce the building time.", 'sitemap')) . "</li>";
                        }
                    } else {
                        echo "<li class=\"sm_error\">" . str_replace("%s", $status->_googleUrl, __('There was a problem while notifying Google. <a href="%s">View result</a>', 'sitemap')) . "</li>";
                    }
                }
                if ($status->_usedYahoo) {
                    if ($status->_yahooSuccess) {
                        echo "<li>" . __("YAHOO was <b>successfully notified</b> about changes.", 'sitemap') . "</li>";
                        $yt = $status->GetYahooTime();
                        if ($yt > 4) {
                            echo "<li class=\\sm_optimize\">" . str_replace("%time%", $yt, __("It took %time% seconds to notify YAHOO, maybe you want to disable this feature to reduce the building time.", 'sitemap')) . "</li>";
                        }
                    } else {
                        echo "<li class=\"sm_error\">" . str_replace("%s", $status->_yahooUrl, __('There was a problem while notifying YAHOO. <a href="%s">View result</a>', 'sitemap')) . "</li>";
                    }
                }
                if ($status->_usedMsn) {
                    if ($status->_msnSuccess) {
                        echo "<li>" . __("Bing was <b>successfully notified</b> about changes.", 'sitemap') . "</li>";
                        $at = $status->GetMsnTime();
                        if ($at > 4) {
                            echo "<li class=\\sm_optimize\">" . str_replace("%time%", $at, __("It took %time% seconds to notify Bing, maybe you want to disable this feature to reduce the building time.", 'sitemap')) . "</li>";
                        }
                    } else {
                        echo "<li class=\"sm_error\">" . str_replace("%s", $status->_msnUrl, __('There was a problem while notifying Bing. <a href="%s">View result</a>', 'sitemap')) . "</li>";
                    }
                }
                if ($status->_usedAsk) {
                    if ($status->_askSuccess) {
                        echo "<li>" . __("Ask.com was <b>successfully notified</b> about changes.", 'sitemap') . "</li>";
                        $at = $status->GetAskTime();
                        if ($at > 4) {
                            echo "<li class=\\sm_optimize\">" . str_replace("%time%", $at, __("It took %time% seconds to notify Ask.com, maybe you want to disable this feature to reduce the building time.", 'sitemap')) . "</li>";
                        }
                    } else {
                        echo "<li class=\"sm_error\">" . str_replace("%s", $status->_askUrl, __('There was a problem while notifying Ask.com. <a href="%s">View result</a>', 'sitemap')) . "</li>";
                    }
                }
                $et = $status->GetTime();
                $mem = $status->GetMemoryUsage();
                if ($mem > 0) {
                    echo "<li>" . str_replace(array("%time%", "%memory%"), array($et, $mem), __("The building process took about <b>%time% seconds</b> to complete and used %memory% MB of memory.", 'sitemap')) . "</li>";
                } else {
                    echo "<li>" . str_replace("%time%", $et, __("The building process took about <b>%time% seconds</b> to complete.", 'sitemap')) . "</li>";
                }
                if (!$status->_hasChanged) {
                    echo "<li>" . __("The content of your sitemap <strong>didn't change</strong> since the last time so the files were not written and no search engine was pinged.", 'sitemap') . "</li>";
                }
            } else {
                if ($this->sg->GetOption("b_auto_delay")) {
                    $st = ($status->GetStartTime() - time()) * -1;
                    //If the building process runs in background and was started within the last 45 seconds, the sitemap might not be completed yet...
                    if ($st < 45) {
                        echo '<li class="">' . __("The building process might still be active! Reload the page in a few seconds and check if something has changed.", 'sitemap') . '</li>';
                    }
                }
                echo '<li class="sm_error">' . str_replace("%url%", $this->sg->GetRedirectLink('sitemap-help-memtime'), __("The last run didn't finish! Maybe you can raise the memory or time limit for PHP scripts. <a href=\"%url%\">Learn more</a>", 'sitemap')) . '</li>';
                if ($status->_memoryUsage > 0) {
                    echo '<li class="sm_error">' . str_replace(array("%memused%", "%memlimit%"), array($status->GetMemoryUsage(), ini_get('memory_limit')), __("The last known memory usage of the script was %memused%MB, the limit of your server is %memlimit%.", 'sitemap')) . '</li>';
                }
                if ($status->_lastTime > 0) {
                    echo '<li class="sm_error">' . str_replace(array("%timeused%", "%timelimit%"), array($status->GetLastTime(), ini_get('max_execution_time')), __("The last known execution time of the script was %timeused% seconds, the limit of your server is %timelimit% seconds.", 'sitemap')) . '</li>';
                }
                if ($status->GetLastPost() > 0) {
                    echo '<li class="sm_optimize">' . str_replace("%lastpost%", $status->GetLastPost(), __("The script stopped around post number %lastpost% (+/- 100)", 'sitemap')) . '</li>';
                }
            }
            echo "<li>" . str_replace("%s", wp_nonce_url($this->sg->GetBackLink() . "&sm_rebuild=true&noheader=true", 'sitemap'), __('If you changed something on your server or blog, you should <a href="%s">rebuild the sitemap</a> manually.', 'sitemap')) . "</li>";
        }
        echo "<li>" . str_replace("%d", wp_nonce_url($this->sg->GetBackLink() . "&sm_rebuild=true&sm_do_debug=true", 'sitemap'), __('If you encounter any problems with the build process you can use the <a href="%d">debug function</a> to get more information.', 'sitemap')) . "</li>";
        ?>

						</ul>
					<?php 
        $this->HtmlPrintBoxFooter();
        ?>
						
					<!-- Basic Options -->
					<?php 
        $this->HtmlPrintBoxHeader('sm_basic_options', __('Basic Options', 'sitemap'));
        ?>
					
						<b><?php 
        _e('Sitemap files:', 'sitemap');
        ?>
</b> <a href="<?php 
        echo $this->sg->GetRedirectLink('sitemap-help-options-files');
        ?>
"><?php 
        _e('Learn more', 'sitemap');
        ?>
</a>
						<ul>
							<li>
								<label for="sm_b_xml">
									<input type="checkbox" id="sm_b_xml" name="sm_b_xml" <?php 
        echo $this->sg->GetOption("b_xml") == true ? "checked=\"checked\"" : "";
        ?>
 />
									<?php 
        _e('Write a normal XML file (your filename)', 'sitemap');
        ?>
								</label>
							</li>
							<li>
								<label for="sm_b_gzip">
									<input type="checkbox" id="sm_b_gzip" name="sm_b_gzip" <?php 
        if (function_exists("gzencode")) {
            echo $this->sg->GetOption("b_gzip") == true ? "checked=\"checked\"" : "";
        } else {
            echo "disabled=\"disabled\"";
        }
        ?>
 />
									<?php 
        _e('Write a gzipped file (your filename + .gz)', 'sitemap');
        ?>
								</label>
							</li>
						</ul>
						<b><?php 
        _e('Building mode:', 'sitemap');
        ?>
</b> <a href="<?php 
        echo $this->sg->GetRedirectLink('sitemap-help-options-process');
        ?>
"><?php 
        _e('Learn more', 'sitemap');
        ?>
</a>
						<ul>
							<li>
								<label for="sm_b_auto_enabled">
									<input type="checkbox" id="sm_b_auto_enabled" name="sm_b_auto_enabled" <?php 
        echo $this->sg->GetOption("b_auto_enabled") == true ? "checked=\"checked\"" : "";
        ?>
 />
									<?php 
        _e('Rebuild sitemap if you change the content of your blog', 'sitemap');
        ?>
								</label>
							</li>
							<li>
								<label for="sm_b_manual_enabled">
									<input type="hidden" name="sm_b_manual_key" value="<?php 
        echo $this->sg->GetOption("b_manual_key");
        ?>
" />
									<input type="checkbox" id="sm_b_manual_enabled" name="sm_b_manual_enabled" <?php 
        echo $this->sg->GetOption("b_manual_enabled") == true ? "checked=\"checked\"" : "";
        ?>
 />
									<?php 
        _e('Enable manual sitemap building via GET Request', 'sitemap');
        ?>
								</label>
								<a href="javascript:void(document.getElementById('sm_manual_help').style.display='');">[?]</a>
								<span id="sm_manual_help" style="display:none;"><br />
								<?php 
        echo str_replace("%1", trailingslashit(get_bloginfo('siteurl')) . "?sm_command=build&amp;sm_key=" . $this->sg->GetOption("b_manual_key"), __('This will allow you to refresh your sitemap if an external tool wrote into the WordPress database without using the WordPress API. Use the following URL to start the process: <a href="%1">%1</a> Please check the logfile above to see if sitemap was successfully built.', 'sitemap'));
        ?>
								</span>
							</li>
						</ul>
						<b><?php 
        _e('Update notification:', 'sitemap');
        ?>
</b> <a href="<?php 
        echo $this->sg->GetRedirectLink('sitemap-help-options-ping');
        ?>
"><?php 
        _e('Learn more', 'sitemap');
        ?>
</a>
						<ul>
							<li>
								<input type="checkbox" id="sm_b_ping" name="sm_b_ping" <?php 
        echo $this->sg->GetOption("b_ping") == true ? "checked=\"checked\"" : "";
        ?>
 />
								<label for="sm_b_ping"><?php 
        _e('Notify Google about updates of your Blog', 'sitemap');
        ?>
</label><br />
								<small><?php 
        echo str_replace("%s", $this->sg->GetRedirectLink('sitemap-gwt'), __('No registration required, but you can join the <a href="%s">Google Webmaster Tools</a> to check crawling statistics.', 'sitemap'));
        ?>
</small>
							</li>
							<li>
								<input type="checkbox" id="sm_b_pingmsn" name="sm_b_pingmsn" <?php 
        echo $this->sg->GetOption("b_pingmsn") == true ? "checked=\"checked\"" : "";
        ?>
 />
								<label for="sm_b_pingmsn"><?php 
        _e('Notify Bing (formerly MSN Live Search) about updates of your Blog', 'sitemap');
        ?>
</label><br />
								<small><?php 
        echo str_replace("%s", $this->sg->GetRedirectLink('sitemap-lwt'), __('No registration required, but you can join the <a href="%s">Bing Webmaster Tools</a> to check crawling statistics.', 'sitemap'));
        ?>
</small>
							</li>
							<li>
								<input type="checkbox" id="sm_b_pingask" name="sm_b_pingask" <?php 
        echo $this->sg->GetOption("b_pingask") == true ? "checked=\"checked\"" : "";
        ?>
 />
								<label for="sm_b_pingask"><?php 
        _e('Notify Ask.com about updates of your Blog', 'sitemap');
        ?>
</label><br />
								<small><?php 
        _e('No registration required.', 'sitemap');
        ?>
</small>
							</li>
							<li>
								<input type="checkbox" id="sm_b_pingyahoo" name="sm_b_pingyahoo" <?php 
        echo $this->sg->GetOption("b_pingyahoo") == true ? "checked=\"checked\"" : "";
        ?>
 />
								<label for="sm_b_pingyahoo"><?php 
        _e('Notify YAHOO about updates of your Blog', 'sitemap');
        ?>
</label><br />
								<label for="sm_b_yahookey"><?php 
        _e('Your Application ID:', 'sitemap');
        ?>
 <input type="text" name="sm_b_yahookey" id="sm_b_yahookey" value="<?php 
        echo $this->sg->GetOption("b_yahookey");
        ?>
" /></label><br />
								<small><?php 
        echo str_replace(array("%s1", "%s2"), array($this->sg->GetRedirectLink('sitemap-ykr'), ' (<a href="http://developer.yahoo.net/about/">Web Services by Yahoo!</a>)'), __('Don\'t you have such a key? <a href="%s1">Request one here</a>! %s2', 'sitemap'));
        ?>
</small>
							</li>
							<li>
								<label for="sm_b_robots">
								<input type="checkbox" id="sm_b_robots" name="sm_b_robots" <?php 
        echo $this->sg->GetOption("b_robots") == true ? "checked=\"checked\"" : "";
        ?>
 />
								<?php 
        _e("Add sitemap URL to the virtual robots.txt file.", 'sitemap');
        ?>
								</label>

								<br />
								<small><?php 
        _e('The virtual robots.txt generated by WordPress is used. A real robots.txt file must NOT exist in the blog directory!', 'sitemap');
        ?>
</small>
							</li>
						</ul>
						<b><?php 
        _e('Advanced options:', 'sitemap');
        ?>
</b> <a href="<?php 
        echo $this->sg->GetRedirectLink('sitemap-help-options-adv');
        ?>
"><?php 
        _e('Learn more', 'sitemap');
        ?>
</a>
						<ul>
							<li>
								<label for="sm_b_max_posts"><?php 
        _e('Limit the number of posts in the sitemap:', 'sitemap');
        ?>
 <input type="text" name="sm_b_max_posts" id="sm_b_max_posts" style="width:40px;" value="<?php 
        echo $this->sg->GetOption("b_max_posts") <= 0 ? "" : $this->sg->GetOption("b_max_posts");
        ?>
" /></label> (<?php 
        echo __('Newer posts will be included first', 'sitemap');
        ?>
)
							</li>
							<li>
								<label for="sm_b_memory"><?php 
        _e('Try to increase the memory limit to:', 'sitemap');
        ?>
 <input type="text" name="sm_b_memory" id="sm_b_memory" style="width:40px;" value="<?php 
        echo $this->sg->GetOption("b_memory");
        ?>
" /></label> (<?php 
        echo htmlspecialchars(__('e.g. "4M", "16M"', 'sitemap'));
        ?>
)
							</li>
							<li>
								<label for="sm_b_time"><?php 
        _e('Try to increase the execution time limit to:', 'sitemap');
        ?>
 <input type="text" name="sm_b_time" id="sm_b_time" style="width:40px;" value="<?php 
        echo $this->sg->GetOption("b_time") === -1 ? '' : $this->sg->GetOption("b_time");
        ?>
" /></label> (<?php 
        echo htmlspecialchars(__('in seconds, e.g. "60" or "0" for unlimited', 'sitemap'));
        ?>
)
							</li>
							<li>
								<?php 
        $useDefStyle = $this->sg->GetDefaultStyle() && $this->sg->GetOption('b_style_default') === true;
        ?>
								<label for="sm_b_style"><?php 
        _e('Include a XSLT stylesheet:', 'sitemap');
        ?>
 <input <?php 
        echo $useDefStyle ? 'disabled="disabled" ' : '';
        ?>
 type="text" name="sm_b_style" id="sm_b_style"  value="<?php 
        echo $this->sg->GetOption("b_style");
        ?>
" /></label>
								(<?php 
        _e('Full or relative URL to your .xsl file', 'sitemap');
        ?>
) <?php 
        if ($this->sg->GetDefaultStyle()) {
            ?>
<label for="sm_b_style_default"><input <?php 
            echo $useDefStyle ? 'checked="checked" ' : '';
            ?>
 type="checkbox" id="sm_b_style_default" name="sm_b_style_default" onclick="document.getElementById('sm_b_style').disabled = this.checked;" /> <?php 
            _e('Use default', 'sitemap');
            ?>
 <?php 
        }
        ?>
							</li>
							<li>
								<label for="sm_b_safemode">
									<?php 
        $forceSafeMode = floatval($wp_version) < 2.2;
        ?>
									<input type="checkbox" <?php 
        if ($forceSafeMode) {
            ?>
disabled="disabled"<?php 
        }
        ?>
 id="sm_b_safemode" name="sm_b_safemode" <?php 
        echo $this->sg->GetOption("b_safemode") == true || $forceSafeMode ? "checked=\"checked\"" : "";
        ?>
 />
									<?php 
        _e('Enable MySQL standard mode. Use this only if you\'re getting MySQL errors. (Needs much more memory!)', 'sitemap');
        ?>
									<?php 
        if ($forceSafeMode) {
            ?>
 <br /><small><?php 
            _e("Upgrade WordPress at least to 2.2 to enable the faster MySQL access", 'sitemap');
            ?>
</small><?php 
        }
        ?>
								</label>
							</li>
							<li>
								<label for="sm_b_auto_delay">
								<?php 
        $forceDirect = floatval($wp_version) < 2.1;
        ?>
									<input type="checkbox" <?php 
        if ($forceDirect) {
            ?>
disabled="disabled"<?php 
        }
        ?>
 id="sm_b_auto_delay" name="sm_b_auto_delay" <?php 
        echo $this->sg->GetOption("b_auto_delay") == true && !$forceDirect ? "checked=\"checked\"" : "";
        ?>
 />
									<?php 
        _e('Build the sitemap in a background process (You don\'t have to wait when you save a post)', 'sitemap');
        ?>
									<?php 
        if ($forceDirect) {
            ?>
 <br /><small><?php 
            _e("Upgrade WordPress at least to 2.1 to enable background building", 'sitemap');
            ?>
</small><?php 
        }
        ?>
								</label>
							</li>
						</ul>
						
					<?php 
        $this->HtmlPrintBoxFooter();
        ?>
					
					<?php 
        $this->HtmlPrintBoxHeader('sm_pages', __('Additional pages', 'sitemap'));
        ?>
		
						<?php 
        _e('Here you can specify files or URLs which should be included in the sitemap, but do not belong to your Blog/WordPress.<br />For example, if your domain is www.foo.com and your blog is located on www.foo.com/blog you might want to include your homepage at www.foo.com', 'sitemap');
        echo "<ul><li>";
        echo "<strong>" . __('Note', 'sitemap') . "</strong>: ";
        _e("If your blog is in a subdirectory and you want to add pages which are NOT in the blog directory or beneath, you MUST place your sitemap file in the root directory (Look at the &quot;Location of your sitemap file&quot; section on this page)!", 'sitemap');
        echo "</li><li>";
        echo "<strong>" . __('URL to the page', 'sitemap') . "</strong>: ";
        _e("Enter the URL to the page. Examples: http://www.foo.com/index.html or www.foo.com/home ", 'sitemap');
        echo "</li><li>";
        echo "<strong>" . __('Priority', 'sitemap') . "</strong>: ";
        _e("Choose the priority of the page relative to the other pages. For example, your homepage might have a higher priority than your imprint.", 'sitemap');
        echo "</li><li>";
        echo "<strong>" . __('Last Changed', 'sitemap') . "</strong>: ";
        _e("Enter the date of the last change as YYYY-MM-DD (2005-12-31 for example) (optional).", 'sitemap');
        echo "</li></ul>";
        ?>
						<script type="text/javascript">
							//<![CDATA[
							<?php 
        $freqVals = "'" . implode("','", array_keys($this->sg->_freqNames)) . "'";
        $freqNames = "'" . implode("','", array_values($this->sg->_freqNames)) . "'";
        ?>

							var changeFreqVals = new Array( <?php 
        echo $freqVals;
        ?>
 );
							var changeFreqNames= new Array( <?php 
        echo $freqNames;
        ?>
 );
							
							var priorities= new Array(0 <?php 
        for ($i = 0.1; $i < 1; $i += 0.1) {
            echo "," . number_format($i, 1, ".", "");
        }
        ?>
);
							
							var pages = [ <?php 
        if (count($this->sg->_pages) > 0) {
            for ($i = 0; $i < count($this->sg->_pages); $i++) {
                $v =& $this->sg->_pages[$i];
                if ($i > 0) {
                    echo ",";
                }
                echo '{url:"' . $v->getUrl() . '", priority:"' . number_format($v->getPriority(), 1, ".", "") . '", changeFreq:"' . $v->getChangeFreq() . '", lastChanged:"' . ($v != null && $v->getLastMod() > 0 ? date("Y-m-d", $v->getLastMod()) : "") . '"}';
            }
        }
        ?>
 ];
							//]]>
						</script>
						<script type="text/javascript" src="<?php 
        echo $this->sg->GetPluginUrl();
        ?>
img/sitemap.js"></script>
						<table width="100%" cellpadding="3" cellspacing="3" id="sm_pageTable">
							<tr>
								<th scope="col"><?php 
        _e('URL to the page', 'sitemap');
        ?>
</th>
								<th scope="col"><?php 
        _e('Priority', 'sitemap');
        ?>
</th>
								<th scope="col"><?php 
        _e('Change Frequency', 'sitemap');
        ?>
</th>
								<th scope="col"><?php 
        _e('Last Changed', 'sitemap');
        ?>
</th>
								<th scope="col"><?php 
        _e('#', 'sitemap');
        ?>
</th>
							</tr>
							<?php 
        if (count($this->sg->_pages) <= 0) {
            ?>
									<tr>
										<td colspan="5" align="center"><?php 
            _e('No pages defined.', 'sitemap');
            ?>
</td>
									</tr><?php 
        }
        ?>
						</table>
						<a href="javascript:void(0);" onclick="sm_addPage();"><?php 
        _e("Add new page", 'sitemap');
        ?>
</a>
					<?php 
        $this->HtmlPrintBoxFooter();
        ?>
					
					
					<!-- AutoPrio Options -->
					<?php 
        $this->HtmlPrintBoxHeader('sm_postprio', __('Post Priority', 'sitemap'));
        ?>
	
						<p><?php 
        _e('Please select how the priority of each post should be calculated:', 'sitemap');
        ?>
</p>
						<ul>
							<li><p><input type="radio" name="sm_b_prio_provider" id="sm_b_prio_provider__0" value="" <?php 
        echo $this->sg->HtmlGetChecked($this->sg->GetOption("b_prio_provider"), "");
        ?>
 /> <label for="sm_b_prio_provider__0"><?php 
        _e('Do not use automatic priority calculation', 'sitemap');
        ?>
</label><br /><?php 
        _e('All posts will have the same priority which is defined in &quot;Priorities&quot;', 'sitemap');
        ?>
</p></li>
							<?php 
        for ($i = 0; $i < count($this->sg->_prioProviders); $i++) {
            echo "<li><p><input type=\"radio\" id=\"sm_b_prio_provider_{$i}\" name=\"sm_b_prio_provider\" value=\"" . $this->sg->_prioProviders[$i] . "\" " . $this->sg->HtmlGetChecked($this->sg->GetOption("b_prio_provider"), $this->sg->_prioProviders[$i]) . " /> <label for=\"sm_b_prio_provider_{$i}\">" . call_user_func(array(&$this->sg->_prioProviders[$i], 'getName')) . "</label><br />" . call_user_func(array(&$this->sg->_prioProviders[$i], 'getDescription')) . "</p></li>";
        }
        ?>
						</ul>
					<?php 
        $this->HtmlPrintBoxFooter();
        ?>
				
						
					<!-- Location Options -->
					<?php 
        $this->HtmlPrintBoxHeader('sm_location', __('Location of your sitemap file', 'sitemap'));
        ?>
		
						<div>
							<b><label for="sm_location_useauto"><input type="radio" id="sm_location_useauto" name="sm_b_location_mode" value="auto" <?php 
        echo $this->sg->GetOption("b_location_mode") == "auto" ? "checked=\"checked\"" : "";
        ?>
 /> <?php 
        _e('Automatic detection', 'sitemap');
        ?>
</label></b>
							<ul>
								<li>
									<label for="sm_b_filename">
										<?php 
        _e('Filename of the sitemap file', 'sitemap');
        ?>
										<input type="text" id="sm_b_filename" name="sm_b_filename" value="<?php 
        echo $this->sg->GetOption("b_filename");
        ?>
" />
									</label><br />
									<?php 
        _e('Detected Path', 'sitemap');
        ?>
: <?php 
        echo $this->sg->getXmlPath(true);
        ?>
<br /><?php 
        _e('Detected URL', 'sitemap');
        ?>
: <a href="<?php 
        echo $this->sg->getXmlUrl(true);
        ?>
"><?php 
        echo $this->sg->getXmlUrl(true);
        ?>
</a>
								</li>
							</ul>
						</div>
						<div>
							<b><label for="sm_location_usemanual"><input type="radio" id="sm_location_usemanual" name="sm_b_location_mode" value="manual" <?php 
        echo $this->sg->GetOption("b_location_mode") == "manual" ? "checked=\"checked\"" : "";
        ?>
  /> <?php 
        _e('Custom location', 'sitemap');
        ?>
</label></b>
							<ul>
								<li>
									<label for="sm_b_filename_manual">
										<?php 
        _e('Absolute or relative path to the sitemap file, including name.', 'sitemap');
        echo "<br />";
        _e('Example', 'sitemap');
        echo ": /var/www/htdocs/wordpress/sitemap.xml";
        ?>
<br />
										<input style="width:70%" type="text" id="sm_b_filename_manual" name="sm_b_filename_manual" value="<?php 
        echo !$this->sg->GetOption("b_filename_manual") ? $this->sg->getXmlPath() : $this->sg->GetOption("b_filename_manual");
        ?>
" />
									</label>
								</li>
								<li>
									<label for="sm_b_fileurl_manual">
										<?php 
        _e('Complete URL to the sitemap file, including name.', 'sitemap');
        echo "<br />";
        _e('Example', 'sitemap');
        echo ": http://www.yourdomain.com/sitemap.xml";
        ?>
<br />
										<input style="width:70%" type="text" id="sm_b_fileurl_manual" name="sm_b_fileurl_manual" value="<?php 
        echo !$this->sg->GetOption("b_fileurl_manual") ? $this->sg->getXmlUrl() : $this->sg->GetOption("b_fileurl_manual");
        ?>
" />
									</label>
								</li>
							</ul>
						</div>
						
					<?php 
        $this->HtmlPrintBoxFooter();
        ?>
					
					<!-- Includes -->
					<?php 
        $this->HtmlPrintBoxHeader('sm_includes', __('Sitemap Content', 'sitemap'));
        ?>
					
						<ul>
							<li>
								<label for="sm_in_home">
									<input type="checkbox" id="sm_in_home" name="sm_in_home"  <?php 
        echo $this->sg->GetOption("in_home") == true ? "checked=\"checked\"" : "";
        ?>
 />
									<?php 
        _e('Include homepage', 'sitemap');
        ?>
								</label>
							</li>
							<li>
								<label for="sm_in_posts">
									<input type="checkbox" id="sm_in_posts" name="sm_in_posts"  <?php 
        echo $this->sg->GetOption("in_posts") == true ? "checked=\"checked\"" : "";
        ?>
 />
									<?php 
        _e('Include posts', 'sitemap');
        ?>
								</label>
							</li>
							<li>
								<label for="sm_in_posts_sub">
									<input type="checkbox" id="sm_in_posts_sub" name="sm_in_posts_sub"  <?php 
        echo $this->sg->GetOption("in_posts_sub") == true ? "checked=\"checked\"" : "";
        ?>
 />
									<?php 
        _e('Include following pages of multi-page posts (Increases build time and memory usage!)', 'sitemap');
        ?>
								</label>
							</li>
							<li>
								<label for="sm_in_pages">
									<input type="checkbox" id="sm_in_pages" name="sm_in_pages"  <?php 
        echo $this->sg->GetOption("in_pages") == true ? "checked=\"checked\"" : "";
        ?>
 />
									<?php 
        _e('Include static pages', 'sitemap');
        ?>
								</label>
							</li>
							<li>
								<label for="sm_in_cats">
									<input type="checkbox" id="sm_in_cats" name="sm_in_cats"  <?php 
        echo $this->sg->GetOption("in_cats") == true ? "checked=\"checked\"" : "";
        ?>
 />
									<?php 
        _e('Include categories', 'sitemap');
        ?>
								</label>
							</li>
							<li>
								<label for="sm_in_arch">
									<input type="checkbox" id="sm_in_arch" name="sm_in_arch"  <?php 
        echo $this->sg->GetOption("in_arch") == true ? "checked=\"checked\"" : "";
        ?>
 />
									<?php 
        _e('Include archives', 'sitemap');
        ?>
								</label>
							</li>
							<?php 
        if ($this->sg->IsTaxonomySupported()) {
            ?>
							<li>
								<label for="sm_in_tags">
									<input type="checkbox" id="sm_in_tags" name="sm_in_tags"  <?php 
            echo $this->sg->GetOption("in_tags") == true ? "checked=\"checked\"" : "";
            ?>
 />
									<?php 
            _e('Include tag pages', 'sitemap');
            ?>
								</label>
							</li>
							<?php 
        }
        ?>
							<li>
								<label for="sm_in_auth">
									<input type="checkbox" id="sm_in_auth" name="sm_in_auth"  <?php 
        echo $this->sg->GetOption("in_auth") == true ? "checked=\"checked\"" : "";
        ?>
 />
									<?php 
        _e('Include author pages', 'sitemap');
        ?>
								</label>
							</li>
						</ul>
						
					<?php 
        $this->HtmlPrintBoxFooter();
        ?>
					
					<!-- Excluded Items -->
					<?php 
        $this->HtmlPrintBoxHeader('sm_excludes', __('Excluded items', 'sitemap'));
        ?>
					
						<b><?php 
        _e('Excluded categories', 'sitemap');
        ?>
:</b>
						<?php 
        if (version_compare($wp_version, "2.5.1", ">=")) {
            ?>
						<cite style="display:block; margin-left:40px;"><?php 
            _e("Note", "sitemap");
            ?>
: <?php 
            _e("Using this feature will increase build time and memory usage!", "sitemap");
            ?>
</cite>
						<div style="border-color:#CEE1EF; border-style:solid; border-width:2px; height:10em; margin:5px 0px 5px 40px; overflow:auto; padding:0.5em 0.5em;">
						<ul>
							<?php 
            wp_category_checklist(0, 0, $this->sg->GetOption("b_exclude_cats"), false);
            ?>
						</ul>
						</div>
						<?php 
        } else {
            ?>
							<ul><li><?php 
            echo sprintf(__("This feature requires at least WordPress 2.5.1, you are using %s", "sitemap"), $wp_version);
            ?>
</li></ul>
						<?php 
        }
        ?>
						
						<b><?php 
        _e("Exclude posts", "sitemap");
        ?>
:</b>
						<div style="margin:5px 0 13px 40px;">
							<label for="sm_b_exclude"><?php 
        _e('Exclude the following posts or pages:', 'sitemap');
        ?>
 <small><?php 
        _e('List of IDs, separated by comma', 'sitemap');
        ?>
</small><br />
							<input name="sm_b_exclude" id="sm_b_exclude" type="text" style="width:400px;" value="<?php 
        echo implode(",", $this->sg->GetOption("b_exclude"));
        ?>
" /></label><br />
							<cite><?php 
        _e("Note", "sitemap");
        ?>
: <?php 
        _e("Child posts won't be excluded automatically!", "sitemap");
        ?>
</cite>
						</div>
						
					<?php 
        $this->HtmlPrintBoxFooter();
        ?>
					
					<!-- Change frequencies -->
					<?php 
        $this->HtmlPrintBoxHeader('sm_change_frequencies', __('Change frequencies', 'sitemap'));
        ?>

						<p>
							<b><?php 
        _e('Note', 'sitemap');
        ?>
:</b>
							<?php 
        _e('Please note that the value of this tag is considered a hint and not a command. Even though search engine crawlers consider this information when making decisions, they may crawl pages marked "hourly" less frequently than that, and they may crawl pages marked "yearly" more frequently than that. It is also likely that crawlers will periodically crawl pages marked "never" so that they can handle unexpected changes to those pages.', 'sitemap');
        ?>
						</p>
						<ul>
							<li>
								<label for="sm_cf_home">
									<select id="sm_cf_home" name="sm_cf_home"><?php 
        $this->sg->HtmlGetFreqNames($this->sg->GetOption("cf_home"));
        ?>
</select>
									<?php 
        _e('Homepage', 'sitemap');
        ?>
								</label>
							</li>
							<li>
								<label for="sm_cf_posts">
									<select id="sm_cf_posts" name="sm_cf_posts"><?php 
        $this->sg->HtmlGetFreqNames($this->sg->GetOption("cf_posts"));
        ?>
</select>
									<?php 
        _e('Posts', 'sitemap');
        ?>
								</label>
							</li>
							<li>
								<label for="sm_cf_pages">
									<select id="sm_cf_pages" name="sm_cf_pages"><?php 
        $this->sg->HtmlGetFreqNames($this->sg->GetOption("cf_pages"));
        ?>
</select>
									<?php 
        _e('Static pages', 'sitemap');
        ?>
								</label>
							</li>
							<li>
								<label for="sm_cf_cats">
									<select id="sm_cf_cats" name="sm_cf_cats"><?php 
        $this->sg->HtmlGetFreqNames($this->sg->GetOption("cf_cats"));
        ?>
</select>
									<?php 
        _e('Categories', 'sitemap');
        ?>
								</label>
							</li>
							<li>
								<label for="sm_cf_arch_curr">
									<select id="sm_cf_arch_curr" name="sm_cf_arch_curr"><?php 
        $this->sg->HtmlGetFreqNames($this->sg->GetOption("cf_arch_curr"));
        ?>
</select>
									<?php 
        _e('The current archive of this month (Should be the same like your homepage)', 'sitemap');
        ?>
								</label>
							</li>
							<li>
								<label for="sm_cf_arch_old">
									<select id="sm_cf_arch_old" name="sm_cf_arch_old"><?php 
        $this->sg->HtmlGetFreqNames($this->sg->GetOption("cf_arch_old"));
        ?>
</select>
									<?php 
        _e('Older archives (Changes only if you edit an old post)', 'sitemap');
        ?>
								</label>
							</li>
							<?php 
        if ($this->sg->IsTaxonomySupported()) {
            ?>
							<li>
								<label for="sm_cf_tags">
									<select id="sm_cf_tags" name="sm_cf_tags"><?php 
            $this->sg->HtmlGetFreqNames($this->sg->GetOption("cf_tags"));
            ?>
</select>
									<?php 
            _e('Tag pages', 'sitemap');
            ?>
								</label>
							</li>
							<?php 
        }
        ?>
							<li>
								<label for="sm_cf_auth">
									<select id="sm_cf_auth" name="sm_cf_auth"><?php 
        $this->sg->HtmlGetFreqNames($this->sg->GetOption("cf_auth"));
        ?>
</select>
									<?php 
        _e('Author pages', 'sitemap');
        ?>
								</label>
							</li>
						</ul>
						
					<?php 
        $this->HtmlPrintBoxFooter();
        ?>
					
					<!-- Priorities -->
					<?php 
        $this->HtmlPrintBoxHeader('sm_priorities', __('Priorities', 'sitemap'));
        ?>
						<ul>
							<li>
								<label for="sm_pr_home">
									<select id="sm_pr_home" name="sm_pr_home"><?php 
        $this->sg->HtmlGetPriorityValues($this->sg->GetOption("pr_home"));
        ?>
</select>
									<?php 
        _e('Homepage', 'sitemap');
        ?>
								</label>
							</li>
							<li>
								<label for="sm_pr_posts">
									<select id="sm_pr_posts" name="sm_pr_posts"><?php 
        $this->sg->HtmlGetPriorityValues($this->sg->GetOption("pr_posts"));
        ?>
</select>
									<?php 
        _e('Posts (If auto calculation is disabled)', 'sitemap');
        ?>
								</label>
							</li>
							<li>
								<label for="sm_pr_posts_min">
									<select id="sm_pr_posts_min" name="sm_pr_posts_min"><?php 
        $this->sg->HtmlGetPriorityValues($this->sg->GetOption("pr_posts_min"));
        ?>
</select>
									<?php 
        _e('Minimum post priority (Even if auto calculation is enabled)', 'sitemap');
        ?>
								</label>
							</li>
							<li>
								<label for="sm_pr_pages">
									<select id="sm_pr_pages" name="sm_pr_pages"><?php 
        $this->sg->HtmlGetPriorityValues($this->sg->GetOption("pr_pages"));
        ?>
</select>
									<?php 
        _e('Static pages', 'sitemap');
        ?>
								</label>
							</li>
							<li>
								<label for="sm_pr_cats">
									<select id="sm_pr_cats" name="sm_pr_cats"><?php 
        $this->sg->HtmlGetPriorityValues($this->sg->GetOption("pr_cats"));
        ?>
</select>
									<?php 
        _e('Categories', 'sitemap');
        ?>
								</label>
							</li>
							<li>
								<label for="sm_pr_arch">
									<select id="sm_pr_arch" name="sm_pr_arch"><?php 
        $this->sg->HtmlGetPriorityValues($this->sg->GetOption("pr_arch"));
        ?>
</select>
									<?php 
        _e('Archives', 'sitemap');
        ?>
								</label>
							</li>
							<?php 
        if ($this->sg->IsTaxonomySupported()) {
            ?>
							<li>
								<label for="sm_pr_tags">
									<select id="sm_pr_tags" name="sm_pr_tags"><?php 
            $this->sg->HtmlGetPriorityValues($this->sg->GetOption("pr_tags"));
            ?>
</select>
									<?php 
            _e('Tag pages', 'sitemap');
            ?>
								</label>
							</li>
							<?php 
        }
        ?>
							<li>
								<label for="sm_pr_auth">
									<select id="sm_pr_auth" name="sm_pr_auth"><?php 
        $this->sg->HtmlGetPriorityValues($this->sg->GetOption("pr_auth"));
        ?>
</select>
									<?php 
        _e('Author pages', 'sitemap');
        ?>
								</label>
							</li>
						</ul>
						
					<?php 
        $this->HtmlPrintBoxFooter();
        ?>
					
					</div>
					<div>
						<p class="submit">
							<?php 
        wp_nonce_field('sitemap');
        ?>
							<input type="submit" name="sm_update" value="<?php 
        _e('Update options', 'sitemap');
        ?>
" />
							<input type="submit" onclick='return confirm("Do you really want to reset your configuration?");' class="sm_warning" name="sm_reset_config" value="<?php 
        _e('Reset options', 'sitemap');
        ?>
" />
						</p>
					</div>
				
				<?php 
        if ($this->mode == 27) {
            ?>
				</div>
				</div>
				<?php 
        }
        ?>
				</div>
				<script type="text/javascript">if(typeof(sm_loadPages)=='function') addLoadEvent(sm_loadPages); </script>
			</form>
			<form action="https://www.paypal.com/cgi-bin/webscr" method="post" id="sm_donate_form">
				<?php 
        $lc = array("en" => array("cc" => "USD", "lc" => "US"), "en-GB" => array("cc" => "GBP", "lc" => "GB"), "de" => array("cc" => "EUR", "lc" => "DE"));
        $myLc = $lc["en"];
        $wpl = get_bloginfo('language');
        if (!empty($wpl)) {
            if (array_key_exists($wpl, $lc)) {
                $myLc = $lc[$wpl];
            } else {
                $wpl = substr($wpl, 0, 2);
                if (array_key_exists($wpl, $lc)) {
                    $myLc = $lc[$wpl];
                }
            }
        }
        ?>
				<input type="hidden" name="cmd" value="_xclick" />
				<input type="hidden" name="business" value="<?php 
        echo "donate" . "@" . "arnebra" . "chhold.de";
        ?>
" />
				<input type="hidden" name="item_name" value="Sitemap Generator for WordPress. Please tell me if if you don't want to be listed on the donator list." />
				<input type="hidden" name="no_shipping" value="1" />
				<input type="hidden" name="return" value="<?php 
        echo 'http://' . $_SERVER['HTTP_HOST'] . $this->sg->GetBackLink();
        ?>
&amp;sm_donated=true" />
				<input type="hidden" name="item_number" value="0001" />
				<input type="hidden" name="currency_code" value="<?php 
        echo $myLc["cc"];
        ?>
" />
				<input type="hidden" name="bn" value="PP-BuyNowBF" />
				<input type="hidden" name="lc" value="<?php 
        echo $myLc["lc"];
        ?>
" />
				<input type="hidden" name="rm" value="2" />
				<input type="hidden" name="on0" value="Your Website" />
				<input type="hidden" name="os0" value="<?php 
        echo get_bloginfo("home");
        ?>
"/>
			</form>
		</div>
		<?php 
    }
Esempio n. 6
0
    /**
     * Displays the option page
     *
     * @since 3.0
     * @access public
     * @author Arne Brachhold
     */
    public function HtmlShowOptionsPage()
    {
        global $wp_version;
        //Hopefully this fixes the caching issues after upgrade. Redirect incl. the versions, but only if no POST data.
        if (count($_POST) == 0 && count($_GET) == 1 && isset($_GET["page"])) {
            $redirURL = $this->sg->GetBackLink() . '&sm_fromidx=true';
            //Redirect so the sm_rebuild GET parameter no longer exists.
            @header("location: " . $redirURL);
            //If there was already any other output, the header redirect will fail
            echo '<script type="text/javascript">location.replace("' . $redirURL . '");</script>';
            echo '<noscript><a href="' . $redirURL . '">Click here to continue</a></noscript>';
            exit;
        }
        $snl = false;
        //SNL
        $this->sg->Initate();
        $message = "";
        $is_ms = $this->sg->IsMultiSite();
        if (!empty($_REQUEST["sm_rebuild"])) {
            //Pressed Button: Rebuild Sitemap
            check_admin_referer('sitemap');
            if (isset($_GET["sm_do_debug"]) && $_GET["sm_do_debug"] == "true") {
                //Check again, just for the case that something went wrong before
                if (!current_user_can("administrator")) {
                    echo '<p>Please log in as admin</p>';
                    return;
                }
                $oldErr = error_reporting(E_ALL);
                $oldIni = ini_set("display_errors", 1);
                echo '<div class="wrap">';
                echo '<h2>' . __('XML Sitemap Generator for WordPress', 'sitemap') . " " . $this->sg->GetVersion() . '</h2>';
                echo '<p>This is the debug mode of the XML Sitemap Generator. It will show all PHP notices and warnings as well as the internal logs, messages and configuration.</p>';
                echo '<p style="font-weight:bold; color:red; padding:5px; border:1px red solid; text-align:center;">DO NOT POST THIS INFORMATION ON PUBLIC PAGES LIKE SUPPORT FORUMS AS IT MAY CONTAIN PASSWORDS OR SECRET SERVER INFORMATION!</p>';
                echo "<h3>WordPress and PHP Information</h3>";
                echo '<p>WordPress ' . $GLOBALS['wp_version'] . ' with ' . ' DB ' . $GLOBALS['wp_db_version'] . ' on PHP ' . phpversion() . '</p>';
                echo '<p>Plugin version: ' . $this->sg->GetVersion() . ' (' . $this->sg->GetSvnVersion() . ')';
                echo '<h4>Environment</h4>';
                echo "<pre>";
                $sc = $_SERVER;
                unset($sc["HTTP_COOKIE"]);
                print_r($sc);
                echo "</pre>";
                echo "<h4>WordPress Config</h4>";
                echo "<pre>";
                $opts = array();
                if (function_exists('wp_load_alloptions')) {
                    $opts = wp_load_alloptions();
                } else {
                    global $wpdb;
                    $os = $wpdb->get_results("SELECT option_name, option_value FROM {$wpdb->options}");
                    foreach ((array) $os as $o) {
                        $opts[$o->option_name] = $o->option_value;
                    }
                }
                $popts = array();
                foreach ($opts as $k => $v) {
                    //Try to filter out passwords etc...
                    if (preg_match("/pass|login|pw|secret|user|usr|key|auth|token/si", $k)) {
                        continue;
                    }
                    $popts[$k] = htmlspecialchars($v);
                }
                print_r($popts);
                echo "</pre>";
                echo '<h4>Sitemap Config</h4>';
                echo "<pre>";
                print_r($this->sg->GetOptions());
                echo "</pre>";
                echo '<h3>Sitemap Content and Errors, Warnings, Notices</h3>';
                echo '<div>';
                $sitemaps = $this->sg->SimulateIndex();
                foreach ($sitemaps as $sitemap) {
                    echo "<h4>Sitemap: <a href=\"" . $sitemap["data"]->GetUrl() . "\">" . $sitemap["type"] . "/" . ($sitemap["params"] ? $sitemap["params"] : "(No parameters)") . "</a> by " . $sitemap["caller"]["class"] . "</h4>";
                    $res = $this->sg->SimulateSitemap($sitemap["type"], $sitemap["params"]);
                    echo "<ul style='padding-left:10px;'>";
                    foreach ($res as $s) {
                        echo "<li>" . $s["data"]->GetUrl() . "</li>";
                    }
                    echo "</ul>";
                }
                $status = GoogleSitemapGeneratorStatus::Load();
                echo '</div>';
                echo '<h3>MySQL Queries</h3>';
                if (defined('SAVEQUERIES') && SAVEQUERIES) {
                    echo '<pre>';
                    var_dump($GLOBALS['wpdb']->queries);
                    echo '</pre>';
                    $total = 0;
                    foreach ($GLOBALS['wpdb']->queries as $q) {
                        $total += $q[1];
                    }
                    echo '<h4>Total Query Time</h4>';
                    echo '<pre>' . count($GLOBALS['wpdb']->queries) . ' queries in ' . round($total, 2) . ' seconds.</pre>';
                } else {
                    echo '<p>Please edit wp-db.inc.php in wp-includes and set SAVEQUERIES to true if you want to see the queries.</p>';
                }
                echo "<h3>Build Process Results</h3>";
                echo "<pre>";
                print_r($status);
                echo "</pre>";
                echo '<p>Done. <a href="' . wp_nonce_url($this->sg->GetBackLink() . "&sm_rebuild=true&sm_do_debug=true", 'sitemap') . '">Rebuild</a> or <a href="' . $this->sg->GetBackLink() . '">Return</a></p>';
                echo '<p style="font-weight:bold; color:red; padding:5px; border:1px red solid; text-align:center;">DO NOT POST THIS INFORMATION ON PUBLIC PAGES LIKE SUPPORT FORUMS AS IT MAY CONTAIN PASSWORDS OR SECRET SERVER INFORMATION!</p>';
                echo '</div>';
                @error_reporting($oldErr);
                @ini_set("display_errors", $oldIni);
                return;
            } else {
                $redirURL = $this->sg->GetBackLink() . '&sm_fromrb=true';
                //Redirect so the sm_rebuild GET parameter no longer exists.
                @header("location: " . $redirURL);
                //If there was already any other output, the header redirect will fail
                echo '<script type="text/javascript">location.replace("' . $redirURL . '");</script>';
                echo '<noscript><a href="' . $redirURL . '">Click here to continue</a></noscript>';
                exit;
            }
        } else {
            if (!empty($_POST['sm_update'])) {
                //Pressed Button: Update Config
                check_admin_referer('sitemap');
                if (isset($_POST['sm_b_style']) && $_POST['sm_b_style'] == $this->sg->getDefaultStyle()) {
                    $_POST['sm_b_style_default'] = true;
                    $_POST['sm_b_style'] = '';
                }
                foreach ($this->sg->GetOptions() as $k => $v) {
                    //Check vor values and convert them into their types, based on the category they are in
                    if (!isset($_POST[$k])) {
                        $_POST[$k] = "";
                    }
                    // Empty string will get false on 2bool and 0 on 2float
                    //Options of the category "Basic Settings" are boolean, except the filename and the autoprio provider
                    if (substr($k, 0, 5) == "sm_b_") {
                        if ($k == "sm_b_prio_provider" || $k == "sm_b_yahookey" || $k == "sm_b_style" || $k == "sm_b_memory") {
                            if ($k == "sm_b_filename_manual" && strpos($_POST[$k], "\\") !== false) {
                                $_POST[$k] = stripslashes($_POST[$k]);
                            }
                            $this->sg->SetOption($k, (string) $_POST[$k]);
                        } else {
                            if ($k == "sm_b_time") {
                                if ($_POST[$k] == '') {
                                    $_POST[$k] = -1;
                                }
                                $this->sg->SetOption($k, intval($_POST[$k]));
                            } else {
                                if ($k == "sm_i_install_date") {
                                    if ($this->sg->GetOption('i_install_date') <= 0) {
                                        $this->sg->SetOption($k, time());
                                    }
                                } else {
                                    if ($k == "sm_b_exclude") {
                                        $IDss = array();
                                        $IDs = explode(",", $_POST[$k]);
                                        for ($x = 0; $x < count($IDs); $x++) {
                                            $ID = intval(trim($IDs[$x]));
                                            if ($ID > 0) {
                                                $IDss[] = $ID;
                                            }
                                        }
                                        $this->sg->SetOption($k, $IDss);
                                    } else {
                                        if ($k == "sm_b_exclude_cats") {
                                            $exCats = array();
                                            if (isset($_POST["post_category"])) {
                                                foreach ((array) $_POST["post_category"] as $vv) {
                                                    if (!empty($vv) && is_numeric($vv)) {
                                                        $exCats[] = intval($vv);
                                                    }
                                                }
                                            }
                                            $this->sg->SetOption($k, $exCats);
                                        } else {
                                            $this->sg->SetOption($k, (bool) $_POST[$k]);
                                        }
                                    }
                                }
                            }
                        }
                        //Options of the category "Includes" are boolean
                    } else {
                        if (substr($k, 0, 6) == "sm_in_") {
                            if ($k == 'sm_in_tax') {
                                $enabledTaxonomies = array();
                                foreach (array_keys((array) $_POST[$k]) as $taxName) {
                                    if (empty($taxName) || !(function_exists('taxonomy_exists') ? taxonomy_exists($taxName) : is_taxonomy($taxName))) {
                                        continue;
                                    }
                                    $enabledTaxonomies[] = $taxName;
                                }
                                $this->sg->SetOption($k, $enabledTaxonomies);
                            } else {
                                if ($k == 'sm_in_customtypes') {
                                    $enabledPostTypes = array();
                                    foreach (array_keys((array) $_POST[$k]) as $postTypeName) {
                                        if (empty($postTypeName) || !post_type_exists($postTypeName)) {
                                            continue;
                                        }
                                        $enabledPostTypes[] = $postTypeName;
                                    }
                                    $this->sg->SetOption($k, $enabledPostTypes);
                                } else {
                                    $this->sg->SetOption($k, (bool) $_POST[$k]);
                                }
                            }
                            //Options of the category "Change frequencies" are string
                        } else {
                            if (substr($k, 0, 6) == "sm_cf_") {
                                $this->sg->SetOption($k, (string) $_POST[$k]);
                                //Options of the category "Priorities" are float
                            } else {
                                if (substr($k, 0, 6) == "sm_pr_") {
                                    $this->sg->SetOption($k, (double) $_POST[$k]);
                                }
                            }
                        }
                    }
                }
                //Apply page changes from POST
                $this->sg->SetPages($this->HtmlApplyPages());
                if ($this->sg->SaveOptions()) {
                    $message .= __('Configuration updated', 'sitemap') . "<br />";
                } else {
                    $message .= __('Error while saving options', 'sitemap') . "<br />";
                }
                if ($this->sg->SavePages()) {
                    $message .= __("Pages saved", 'sitemap') . "<br />";
                } else {
                    $message .= __('Error while saving pages', 'sitemap') . "<br />";
                }
            } else {
                if (!empty($_POST["sm_reset_config"])) {
                    //Pressed Button: Reset Config
                    check_admin_referer('sitemap');
                    $this->sg->InitOptions();
                    $this->sg->SaveOptions();
                    $message .= __('The default configuration was restored.', 'sitemap');
                } else {
                    if (!empty($_GET["sm_delete_old"])) {
                        //Delete old sitemap files
                        check_admin_referer('sitemap');
                        //Check again, just for the case that something went wrong before
                        if (!current_user_can("administrator")) {
                            echo '<p>Please log in as admin</p>';
                            return;
                        }
                        if (!$this->sg->DeleteOldFiles()) {
                            $message = __("The old files could NOT be deleted. Please use an FTP program and delete them by yourself.", "sitemap");
                        } else {
                            $message = __("The old files were successfully deleted.", "sitemap");
                        }
                    }
                }
            }
        }
        //Print out the message to the user, if any
        if ($message != "") {
            ?>
			<div class="updated"><strong><p><?php 
            echo $message;
            ?>
</p></strong></div><?php 
        }
        if (!$snl) {
            if (isset($_GET['sm_hidedonate'])) {
                $this->sg->SetOption('i_hide_donated', true);
                $this->sg->SaveOptions();
            }
            if (isset($_GET['sm_donated'])) {
                $this->sg->SetOption('i_donated', true);
                $this->sg->SaveOptions();
            }
            if (isset($_GET['sm_hide_note'])) {
                $this->sg->SetOption('i_hide_note', true);
                $this->sg->SaveOptions();
            }
            if (isset($_GET['sm_hidedonors'])) {
                $this->sg->SetOption('i_hide_donors', true);
                $this->sg->SaveOptions();
            }
            if (isset($_GET['sm_hide_works'])) {
                $this->sg->SetOption('i_hide_works', true);
                $this->sg->SaveOptions();
            }
            if (isset($_GET['sm_donated']) || $this->sg->GetOption('i_donated') === true && $this->sg->GetOption('i_hide_donated') !== true) {
                ?>
				<div class="updated">
					<strong><p><?php 
                _e('Thank you very much for your donation. You help me to continue support and development of this plugin and other free software!', 'sitemap');
                ?>
 <a href="<?php 
                echo $this->sg->GetBackLink() . "&amp;sm_hidedonate=true";
                ?>
"><small style="font-weight:normal;"><?php 
                _e('Hide this notice', 'sitemap');
                ?>
</small></a></p></strong>
				</div>
				<?php 
            } else {
                if ($this->sg->GetOption('i_donated') !== true && $this->sg->GetOption('i_install_date') > 0 && $this->sg->GetOption('i_hide_note') !== true && time() > $this->sg->GetOption('i_install_date') + 60 * 60 * 24 * 30) {
                    ?>
				<div class="updated">
					<strong><p><?php 
                    echo str_replace("%s", $this->sg->GetRedirectLink("sitemap-donate-note"), __('Thanks for using this plugin! You\'ve installed this plugin over a month ago. If it works and you are satisfied with the results, isn\'t it worth at least a few dollar? <a href="%s">Donations</a> help me to continue support and development of this <i>free</i> software! <a href="%s">Sure, no problem!</a>', 'sitemap'));
                    ?>
 <a href="<?php 
                    echo $this->sg->GetBackLink() . "&amp;sm_donated=true";
                    ?>
" style="float:right; display:block; border:none; margin-left:10px;"><small style="font-weight:normal; "><?php 
                    _e('Sure, but I already did!', 'sitemap');
                    ?>
</small></a> <a href="<?php 
                    echo $this->sg->GetBackLink() . "&amp;sm_hide_note=true";
                    ?>
" style="float:right; display:block; border:none;"><small style="font-weight:normal; "><?php 
                    _e('No thanks, please don\'t bug me anymore!', 'sitemap');
                    ?>
</small></a></p></strong>
					<div style="clear:right;"></div>
				</div>
				<?php 
                } else {
                    if ($this->sg->GetOption('i_install_date') > 0 && $this->sg->GetOption('i_hide_works') !== true && time() > $this->sg->GetOption('i_install_date') + 60 * 60 * 24 * 15) {
                        ?>
				<div class="updated">
					<strong><p><?php 
                        echo str_replace("%s", $this->sg->GetRedirectLink("sitemap-works-note"), __('Thanks for using this plugin! You\'ve installed this plugin some time ago. If it works and your are satisfied, why not <a href="%s">rate it</a> and <a href="%s">recommend it</a> to others? :-)', 'sitemap'));
                        ?>
 <a href="<?php 
                        echo $this->sg->GetBackLink() . "&amp;sm_hide_works=true";
                        ?>
" style="float:right; display:block; border:none;"><small style="font-weight:normal; "><?php 
                        _e('Don\'t show this anymore', 'sitemap');
                        ?>
</small></a></p></strong>
					<div style="clear:right;"></div>
				</div>
				<?php 
                    }
                }
            }
        }
        ?>
				
		<style type="text/css">
		
		li.sm_hint {
			color:green;
		}
		
		li.sm_optimize {
			color:orange;
		}
		
		li.sm_error {
			color:red;
		}
		
		input.sm_warning:hover {
			background: #ce0000;
			color: #fff;
		}
		
		a.sm_button {
			padding:4px;
			display:block;
			padding-left:25px;
			background-repeat:no-repeat;
			background-position:5px 50%;
			text-decoration:none;
			border:none;
		}
		
		a.sm_button:hover {
			border-bottom-width:1px;
		}

		a.sm_donatePayPal {
			background-image:url(<?php 
        echo $this->sg->GetPluginUrl();
        ?>
img/icon-paypal.gif);
		}
		
		a.sm_donateAmazon {
			background-image:url(<?php 
        echo $this->sg->GetPluginUrl();
        ?>
img/icon-amazon.gif);
		}
		
		a.sm_pluginHome {
			background-image:url(<?php 
        echo $this->sg->GetPluginUrl();
        ?>
img/icon-arne.gif);
		}
		
		a.sm_pluginList {
			background-image:url(<?php 
        echo $this->sg->GetPluginUrl();
        ?>
img/icon-email.gif);
		}
		
		a.sm_pluginSupport {
			background-image:url(<?php 
        echo $this->sg->GetPluginUrl();
        ?>
img/icon-wordpress.gif);
		}
		
		a.sm_pluginBugs {
			background-image:url(<?php 
        echo $this->sg->GetPluginUrl();
        ?>
img/icon-trac.gif);
		}
		
		a.sm_resGoogle {
			background-image:url(<?php 
        echo $this->sg->GetPluginUrl();
        ?>
img/icon-google.gif);
		}
		
		a.sm_resYahoo {
			background-image:url(<?php 
        echo $this->sg->GetPluginUrl();
        ?>
img/icon-yahoo.gif);
		}
		
		a.sm_resBing {
			background-image:url(<?php 
        echo $this->sg->GetPluginUrl();
        ?>
img/icon-bing.gif);
		}
		
		div.sm-update-nag p {
			margin:5px;
		}
		
		</style>
	

		<style type="text/css">
	
			.sm-padded .inside {
				margin:12px!important;
			}
			.sm-padded .inside ul {
				margin:6px 0 12px 0;
			}
			
			.sm-padded .inside input {
				padding:1px;
				margin:0;
			}
		</style>


		<div class="wrap" id="sm_div">
			<form method="post" action="<?php 
        echo $this->sg->GetBackLink();
        ?>
">
				<h2><?php 
        _e('XML Sitemap Generator for WordPress', 'sitemap');
        echo " " . $this->sg->GetVersion();
        ?>
 </h2>
				<?php 
        if (function_exists("wp_update_plugins") && (!defined('SM_NO_UPDATE') || SM_NO_UPDATE == false)) {
            wp_update_plugins();
            $file = GoogleSitemapGeneratorLoader::GetBaseName();
            $plugin_data = get_plugin_data(GoogleSitemapGeneratorLoader::GetPluginFile());
            $current = function_exists('get_transient') ? get_transient('update_plugins') : get_option('update_plugins');
            if (isset($current->response[$file])) {
                $r = $current->response[$file];
                ?>
<div id="update-nag" class="sm-update-nag"><?php 
                if (!current_user_can('edit_plugins')) {
                    printf(__('There is a new version of %1$s available. <a href="%2$s">Download version %3$s here</a>.', 'default'), $plugin_data['Name'], $r->url, $r->new_version);
                } else {
                    if (empty($r->package)) {
                        printf(__('There is a new version of %1$s available. <a href="%2$s">Download version %3$s here</a> <em>automatic upgrade unavailable for this plugin</em>.', 'default'), $plugin_data['Name'], $r->url, $r->new_version);
                    } else {
                        printf(__('There is a new version of %1$s available. <a href="%2$s">Download version %3$s here</a> or <a href="%4$s">upgrade automatically</a>.', 'default'), $plugin_data['Name'], $r->url, $r->new_version, wp_nonce_url("update.php?action=upgrade-plugin&amp;plugin={$file}", 'upgrade-plugin_' . $file));
                    }
                }
                ?>
</div><?php 
            }
        }
        if (get_option('blog_public') != 1) {
            ?>
<div class="error"><p><?php 
            echo str_replace("%s", "options-privacy.php", __('Your blog is currently blocking search engines! Visit the <a href="%s">privacy settings</a> to change this.', 'sitemap'));
            ?>
</p></div><?php 
        }
        ?>

					<?php 
        if (!$snl) {
            ?>
						<div id="poststuff" class="metabox-holder has-right-sidebar">
							<div class="inner-sidebar">
								<div id="side-sortables" class="meta-box-sortabless ui-sortable" style="position:relative;">
					<?php 
        } else {
            ?>
						<div id="poststuff" class="metabox-holder">
					<?php 
        }
        ?>
				
				
					<?php 
        if (!$snl) {
            ?>
				
							<?php 
            $this->HtmlPrintBoxHeader('sm_pnres', __('About this Plugin:', 'sitemap'), true);
            ?>
								<a class="sm_button sm_pluginHome"    href="<?php 
            echo $this->sg->GetRedirectLink('sitemap-home');
            ?>
"><?php 
            _e('Plugin Homepage', 'sitemap');
            ?>
</a>
								<a class="sm_button sm_pluginHome"    href="<?php 
            echo $this->sg->GetRedirectLink('sitemap-feedback');
            ?>
"><?php 
            _e('Suggest a Feature', 'sitemap');
            ?>
</a>
								<a class="sm_button sm_pluginList"    href="<?php 
            echo $this->sg->GetRedirectLink('sitemap-list');
            ?>
"><?php 
            _e('Notify List', 'sitemap');
            ?>
</a>
								<a class="sm_button sm_pluginSupport" href="<?php 
            echo $this->sg->GetRedirectLink('sitemap-support');
            ?>
"><?php 
            _e('Support Forum', 'sitemap');
            ?>
</a>
								<a class="sm_button sm_pluginBugs"    href="<?php 
            echo $this->sg->GetRedirectLink('sitemap-bugs');
            ?>
"><?php 
            _e('Report a Bug', 'sitemap');
            ?>
</a>
								
								<a class="sm_button sm_donatePayPal"  href="<?php 
            echo $this->sg->GetRedirectLink('sitemap-paypal');
            ?>
"><?php 
            _e('Donate with PayPal', 'sitemap');
            ?>
</a>
								<a class="sm_button sm_donateAmazon"  href="<?php 
            echo $this->sg->GetRedirectLink('sitemap-amazon');
            ?>
"><?php 
            _e('My Amazon Wish List', 'sitemap');
            ?>
</a>
								<?php 
            if (__('translator_name', 'sitemap') != 'translator_name') {
                ?>
<a class="sm_button sm_pluginSupport" href="<?php 
                _e('translator_url', 'sitemap');
                ?>
"><?php 
                _e('translator_name', 'sitemap');
                ?>
</a><?php 
            }
            ?>
							<?php 
            $this->HtmlPrintBoxFooter(true);
            ?>
						
						
							<?php 
            $this->HtmlPrintBoxHeader('sm_smres', __('Sitemap Resources:', 'sitemap'), true);
            ?>
								<a class="sm_button sm_resGoogle"    href="<?php 
            echo $this->sg->GetRedirectLink('sitemap-gwt');
            ?>
"><?php 
            _e('Webmaster Tools', 'sitemap');
            ?>
</a>
								<a class="sm_button sm_resGoogle"    href="<?php 
            echo $this->sg->GetRedirectLink('sitemap-gwb');
            ?>
"><?php 
            _e('Webmaster Blog', 'sitemap');
            ?>
</a>
								
								<a class="sm_button sm_resYahoo"     href="<?php 
            echo $this->sg->GetRedirectLink('sitemap-yse');
            ?>
"><?php 
            _e('Site Explorer', 'sitemap');
            ?>
</a>
								<a class="sm_button sm_resYahoo"     href="<?php 
            echo $this->sg->GetRedirectLink('sitemap-ywb');
            ?>
"><?php 
            _e('Search Blog', 'sitemap');
            ?>
</a>
								
								<a class="sm_button sm_resBing"      href="<?php 
            echo $this->sg->GetRedirectLink('sitemap-lwt');
            ?>
"><?php 
            _e('Webmaster Tools', 'sitemap');
            ?>
</a>
								<a class="sm_button sm_resBing"      href="<?php 
            echo $this->sg->GetRedirectLink('sitemap-lswcb');
            ?>
"><?php 
            _e('Webmaster Center Blog', 'sitemap');
            ?>
</a>
								<br />
								<a class="sm_button sm_resGoogle"    href="<?php 
            echo $this->sg->GetRedirectLink('sitemap-prot');
            ?>
"><?php 
            _e('Sitemaps Protocol', 'sitemap');
            ?>
</a>
								<a class="sm_button sm_resGoogle"    href="<?php 
            echo $this->sg->GetRedirectLink('sitemap-ofaq');
            ?>
"><?php 
            _e('Official Sitemaps FAQ', 'sitemap');
            ?>
</a>
								<a class="sm_button sm_pluginHome"   href="<?php 
            echo $this->sg->GetRedirectLink('sitemap-afaq');
            ?>
"><?php 
            _e('My Sitemaps FAQ', 'sitemap');
            ?>
</a>
							<?php 
            $this->HtmlPrintBoxFooter(true);
            ?>
							
							<?php 
            $this->HtmlPrintBoxHeader('dm_donations', __('Recent Donations:', 'sitemap'), true);
            ?>
								<?php 
            if ($this->sg->GetOption('i_hide_donors') !== true) {
                ?>
									<iframe border="0" frameborder="0" scrolling="no" allowtransparency="yes" style="width:100%; height:80px;" src="<?php 
                echo $this->sg->GetRedirectLink('sitemap-donorlist');
                ?>
">
									<?php 
                _e('List of the donors', 'sitemap');
                ?>
									</iframe><br />
									<a href="<?php 
                echo $this->sg->GetBackLink() . "&amp;sm_hidedonors=true";
                ?>
"><small><?php 
                _e('Hide this list', 'sitemap');
                ?>
</small></a><br /><br />
								<?php 
            }
            ?>
								<a style="float:left; margin-right:5px; border:none;" href="javascript:document.getElementById('sm_donate_form').submit();"><img style="vertical-align:middle; border:none; margin-top:2px;" src="<?php 
            echo $this->sg->GetPluginUrl();
            ?>
img/icon-donate.gif" border="0" alt="PayPal" title="Help me to continue support of this plugin :)" /></a>
								<span><small><?php 
            _e('Thanks for your support!', 'sitemap');
            ?>
</small></span>
								<div style="clear:left; height:1px;"></div>
							<?php 
            $this->HtmlPrintBoxFooter(true);
            ?>
							
						
						</div>
					</div>
					<?php 
        }
        ?>
					
					<div class="has-sidebar sm-padded" >
				
						<div id="post-body-content" class="<?php 
        if (!$snl) {
            ?>
has-sidebar-content<?php 
        }
        ?>
">
					
							<div class="meta-box-sortabless">

							<!-- beta note -->
							<?php 
        $this->HtmlPrintBoxHeader('sm_rebuild', __('Beta-version', 'sitemap'));
        ?>
							<p><strong><?php 
        _e('Thanks for trying out the latest beta release of the sitemap generator plugin!', 'sitemap');
        ?>
</strong></p>
							<p><?php 
        printf(__('Please let me know if you experience any problems or if you have any suggestions by posting <a href="%s">here</a>. Your feedback is very important for me!', 'sitemap'), $this->sg->GetRedirectLink('sitemap-beta-feedback'));
        ?>
</p>
							<?php 
        $this->HtmlPrintBoxFooter();
        ?>

					
					<!-- Rebuild Area -->
					<?php 
        $status = GoogleSitemapGeneratorStatus::Load();
        $head = __('Search engines haven\'t been notified yet', 'sitemap');
        if ($status != null && $status->GetStartTime() > 0) {
            $st = $status->GetStartTime() + get_option('gmt_offset') * 3600;
            $head = str_replace("%date%", date_i18n(get_option('date_format'), $st) . " " . date_i18n(get_option('time_format'), $st), __("Result of the last ping, started on %date%.", 'sitemap'));
        }
        $this->HtmlPrintBoxHeader('sm_rebuild', $head);
        ?>
						<ul>
							<?php 
        if ($this->sg->OldFileExists()) {
            echo "<li class=\"sm_error\">" . str_replace("%s", wp_nonce_url($this->sg->GetBackLink() . "&sm_delete_old=true", 'sitemap'), __('There is still a sitemap.xml or sitemap.xml.gz file in your blog directory. Please delete them as no static files are used anymore or <a href="%s">try to delete them automatically</a>.', 'sitemap')) . "</li>";
        }
        echo "<li>" . str_replace("%s", $this->sg->getXmlUrl(), __('The URL to your sitemap index file is: <a href="%s">%s</a>.', 'sitemap')) . "</li>";
        if ($status == null) {
            echo "<li>" . __('Search engines haven\'t been notified yet. Write a post to let them know about your sitemap.', 'sitemap') . "</li>";
        } else {
            $services = $status->GetUsedPingServices();
            foreach ($services as $service) {
                $name = $status->GetServiceName($service);
                if ($status->GetPingResult($service)) {
                    echo "<li>" . sprintf(__("%s was <b>successfully notified</b> about changes.", 'sitemap'), $name) . "</li>";
                    $dur = $status->GetPingDuration($service);
                    if ($dur > 4) {
                        echo "<li class=\\sm_optimize\">" . str_replace(array("%time%", "%name%"), array($dur, $name), __("It took %time% seconds to notify %name%, maybe you want to disable this feature to reduce the building time.", 'sitemap')) . "</li>";
                    }
                } else {
                    echo "<li class=\"sm_error\">" . str_replace(array("%s", "%name%"), array(wp_nonce_url($this->sg->GetBackLink() . "&sm_ping_service=" . $service . "&noheader=true", 'sitemap'), $name), __('There was a problem while notifying %name%. <a href="%s">View result</a>', 'sitemap')) . "</li>";
                }
            }
        }
        echo "<li>" . str_replace("%d", wp_nonce_url($this->sg->GetBackLink() . "&sm_rebuild=true&sm_do_debug=true", 'sitemap'), __('If you encounter any problems with your sitemap you can use the <a href="%d">debug function</a> to get more information.', 'sitemap')) . "</li>";
        ?>

						</ul>
					<?php 
        $this->HtmlPrintBoxFooter();
        ?>
						
					<!-- Basic Options -->
					<?php 
        $this->HtmlPrintBoxHeader('sm_basic_options', __('Basic Options', 'sitemap'));
        ?>
					
						<b><?php 
        _e('Update notification:', 'sitemap');
        ?>
</b> <a href="<?php 
        echo $this->sg->GetRedirectLink('sitemap-help-options-ping');
        ?>
"><?php 
        _e('Learn more', 'sitemap');
        ?>
</a>
						<ul>
							<li>
								<input type="checkbox" id="sm_b_ping" name="sm_b_ping" <?php 
        echo $this->sg->GetOption("b_ping") == true ? "checked=\"checked\"" : "";
        ?>
 />
								<label for="sm_b_ping"><?php 
        _e('Notify Google about updates of your Blog', 'sitemap');
        ?>
</label><br />
								<small><?php 
        echo str_replace("%s", $this->sg->GetRedirectLink('sitemap-gwt'), __('No registration required, but you can join the <a href="%s">Google Webmaster Tools</a> to check crawling statistics.', 'sitemap'));
        ?>
</small>
							</li>
							<li>
								<input type="checkbox" id="sm_b_pingmsn" name="sm_b_pingmsn" <?php 
        echo $this->sg->GetOption("b_pingmsn") == true ? "checked=\"checked\"" : "";
        ?>
 />
								<label for="sm_b_pingmsn"><?php 
        _e('Notify Bing (formerly MSN Live Search) about updates of your Blog', 'sitemap');
        ?>
</label><br />
								<small><?php 
        echo str_replace("%s", $this->sg->GetRedirectLink('sitemap-lwt'), __('No registration required, but you can join the <a href="%s">Bing Webmaster Tools</a> to check crawling statistics.', 'sitemap'));
        ?>
</small>
							</li>
							<li>
								<input type="checkbox" id="sm_b_pingask" name="sm_b_pingask" <?php 
        echo $this->sg->GetOption("b_pingask") == true ? "checked=\"checked\"" : "";
        ?>
 />
								<label for="sm_b_pingask"><?php 
        _e('Notify Ask.com about updates of your Blog', 'sitemap');
        ?>
</label><br />
								<small><?php 
        _e('No registration required.', 'sitemap');
        ?>
</small>
							</li>
							<li>
								<input type="checkbox" id="sm_b_pingyahoo" name="sm_b_pingyahoo" <?php 
        echo $this->sg->GetOption("b_pingyahoo") == true ? "checked=\"checked\"" : "";
        ?>
 />
								<label for="sm_b_pingyahoo"><?php 
        _e('Notify YAHOO about updates of your Blog', 'sitemap');
        ?>
</label><br />
								<label for="sm_b_yahookey"><?php 
        _e('Your Application ID:', 'sitemap');
        ?>
 <input type="text" name="sm_b_yahookey" id="sm_b_yahookey" value="<?php 
        echo esc_attr($this->sg->GetOption("b_yahookey"));
        ?>
" /></label><br />
								<small><?php 
        echo str_replace(array("%s1", "%s2"), array($this->sg->GetRedirectLink('sitemap-ykr'), ' (<a href="http://developer.yahoo.net/about/">Web Services by Yahoo!</a>)'), __('Don\'t you have such a key? <a href="%s1">Request one here</a>! %s2', 'sitemap'));
        ?>
</small>
							</li>
							<li>
								<label for="sm_b_robots">
								<input type="checkbox" id="sm_b_robots" name="sm_b_robots" <?php 
        echo $this->sg->GetOption("b_robots") == true ? "checked=\"checked\"" : "";
        ?>
 />
								<?php 
        _e("Add sitemap URL to the virtual robots.txt file.", 'sitemap');
        ?>
								</label>

								<br />
								<small><?php 
        _e('The virtual robots.txt generated by WordPress is used. A real robots.txt file must NOT exist in the blog directory!', 'sitemap');
        ?>
</small>
							</li>
						</ul>
						<b><?php 
        _e('Advanced options:', 'sitemap');
        ?>
</b> <a href="<?php 
        echo $this->sg->GetRedirectLink('sitemap-help-options-adv');
        ?>
"><?php 
        _e('Learn more', 'sitemap');
        ?>
</a>
						<ul>
							<li>
								<label for="sm_b_memory"><?php 
        _e('Try to increase the memory limit to:', 'sitemap');
        ?>
 <input type="text" name="sm_b_memory" id="sm_b_memory" style="width:40px;" value="<?php 
        echo esc_attr($this->sg->GetOption("b_memory"));
        ?>
" /></label> (<?php 
        echo htmlspecialchars(__('e.g. "4M", "16M"', 'sitemap'));
        ?>
)
							</li>
							<li>
								<label for="sm_b_time"><?php 
        _e('Try to increase the execution time limit to:', 'sitemap');
        ?>
 <input type="text" name="sm_b_time" id="sm_b_time" style="width:40px;" value="<?php 
        echo esc_attr($this->sg->GetOption("b_time") === -1 ? '' : $this->sg->GetOption("b_time"));
        ?>
" /></label> (<?php 
        echo htmlspecialchars(__('in seconds, e.g. "60" or "0" for unlimited', 'sitemap'));
        ?>
)
							</li>
							<li>
								<?php 
        $useDefStyle = $this->sg->GetDefaultStyle() && $this->sg->GetOption('b_style_default') === true;
        ?>
								<label for="sm_b_style"><?php 
        _e('Include a XSLT stylesheet:', 'sitemap');
        ?>
 <input <?php 
        echo $useDefStyle ? 'disabled="disabled" ' : '';
        ?>
 type="text" name="sm_b_style" id="sm_b_style"  value="<?php 
        echo esc_attr($this->sg->GetOption("b_style"));
        ?>
" /></label>
								(<?php 
        _e('Full or relative URL to your .xsl file', 'sitemap');
        ?>
) <?php 
        if ($this->sg->GetDefaultStyle()) {
            ?>
<label for="sm_b_style_default"><input <?php 
            echo $useDefStyle ? 'checked="checked" ' : '';
            ?>
 type="checkbox" id="sm_b_style_default" name="sm_b_style_default" onclick="document.getElementById('sm_b_style').disabled = this.checked;" /> <?php 
            _e('Use default', 'sitemap');
            ?>
 <?php 
        }
        ?>
							</li>
							<li>
								<label for="sm_b_html">
									<input type="checkbox" id="sm_b_html" name="sm_b_html"  <?php 
        echo $this->sg->GetOption("b_html") == true ? "checked=\"checked\"" : "";
        ?>
 />
									<?php 
        _e('Include sitemap in HTML format', 'sitemap');
        ?>
								</label>
							</li>
						</ul>
						
					<?php 
        $this->HtmlPrintBoxFooter();
        ?>
					
					<?php 
        $this->HtmlPrintBoxHeader('sm_pages', __('Additional pages', 'sitemap'));
        ?>
		
						<?php 
        _e('Here you can specify files or URLs which should be included in the sitemap, but do not belong to your Blog/WordPress.<br />For example, if your domain is www.foo.com and your blog is located on www.foo.com/blog you might want to include your homepage at www.foo.com', 'sitemap');
        echo "<ul><li>";
        echo "<strong>" . __('Note', 'sitemap') . "</strong>: ";
        _e("If your blog is in a subdirectory and you want to add pages which are NOT in the blog directory or beneath, you MUST place your sitemap file in the root directory (Look at the &quot;Location of your sitemap file&quot; section on this page)!", 'sitemap');
        echo "</li><li>";
        echo "<strong>" . __('URL to the page', 'sitemap') . "</strong>: ";
        _e("Enter the URL to the page. Examples: http://www.foo.com/index.html or www.foo.com/home ", 'sitemap');
        echo "</li><li>";
        echo "<strong>" . __('Priority', 'sitemap') . "</strong>: ";
        _e("Choose the priority of the page relative to the other pages. For example, your homepage might have a higher priority than your imprint.", 'sitemap');
        echo "</li><li>";
        echo "<strong>" . __('Last Changed', 'sitemap') . "</strong>: ";
        _e("Enter the date of the last change as YYYY-MM-DD (2005-12-31 for example) (optional).", 'sitemap');
        echo "</li></ul>";
        ?>
						<script type="text/javascript">
							//<![CDATA[
							<?php 
        $freqVals = "'" . implode("','", array_keys($this->sg->GetFreqNames())) . "'";
        $freqNames = "'" . implode("','", array_values($this->sg->GetFreqNames())) . "'";
        ?>

							var changeFreqVals = new Array( <?php 
        echo $freqVals;
        ?>
 );
							var changeFreqNames= new Array( <?php 
        echo $freqNames;
        ?>
 );
							
							var priorities= new Array(0 <?php 
        for ($i = 0.1; $i < 1; $i += 0.1) {
            echo "," . number_format($i, 1, ".", "");
        }
        ?>
);
							
							var pages = [ <?php 
        $pages = $this->sg->GetPages();
        if (count($pages) > 0) {
            for ($i = 0; $i < count($this->sg->GetPages()); $i++) {
                $v = $pages[$i];
                if ($i > 0) {
                    echo ",";
                }
                echo '{url:"' . esc_js($v->getUrl()) . '", priority:' . esc_js(number_format($v->getPriority(), 1, ".", "")) . ', changeFreq:"' . esc_js($v->getChangeFreq()) . '", lastChanged:"' . esc_js($v != null && $v->getLastMod() > 0 ? date("Y-m-d", $v->getLastMod()) : "") . '"}';
            }
        }
        ?>
 ];
							//]]>
						</script>
						<script type="text/javascript" src="<?php 
        echo $this->sg->GetPluginUrl();
        ?>
img/sitemap.js"></script>
						<table width="100%" cellpadding="3" cellspacing="3" id="sm_pageTable">
							<tr>
								<th scope="col"><?php 
        _e('URL to the page', 'sitemap');
        ?>
</th>
								<th scope="col"><?php 
        _e('Priority', 'sitemap');
        ?>
</th>
								<th scope="col"><?php 
        _e('Change Frequency', 'sitemap');
        ?>
</th>
								<th scope="col"><?php 
        _e('Last Changed', 'sitemap');
        ?>
</th>
								<th scope="col"><?php 
        _e('#', 'sitemap');
        ?>
</th>
							</tr>
							<?php 
        if (count($pages) <= 0) {
            ?>
									<tr>
										<td colspan="5" align="center"><?php 
            _e('No pages defined.', 'sitemap');
            ?>
</td>
									</tr><?php 
        }
        ?>
						</table>
						<a href="javascript:void(0);" onclick="sm_addPage();"><?php 
        _e("Add new page", 'sitemap');
        ?>
</a>
					<?php 
        $this->HtmlPrintBoxFooter();
        ?>
					
					
					<!-- AutoPrio Options -->
					<?php 
        $this->HtmlPrintBoxHeader('sm_postprio', __('Post Priority', 'sitemap'));
        ?>
	
						<p><?php 
        _e('Please select how the priority of each post should be calculated:', 'sitemap');
        ?>
</p>
						<ul>
							<li><p><input type="radio" name="sm_b_prio_provider" id="sm_b_prio_provider__0" value="" <?php 
        echo $this->HtmlGetChecked($this->sg->GetOption("b_prio_provider"), "");
        ?>
 /> <label for="sm_b_prio_provider__0"><?php 
        _e('Do not use automatic priority calculation', 'sitemap');
        ?>
</label><br /><?php 
        _e('All posts will have the same priority which is defined in &quot;Priorities&quot;', 'sitemap');
        ?>
</p></li>
							<?php 
        $provs = $this->sg->GetPrioProviders();
        for ($i = 0; $i < count($provs); $i++) {
            echo "<li><p><input type=\"radio\" id=\"sm_b_prio_provider_{$i}\" name=\"sm_b_prio_provider\" value=\"" . $provs[$i] . "\" " . $this->HtmlGetChecked($this->sg->GetOption("b_prio_provider"), $provs[$i]) . " /> <label for=\"sm_b_prio_provider_{$i}\">" . call_user_func(array($provs[$i], 'getName')) . "</label><br />" . call_user_func(array($provs[$i], 'getDescription')) . "</p></li>";
        }
        ?>
						</ul>
					<?php 
        $this->HtmlPrintBoxFooter();
        ?>
					
					<!-- Includes -->
					<?php 
        $this->HtmlPrintBoxHeader('sm_includes', __('Sitemap Content', 'sitemap'));
        ?>
						<b><?php 
        _e('WordPress standard content', 'sitemap');
        ?>
:</b>
						<ul>
							<li>
								<label for="sm_in_home">
									<input type="checkbox" id="sm_in_home" name="sm_in_home"  <?php 
        echo $this->sg->GetOption("in_home") == true ? "checked=\"checked\"" : "";
        ?>
 />
									<?php 
        _e('Include homepage', 'sitemap');
        ?>
								</label>
							</li>
							<li>
								<label for="sm_in_posts">
									<input type="checkbox" id="sm_in_posts" name="sm_in_posts"  <?php 
        echo $this->sg->GetOption("in_posts") == true ? "checked=\"checked\"" : "";
        ?>
 />
									<?php 
        _e('Include posts', 'sitemap');
        ?>
								</label>
							</li>
							<li>
								<label for="sm_in_pages">
									<input type="checkbox" id="sm_in_pages" name="sm_in_pages"  <?php 
        echo $this->sg->GetOption("in_pages") == true ? "checked=\"checked\"" : "";
        ?>
 />
									<?php 
        _e('Include static pages', 'sitemap');
        ?>
								</label>
							</li>
							<li>
								<label for="sm_in_cats">
									<input type="checkbox" id="sm_in_cats" name="sm_in_cats"  <?php 
        echo $this->sg->GetOption("in_cats") == true ? "checked=\"checked\"" : "";
        ?>
 />
									<?php 
        _e('Include categories', 'sitemap');
        ?>
								</label>
							</li>
							<li>
								<label for="sm_in_arch">
									<input type="checkbox" id="sm_in_arch" name="sm_in_arch"  <?php 
        echo $this->sg->GetOption("in_arch") == true ? "checked=\"checked\"" : "";
        ?>
 />
									<?php 
        _e('Include archives', 'sitemap');
        ?>
								</label>
							</li>
							<li>
								<label for="sm_in_auth">
									<input type="checkbox" id="sm_in_auth" name="sm_in_auth"  <?php 
        echo $this->sg->GetOption("in_auth") == true ? "checked=\"checked\"" : "";
        ?>
 />
									<?php 
        _e('Include author pages', 'sitemap');
        ?>
								</label>
							</li>
							<?php 
        if ($this->sg->IsTaxonomySupported()) {
            ?>
							<li>
								<label for="sm_in_tags">
									<input type="checkbox" id="sm_in_tags" name="sm_in_tags"  <?php 
            echo $this->sg->GetOption("in_tags") == true ? "checked=\"checked\"" : "";
            ?>
 />
									<?php 
            _e('Include tag pages', 'sitemap');
            ?>
								</label>
							</li>
							<?php 
        }
        ?>
						</ul>
							
						<?php 
        if ($this->sg->IsTaxonomySupported()) {
            $taxonomies = $this->sg->GetCustomTaxonomies();
            $enabledTaxonomies = $this->sg->GetOption('in_tax');
            if (count($taxonomies) > 0) {
                ?>
<b><?php 
                _e('Custom taxonomies', 'sitemap');
                ?>
:</b><ul><?php 
                foreach ($taxonomies as $taxName) {
                    $taxonomy = get_taxonomy($taxName);
                    $selected = in_array($taxonomy->name, $enabledTaxonomies);
                    ?>
									<li>
										<label for="sm_in_tax[<?php 
                    echo $taxonomy->name;
                    ?>
]">
											<input type="checkbox" id="sm_in_tax[<?php 
                    echo $taxonomy->name;
                    ?>
]" name="sm_in_tax[<?php 
                    echo $taxonomy->name;
                    ?>
]" <?php 
                    echo $selected ? "checked=\"checked\"" : "";
                    ?>
 />
											<?php 
                    echo str_replace('%s', $taxonomy->label, __('Include taxonomy pages for %s', 'sitemap'));
                    ?>
										</label>
									</li>
									<?php 
                }
                ?>
</ul><?php 
            }
        }
        if ($this->sg->IsCustomPostTypesSupported()) {
            $custom_post_types = $this->sg->GetCustomPostTypes();
            $enabledPostTypes = $this->sg->GetOption('in_customtypes');
            if (count($custom_post_types) > 0) {
                ?>
<b><?php 
                _e('Custom post types', 'sitemap');
                ?>
:</b><ul><?php 
                foreach ($custom_post_types as $post_type) {
                    $post_type_object = get_post_type_object($post_type);
                    if (is_array($enabledPostTypes)) {
                        $selected = in_array($post_type_object->name, $enabledPostTypes);
                    }
                    ?>
									<li>
										<label for="sm_in_customtypes[<?php 
                    echo $post_type_object->name;
                    ?>
]">
											<input type="checkbox" id="sm_in_customtypes[<?php 
                    echo $post_type_object->name;
                    ?>
]" name="sm_in_customtypes[<?php 
                    echo $post_type_object->name;
                    ?>
]" <?php 
                    echo $selected ? "checked=\"checked\"" : "";
                    ?>
 />
											<?php 
                    echo str_replace('%s', $post_type_object->label, __('Include custom post type %s', 'sitemap'));
                    ?>
										</label>
									</li>
									<?php 
                }
                ?>
</ul><?php 
            }
        }
        ?>
						
						<b><?php 
        _e('Further options', 'sitemap');
        ?>
:</b>
						<ul>
							<li>
								<label for="sm_in_lastmod">
									<input type="checkbox" id="sm_in_lastmod" name="sm_in_lastmod"  <?php 
        echo $this->sg->GetOption("in_lastmod") == true ? "checked=\"checked\"" : "";
        ?>
 />
									<?php 
        _e('Include the last modification time.', 'sitemap');
        ?>
								</label><br />
								<small><?php 
        _e('This is highly recommended and helps the search engines to know when your content has changed. This option affects <i>all</i> sitemap entries.', 'sitemap');
        ?>
</small>
							</li>
						</ul>
						
					<?php 
        $this->HtmlPrintBoxFooter();
        ?>
					
					<!-- Excluded Items -->
					<?php 
        $this->HtmlPrintBoxHeader('sm_excludes', __('Excluded items', 'sitemap'));
        ?>
					
						<b><?php 
        _e('Excluded categories', 'sitemap');
        ?>
:</b>

						<cite style="display:block; margin-left:40px;"><?php 
        _e("Note", "sitemap");
        ?>
: <?php 
        _e("Using this feature will increase build time and memory usage!", "sitemap");
        ?>
</cite>
						<div style="border-color:#CEE1EF; border-style:solid; border-width:2px; height:10em; margin:5px 0px 5px 40px; overflow:auto; padding:0.5em 0.5em;">
							<ul>
								<?php 
        wp_category_checklist(0, 0, $this->sg->GetOption("b_exclude_cats"), false);
        ?>
							</ul>
						</div>
						
						<b><?php 
        _e("Exclude posts", "sitemap");
        ?>
:</b>
						<div style="margin:5px 0 13px 40px;">
							<label for="sm_b_exclude"><?php 
        _e('Exclude the following posts or pages:', 'sitemap');
        ?>
 <small><?php 
        _e('List of IDs, separated by comma', 'sitemap');
        ?>
</small><br />
							<input name="sm_b_exclude" id="sm_b_exclude" type="text" style="width:400px;" value="<?php 
        echo esc_attr(implode(",", $this->sg->GetOption("b_exclude")));
        ?>
" /></label><br />
							<cite><?php 
        _e("Note", "sitemap");
        ?>
: <?php 
        _e("Child posts won't be excluded automatically!", "sitemap");
        ?>
</cite>
						</div>
						
					<?php 
        $this->HtmlPrintBoxFooter();
        ?>
					
					<!-- Change frequencies -->
					<?php 
        $this->HtmlPrintBoxHeader('sm_change_frequencies', __('Change frequencies', 'sitemap'));
        ?>

						<p>
							<b><?php 
        _e('Note', 'sitemap');
        ?>
:</b>
							<?php 
        _e('Please note that the value of this tag is considered a hint and not a command. Even though search engine crawlers consider this information when making decisions, they may crawl pages marked "hourly" less frequently than that, and they may crawl pages marked "yearly" more frequently than that. It is also likely that crawlers will periodically crawl pages marked "never" so that they can handle unexpected changes to those pages.', 'sitemap');
        ?>
						</p>
						<ul>
							<li>
								<label for="sm_cf_home">
									<select id="sm_cf_home" name="sm_cf_home"><?php 
        $this->HtmlGetFreqNames($this->sg->GetOption("cf_home"));
        ?>
</select>
									<?php 
        _e('Homepage', 'sitemap');
        ?>
								</label>
							</li>
							<li>
								<label for="sm_cf_posts">
									<select id="sm_cf_posts" name="sm_cf_posts"><?php 
        $this->HtmlGetFreqNames($this->sg->GetOption("cf_posts"));
        ?>
</select>
									<?php 
        _e('Posts', 'sitemap');
        ?>
								</label>
							</li>
							<li>
								<label for="sm_cf_pages">
									<select id="sm_cf_pages" name="sm_cf_pages"><?php 
        $this->HtmlGetFreqNames($this->sg->GetOption("cf_pages"));
        ?>
</select>
									<?php 
        _e('Static pages', 'sitemap');
        ?>
								</label>
							</li>
							<li>
								<label for="sm_cf_cats">
									<select id="sm_cf_cats" name="sm_cf_cats"><?php 
        $this->HtmlGetFreqNames($this->sg->GetOption("cf_cats"));
        ?>
</select>
									<?php 
        _e('Categories', 'sitemap');
        ?>
								</label>
							</li>
							<li>
								<label for="sm_cf_arch_curr">
									<select id="sm_cf_arch_curr" name="sm_cf_arch_curr"><?php 
        $this->HtmlGetFreqNames($this->sg->GetOption("cf_arch_curr"));
        ?>
</select>
									<?php 
        _e('The current archive of this month (Should be the same like your homepage)', 'sitemap');
        ?>
								</label>
							</li>
							<li>
								<label for="sm_cf_arch_old">
									<select id="sm_cf_arch_old" name="sm_cf_arch_old"><?php 
        $this->HtmlGetFreqNames($this->sg->GetOption("cf_arch_old"));
        ?>
</select>
									<?php 
        _e('Older archives (Changes only if you edit an old post)', 'sitemap');
        ?>
								</label>
							</li>
							<?php 
        if ($this->sg->IsTaxonomySupported()) {
            ?>
							<li>
								<label for="sm_cf_tags">
									<select id="sm_cf_tags" name="sm_cf_tags"><?php 
            $this->HtmlGetFreqNames($this->sg->GetOption("cf_tags"));
            ?>
</select>
									<?php 
            _e('Tag pages', 'sitemap');
            ?>
								</label>
							</li>
							<?php 
        }
        ?>
							<li>
								<label for="sm_cf_auth">
									<select id="sm_cf_auth" name="sm_cf_auth"><?php 
        $this->HtmlGetFreqNames($this->sg->GetOption("cf_auth"));
        ?>
</select>
									<?php 
        _e('Author pages', 'sitemap');
        ?>
								</label>
							</li>
						</ul>
						
					<?php 
        $this->HtmlPrintBoxFooter();
        ?>
					
					<!-- Priorities -->
					<?php 
        $this->HtmlPrintBoxHeader('sm_priorities', __('Priorities', 'sitemap'));
        ?>
						<ul>
							<li>
								<label for="sm_pr_home">
									<select id="sm_pr_home" name="sm_pr_home"><?php 
        $this->HtmlGetPriorityValues($this->sg->GetOption("pr_home"));
        ?>
</select>
									<?php 
        _e('Homepage', 'sitemap');
        ?>
								</label>
							</li>
							<li>
								<label for="sm_pr_posts">
									<select id="sm_pr_posts" name="sm_pr_posts"><?php 
        $this->HtmlGetPriorityValues($this->sg->GetOption("pr_posts"));
        ?>
</select>
									<?php 
        _e('Posts (If auto calculation is disabled)', 'sitemap');
        ?>
								</label>
							</li>
							<li>
								<label for="sm_pr_posts_min">
									<select id="sm_pr_posts_min" name="sm_pr_posts_min"><?php 
        $this->HtmlGetPriorityValues($this->sg->GetOption("pr_posts_min"));
        ?>
</select>
									<?php 
        _e('Minimum post priority (Even if auto calculation is enabled)', 'sitemap');
        ?>
								</label>
							</li>
							<li>
								<label for="sm_pr_pages">
									<select id="sm_pr_pages" name="sm_pr_pages"><?php 
        $this->HtmlGetPriorityValues($this->sg->GetOption("pr_pages"));
        ?>
</select>
									<?php 
        _e('Static pages', 'sitemap');
        ?>
								</label>
							</li>
							<li>
								<label for="sm_pr_cats">
									<select id="sm_pr_cats" name="sm_pr_cats"><?php 
        $this->HtmlGetPriorityValues($this->sg->GetOption("pr_cats"));
        ?>
</select>
									<?php 
        _e('Categories', 'sitemap');
        ?>
								</label>
							</li>
							<li>
								<label for="sm_pr_arch">
									<select id="sm_pr_arch" name="sm_pr_arch"><?php 
        $this->HtmlGetPriorityValues($this->sg->GetOption("pr_arch"));
        ?>
</select>
									<?php 
        _e('Archives', 'sitemap');
        ?>
								</label>
							</li>
							<?php 
        if ($this->sg->IsTaxonomySupported()) {
            ?>
							<li>
								<label for="sm_pr_tags">
									<select id="sm_pr_tags" name="sm_pr_tags"><?php 
            $this->HtmlGetPriorityValues($this->sg->GetOption("pr_tags"));
            ?>
</select>
									<?php 
            _e('Tag pages', 'sitemap');
            ?>
								</label>
							</li>
							<?php 
        }
        ?>
							<li>
								<label for="sm_pr_auth">
									<select id="sm_pr_auth" name="sm_pr_auth"><?php 
        $this->HtmlGetPriorityValues($this->sg->GetOption("pr_auth"));
        ?>
</select>
									<?php 
        _e('Author pages', 'sitemap');
        ?>
								</label>
							</li>
						</ul>
						
					<?php 
        $this->HtmlPrintBoxFooter();
        ?>
					
					</div>
					<div>
						<p class="submit">
							<?php 
        wp_nonce_field('sitemap');
        ?>
							<input type="submit" class="button-primary" name="sm_update" value="<?php 
        _e('Update options', 'sitemap');
        ?>
" />
							<input type="submit" onclick='return confirm("Do you really want to reset your configuration?");' class="sm_warning" name="sm_reset_config" value="<?php 
        _e('Reset options', 'sitemap');
        ?>
" />
						</p>
					</div>
				
				
				</div>
				</div>
				</div>
				<script type="text/javascript">if(typeof(sm_loadPages)=='function') addLoadEvent(sm_loadPages); </script>
			</form>
			<form action="https://www.paypal.com/cgi-bin/webscr" method="post" id="sm_donate_form">
				<?php 
        $lc = array("en" => array("cc" => "USD", "lc" => "US"), "en-GB" => array("cc" => "GBP", "lc" => "GB"), "de" => array("cc" => "EUR", "lc" => "DE"));
        $myLc = $lc["en"];
        $wpl = get_bloginfo('language');
        if (!empty($wpl)) {
            if (array_key_exists($wpl, $lc)) {
                $myLc = $lc[$wpl];
            } else {
                $wpl = substr($wpl, 0, 2);
                if (array_key_exists($wpl, $lc)) {
                    $myLc = $lc[$wpl];
                }
            }
        }
        ?>
				<input type="hidden" name="cmd" value="_xclick" />
				<input type="hidden" name="business" value="<?php 
        echo "donate" . "@" . "arnebra" . "chhold.de";
        ?>
" />
				<input type="hidden" name="item_name" value="Sitemap Generator for WordPress. Please tell me if if you don't want to be listed on the donator list." />
				<input type="hidden" name="no_shipping" value="1" />
				<input type="hidden" name="return" value="<?php 
        echo 'http://' . $_SERVER['HTTP_HOST'] . $this->sg->GetBackLink();
        ?>
&amp;sm_donated=true" />
				<input type="hidden" name="item_number" value="0001" />
				<input type="hidden" name="currency_code" value="<?php 
        echo $myLc["cc"];
        ?>
" />
				<input type="hidden" name="bn" value="PP-BuyNowBF" />
				<input type="hidden" name="lc" value="<?php 
        echo $myLc["lc"];
        ?>
" />
				<input type="hidden" name="rm" value="2" />
				<input type="hidden" name="on0" value="Your Website" />
				<input type="hidden" name="os0" value="<?php 
        echo get_bloginfo("url");
        ?>
"/>
			</form>
		</div>
		<?php 
    }
Esempio n. 7
0
_e('Click to toggle');
?>
">
					<br/>
				</div>
				<h3><?php 
_e('Categories');
?>
</h3>
				<div class="inside">

					<div id="categories-all" class="tabs-panel">

						<ul id="categorychecklist" class="list:category categorychecklist form-no-clear">
							<?php 
wp_category_checklist($post_ID, false);
?>
						</ul>
					</div>

					<div id="category-adder" class="wp-hidden-children">
						<a id="category-add-toggle" href="#category-add" class="hide-if-no-js" tabindex="3"><?php 
_e('+ Add New Category');
?>
</a>
						<p id="category-add" class="wp-hidden-child">
							<label class="screen-reader-text" for="newcat"><?php 
_e('Add New Category');
?>
</label><input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php 
esc_attr_e('New category name');
Esempio n. 8
0
/**
 * list category-box in sidebar
 *
 * @uses $post_ID
 */
function _mw_adminimize_sidecat_list_category_box()
{
    global $post_ID;
    ?>

	<div class="inside" id="categorydivsb">
		<p><strong><?php 
    _e("Categories");
    ?>
</strong></p>
		<ul id="categorychecklist" class="list:category categorychecklist form-no-clear">
			<?php 
    wp_category_checklist($post_ID);
    ?>
		</ul>
		<?php 
    if (!defined('WP_PLUGIN_DIR')) {
        // for wp <2.6
        ?>
			<div id="category-adder" class="wp-hidden-children">
				<h4><a id="category-add-toggle" href="#category-add" class="hide-if-no-js" tabindex="3"><?php 
        _e('+ Add New Category');
        ?>
</a></h4>

				<p id="category-add" class="wp-hidden-child">
					<input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php 
        _e('New category name');
        ?>
" tabindex="3" />
					<?php 
        wp_dropdown_categories(array('hide_empty' => 0, 'name' => 'newcat_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => __('Parent category'), 'tab_index' => 3));
        ?>
					<input type="button" id="category-add-sumbit" class="add:categorychecklist:category-add button" value="<?php 
        _e('Add');
        ?>
" tabindex="3" />
					<?php 
        wp_nonce_field('add-category', '_ajax_nonce', FALSE);
        ?>
					<span id="category-ajax-response"></span>
				</p>
			</div>
		<?php 
    } else {
        ?>
			<div id="category-adder" class="wp-hidden-children">
				<h4><a id="category-add-toggle" href="#category-add" class="hide-if-no-js" tabindex="3"><?php 
        _e('+ Add New Category');
        ?>
</a></h4>

				<p id="category-add" class="wp-hidden-child">
					<label class="hidden" for="newcat"><?php 
        _e('Add New Category');
        ?>
</label><input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php 
        _e('New category name');
        ?>
" tabindex="3" aria-required="TRUE" />
					<br />
					<label class="hidden" for="newcat_parent"><?php 
        _e('Parent category');
        ?>
:</label><?php 
        wp_dropdown_categories(array('hide_empty' => 0, 'name' => 'newcat_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => __('Parent category'), 'tab_index' => 3));
        ?>
					<input type="button" id="category-add-sumbit" class="add:categorychecklist:category-add button" value="<?php 
        _e('Add');
        ?>
" tabindex="3" />
					<?php 
        wp_nonce_field('add-category', '_ajax_nonce', FALSE);
        ?>
					<span id="category-ajax-response"></span>
				</p>
			</div>
		<?php 
    }
    ?>
	</div>
<?php 
}
Esempio n. 9
0
    function options_panel()
    {
        if (!empty($_POST)) {
            check_admin_referer('fv_top_level_cats');
            if (isset($_POST['fv_top_level_cats_submit'])) {
                if (isset($_POST['fv_top_level_cats'])) {
                    $options = get_option('fv_top_level_cats', array());
                }
                if (isset($_POST['post_category'])) {
                    $options['category-allow'] = $_POST['post_category'];
                }
                if (isset($_POST['top-level-only'])) {
                    $options['top-level-only'] = $_POST['top-level-only'] ? true : false;
                }
                if (isset($_POST['category-allow-enabled'])) {
                    $options['category-allow-enabled'] = $_POST['category-allow-enabled'] ? true : false;
                }
                if (isset($options)) {
                    update_option('fv_top_level_cats', $options);
                }
                ?>
    <div id="message" class="updated fade">
      <p>
        <strong>
          Settings saved
        </strong>
      </p>
    </div>
<?php 
            }
            // fv_top_level_cats_submit
        }
        $options = get_option('fv_top_level_cats');
        ?>

<div class="wrap">
  <div style="position: absolute; right: 20px; margin-top: 5px">
  <a href="http://foliovision.com/wordpress/plugins/fv-top-level-categories" target="_blank" title="Documentation"><img alt="visit foliovision" src="http://foliovision.com/shared/fv-logo.png" /></a>
  </div>
  <div>
    <div id="icon-options-general" class="icon32"><br /></div>
    <h2><?php 
        _e('FV Top Level Categories', 'fv_tlc');
        ?>
</h2>
  </div>
  
  <?php 
        if ($this->is_category_permalinks()) {
            ?>
    <style>
      #category-allow ul.children { margin-left: 20px; }
    </style>
    <form method="post" action="">
      <?php 
            wp_nonce_field('fv_top_level_cats');
            ?>
      <div id="poststuff" class="ui-sortable">
        <div class="postbox">
          <h3>
          <?php 
            _e('Adjust categories in your post URLs', 'fv_tlc');
            ?>
          </h3>
          <div class="inside">
            <table class="form-table">
              <tr>
                <td>
                  <label for="top-level-only">

                    <input type="checkbox" name="top-level-only" id="top-level-only" value="1" <?php 
            if (isset($options['top-level-only'])) {
                if ($options['top-level-only']) {
                    echo 'checked="checked"';
                }
            }
            ?>
 />
                    <?php 
            _e('Only use top-level categories in URLs.', 'fv_tlc');
            ?>
                  </label>
                </td>
              </tr>                
              <tr>
                <td>
                  <label for="category-allow-enabled">
                    <input type="checkbox" name="category-allow-enabled" id="category-allow-enabled" value="1" <?php 
            if (isset($options['category-allow-enabled'])) {
                if ($options['category-allow-enabled']) {
                    echo 'checked="checked"';
                }
            }
            ?>
 />
                    <?php 
            _e('Only allow following categories in URLs:', 'fv_tlc');
            ?>
                  </label>                  
                  <blockquote>
                    <ul id="category-allow"> <?php 
            if (isset($options['category-allow'])) {
                $descendants_and_self = $options['category-allow'];
            } else {
                $descendants_and_self = 0;
                //wp default value
            }
            wp_category_checklist(0, 0, $descendants_and_self, false, null, false);
            ?>
                    </ul>
                  </blockquote>
                </td>
              </tr>                                       
            </table>
            <p>
              <input type="submit" name="fv_top_level_cats_submit" class="button-primary" value="<?php 
            _e('Save Changes', 'fv_tlc');
            ?>
" />
            </p>
          </div>
        </div>
        <p><?php 
            _e('Are you having any problems or questions? Use our <a target="_blank" href="http://foliovision.com/support/fv-top-level-categories/">support forums</a>.', 'fv_tlc');
            ?>
</p>
      </div>
         
    </form>
  <?php 
        } else {
            ?>
    <p><?php 
            _e('Since you are not using %category% in your post permalinks, there is nothing to adjust.', 'fv_tlc');
            ?>
</p>
  <?php 
        }
        ?>

</div>


<?php 
    }
Esempio n. 10
0
         $add = array('what' => 'category', 'id' => $cat_id, 'data' => str_replace(array("\n", "\t"), '', $data), 'position' => -1);
     }
     if ($parent) {
         // Foncy - replace the parent and all its children
         $parent = get_category($parent);
         $term_id = $parent->term_id;
         while ($parent->parent) {
             // get the top parent
             $parent =& get_category($parent->parent);
             if (is_wp_error($parent)) {
                 break;
             }
             $term_id = $parent->term_id;
         }
         ob_start();
         wp_category_checklist(0, $term_id, $checked_categories, $popular_ids, null, false);
         $data = ob_get_contents();
         ob_end_clean();
         $add = array('what' => 'category', 'id' => $term_id, 'data' => str_replace(array("\n", "\t"), '', $data), 'position' => -1);
     }
     ob_start();
     wp_dropdown_categories(array('hide_empty' => 0, 'name' => 'newcat_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => __('Parent category')));
     $sup = ob_get_contents();
     ob_end_clean();
     $add['supplemental'] = array('newcat_parent' => $sup);
     $x = new WP_Ajax_Response($add);
     $x->send();
     break;
 case 'add-link-category':
     // On the Fly
     check_ajax_referer($action);
Esempio n. 11
0
 /**
  * Ouput formatted options
  *
  * @param array $option_data
  * @return string
  */
 function printOptions($option_data, $option_actual)
 {
     // Generate output
     $output = '';
     $output .= "\n" . '<table class="form-table avhec-options">' . "\n";
     foreach ($option_data as $option) {
         $section = substr($option[0], strpos($option[0], '[') + 1);
         $section = substr($section, 0, strpos($section, ']['));
         $option_key = rtrim($option[0], ']');
         $option_key = substr($option_key, strpos($option_key, '][') + 2);
         // Helper
         if ($option[2] == 'helper') {
             $output .= '<tr style="vertical-align: top;"><td class="helper" colspan="2">' . wp_filter_post_kses($option[4]) . '</td></tr>' . "\n";
             continue;
         }
         switch ($option[2]) {
             case 'checkbox':
                 $input_type = '<input type="checkbox" id="' . esc_attr($option[0]) . '" name="' . esc_attr($option[0]) . '" value="' . esc_attr($option[3]) . '" ' . $this->isChecked('1', $option_actual[$section][$option_key]) . ' />' . "\n";
                 $explanation = $option[4];
                 break;
             case 'dropdown':
                 $selvalue = $option[3];
                 $seltext = $option[4];
                 $seldata = '';
                 foreach ((array) $selvalue as $key => $sel) {
                     $seldata .= '<option value="' . esc_attr($sel) . '" ' . ($option_actual[$section][$option_key] == $sel ? 'selected="selected"' : '') . ' >' . esc_html(ucfirst($seltext[$key])) . '</option>' . "\n";
                 }
                 $input_type = '<select id="' . esc_attr($option[0]) . '" name="' . esc_attr($option[0]) . '">' . $seldata . '</select>' . "\n";
                 $explanation = $option[5];
                 break;
             case 'text-color':
                 $input_type = '<input type="text" ' . ($option[3] > 1 ? ' style="width: 95%" ' : '') . 'id="' . esc_attr($option[0]) . '" name="' . esc_attr($option[0]) . '" value="' . esc_attr($option_actual[$section][$option_key]) . '" size="' . esc_attr($option[3]) . '" /><div class="box_color ' . esc_attr($option[0]) . '"></div>' . "\n";
                 $explanation = $option[4];
                 break;
             case 'textarea':
                 $input_type = '<textarea rows="' . esc_attr($option[5]) . '" ' . ($option[3] > 1 ? ' style="width: 95%" ' : '') . 'id="' . esc_attr($option[0]) . '" name="' . esc_attr($option[0]) . '" size="' . esc_attr($option[3]) . '" />' . $option_actual[$section][$option_key] . '</textarea>';
                 $explanation = $option[4];
                 break;
             case 'catlist':
                 ob_start();
                 echo '<div id="avhec-catlist">';
                 echo '<ul>';
                 wp_category_checklist(0, 0, $option_actual[$section][$option_key]);
                 echo '</ul>';
                 echo '</div>';
                 $input_type = ob_get_contents();
                 ob_end_clean();
                 $explanation = $option[4];
                 break;
             case 'text':
             default:
                 $input_type = '<input type="text" ' . ($option[3] > 1 ? ' style="width: 95%" ' : '') . 'id="' . esc_attr($option[0]) . '" name="' . esc_attr($option[0]) . '" value="' . esc_attr($option_actual[$section][$option_key]) . '" size="' . esc_attr($option[3]) . '" />' . "\n";
                 $explanation = $option[4];
                 break;
         }
         // Additional Information
         $extra = '';
         if ($explanation) {
             $extra = '<br /><span class="description">' . wp_filter_kses($explanation) . '</span>' . "\n";
         }
         // Output
         $output .= '<tr style="vertical-align: top;"><th align="left" scope="row"><label for="' . esc_attr($option[0]) . '">' . wp_filter_kses($option[1]) . '</label></th><td>' . $input_type . '	' . $extra . '</td></tr>' . "\n";
     }
     $output .= '</table>' . "\n";
     return $output;
 }
Esempio n. 12
0
    function display_event_page()
    {
        global $wpdb, $eventDisplay;
        // send to Processform if submitted
        if ($_REQUEST['action']) {
            $this->proccess_form($_REQUEST['action']);
        }
        // echo notice to display form action results
        if ($this->formNotice) {
            ?>
    
      <div id="message" class="updated fade"><p><strong><?php 
            echo $this->formNotice;
            ?>
</strong></p></div>
      <?php 
        }
        if ($this->eventId) {
            $this->pagePurpose = 'edit';
            $this->get_event_info($this->eventId);
            //echo "<pre>";
            //print_r($this->eventInfo);
            //echo "</pre>";
            // start times
            $starttimeday = $eventDisplay->format_datetime("d", $this->eventInfo->starttime, true);
            $starttimemonth = $eventDisplay->format_datetime("m", $this->eventInfo->starttime, true);
            $starttimeyear = $eventDisplay->format_datetime("Y", $this->eventInfo->starttime, true);
            $starttimehour = $eventDisplay->format_datetime("H", $this->eventInfo->starttime, true);
            $starttimeampm = $eventDisplay->format_datetime("a", $this->eventInfo->starttime, true);
            $starttimemin = $eventDisplay->format_datetime("i", $this->eventInfo->starttime, true);
            // end times
            $endtimeday = $eventDisplay->format_datetime("d", $this->eventInfo->endtime, true);
            $endtimemonth = $eventDisplay->format_datetime("m", $this->eventInfo->endtime, true);
            $endtimeyear = $eventDisplay->format_datetime("Y", $this->eventInfo->endtime, true);
            $endtimehour = $eventDisplay->format_datetime("H", $this->eventInfo->endtime, true);
            $endtimeampm = $eventDisplay->format_datetime("a", $this->eventInfo->endtime, true);
            $endtimemin = $eventDisplay->format_datetime("i", $this->eventInfo->endtime, true);
        }
        ?>
    
    	<div class="wrap">
      <h2><?php 
        echo ucfirst($this->pagePurpose);
        ?>
 an Event</h2>
      
      <form action="<?php 
        echo $_SERVER['SCRIPT_NAME'];
        ?>
?page=<?php 
        echo $_GET['page'];
        ?>
" method="post">
      <table class="optiontable">
    
      <?php 
        if ($this->eventId) {
            ?>
        <input type="hidden" name="action" value="editevent" />   
        <input type="hidden" name="eventid" value="<?php 
            echo $this->eventId;
            ?>
" />
      <?php 
        } else {
            ?>
        <input type="hidden" name="action" value="addevent" />
      <?php 
        }
        ?>
  
        
        <tr valign="top">
          <th scope="row">Title:</th>
          <td><input type="text" name="title" value="<?php 
        echo $this->eventInfo->title;
        ?>
" size="40" /></td>
        </tr>
        <tr valign="top">
              <th scope="row">Event Info:</th>
          <td colspan="1">
            
              <div class="tab-container" id="container1">
                <div class="tab-panes">

    <table class="onetime">
        <tr valign="top">
          <th scope="row">Start:</th>
          <td>
    
            <select id="date-start-mm" name="date-start-mm">
            <?php 
        for ($i = 1; $i < 13; $i++) {
            $display_month = sprintf("%02s", $i);
            ?>
              <option value="<?php 
            echo $display_month;
            ?>
" <?php 
            if ($starttimemonth == $display_month) {
                ?>
selected="selected"<?php 
            }
            ?>
 ><?php 
            echo date("F", mktime(0, 0, 0, $i, 1, 2000));
            ?>
</option>
            <?php 
        }
        ?>
            </select>
    
            <select id="date-start-dd" name="date-start-dd">
            <?php 
        for ($i = 1; $i < 32; $i++) {
            $display_date = sprintf("%02s", $i);
            ?>
              <option value="<?php 
            echo $display_date;
            ?>
" <?php 
            if ($starttimeday == $display_date) {
                ?>
selected="selected"<?php 
            }
            ?>
 ><?php 
            echo date("jS", mktime(0, 0, 0, 1, $i, 2000));
            ?>
</option>
            <?php 
        }
        ?>
            </select>
    
            <select class="w4em split-date" value="<?php 
        echo $starttimeyear;
        ?>
" id="date-start" name="date-start">
            <?php 
        for ($i = 2009; $i < 2024; $i++) {
            $display_years = sprintf("%02s", $i);
            ?>
              <option value="<?php 
            echo $display_years;
            ?>
" <?php 
            if ($starttimeyear == $display_years) {
                ?>
selected="selected"<?php 
            }
            ?>
 ><?php 
            echo $i;
            ?>
</option>
            <?php 
        }
        ?>
            
            </select>
            <input type="hidden" size="10" id="linkedDates" disabled="disabled"/>

    
            <select id="date-start-hour" name="date-start-hour">
            <?php 
        for ($i = 1; $i < 13; $i++) {
            $display_hours = sprintf("%02s", $i);
            ?>
              <option value="<?php 
            echo $display_hours;
            ?>
" <?php 
            if ($starttimehour == $display_hours || $starttimehour == $display_hours + 12) {
                ?>
selected="selected"<?php 
            }
            ?>
 ><?php 
            echo $i;
            ?>
</option>
            <?php 
        }
        ?>
            </select>
    
            <select id="date-start-min" name="date-start-min">
            <?php 
        for ($i = 0; $i < 60; $i++) {
            $display_mins = sprintf("%02s", $i);
            ?>
              <option value="<?php 
            echo $display_mins;
            ?>
" <?php 
            if ($starttimemin == $display_mins) {
                ?>
selected="selected"<?php 
            }
            ?>
 ><?php 
            echo $display_mins;
            ?>
</option>
            <?php 
        }
        ?>
            </select>
    
            <select id="date-start-ampm" name="date-start-ampm">
              <option value="am" <?php 
        if ($starttimeampm == 'am') {
            ?>
selected="selected"<?php 
        }
        ?>
 >am</option>
              <option value="pm" <?php 
        if ($starttimeampm == 'pm') {
            ?>
selected="selected"<?php 
        }
        ?>
 >pm</option>
            </select>
           
          </td>    
        </tr>
        <tr valign="top">
          <th scope="row">End:</th>
          <td>
          
            <select id="date-end-mm" name="date-end-mm">
            <?php 
        for ($i = 1; $i < 13; $i++) {
            $display_month = sprintf("%02s", $i);
            ?>
              <option value="<?php 
            echo $display_month;
            ?>
" <?php 
            if ($endtimemonth == $display_month) {
                ?>
selected="selected"<?php 
            }
            ?>
 ><?php 
            echo date("F", mktime(0, 0, 0, $i, 1, 2000));
            ?>
</option>
            <?php 
        }
        ?>
            </select>
          
            <select id="date-end-dd" name="date-end-dd">
            <?php 
        for ($i = 1; $i < 32; $i++) {
            $display_date = sprintf("%02s", $i);
            ?>
              <option value="<?php 
            echo $display_date;
            ?>
" <?php 
            if ($endtimeday == $display_date) {
                ?>
selected="selected"<?php 
            }
            ?>
 ><?php 
            echo date("jS", mktime(0, 0, 0, 1, $i, 2000));
            ?>
</option>
            <?php 
        }
        ?>
            </select>
    
            <select class="w4em split-date" value="<?php 
        echo $endtimeyear;
        ?>
" id="date-end" name="date-end">
            <?php 
        for ($i = 2009; $i < 2024; $i++) {
            $display_years = sprintf("%02s", $i);
            ?>
              <option value="<?php 
            echo $display_years;
            ?>
" <?php 
            if ($endtimeyear == $display_years) {
                ?>
selected="selected"<?php 
            }
            ?>
 ><?php 
            echo $i;
            ?>
</option>
            <?php 
        }
        ?>
            
            </select>

            <input type="hidden" size="10" id="endlinkedDates" disabled="disabled"/>
    
            <select id="date-end-hour" name="date-end-hour">
            <?php 
        for ($i = 1; $i < 13; $i++) {
            $display_hours = sprintf("%02s", $i);
            ?>
              <option value="<?php 
            echo $display_hours;
            ?>
" <?php 
            if ($endtimehour == $display_hours || $endtimehour == $display_hours + 12) {
                ?>
selected="selected"<?php 
            }
            ?>
 ><?php 
            echo $i;
            ?>
</option>
            <?php 
        }
        ?>
            </select>
    
            <select id="date-end-min" name="date-end-min">
            <?php 
        for ($i = 0; $i < 60; $i++) {
            $display_mins = sprintf("%02s", $i);
            ?>
              <option value="<?php 
            echo $display_mins;
            ?>
" <?php 
            if ($endtimemin == $display_mins) {
                ?>
selected="selected"<?php 
            }
            ?>
 ><?php 
            echo $display_mins;
            ?>
</option>
            <?php 
        }
        ?>
            </select>
    
            <select id="date-end-ampm" name="date-end-ampm">
              <option value="am" <?php 
        if ($endtimeampm == 'am') {
            ?>
selected="selected"<?php 
        }
        ?>
 >am</option>
              <option value="pm" <?php 
        if ($endtimeampm == 'pm') {
            ?>
selected="selected"<?php 
        }
        ?>
 >pm</option>
            </select>
           
      </td>    
        </tr>
    </table>
                </div> <!-- panes -->
              </div>

           
          </td>
        </tr>
        <tr valign="top">
          <th scope="row">Categories:</th>
          <td>
            <div id="categories-all" class="ui-tabs-panel">
              <ul id="categorychecklist" class="list:category categorychecklist form-no-clear">
              <?php 
        $eventcategories = $this->get_event_categories($this->eventId);
        wp_category_checklist(0, false, $eventcategories);
        ?>
              </ul>
            </div>
          </td>
        </tr>
        <tr valign="top">
          <th scope="row">Address:</th>
          <td><input type="text" name="address" value="<?php 
        echo $this->eventInfo->address;
        ?>
" size="40" /></td>
        </tr>
        <tr valign="top">
          <th scope="row">City:</th>
          <td><input type="text" name="city" value="<?php 
        echo $this->eventInfo->city;
        ?>
" size="40" /></td>
        </tr>
        <tr valign="top">
          <th scope="row">State:</th>
          <td><input type="text" name="state" value="<?php 
        echo $this->eventInfo->state;
        ?>
" size="2" maxlength="2" /></td>
        </tr>
        <tr valign="top">
          <th scope="row">Zip:</th>
          <td><input type="text" name="zip" value="<?php 
        echo $this->eventInfo->zip;
        ?>
" size="6" maxlength="6" /></td>
        </tr>                
        <tr valign="top">
          <th scope="row">Contact Name:</th>
          <td><input type="text" name="contactname" value="<?php 
        echo $this->eventInfo->contactname;
        ?>
" size="40" /></td>
        </tr>
        <tr valign="top">
          <th scope="row">Contact Phone:</th>
          <td><input type="text" name="contactphone" value="<?php 
        echo $this->eventInfo->contactphone;
        ?>
" size="40" /></td>
        </tr>
        <tr valign="top">
          <th scope="row">Contact Email:</th>
          <td><input type="text" name="contactemail" value="<?php 
        echo $this->eventInfo->contactemail;
        ?>
" size="40" /></td>
        </tr>
        <tr valign="top">
          <th scope="row">Description:</th>
          <td><textarea cols="45" rows="8" name="description"><?php 
        echo $this->eventInfo->description;
        ?>
</textarea><br/><br/></td>
        </tr>
        <tr valign="top">
          <th scope="row">RSVP Active:</th>
          <td><input type="radio" name="rsvpactive" value="1"<?php 
        if ($this->eventInfo->rsvpactive == 1) {
            echo ' checked="checked"';
        }
        ?>
 /> Yes&nbsp;&nbsp;<input type="radio" name="rsvpactive" value="0"<?php 
        if ($this->eventInfo->rsvpactive == 0) {
            echo ' checked="checked"';
        }
        ?>
 /> No<br/><br/></td>
        </tr>
        <tr valign="top">
          <th scope="row">All Day Event:</th>
          <td><input type="radio" name="schedule" value="1"<?php 
        if ($this->eventInfo->schedule == 1) {
            echo ' checked="checked"';
        }
        ?>
 /> Yes&nbsp;&nbsp;<input type="radio" name="schedule" value="0"<?php 
        if ($this->eventInfo->schedule == 0) {
            echo ' checked="checked"';
        }
        ?>
 /> No<br/><br/></td>
        </tr>
        <tr valign="top">
          <th scope="row">Active:</th>
          <td><input type="radio" name="active" value="1"<?php 
        if ($this->eventInfo->active == 1) {
            echo ' checked="checked"';
        }
        ?>
 /> Yes&nbsp;&nbsp;<input type="radio" name="active" value="0"<?php 
        if ($this->eventInfo->active == 0) {
            echo ' checked="checked"';
        }
        ?>
 /> No<br/><br/></td>
        </tr>         
      </table>
      <p class="submit"><input type="submit" name="Submit" value="<?php 
        echo ucfirst($this->pagePurpose);
        ?>
 This Event &raquo;" /></p>
      </form>
      </div>
  <?php 
    }
Esempio n. 13
0
    /**
     * Displays the form for this widget on the Widgets page of the WP Admin area.
     *
     * @param array  An array of the current settings for this widget
     * @return void Echoes it's output
     **/
    function form($instance)
    {
        $instance = wp_parse_args((array) $instance, array('title' => __('Photo', 'dw_focus'), 'row' => 2, 'category' => 0));
        $title = esc_html($instance['title']);
        ?>
 
        <p><label for="<?php 
        echo $this->get_field_id('title');
        ?>
"><?php 
        _e('Widget titlte', 'dw_focus');
        ?>
</label>
        <input type="text" name="<?php 
        echo $this->get_field_name('title');
        ?>
" id="<?php 
        echo $this->get_field_id('title');
        ?>
" class="widefat" value="<?php 
        echo trim($instance['title']);
        ?>
" >
        </p>

        <p><label for="<?php 
        echo $this->get_field_id('row');
        ?>
"><?php 
        _e('Widget row', 'dw_focus');
        ?>
</label>
        <input class="widefat" type="text" name="<?php 
        echo $this->get_field_name('row');
        ?>
" id="<?php 
        echo $this->get_field_id('row');
        ?>
" value="<?php 
        echo $instance['row'];
        ?>
"  >   </p>

        <div class="categories-checklist-container">
            <p>
                <label for="<?php 
        echo $this->get_field_id('category');
        ?>
">
                    <?php 
        _e('Current categories: ', 'dw_focus');
        ?>
<span class="description">
                        <?php 
        if (!empty($instance['category']) && is_array($instance['category'])) {
            foreach ($instance['category'] as $cat) {
                $cat_obj = get_category($cat);
                echo $cat_obj->name . ', ';
            }
        }
        ?>
                    </span><br>
                    <span class="widefat category-pseudo-select">&nbsp;&nbsp;<?php 
        _e('Select Categories', 'dw_focus');
        ?>
</span> 
                </label>
            </p>
            <ul class="categories-checklist">
                <?php 
        $walker = new DW_Walker_Category_Checklist($this->get_field_name('category'));
        wp_category_checklist(0, 0, $instance['category'], false, $walker, false);
        ?>
            </ul>
        </div>
    <?php 
    }
 $x = new WP_Ajax_Response();
 foreach ($names as $cat_name) {
     $cat_name = trim($cat_name);
     $category_nicename = sanitize_title($cat_name);
     if ('' === $category_nicename) {
         continue;
     }
     $cat_id = wp_create_category($cat_name, $parent);
     $checked_categories[] = $cat_id;
     if ($parent) {
         // Do these all at once in a second
         continue;
     }
     $category = get_category($cat_id);
     ob_start();
     wp_category_checklist(0, $cat_id, $checked_categories);
     $data = ob_get_contents();
     ob_end_clean();
     $x->add(array('what' => 'category', 'id' => $cat_id, 'data' => $data, 'position' => -1));
 }
 if ($parent) {
     // Foncy - replace the parent and all its children
     $parent = get_category($parent);
     ob_start();
     dropdown_categories(0, $parent);
     $data = ob_get_contents();
     ob_end_clean();
     $x->add(array('what' => 'category', 'id' => $parent->term_id, 'old_id' => $parent->term_id, 'data' => $data, 'position' => -1));
 }
 $x->send();
 break;
Esempio n. 15
0
function capa_sublevel_roles()
{
    // Check if POST isnt empty
    $_POST ? capa_handle_action() : NULL;
    /**
    	TODO wp_get_nav_menus( array('orderby' => 'name') ) Rights
    */
    /*
    <ul class="subsubsub">
    <li><a href='upload.php' class="current">All <span class="count">(116)</span></a> |</li>
    <li><a href='upload.php?post_mime_type=image'>Images <span class="count">(102)</span></a> |</li>
    
    <li><a href='upload.php?post_mime_type=audio'>Audio <span class="count">(4)</span></a> |</li>
    <li><a href="upload.php?detached=1">Unattached <span class="count">(8)</span></a></li></ul>
    */
    echo '<div class="wrap">';
    // For WP < 27
    echo function_exists('screen_icon') ? screen_icon('users') : NULL;
    echo '<h2 style="margin-bottom:15px;">' . __('CaPa &raquo; Users Roles', 'capa') . '</h2>';
    // --------------------------------------------------------------
    $categorys = get_categories(array('sort_column' => 'menu_order', 'hide_empty' => 0, 'child_of' => 0, 'hierarchical' => 0));
    $category_check_role_editor = get_option("capa_protect_cat_role_editor");
    $category_check_role_author = get_option("capa_protect_cat_role_author");
    $category_check_role_contributor = get_option("capa_protect_cat_role_contributor");
    $category_check_role_subscriber = get_option("capa_protect_cat_role_subscriber");
    $category_check_role_visitor = get_option("capa_protect_cat_anonymous");
    $pages = get_pages(array('sort_column' => 'menu_order'));
    $page_check_role_editor = get_option("capa_protect_pag_role_editor");
    $page_check_role_author = get_option("capa_protect_pag_role_author");
    $page_check_role_contributor = get_option("capa_protect_pag_role_contributor");
    $page_check_role_subscriber = get_option("capa_protect_pag_role_subscriber");
    $page_check_role_visitor = get_option("capa_protect_pag_anonymous");
    $odd[0] = '';
    $odd[1] = ' class="alternate"';
    echo '<ul class="subsubsub" style="float:none;">';
    echo '<li><a href="#capa-scroll-category">' . _n('Category', 'Categories', count($categorys), 'capa') . '</a> | </li>';
    echo '<li><a href="#capa-scroll-page">' . _n('Page', 'Pages', count($pages), 'capa') . '</a></li>';
    #  |
    #				echo '<li><a href="#capa-scroll-redirect">'._n('Redirect','Redirects', 0, 'capa').'</a></li>';
    echo '</ul>';
    echo '<form name="capa_protect" method="post">';
    // --------------------------------------------------------------
    // ---- Categories --- //
    // --------------------------------------------------------------
    echo '<a name="capa-scroll-category"></a>';
    echo '<h2 style="margin-bottom:15px;">' . _n('Category visibility', 'Categories visibility', count($categorys), 'capa') . '<br><span class="description">' . __('Select which categories are available for each user role.', 'capa') . '</span></h2>';
    echo '
				<table class="widefat fixed capa-table">
					<thead>
						<tr>
							<th>&nbsp;</th>
							<th style="text-align:center;">' . __('Administrator', 'capa') . '</th>
							<th style="text-align:center;">' . __('Editor', 'capa') . '</th>
							<th style="text-align:center;">' . __('Author', 'capa') . '</th>
							<th style="text-align:center;">' . __('Contributor', 'capa') . '</th>
							<th style="text-align:center;">' . __('Subscriber', 'capa') . '</th>
							<th style="text-align:center;">' . __('Visitor', 'capa') . '</th>
						</tr>
					</thead>

					<tfoot>
						<tr>
							<th> ' . __('check/uncheck', 'capa') . ' </th>
							<th> &nbsp; </th>
							<th> <input type="checkbox" id="check-cat-editor" onclick="capa_check(\'capa_protect_cat[editor][]\',\'check-cat-editor\');"> </th>
							<th> <input type="checkbox" id="check-cat-author" onclick="capa_check(\'capa_protect_cat[author][]\',\'check-cat-author\');"> </th>
							<th> <input type="checkbox" id="check-cat-contributor" onclick="capa_check(\'capa_protect_cat[contributor][]\',\'check-cat-contributor\');"> </th>
							<th> <input type="checkbox" id="check-cat-subscriber" onclick="capa_check(\'capa_protect_cat[subscriber][]\',\'check-cat-subscriber\');"> </th>
							<th> <input type="checkbox" id="check-cat-visitor" onclick="capa_check(\'capa_protect_cat[visitor][]\',\'check-cat-visitor\');"> </th>
						</tr>
					</tfoot>

					<tbody class="capa-tbody">
				';
    foreach ($categorys as $id => $cat) {
        $raw_order[$cat->term_id] = $id;
        $search[$cat->term_id] = $cat->category_parent;
    }
    // Get children-lvl
    foreach ($categorys as $id => $cat) {
        $lvl['cat'][$cat->term_id] = capa_find_lvl($cat->term_id, $search);
    }
    // Get category menu_order
    ob_start();
    wp_category_checklist();
    $cat_output = ob_get_contents();
    ob_end_clean();
    preg_match_all("#category-(?P<id>(\\d+))'( |>)#isU", $cat_output, $sort_order, PREG_PATTERN_ORDER);
    $sort_order = $sort_order['id'];
    $i = 0;
    #str_repeat( '&#8212; ', $lvl['cat'][$categorys[$raw_order[$id]]->term_id] )
    #'.(($lvl['cat'][$categorys[$raw_order[$id]]->term_id] > 0) ? 'style="padding-left: '.$lvl['cat'][$categorys[$raw_order[$id]]->term_id].'5px;"' : '').'
    foreach ($sort_order as $key => $id) {
        echo '<tr style="text-align:center;" ' . $odd[$i % 2] . '>';
        echo '<th><input type="hidden" id="empty-' . $categorys[$raw_order[$id]]->slug . '" name="empty" value="0" readonly><label onclick="capa_check_slug(\'' . $categorys[$raw_order[$id]]->slug . '-' . $categorys[$raw_order[$id]]->term_id . '\',\'empty-' . $categorys[$raw_order[$id]]->slug . '\');">' . str_repeat('<span style="color:#21759B;">&rsaquo;</span> ', $lvl['cat'][$categorys[$raw_order[$id]]->term_id]) . $categorys[$raw_order[$id]]->cat_name . '</label></th>';
        echo '<td><input class="category_id_role" type="checkbox" DISABLED></td>';
        echo '<td><input class="category_id_role ' . $categorys[$raw_order[$id]]->slug . '-' . $categorys[$raw_order[$id]]->term_id . '"  type="checkbox" name="capa_protect_cat[editor][]" value="' . $categorys[$raw_order[$id]]->term_id . '" ' . (isset($category_check_role_editor[$categorys[$raw_order[$id]]->term_id]) ? 'checked' : NULL) . '></td>';
        echo '<td><input class="category_id_role ' . $categorys[$raw_order[$id]]->slug . '-' . $categorys[$raw_order[$id]]->term_id . '"  type="checkbox" name="capa_protect_cat[author][]" value="' . $categorys[$raw_order[$id]]->term_id . '" ' . (isset($category_check_role_author[$categorys[$raw_order[$id]]->term_id]) ? 'checked' : NULL) . '></td>';
        echo '<td><input class="category_id_role ' . $categorys[$raw_order[$id]]->slug . '-' . $categorys[$raw_order[$id]]->term_id . '"  type="checkbox" name="capa_protect_cat[contributor][]" value="' . $categorys[$raw_order[$id]]->term_id . '" ' . (isset($category_check_role_contributor[$categorys[$raw_order[$id]]->term_id]) ? 'checked' : NULL) . '></td>';
        echo '<td><input class="category_id_role ' . $categorys[$raw_order[$id]]->slug . '-' . $categorys[$raw_order[$id]]->term_id . '"  type="checkbox" name="capa_protect_cat[subscriber][]" value="' . $categorys[$raw_order[$id]]->term_id . '" ' . (isset($category_check_role_subscriber[$categorys[$raw_order[$id]]->term_id]) ? 'checked' : NULL) . '></td>';
        echo '<td><input class="category_id_role ' . $categorys[$raw_order[$id]]->slug . '-' . $categorys[$raw_order[$id]]->term_id . '"  type="checkbox" name="capa_protect_cat[visitor][]" value="' . $categorys[$raw_order[$id]]->term_id . '" ' . (isset($category_check_role_visitor[$categorys[$raw_order[$id]]->term_id]) ? 'checked' : NULL) . '></td>';
        echo '</tr>';
        $i++;
    }
    echo '
					</tbody>
				</table>
			';
    echo '<br>';
    // --------------------------------------------------------------
    // ---- Pages --- //
    // --------------------------------------------------------------
    if ($pages) {
        echo '<a name="capa-scroll-page"></a>';
        echo '<h2 style="margin-bottom:15px;">' . _n('Page visibility', 'Pages visibility', count($pages), 'capa') . '<br><span class="description">' . __('Select which pages are available for each user role.', 'capa') . '</span></h2>';
        echo '
				<table class="widefat fixed capa-table">
					<thead>
						<tr>
							<th>&nbsp;</th>
							<th style="text-align:center;">' . __('Administrator', 'capa') . '</th>
							<th style="text-align:center;">' . __('Editor', 'capa') . '</th>
							<th style="text-align:center;">' . __('Author', 'capa') . '</th>
							<th style="text-align:center;">' . __('Contributor', 'capa') . '</th>
							<th style="text-align:center;">' . __('Subscriber', 'capa') . '</th>
							<th style="text-align:center;">' . __('Visitor', 'capa') . '</th>
						</tr>
					</thead>

					<tfoot>
						<tr>
							<th> ' . __('check/uncheck', 'capa') . ' </th>
							<th> &nbsp; </th>
							<th> <input type="checkbox" id="check-pag-editor" onclick="capa_check(\'capa_protect_pag[editor][]\',\'check-pag-editor\');"> </th>
							<th> <input type="checkbox" id="check-pag-author" onclick="capa_check(\'capa_protect_pag[author][]\',\'check-pag-author\');"> </th>
							<th> <input type="checkbox" id="check-pag-contributor" onclick="capa_check(\'capa_protect_pag[contributor][]\',\'check-pag-contributor\');"> </th>
							<th> <input type="checkbox" id="check-pag-subscriber" onclick="capa_check(\'capa_protect_pag[subscriber][]\',\'check-pag-subscriber\');"> </th>
							<th> <input type="checkbox" id="check-pag-visitor" onclick="capa_check(\'capa_protect_pag[visitor][]\',\'check-pag-visitor\');"> </th>
						</tr>
					</tfoot>


					<tbody class="capa-tbody">
				';
        $i = 0;
        foreach ($pages as $id => $page) {
            $search[$page->ID] = $page->post_parent;
        }
        foreach ($pages as $id => $page) {
            $lvl['page'][$page->ID] = capa_find_lvl($page->ID, $search);
        }
        #str_repeat( '&rsaquo; ', $lvl['cat'][$categorys[$raw_order[$id]]->term_id] )
        #'.(($lvl['page'][$page->ID] > 0) ? 'style="padding-left: '.$lvl['page'][$page->ID].'5px;"' : '').'
        foreach ($pages as $page) {
            echo '<tr style="text-align:center;" ' . $odd[$i % 2] . '>';
            echo '<th><input type="hidden" id="empty-' . $page->post_name . '" name="empty" value="0" readonly><label onclick="capa_check_slug(\'' . $page->post_name . '-' . $page->ID . '\',\'empty-' . $page->post_name . '\');">' . str_repeat('<span style="color:#21759B;">&rsaquo;</span> ', $lvl['page'][$page->ID]) . $page->post_title . '</label></th>';
            echo '<td><input class="page_id_role" type="checkbox" DISABLED></td>';
            echo '<td><input class="page_id_role ' . $page->post_name . '-' . $page->ID . '" type="checkbox" name="capa_protect_pag[editor][]" value="' . $page->ID . '" ' . (isset($page_check_role_editor[$page->ID]) ? 'checked' : NULL) . '></td>';
            echo '<td><input class="page_id_role ' . $page->post_name . '-' . $page->ID . '" type="checkbox" name="capa_protect_pag[author][]" value="' . $page->ID . '" ' . (isset($page_check_role_author[$page->ID]) ? 'checked' : NULL) . '></td>';
            echo '<td><input class="page_id_role ' . $page->post_name . '-' . $page->ID . '" type="checkbox" name="capa_protect_pag[contributor][]" value="' . $page->ID . '" ' . (isset($page_check_role_contributor[$page->ID]) ? 'checked' : NULL) . '></td>';
            echo '<td><input class="page_id_role ' . $page->post_name . '-' . $page->ID . '" type="checkbox" name="capa_protect_pag[subscriber][]" value="' . $page->ID . '" ' . (isset($page_check_role_subscriber[$page->ID]) ? 'checked' : NULL) . '></td>';
            echo '<td><input class="page_id_role ' . $page->post_name . '-' . $page->ID . '" type="checkbox" name="capa_protect_pag[visitor][]" value="' . $page->ID . '" ' . (isset($page_check_role_visitor[$page->ID]) ? 'checked' : NULL) . '></td>';
            echo '</tr>';
            $i++;
        }
        echo '
					</tbody>
				</table>
			';
    }
    echo '<br>';
    // --------------------------------------------------------------
    // ---- Redirect --- //
    // --------------------------------------------------------------
    if (TRUE == FALSE) {
        echo '<a name="capa-scroll-redirect"></a>';
        echo '<h2 style="margin-bottom:15px;">' . _n('Redirect', 'Redirects', 0, 'capa') . '<br><span class="description">' . __('Select which pages are available for each user role.', 'capa') . '</span></h2>';
        echo '
				<table class="widefat fixed capa-table">
					<thead>
						<tr>
							<th>&nbsp;</th>
							<th style="text-align:center;">' . __('Administrator', 'capa') . '</th>
							<th style="text-align:center;">' . __('Editor', 'capa') . '</th>
							<th style="text-align:center;">' . __('Author', 'capa') . '</th>
							<th style="text-align:center;">' . __('Contributor', 'capa') . '</th>
							<th style="text-align:center;">' . __('Subscriber', 'capa') . '</th>
							<th style="text-align:center;">' . __('Visitor', 'capa') . '</th>
						</tr>
					</thead>

					<tfoot>
						<tr>
							<th> ' . __('check/uncheck', 'capa') . ' </th>
							<th> &nbsp; </th>
							<th> <input type="checkbox" id="check-pag-editor" onclick="capa_check(\'capa_protect_pag[editor][]\',\'check-pag-editor\');"> </th>
							<th> <input type="checkbox" id="check-pag-author" onclick="capa_check(\'capa_protect_pag[author][]\',\'check-pag-author\');"> </th>
							<th> <input type="checkbox" id="check-pag-contributor" onclick="capa_check(\'capa_protect_pag[contributor][]\',\'check-pag-contributor\');"> </th>
							<th> <input type="checkbox" id="check-pag-subscriber" onclick="capa_check(\'capa_protect_pag[subscriber][]\',\'check-pag-subscriber\');"> </th>
							<th> <input type="checkbox" id="check-pag-visitor" onclick="capa_check(\'capa_protect_pag[visitor][]\',\'check-pag-visitor\');"> </th>
						</tr>
					</tfoot>


					<tbody class="capa-tbody">
				';
        $i = 0;
        foreach ($pages as $id => $page) {
            $search[$page->ID] = $page->post_parent;
        }
        foreach ($pages as $id => $page) {
            $lvl['page'][$page->ID] = capa_find_lvl($page->ID, $search);
        }
        #str_repeat( '&rsaquo; ', $lvl['cat'][$categorys[$raw_order[$id]]->term_id] )
        #'.(($lvl['page'][$page->ID] > 0) ? 'style="padding-left: '.$lvl['page'][$page->ID].'5px;"' : '').'
        foreach ($pages as $page) {
            echo '<tr style="text-align:center;" ' . $odd[$i % 2] . '>';
            echo '<th><input type="hidden" id="empty-' . $page->post_name . '" name="empty" value="0" readonly><label onclick="capa_check_slug(\'' . $page->post_name . '-' . $page->ID . '\',\'empty-' . $page->post_name . '\');">' . str_repeat('<span style="color:#21759B;">&rsaquo;</span> ', $lvl['page'][$page->ID]) . $page->post_title . '</label></th>';
            echo '<td><input class="page_id_role" type="checkbox" DISABLED></td>';
            echo '<td><input class="page_id_role ' . $page->post_name . '-' . $page->ID . '" type="checkbox" name="capa_protect_pag[editor][]" value="' . $page->ID . '" ' . (isset($page_check_role_editor[$page->ID]) ? 'checked' : NULL) . '></td>';
            echo '<td><input class="page_id_role ' . $page->post_name . '-' . $page->ID . '" type="checkbox" name="capa_protect_pag[author][]" value="' . $page->ID . '" ' . (isset($page_check_role_author[$page->ID]) ? 'checked' : NULL) . '></td>';
            echo '<td><input class="page_id_role ' . $page->post_name . '-' . $page->ID . '" type="checkbox" name="capa_protect_pag[contributor][]" value="' . $page->ID . '" ' . (isset($page_check_role_contributor[$page->ID]) ? 'checked' : NULL) . '></td>';
            echo '<td><input class="page_id_role ' . $page->post_name . '-' . $page->ID . '" type="checkbox" name="capa_protect_pag[subscriber][]" value="' . $page->ID . '" ' . (isset($page_check_role_subscriber[$page->ID]) ? 'checked' : NULL) . '></td>';
            echo '<td><input class="page_id_role ' . $page->post_name . '-' . $page->ID . '" type="checkbox" name="capa_protect_pag[visitor][]" value="' . $page->ID . '" ' . (isset($page_check_role_visitor[$page->ID]) ? 'checked' : NULL) . '></td>';
            echo '</tr>';
            $i++;
        }
        echo '
					</tbody>
				</table>
			';
    }
    echo '
			<p class="submit" style="float:left; margin-right:10px;">
				<button type="submit" name="submit" class="button-primary" value="Update Role Options" >' . __('Update user roles settings', 'capa') . '</button> 
			</p>
			<p class="submit">
				<button type="submit" name="submit" class="button" value="reset role options" >' . __('Reset user roles', 'capa') . '</button>
			</p>
			</form>';
}
Esempio n. 16
0
function top_admin()
{
    //check permission
    if (current_user_can('manage_options')) {
        $message = null;
        $message_updated = __("Tweetily options have been updated!", 'Tweetily');
        $response = null;
        $save = true;
        $settings = top_get_settings();
        //on authorize
        if (isset($_GET['TOP_oauth'])) {
            global $top_oauth;
            $result = $top_oauth->get_access_token($settings['oauth_request_token'], $settings['oauth_request_token_secret'], $_GET['oauth_verifier']);
            if ($result) {
                $settings['oauth_access_token'] = $result['oauth_token'];
                $settings['oauth_access_token_secret'] = $result['oauth_token_secret'];
                $settings['user_id'] = $result['user_id'];
                $result = $top_oauth->get_user_info($result['user_id']);
                if ($result) {
                    $settings['profile_image_url'] = $result['user']['profile_image_url'];
                    $settings['screen_name'] = $result['user']['screen_name'];
                    if (isset($result['user']['location'])) {
                        $settings['location'] = $result['user']['location'];
                    } else {
                        $settings['location'] = false;
                    }
                }
                top_save_settings($settings);
                echo '<script language="javascript">window.open ("' . get_bloginfo('wpurl') . '/wp-admin/admin.php?page=Tweetily","_self")</script>';
                die;
            }
        } else {
            if (isset($_GET['top']) && $_GET['top'] == 'deauthorize') {
                $settings = top_get_settings();
                $settings['oauth_access_token'] = '';
                $settings['oauth_access_token_secret'] = '';
                $settings['user_id'] = '';
                $settings['tweet_queue'] = array();
                top_save_settings($settings);
                echo '<script language="javascript">window.open ("' . get_bloginfo('wpurl') . '/wp-admin/admin.php?page=Tweetily","_self")</script>';
                die;
            } else {
                if (isset($_GET['top']) && $_GET['top'] == 'reset') {
                    print '
			<div id="message" class="updated fade">
				<p>' . __("All settings have been reset. Please update the settings for Tweetily to start tweeting again.", 'Tweetily') . '</p>
			</div>';
                }
            }
        }
        //check if username and key provided if bitly selected
        if (isset($_POST['top_opt_url_shortener'])) {
            if ($_POST['top_opt_url_shortener'] == "bit.ly") {
                //check bitly username
                if (!isset($_POST['top_opt_bitly_user'])) {
                    print '
			<div id="message" class="updated fade">
				<p>' . __('Please enter bit.ly username.', 'Tweetily') . '</p>
			</div>';
                    $save = false;
                } elseif (!isset($_POST['top_opt_bitly_key'])) {
                    print '
			<div id="message" class="updated fade">
				<p>' . __('Please enter bit.ly API Key.', 'Tweetily') . '</p>
			</div>';
                    $save = false;
                } else {
                    $save = true;
                }
            }
        }
        if (get_option('next_tweet_time') == '0') {
            $next_tweet_time = time() + get_option('top_opt_interval') * 60 * 60;
            update_option('next_tweet_time', $next_tweet_time);
        }
        //if submit and if bitly selected its fields are filled then save
        if (isset($_POST['submit']) && $save) {
            $message = $message_updated;
            //
            if (isset($_POST['as_number_tweet'])) {
                if ($_POST['as_number_tweet'] > 0 && $_POST['as_number_tweet'] <= 10) {
                    update_option('as_number_tweet', $_POST['as_number_tweet']);
                } elseif ($_POST['as_number_tweet'] > 10) {
                    update_option('as_number_tweet', 10);
                } else {
                    update_option('as_number_tweet', 1);
                }
            }
            if (isset($_POST['as_post_type'])) {
                update_option('as_post_type', $_POST['as_post_type']);
            }
            //TOP admin URL (current url)
            if (isset($_POST['top_opt_admin_url'])) {
                update_option('top_opt_admin_url', $_POST['top_opt_admin_url']);
            }
            //what to tweet
            if (isset($_POST['top_opt_tweet_type'])) {
                update_option('top_opt_tweet_type', $_POST['top_opt_tweet_type']);
            }
            //additional data
            if (isset($_POST['top_opt_add_text'])) {
                update_option('top_opt_add_text', $_POST['top_opt_add_text']);
            }
            //place of additional data
            if (isset($_POST['top_opt_add_text_at'])) {
                update_option('top_opt_add_text_at', $_POST['top_opt_add_text_at']);
            }
            //include link
            if (isset($_POST['top_opt_include_link'])) {
                update_option('top_opt_include_link', $_POST['top_opt_include_link']);
            }
            //fetch url from custom field?
            if (isset($_POST['top_opt_custom_url_option'])) {
                update_option('top_opt_custom_url_option', true);
            } else {
                update_option('top_opt_custom_url_option', false);
            }
            //custom field to fetch URL from
            if (isset($_POST['top_opt_custom_url_field'])) {
                update_option('top_opt_custom_url_field', $_POST['top_opt_custom_url_field']);
            } else {
                update_option('top_opt_custom_url_field', '');
            }
            //use URL shortner?
            if (isset($_POST['top_opt_use_url_shortner'])) {
                update_option('top_opt_use_url_shortner', true);
            } else {
                update_option('top_opt_use_url_shortner', false);
            }
            //url shortener to use
            if (isset($_POST['top_opt_url_shortener'])) {
                update_option('top_opt_url_shortener', $_POST['top_opt_url_shortener']);
                if ($_POST['top_opt_url_shortener'] == "bit.ly") {
                    if (isset($_POST['top_opt_bitly_user'])) {
                        update_option('top_opt_bitly_user', $_POST['top_opt_bitly_user']);
                    }
                    if (isset($_POST['top_opt_bitly_key'])) {
                        update_option('top_opt_bitly_key', $_POST['top_opt_bitly_key']);
                    }
                }
            }
            //hashtags option
            if (isset($_POST['top_opt_custom_hashtag_option'])) {
                update_option('top_opt_custom_hashtag_option', $_POST['top_opt_custom_hashtag_option']);
            } else {
                update_option('top_opt_custom_hashtag_option', "nohashtag");
            }
            //use inline hashtags
            if (isset($_POST['top_opt_use_inline_hashtags'])) {
                update_option('top_opt_use_inline_hashtags', true);
            } else {
                update_option('top_opt_use_inline_hashtags', false);
            }
            //hashtag length
            if (isset($_POST['top_opt_hashtag_length'])) {
                update_option('top_opt_hashtag_length', $_POST['top_opt_hashtag_length']);
            } else {
                update_option('top_opt_hashtag_length', 0);
            }
            //custom field name to fetch hashtag from
            if (isset($_POST['top_opt_custom_hashtag_field'])) {
                update_option('top_opt_custom_hashtag_field', $_POST['top_opt_custom_hashtag_field']);
            } else {
                update_option('top_opt_custom_hashtag_field', '');
            }
            //default hashtags for tweets
            if (isset($_POST['top_opt_hashtags'])) {
                update_option('top_opt_hashtags', $_POST['top_opt_hashtags']);
            } else {
                update_option('top_opt_hashtags', '');
            }
            //tweet interval
            if (isset($_POST['top_opt_interval'])) {
                if (is_numeric($_POST['top_opt_interval']) && $_POST['top_opt_interval'] > 0) {
                    update_option('top_opt_interval', $_POST['top_opt_interval']);
                } else {
                    update_option('top_opt_interval', "4");
                }
            }
            $next_tweet_time = time() + get_option('top_opt_interval') * 60 * 60;
            update_option('next_tweet_time', $next_tweet_time);
            //random interval
            if (isset($_POST['top_opt_interval_slop'])) {
                if (is_numeric($_POST['top_opt_interval_slop']) && $_POST['top_opt_interval_slop'] > 0) {
                    update_option('top_opt_interval_slop', $_POST['top_opt_interval_slop']);
                } else {
                    update_option('top_opt_interval_slop', "4");
                }
            }
            //minimum post age to tweet
            if (isset($_POST['top_opt_age_limit'])) {
                if (is_numeric($_POST['top_opt_age_limit']) && $_POST['top_opt_age_limit'] >= 0) {
                    update_option('top_opt_age_limit', $_POST['top_opt_age_limit']);
                } else {
                    update_option('top_opt_age_limit', "30");
                }
            }
            //maximum post age to tweet
            if (isset($_POST['top_opt_max_age_limit'])) {
                if (is_numeric($_POST['top_opt_max_age_limit']) && $_POST['top_opt_max_age_limit'] > 0) {
                    update_option('top_opt_max_age_limit', $_POST['top_opt_max_age_limit']);
                } else {
                    update_option('top_opt_max_age_limit', "0");
                }
            }
            //option as_number_tweet
            //option to enable log
            if (isset($_POST['top_enable_log'])) {
                update_option('top_enable_log', true);
                global $top_debug;
                $top_debug->enable(true);
            } else {
                update_option('top_enable_log', false);
                global $top_debug;
                $top_debug->enable(false);
            }
            //categories to omit from tweet
            if (isset($_POST['post_category'])) {
                update_option('top_opt_omit_cats', implode(',', $_POST['post_category']));
            } else {
                update_option('top_opt_omit_cats', '');
            }
            //successful update message
            print '
			<div id="message" class="updated fade">
				<p>' . __('Tweetily Options Updated.', 'Tweetily') . '</p>
			</div>';
        } elseif (isset($_POST['tweet'])) {
            update_option('top_opt_last_update', time());
            $tweet_msg = top_opt_tweet_old_post();
            print '
			<div id="message" class="updated fade">
				<p>' . __($tweet_msg, 'Tweetily') . '</p>
			</div>';
        } elseif (isset($_POST['reset'])) {
            top_reset_settings();
            echo '<script language="javascript">window.open ("' . get_bloginfo('wpurl') . '/wp-admin/admin.php?page=Tweetily&top=reset","_self")</script>';
            die;
        }
        //set up data into fields from db
        global $wpdb;
        $admin_url = site_url('/wp-admin/admin.php?page=Tweetily');
        //Current URL - updated querie for those with caching plugins
        //$admin_url = $wpdb->get_var("select option_value from wp_options where option_name = 'top_opt_admin_url';");
        //$admin_url = get_option('top_opt_admin_url');
        if (!isset($admin_url)) {
            $admin_url = top_currentPageURL();
            update_option('top_opt_admin_url', $admin_url);
        }
        //what to tweet?
        $tweet_type = get_option('top_opt_tweet_type');
        if (!isset($tweet_type)) {
            $tweet_type = "title";
        }
        //additional text
        $additional_text = get_option('top_opt_add_text');
        if (!isset($additional_text)) {
            $additional_text = "";
        }
        //position of additional text
        $additional_text_at = get_option('top_opt_add_text_at');
        if (!isset($additional_text_at)) {
            $additional_text_at = "beginning";
        }
        //include link in tweet
        $include_link = get_option('top_opt_include_link');
        if (!isset($include_link)) {
            $include_link = "no";
        }
        //use custom field to fetch url
        $custom_url_option = get_option('top_opt_custom_url_option');
        if (!isset($custom_url_option)) {
            $custom_url_option = "";
        } elseif ($custom_url_option) {
            $custom_url_option = "checked";
        } else {
            $custom_url_option = "";
        }
        //custom field name for url
        $custom_url_field = get_option('top_opt_custom_url_field');
        if (!isset($custom_url_field)) {
            $custom_url_field = "";
        }
        //use url shortner?
        $use_url_shortner = get_option('top_opt_use_url_shortner');
        if (!isset($use_url_shortner)) {
            $use_url_shortner = "";
        } elseif ($use_url_shortner) {
            $use_url_shortner = "checked";
        } else {
            $use_url_shortner = "";
        }
        //url shortner
        $url_shortener = get_option('top_opt_url_shortener');
        if (!isset($url_shortener)) {
            $url_shortener = top_opt_URL_SHORTENER;
        }
        //bitly key
        $bitly_api = get_option('top_opt_bitly_key');
        if (!isset($bitly_api)) {
            $bitly_api = "";
        }
        //bitly username
        $bitly_username = get_option('top_opt_bitly_user');
        if (!isset($bitly_username)) {
            $bitly_username = "";
        }
        //hashtag option
        $custom_hashtag_option = get_option('top_opt_custom_hashtag_option');
        if (!isset($custom_hashtag_option)) {
            $custom_hashtag_option = "nohashtag";
        }
        //use inline hashtag
        $use_inline_hashtags = get_option('top_opt_use_inline_hashtags');
        if (!isset($use_inline_hashtags)) {
            $use_inline_hashtags = "";
        } elseif ($use_inline_hashtags) {
            $use_inline_hashtags = "checked";
        } else {
            $use_inline_hashtags = "";
        }
        //hashtag length
        $hashtag_length = get_option('top_opt_hashtag_length');
        if (!isset($hashtag_length)) {
            $hashtag_length = "20";
        }
        //custom field
        $custom_hashtag_field = get_option('top_opt_custom_hashtag_field');
        if (!isset($custom_hashtag_field)) {
            $custom_hashtag_field = "";
        }
        //default hashtag
        $twitter_hashtags = get_option('top_opt_hashtags');
        if (!isset($twitter_hashtags)) {
            $twitter_hashtags = top_opt_HASHTAGS;
        }
        //interval
        $interval = get_option('top_opt_interval');
        if (!(isset($interval) && is_numeric($interval))) {
            $interval = top_opt_INTERVAL;
        }
        //random interval
        $slop = get_option('top_opt_interval_slop');
        if (!(isset($slop) && is_numeric($slop))) {
            $slop = top_opt_INTERVAL_SLOP;
        }
        //min age limit
        $ageLimit = get_option('top_opt_age_limit');
        if (!(isset($ageLimit) && is_numeric($ageLimit))) {
            $ageLimit = top_opt_AGE_LIMIT;
        }
        //max age limit
        $maxAgeLimit = get_option('top_opt_max_age_limit');
        if (!(isset($maxAgeLimit) && is_numeric($maxAgeLimit))) {
            $maxAgeLimit = top_opt_MAX_AGE_LIMIT;
        }
        //check enable log
        $top_enable_log = get_option('top_enable_log');
        if (!isset($top_enable_log)) {
            $top_enable_log = "";
        } elseif ($top_enable_log) {
            $top_enable_log = "checked";
        } else {
            $top_enable_log = "";
        }
        //set omitted categories
        $omitCats = get_option('top_opt_omit_cats');
        if (!isset($omitCats)) {
            $omitCats = top_opt_OMIT_CATS;
        }
        $x = WP_PLUGIN_URL . '/' . str_replace(basename(__FILE__), "", plugin_basename(__FILE__));
        print '
			<div class="wrap">
				<h2>' . __('Tweetily - Tweet WP Posts Automatically by - ', 'Tweetily') . ' <a href="http://www.themana.gr">Flavio Martins</a></h2>
<h3>If you like this plugin, follow <a href="http://www.twitter.com/themanagr">@themanagr</a> on Twitter to help keep this plugin free...FOREVER!</h3>

<a href="https://twitter.com/themanagr" class="twitter-follow-button" data-show-count="true" data-size="large">Follow @themanagr</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
<br /><br />

				<form id="top_opt" name="top_TweetOldPost" action="" method="post">
					<input type="hidden" name="top_opt_action" value="top_opt_update_settings" />
					<fieldset class="options">
						<div class="option">
							<label for="top_opt_twitter_username">' . __('', 'Tweetily') . '</label>


<div id="profile-box">';
        if (!$settings["oauth_access_token"]) {
            echo '<a href="' . top_get_auth_url() . '" class="auth-twitter">Sign in with Twitter</a>';
        } else {
            echo '<img class="avatar" src="' . $settings["profile_image_url"] . '" alt="" />
							<h4>' . $settings["screen_name"] . '</h4>';
            if ($settings["location"]) {
                echo '<h5>' . $settings["location"] . '</h5>';
            }
            echo '<p>

								You\'re Connected! <a href="' . $_SERVER["REQUEST_URI"] . '&top=deauthorize" onclick=\'return confirm("Are you sure you want to deauthorize your Twitter account?");\'>Click here to deauthorize</a>.<br />

							</p>

							<div class="retweet-clear"></div>
					';
        }
        $as_number_tweet = get_option('as_number_tweet');
        $as_post_type = get_option('as_post_type');
        print '</div>
						</div>
                                               
						<div class="countdown_opt" style="width:100%;height:auto;overflow: hidden;float:none;border-bottom: dashed 1px #ccc;"><br />
						<label style="margin-left:40px;"><strong>Next Tweet coming in:</strong></label>
						<div id="defaultCountdown" style="width:20%;margin-left:15%;margin-bottom:40px;"></div>
						</div>
						
						<div class="option" >
							<label for="top_opt_tweet_type" >' . __('Tweet Content:<br /><span class="desc">What do you want to share?<span>', 'Tweetily') . '</label>
							<select id="top_opt_tweet_type" name="top_opt_tweet_type" style="width:150px">
								<option value="title" ' . top_opt_optionselected("title", $tweet_type) . '>' . __(' Post Title Only ', 'Tweetily') . ' </option>
								<option value="body" ' . top_opt_optionselected("body", $tweet_type) . '>' . __(' Post Body Only ', 'Tweetily') . ' </option>
								<option value="titlenbody" ' . top_opt_optionselected("titlenbody", $tweet_type) . '>' . __(' Both Title & Body ', 'Tweetily') . ' </option>
							</select>
                                                        
						</div>
						
						
						<div class="option" >
							<label for="top_opt_add_text">' . __('Additional Text:<br /><span class="desc">Text added to your auto posts.<span>', 'Tweetily') . '</label>
							<input type="text" size="25" name="top_opt_add_text" id="top_opt_add_text" value="' . $additional_text . '" autocomplete="off" />
						</div>
						<div class="option" >
							<label for="top_opt_add_text_at">' . __('Additional Text Location:<br /><span class="desc">Where you want the added text.<span>', 'Tweetily') . ':</label>
							<select id="top_opt_add_text_at" name="top_opt_add_text_at" style="width:175px">
								<option value="beginning" ' . top_opt_optionselected("beginning", $additional_text_at) . '>' . __(' Beginning of the tweet ', 'Tweetily') . '</option>
								<option value="end" ' . top_opt_optionselected("end", $additional_text_at) . '>' . __(' End of the tweet ', 'Tweetily') . '</option>
							</select>
						</div>
						
						<div class="option">
							<label for="top_opt_include_link">' . __('Include Link:<br /><span class="desc">Include a link to your post?<span>', 'Tweetily') . '</label>
							<select id="top_opt_include_link" name="top_opt_include_link" style="width:150px" onchange="javascript:showURLOptions()">
								<option value="false" ' . top_opt_optionselected("false", $include_link) . '>' . __(' No ', 'Tweetily') . '</option>
								<option value="true" ' . top_opt_optionselected("true", $include_link) . '>' . __(' Yes ', 'Tweetily') . '</option>
							</select>
						</div>
                                                
						<div id="urloptions" style="display:none">
						
                                                
						
						<div class="option">
							<label for="top_opt_use_url_shortner">' . __('Use URL shortner?:<br /><span class="desc">Shorten the link to your post.<span>', 'Tweetily') . '</label>
							<input onchange="return showshortener()" type="checkbox" name="top_opt_use_url_shortner" id="top_opt_use_url_shortner" ' . $use_url_shortner . ' />
							
						</div>
						
						<div  id="urlshortener">
						<div class="option">
							<label for="top_opt_url_shortener">' . __('URL Shortener Service', 'Tweetily') . ':</label>
							<select name="top_opt_url_shortener" id="top_opt_url_shortener" onchange="javascript:showURLAPI()" style="width:100px;">
									<option value="is.gd" ' . top_opt_optionselected('is.gd', $url_shortener) . '>' . __('is.gd', 'Tweetily') . '</option>
									<option value="su.pr" ' . top_opt_optionselected('su.pr', $url_shortener) . '>' . __('su.pr', 'Tweetily') . '</option>
									<option value="bit.ly" ' . top_opt_optionselected('bit.ly', $url_shortener) . '>' . __('bit.ly', 'Tweetily') . '</option>
									<option value="tr.im" ' . top_opt_optionselected('tr.im', $url_shortener) . '>' . __('tr.im', 'Tweetily') . '</option>
									<option value="3.ly" ' . top_opt_optionselected('3.ly', $url_shortener) . '>' . __('3.ly', 'Tweetily') . '</option>
									<option value="u.nu" ' . top_opt_optionselected('u.nu', $url_shortener) . '>' . __('u.nu', 'Tweetily') . '</option>
									<option value="1click.at" ' . top_opt_optionselected('1click.at', $url_shortener) . '>' . __('1click.at', 'Tweetily') . '</option>
									<option value="tinyurl" ' . top_opt_optionselected('tinyurl', $url_shortener) . '>' . __('tinyurl', 'Tweetily') . '</option>
							</select>
						</div>
						<div id="showDetail" style="display:none">
							<div class="option">
								<label for="top_opt_bitly_user">' . __('bit.ly Username', 'Tweetily') . ':</label>
								<input type="text" size="25" name="top_opt_bitly_user" id="top_opt_bitly_user" value="' . $bitly_username . '" autocomplete="off" />
							</div>
							
							<div class="option">
								<label for="top_opt_bitly_key">' . __('bit.ly API Key', 'Tweetily') . ':</label>
								<input type="text" size="25" name="top_opt_bitly_key" id="top_opt_bitly_key" value="' . $bitly_api . '" autocomplete="off" />
							</div>
						</div>
                                                </div>
					</div>
						

                                                <div class="option" >
							<label for="top_opt_custom_hashtag_option">' . __('#Hashtags:<br /><span class="desc">Include #hashtags in your auto posts.<span>', 'Tweetily') . '</label>
                                                        <select name="top_opt_custom_hashtag_option" id="top_opt_custom_hashtag_option" onchange="javascript:return showHashtagCustomField()" style="width:275px;">
									<option value="nohashtag" ' . top_opt_optionselected('nohashtag', $custom_hashtag_option) . '>' . __('No. Don\'t add any hashtags', 'Tweetily') . '</option>
                                                                        <option value="common" ' . top_opt_optionselected('common', $custom_hashtag_option) . '>' . __('Yes. Use common hashtags for all tweets', 'Tweetily') . '</option>    
									<option value="categories" ' . top_opt_optionselected('categories', $custom_hashtag_option) . '>' . __('Yes, Use hashtags from post categories', 'Tweetily') . '</option>
									<option value="tags" ' . top_opt_optionselected('tags', $custom_hashtag_option) . '>' . __('Yes. Use create hashtags from post tags', 'Tweetily') . '</option>
									
									
							</select>
							
                                                        
						</div>
						<div id="inlinehashtag" style="display:none;">
						<div class="option">
							<label for="top_opt_use_inline_hashtags">' . __('Use inline hashtags: ', 'Tweetily') . '</label>
							<input type="checkbox" name="top_opt_use_inline_hashtags" id="top_opt_use_inline_hashtags" ' . $use_inline_hashtags . ' /> 
                                                       
						</div>
                                                
                                                <div class="option">
							<label for="top_opt_hashtag_length">' . __('Maximum characters for hashtags: ', 'Tweetily') . '</label>
							<input type="text" size="25" name="top_opt_hashtag_length" id="top_opt_hashtag_length" value="' . $hashtag_length . '" /> 
                                                       <strong>(If 0, all hashtags will be included.)</strong>
						</div>
						</div>
						<div id="customhashtag" style="display:none;">
						<div class="option">
							<label for="top_opt_custom_hashtag_field">' . __('Custom field name', 'Tweetily') . ':</label>
							<input type="text" size="25" name="top_opt_custom_hashtag_field" id="top_opt_custom_hashtag_field" value="' . $custom_hashtag_field . '" autocomplete="off" />
							<strong>Get hashtags from this custom field</strong>
						</div>
						
						</div>
                                                <div id="commonhashtag" style="display:none;">
						<div class="option">
							<label for="top_opt_hashtags">' . __('Common #hashtags for your tweets', 'Tweetily') . ':</label>
							<input type="text" size="25" name="top_opt_hashtags" id="top_opt_hashtags" value="' . $twitter_hashtags . '" autocomplete="off" />
							<strong>Include #. (e.g. #marketing, #blogging, #custserv)</strong>
						</div>
						</div>
						<div class="option" >
							<label for="top_opt_interval">' . __('Time between tweets: <br /><span class="desc">Minimum time between your tweets?<span>', 'Tweetily') . '</label>
							<input type="text" id="top_opt_interval" maxlength="5" value="' . $interval . '" name="top_opt_interval" /> Hour / Hours <strong>(If 0, it will default to 4 hours.)</strong>
                                                       
						</div>
						<div class="option" >
							<label for="top_opt_interval_slop">' . __('Random Time Added: <br /><span class="desc">Random time added to make your post normal.<span>', 'Tweetily') . '</label>
							<input type="text" id="top_opt_interval_slop" maxlength="5" value="' . $slop . '" name="top_opt_interval_slop" /> Hour / Hours <strong>(If 0, it will default to 4 hours.)</strong>
                                                            
						</div>
						<div class="option" >
							<label for="top_opt_age_limit">' . __('Minimum age of post: <br /><span class="desc">Include post in tweets if at least this age.<span>', 'Tweetily') . '</label>
							<input type="text" id="top_opt_age_limit" maxlength="5" value="' . $ageLimit . '" name="top_opt_age_limit" /> Day / Days
							<strong>(If 0, it will include today.)</strong>
                                                           
						</div>
						
						<div class="option" >
							<label for="top_opt_max_age_limit">' . __('Maximum age of post: <br /><span class="desc">Don\'t include posts older than this.<span>', 'Tweetily') . '</label>
                                                        <input type="text" id="top_opt_max_age_limit" maxlength="5" value="' . $maxAgeLimit . '" name="top_opt_max_age_limit" /> Day / Days
                                                       <strong>(If 0, all posts will be included.)</strong>
						</div>
						
                                                <div class="option" >
							<label for="top_enable_log">' . __('Enable Logging: ', 'Tweetily') . '</label>
							<input type="checkbox" name="top_enable_log" id="top_enable_log" ' . $top_enable_log . ' /> 
                                                        <strong>Yes, save a log of actions in log file.</strong>    
                                                       
						</div>
						<div class="option">
						<label class="ttip">Number of Tweets: <span class="desc">Number of tweets to share each time.<span></label>
						  <input type="text" value="' . $as_number_tweet . '" name="as_number_tweet"/>
						</div>
						
						<div class="option">
						<label class="ttip">Select post type: <span class="desc">What type of items do you want to share?<span></label>
						<select name="as_post_type">
							<option value="post">Only Posts</option>
							<option value="page">Only Pages</option>
							<option value="all">Both Posts & Pages</option>
						</select> Currently sharing:&nbsp;' . $as_post_type . '
						</div>
                                        
				    	<div class="option category">
				    	<div style="float:left">
						    	<label class="catlabel">' . __('Exclude Categories: <span class="desc">Check categories not to share.<span>', 'Tweetily') . '</label> </div>
						    	<div style="float:left">
						    		<ul id="categorychecklist" class="list:category categorychecklist form-no-clear">
								';
        wp_category_checklist(0, 0, explode(',', $omitCats));
        print '				    		</ul>
              <div style="clear:both;padding-top:20px;">
                                                          <a href="' . get_bloginfo('wpurl') . '/wp-admin/admin.php?page=ExcludePosts">Exclude specific posts</a> from selected categories.
                                                              </div>
                                                              

								</div>
                                                               
								</div>
					</fieldset>
					
                    	<div class="option">
							<label for="top_opt_admin_url">' . __('Your Tweetily Plugin Admin URL', 'Tweetily') . ':</label>
							<input type="text" style="width:500px" id="top_opt_admin_url" value="' . $admin_url . '" name="top_opt_admin_url" /><br /><strong>(Note: If this does not show your current URL in this textbox, paste the current URL in this textbox, then click "Update Options".)</strong>  
						</div>                  

                                                
						<p class="submit"><input type="submit" name="submit" onclick="javascript:return validate()" value="' . __('Update Tweetily Options', 'Tweetily') . '" />
						<input type="submit" name="tweet" value="' . __('Tweet Now!', 'Tweetily') . '" />
                                                <input type="submit" onclick=\'return confirm("This will reset all the setting, including your account, omitted categories and excluded posts. Are you sure you want to reset all the settings?");\' name="reset" value="' . __('Reset Settings', 'Tweetily') . '" /><br /><br /><strong>Note: Please remember to click "Update Settings" after making any changes.</strong>
					</p>
						
				</form><script language="javascript" type="text/javascript">
function showURLAPI()
{
	var urlShortener=document.getElementById("top_opt_url_shortener").value;
	if(urlShortener=="bit.ly")
	{
		document.getElementById("showDetail").style.display="block";
		
	}
	else
	{
		document.getElementById("showDetail").style.display="none";
		
	}
	
}

function validate()
{

	if(document.getElementById("showDetail").style.display=="block" && document.getElementById("top_opt_url_shortener").value=="bit.ly")
	{
		if(trim(document.getElementById("top_opt_bitly_user").value)=="")
		{
			alert("Please enter bit.ly username.");
			document.getElementById("top_opt_bitly_user").focus();
			return false;
		}

		if(trim(document.getElementById("top_opt_bitly_key").value)=="")
		{
			alert("Please enter bit.ly API key.");
			document.getElementById("top_opt_bitly_key").focus();
			return false;
		}
	}
 if(trim(document.getElementById("top_opt_interval").value) != "" && !isNumber(trim(document.getElementById("top_opt_interval").value)))
        {
            alert("Enter only numeric in Minimum interval between tweet");
		document.getElementById("top_opt_interval").focus();
		return false;
        }
         if(trim(document.getElementById("top_opt_interval_slop").value) != "" && !isNumber(trim(document.getElementById("top_opt_interval_slop").value)))
        {
            alert("Enter only numeric in Random interval");
		document.getElementById("top_opt_interval_slop").focus();
		return false;
        }
        if(trim(document.getElementById("top_opt_age_limit").value) != "" && !isNumber(trim(document.getElementById("top_opt_age_limit").value)))
        {
            alert("Enter only numeric in Minimum age of post");
		document.getElementById("top_opt_age_limit").focus();
		return false;
        }
 if(trim(document.getElementById("top_opt_max_age_limit").value) != "" && !isNumber(trim(document.getElementById("top_opt_max_age_limit").value)))
        {
            alert("Enter only numeric in Maximum age of post");
		document.getElementById("top_opt_max_age_limit").focus();
		return false;
        }
	if(trim(document.getElementById("top_opt_max_age_limit").value) != "" && trim(document.getElementById("top_opt_max_age_limit").value) != 0)
	{
	if(eval(document.getElementById("top_opt_age_limit").value) > eval(document.getElementById("top_opt_max_age_limit").value))
	{
		alert("Post max age limit cannot be less than Post min age iimit");
		document.getElementById("top_opt_age_limit").focus();
		return false;
	}
	}
}

function trim(stringToTrim) {
	return stringToTrim.replace(/^\\s+|\\s+$/g,"");
}

function showCustomField()
{
	if(document.getElementById("top_opt_custom_url_option").checked)
	{
		document.getElementById("customurl").style.display="block";
	}
	else
	{
		document.getElementById("customurl").style.display="none";
	}
}

function showHashtagCustomField()
{
	if(document.getElementById("top_opt_custom_hashtag_option").value=="custom")
	{
		document.getElementById("customhashtag").style.display="block";
                document.getElementById("commonhashtag").style.display="none";
                 document.getElementById("inlinehashtag").style.display="block";
	}
        else if(document.getElementById("top_opt_custom_hashtag_option").value=="common")
	{
		document.getElementById("customhashtag").style.display="none";
                document.getElementById("commonhashtag").style.display="block";
                document.getElementById("inlinehashtag").style.display="block";
	}
        else if(document.getElementById("top_opt_custom_hashtag_option").value=="nohashtag")
	{
		document.getElementById("customhashtag").style.display="none";
                document.getElementById("commonhashtag").style.display="none";
                document.getElementById("inlinehashtag").style.display="none";
	}
	else
	{
                document.getElementById("inlinehashtag").style.display="block";
		document.getElementById("customhashtag").style.display="none";
                document.getElementById("commonhashtag").style.display="none";
	}
}

function showURLOptions()
{
    if(document.getElementById("top_opt_include_link").value=="true")
	{
		document.getElementById("urloptions").style.display="block";
	}
	else
	{
		document.getElementById("urloptions").style.display="none";
	}
}

function isNumber(val)
{
    if(isNaN(val)){
        return false;
    }
    else{
        return true;
    }
}

function showshortener()
{
						

	if((document.getElementById("top_opt_use_url_shortner").checked))
		{
			document.getElementById("urlshortener").style.display="block";
		}
		else
		{
			document.getElementById("urlshortener").style.display="none";
		}
}
function setFormAction()
{
    if(document.getElementById("top_opt_admin_url").value == "")
    {
        document.getElementById("top_opt_admin_url").value=location.href;
        document.getElementById("top_opt").action=location.href;
    }
    else
    {
        document.getElementById("top_opt").action=document.getElementById("top_opt_admin_url").value;
    }
}

setFormAction();
showURLAPI();
showshortener();
showCustomField();
showHashtagCustomField();
showURLOptions();

</script>';
        echo "<script type='text/javascript' src='" . plugins_url('countdown/jquery-1.7.1.min.js', __FILE__) . "'></script>";
        echo "<script type='text/javascript' src='" . plugins_url('countdown/jquery.countdown.pack.js', __FILE__) . "'></script>";
        $next_tweet_time = get_option('next_tweet_time');
        echo "<script type='text/javascript'>\n\$(function () {\n\tvar untilDay = new Date({$next_tweet_time} * 1000);\n\t\$('#defaultCountdown').countdown({until: untilDay , format: 'HMS'});\n});\n</script>";
    } else {
        print '
			<div id="message" class="updated fade">
				<p>' . __('Oh no! Permission error, please contact your Web site administrator.', 'Tweetily') . '</p>
			</div>';
    }
}
function page_categories_meta_box($post)
{
    ?>
<ul id="category-tabs">
	<li class="tabs"><a href="#categories-all" tabindex="3"><?php 
    _e('All Categories');
    ?>
</a></li>
	<li class="hide-if-no-js"><a href="#categories-pop" tabindex="3"><?php 
    _e('Most Used');
    ?>
</a></li>
</ul>

<div id="categories-pop" class="tabs-panel" style="display: none;">
	<ul id="categorychecklist-pop" class="categorychecklist form-no-clear" >
<?php 
    $popular_ids = wp_popular_terms_checklist('category');
    ?>
	</ul>
</div>

<div id="categories-all" class="tabs-panel">
	<ul id="categorychecklist" class="list:category categorychecklist form-no-clear">
<?php 
    wp_category_checklist($post->ID, false, false, $popular_ids);
    ?>
	</ul>
</div>

<?php 
    if (current_user_can('manage_categories')) {
        ?>
<div id="category-adder" class="wp-hidden-children">
	<h4><a id="category-add-toggle" href="#category-add" class="hide-if-no-js" tabindex="3"><?php 
        _e('+ Add New Category');
        ?>
</a></h4>
	<p id="category-add" class="wp-hidden-child">
	<label class="screen-reader-text" for="newcat"><?php 
        _e('Add New Category');
        ?>
</label><input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php 
        esc_attr_e('New category name');
        ?>
" tabindex="3" aria-required="true"/>
	<label class="screen-reader-text" for="newcat_parent"><?php 
        _e('Parent category');
        ?>
:</label><?php 
        wp_dropdown_categories(array('hide_empty' => 0, 'name' => 'newcat_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => __('Parent category')));
        ?>
	<input type="button" id="category-add-sumbit" class="add:categorychecklist:category-add button" value="<?php 
        esc_attr_e('Add');
        ?>
" tabindex="3" />
<?php 
        wp_nonce_field('add-category', '_ajax_nonce', false);
        ?>
	<span id="category-ajax-response"></span></p>
</div>
<?php 
    }
}
    function vwpc_render_editor()
    {
        // Show / Hide the editor on loading
        global $post;
        // if ( ! is_page() ) return;
        if (isset($post->ID) && 'page_composer.php' == get_post_meta($post->ID, '_wp_page_template', TRUE)) {
            ?>
			<style>#postdivrich{ display:none; }</style>
		<?php 
        } else {
            ?>
			<style>#vwpc-container{ display:none; }</style>
		<?php 
        }
        ?>

		<div id="vwpc-container">
			<input type="hidden" name="vwpc_is_enabled" value="1">

			<div class="vwpc-toolbox">
				<div class="dropdown">
					<button class="button button-primary button-large dropdown-toggle" type="button" id="add-section-button" data-toggle="dropdown">
						<?php 
        _e('Add Section', 'envirra-backend');
        ?>
						<span class="caret"></span>
					</button>
					<ul class="dropdown-menu" role="menu" aria-labelledby="add-section-button"></ul>
				</div>
			</div>

			<div class="vwpc-sections">
				<div class="vwpc-section-empty"><?php 
        _e('Click <strong>Add Section</strong> button to add new section.', 'envirra');
        ?>
</div>
				<div class="vwpc-section-loading"><i class="icon-entypo-arrows-ccw"></i> <?php 
        _e('Loading ...', 'envirra-backend');
        ?>
</div>
			</div>

			<!-- Section Template -->
			<script id="vwpc-template-section" type="text/template">
				<div class="vwpc-section">
					<input type="hidden" class="vwpc-section-order" name="vwpc_section_order[]">
					<input type="hidden" class="vwpc-section-type">
					<div class="vwpc-section-bar">
						<div class="vwpc-section-toolbox">
							<a class="vwpc-section-open-option" href="#"><i class="icon-entypo-cog"></i></a>
							<a class="vwpc-section-delete-section" href="#"><i class="icon-entypo-cancel"></i></a>
						</div>
						<i class="vwpc-section-handle icon-entypo-arrow-combo"></i>
						<div class="vwpc-section-label"></div>
					</div>
					<div class="vwpc-section-options hidden"></div>
				</div>
			</script>

			<script id="vwpc-template-section-option" type="text/template">
				<div class="vwpc-section-option vwpc-section-option-2-columns">
					<div class="vwpc-section-option-label-wrapper">
						<label class="vwpc-section-option-label"></label>
						<div class="vwpc-section-option-description"></div>
					</div>
					<div class="vwpc-section-option-field-wrapper"></div>
				</div>
			</script>

			<!-- Fields Template -->
			<script id="vwpc-template-field-text" type="text/template">
				<input class="vwpc-field" type="text">
			</script>

			<script id="vwpc-template-field-number" type="text/template">
				<input class="vwpc-field" type="number" name="quantity" min="1">
			</script>

			<script id="vwpc-template-field-checkbox" type="text/template">
				<input class="vwpc-field" type="hidden">
				<label>
					<input class="vwpc-field" type="checkbox">
					<span></span>
				</label>
			</script>

			<script id="vwpc-template-field-select" type="text/template">
				<select class="vwpc-field"></select>
			</script>

			<script id="vwpc-template-field-category" type="text/template">
				<?php 
        wp_dropdown_categories(array('hide_empty' => 0, 'class' => 'vwpc-field', 'hierarchical' => true));
        ?>
			</script>

			<script id="vwpc-template-field-category_with_all_option" type="text/template">
				<?php 
        wp_dropdown_categories(array('show_option_all' => __('All', 'envirra'), 'hide_empty' => 0, 'class' => 'vwpc-field', 'hierarchical' => true));
        ?>
			</script>

			<script id="vwpc-template-field-categories" type="text/template">
				<ul class="vw-category-checklist vwpc-field">
					<?php 
        $walker = new Vw_Walker_Category_Checklist();
        $walker->set_field_name('selected_cats');
        wp_category_checklist(0, 0, array(), false, $walker);
        ?>
				</ul>
			</script>

			<script id="vwpc-template-field-sidebar" type="text/template">
				<select>
					<option value="0"><?php 
        echo __('None', 'envirra-backend');
        ?>
</option>
				<?php 
        foreach ($GLOBALS['wp_registered_sidebars'] as $sidebar) {
            ?>
					<option value="<?php 
            echo esc_attr(ucwords($sidebar['id']));
            ?>
">
						<?php 
            echo ucwords($sidebar['name']);
            ?>
					</option>
				<?php 
        }
        ?>
				</select>
			</script>

			<script id="vwpc-template-field-html" type="text/template">
				<textarea class="vwpc-field"></textarea>
			</script>
		</div>
		<?php 
    }
Esempio n. 19
0
 function categoryChecklist($post_id = 0, $descendents_and_self = 0, $selected_cats = false)
 {
     wp_category_checklist($post_id, $descendents_and_self, $selected_cats);
 }
/**
 * {@internal Missing Short Description}}
 *
 * Outputs the quick edit and bulk edit table rows for posts and pages
 *
 * @since 2.7
 *
 * @param string $type 'post' or 'page'
 */
function inline_edit_row( $type ) {
	global $current_user, $mode;

	$is_page = 'page' == $type;
	if ( $is_page ) {
		$screen = 'edit-pages';
		$post = get_default_page_to_edit();
	} else {
		$screen = 'edit';
		$post = get_default_post_to_edit();
	}

	$columns = $is_page ? wp_manage_pages_columns() : wp_manage_posts_columns();
	$hidden = array_intersect( array_keys( $columns ), array_filter( get_hidden_columns($screen) ) );
	$col_count = count($columns) - count($hidden);
	$m = ( isset($mode) && 'excerpt' == $mode ) ? 'excerpt' : 'list';
	$can_publish = current_user_can("publish_{$type}s");
	$core_columns = array( 'cb' => true, 'date' => true, 'title' => true, 'categories' => true, 'tags' => true, 'comments' => true, 'author' => true );

?>

<form method="get" action=""><table style="display: none"><tbody id="inlineedit">
	<?php
	$bulk = 0;
	while ( $bulk < 2 ) { ?>

	<tr id="<?php echo $bulk ? 'bulk-edit' : 'inline-edit'; ?>" class="inline-edit-row inline-edit-row-<?php echo "$type ";
		echo $bulk ? "bulk-edit-row bulk-edit-row-$type" : "quick-edit-row quick-edit-row-$type";
	?>" style="display: none"><td colspan="<?php echo $col_count; ?>">

	<fieldset class="inline-edit-col-left"><div class="inline-edit-col">
		<h4><?php echo $bulk ? ( $is_page ? __( 'Bulk Edit Pages' ) : __( 'Bulk Edit Posts' ) ) : __( 'Quick Edit' ); ?></h4>


<?php if ( $bulk ) : ?>
		<div id="bulk-title-div">
			<div id="bulk-titles"></div>
		</div>

<?php else : // $bulk ?>

		<label>
			<span class="title"><?php _e( 'Title' ); ?></span>
			<span class="input-text-wrap"><input type="text" name="post_title" class="ptitle" value="" /></span>
		</label>

<?php endif; // $bulk ?>


<?php if ( !$bulk ) : ?>

		<label>
			<span class="title"><?php _e( 'Slug' ); ?></span>
			<span class="input-text-wrap"><input type="text" name="post_name" value="" /></span>
		</label>

		<label><span class="title"><?php _e( 'Date' ); ?></span></label>
		<div class="inline-edit-date">
			<?php touch_time(1, 1, 4, 1); ?>
		</div>
		<br class="clear" />

<?php endif; // $bulk

		ob_start();
		$authors = get_editable_user_ids( $current_user->id, true, $type ); // TODO: ROLE SYSTEM
		if ( $authors && count( $authors ) > 1 ) :
			$users_opt = array('include' => $authors, 'name' => 'post_author', 'class'=> 'authors', 'multi' => 1);
			if ( $bulk )
				$users_opt['show_option_none'] = __('- No Change -');
?>
		<label>
			<span class="title"><?php _e( 'Author' ); ?></span>
			<?php wp_dropdown_users( $users_opt ); ?>
		</label>

<?php
		endif; // authors
		$authors_dropdown = ob_get_clean();
?>

<?php if ( !$bulk ) : echo $authors_dropdown; ?>

		<div class="inline-edit-group">
			<label class="alignleft">
				<span class="title"><?php _e( 'Password' ); ?></span>
				<span class="input-text-wrap"><input type="text" name="post_password" class="inline-edit-password-input" value="" /></span>
			</label>

			<em style="margin:5px 10px 0 0" class="alignleft"><?php echo _c( '&ndash;OR&ndash;|Between password field and private checkbox on post quick edit interface' ); ?></em>

			<label class="alignleft inline-edit-private">
				<input type="checkbox" name="keep_private" value="private" />
				<span class="checkbox-title"><?php echo $is_page ? __('Private page') : __('Private post'); ?></span>
			</label>
		</div>

<?php endif; ?>

	</div></fieldset>

<?php if ( !$is_page && !$bulk ) : ?>

	<fieldset class="inline-edit-col-center inline-edit-categories"><div class="inline-edit-col">
		<span class="title inline-edit-categories-label"><?php _e( 'Categories' ); ?>
			<span class="catshow"><?php _e('[more]'); ?></span>
			<span class="cathide" style="display:none;"><?php _e('[less]'); ?></span>
		</span>
		<ul class="cat-checklist">
			<?php wp_category_checklist(); ?>
		</ul>
	</div></fieldset>

<?php endif; // !$is_page && !$bulk ?>

	<fieldset class="inline-edit-col-right"><div class="inline-edit-col">

<?php
	if ( $bulk )
		echo $authors_dropdown;
?>

<?php if ( $is_page ) : ?>

		<label>
			<span class="title"><?php _e( 'Parent' ); ?></span>
<?php
	$dropdown_args = array('selected' => $post->post_parent, 'name' => 'post_parent', 'show_option_none' => __('Main Page (no parent)'), 'option_none_value' => 0, 'sort_column'=> 'menu_order, post_title');
	if ( $bulk )
		$dropdown_args['show_option_no_change'] =  __('- No Change -');
	$dropdown_args = apply_filters('quick_edit_dropdown_pages_args', $dropdown_args);
	wp_dropdown_pages($dropdown_args);
?>
		</label>

<?php	if ( !$bulk ) : ?>

		<label>
			<span class="title"><?php _e( 'Order' ); ?></span>
			<span class="input-text-wrap"><input type="text" name="menu_order" class="inline-edit-menu-order-input" value="<?php echo $post->menu_order ?>" /></span>
		</label>

<?php	endif; // !$bulk ?>

		<label>
			<span class="title"><?php _e( 'Template' ); ?></span>
			<select name="page_template">
<?php	if ( $bulk ) : ?>
				<option value="-1"><?php _e('- No Change -'); ?></option>
<?php	endif; // $bulk ?>
				<option value="default"><?php _e( 'Default Template' ); ?></option>
				<?php page_template_dropdown() ?>
			</select>
		</label>

<?php elseif ( !$bulk ) : // $is_page ?>

		<label class="inline-edit-tags">
			<span class="title"><?php _e( 'Tags' ); ?></span>
			<textarea cols="22" rows="1" name="tags_input" class="tags_input"></textarea>
		</label>

<?php endif; // $is_page  ?>

<?php if ( $bulk ) : ?>

		<div class="inline-edit-group">
		<label class="alignleft">
			<span class="title"><?php _e( 'Comments' ); ?></span>
			<select name="comment_status">
				<option value=""><?php _e('- No Change -'); ?></option>
				<option value="open"><?php _e('Allow'); ?></option>
				<option value="closed"><?php _e('Do not allow'); ?></option>
			</select>
		</label>

		<label class="alignright">
			<span class="title"><?php _e( 'Pings' ); ?></span>
			<select name="ping_status">
				<option value=""><?php _e('- No Change -'); ?></option>
				<option value="open"><?php _e('Allow'); ?></option>
				<option value="closed"><?php _e('Do not allow'); ?></option>
			</select>
		</label>
		</div>

<?php else : // $bulk ?>

		<div class="inline-edit-group">
			<label class="alignleft">
				<input type="checkbox" name="comment_status" value="open" />
				<span class="checkbox-title"><?php _e( 'Allow Comments' ); ?></span>
			</label>

			<label class="alignleft">
				<input type="checkbox" name="ping_status" value="open" />
				<span class="checkbox-title"><?php _e( 'Allow Pings' ); ?></span>
			</label>
		</div>

<?php endif; // $bulk ?>


		<div class="inline-edit-group">
			<label class="inline-edit-status alignleft">
				<span class="title"><?php _e( 'Status' ); ?></span>
				<select name="_status">
<?php if ( $bulk ) : ?>
					<option value="-1"><?php _e('- No Change -'); ?></option>
<?php endif; // $bulk ?>
				<?php if ( $can_publish ) : // Contributors only get "Unpublished" and "Pending Review" ?>
					<option value="publish"><?php _e( 'Published' ); ?></option>
					<option value="future"><?php _e( 'Scheduled' ); ?></option>
<?php if ( $bulk ) : ?>
					<option value="private"><?php _e('Private') ?></option>
<?php endif; // $bulk ?>
				<?php endif; ?>
					<option value="pending"><?php _e( 'Pending Review' ); ?></option>
					<option value="draft"><?php _e( 'Unpublished' ); ?></option>
				</select>
			</label>

<?php if ( !$is_page && $can_publish && current_user_can( 'edit_others_posts' ) ) : ?>

<?php	if ( $bulk ) : ?>

			<label class="alignright">
				<span class="title"><?php _e( 'Sticky' ); ?></span>
				<select name="sticky">
					<option value="-1"><?php _e( '- No Change -' ); ?></option>
					<option value="sticky"><?php _e( 'Sticky' ); ?></option>
					<option value="unsticky"><?php _e( 'Not Sticky' ); ?></option>
				</select>
			</label>

<?php	else : // $bulk ?>

			<label class="alignleft">
				<input type="checkbox" name="sticky" value="sticky" />
				<span class="checkbox-title"><?php _e( 'Make this post sticky' ); ?></span>
			</label>

<?php	endif; // $bulk ?>

<?php endif; // !$is_page && $can_publish && current_user_can( 'edit_others_posts' ) ?>

		</div>

	</div></fieldset>

<?php
	foreach ( $columns as $column_name => $column_display_name ) {
		if ( isset( $core_columns[$column_name] ) )
			continue;
		do_action( $bulk ? 'bulk_edit_custom_box' : 'quick_edit_custom_box', $column_name, $type);
	}
?>
	<p class="submit inline-edit-save">
		<a accesskey="c" href="#inline-edit" title="<?php _e('Cancel'); ?>" class="button-secondary cancel alignleft"><?php _e('Cancel'); ?></a>
		<?php if ( ! $bulk ) {
			wp_nonce_field( 'inlineeditnonce', '_inline_edit', false );
			$update_text = ( $is_page ) ? __( 'Update Page' ) : __( 'Update Post' );
			?>
			<a accesskey="s" href="#inline-edit" title="<?php _e('Update'); ?>" class="button-primary save alignright"><?php echo attribute_escape( $update_text ); ?></a>
			<img class="waiting" style="display:none;" src="images/loading.gif" alt="" />
		<?php } else {
			$update_text = ( $is_page ) ? __( 'Update Pages' ) : __( 'Update Posts' );
		?>
			<input accesskey="s" class="button-primary alignright" type="submit" name="bulk_edit" value="<?php echo attribute_escape( $update_text ); ?>" />
		<?php } ?>
		<input type="hidden" name="post_view" value="<?php echo $m; ?>" />
		<br class="clear" />
	</p>
	</td></tr>
<?php
	$bulk++;
	} ?>
	</tbody></table></form>
<?php
}
Esempio n. 21
0
        function config_page()
        {
            if (isset($_POST['submit'])) {
                $nonce = $_REQUEST['_wpnonce'];
                if (!wp_verify_nonce($nonce, 'sbc-updatesettings')) {
                    die('Security check failed');
                }
                if (!current_user_can('manage_options')) {
                    die(__('You cannot edit the search-by-category options.'));
                }
                check_admin_referer('sbc-updatesettings');
                // Get our new option values
                $focus = $_POST['focus'];
                $hide_empty = $_POST['hide-empty'];
                $search_text = $_POST['search-text'];
                $exclude_child = $_POST['exclude-child'];
                $sbc_style = $_POST['sbc-style'];
                if (isset($_POST['post_category'])) {
                    $raw_excluded_cats = $_POST['post_category'];
                    // Fix our excluded category return values
                    $fix = $raw_excluded_cats;
                    array_unshift($fix, "1");
                    $excluded_cats = implode(',', $fix);
                }
                // Make sure "$hide_empty" & "$exclude_child" are set right
                if (empty($hide_empty)) {
                    $hide_empty = '0';
                }
                // 0 means false
                if (empty($exclude_child)) {
                    $exclude_child = '0';
                }
                // 0 means false
                if (empty($sbc_style)) {
                    $sbc_style = '0';
                }
                // 0 means false
                // Update the DB with the new option values
                update_option("sbc-focus", mysql_real_escape_string($focus));
                update_option("sbc-hide-empty", mysql_real_escape_string($hide_empty));
                update_option("sbc-selected-excluded", mysql_real_escape_string($raw_excluded_cats));
                update_option("sbc-excluded-cats", mysql_real_escape_string($excluded_cats));
                update_option("sbc-search-text", mysql_real_escape_string($search_text));
                update_option("sbc-exclude-child", mysql_real_escape_string($exclude_child));
                update_option("sbc-style", mysql_real_escape_string($sbc_style));
            }
            $focus = get_option("sbc-focus");
            $hide_empty = get_option("sbc-hide-empty");
            $search_text = get_option("sbc-search-text");
            $excluded_cats = get_option("sbc-excluded-cats");
            $exclude_child = get_option("sbc-exclude-child");
            $raw_excluded_cats = get_option("sbc-selected-excluded");
            // For Admin Checklist
            $sbc_style = get_option("sbc-style");
            ?>
 
            <div class="wrap"> 
                <hr /><h2>Seach By Category Options</h2> 
                <form action="" method="post" id="sbc-config"> 
                    <table class="form-table"> 
                        <?php 
            if (function_exists('wp_nonce_field')) {
                wp_nonce_field('sbc-updatesettings');
            }
            ?>
 
                        <tr> 
                            <th scope="row" valign="top"><label for="search-text">Display text in the search box:</label></th> 
                            <td><input type="text" name="search-text" id="search-text" class="regular-text" value="<?php 
            echo $search_text;
            ?>
"/></td> 
                        </tr> 
                        <tr> 
                            <th scope="row" valign="top"><label for="focus">Display text in drop-down selection:</label></th> 
                            <td><input type="text" name="focus" id="focus" class="regular-text" value="<?php 
            echo $focus;
            ?>
"/></td> 
                        </tr> 
                        <tr> 
                            <th scope="row" valign="top"><label for="hide-empty">Hide categories with no posts?</label></th> 
                            <td><input type="checkbox" name="hide-empty" id="hide-empty" value="1" <?php 
            if ($hide_empty == '1') {
                echo 'checked="checked"';
            }
            ?>
 /></td> 
                        </tr> 
                        <tr> 
                            <th scope="row" valign="top"><label for="exclude-child">Exclude Child categories from list?</label></th> 
                            <td><input type="checkbox" name="exclude-child" id="exclude-child" value="1" <?php 
            if ($exclude_child == '1') {
                echo 'checked="checked"';
            }
            ?>
 /></td> 
                        </tr> 
                        <tr> 
                            <th scope="row" valign="top"><label for="sbc-style">Use the SBC Form styling?</label></th> 
                            <td><input type="checkbox" name="sbc-style" id="sbc-style" value="1" <?php 
            if ($sbc_style == '1') {
                echo 'checked="checked"';
            }
            ?>
 /> <em>* Styling doesn't display correctly in IE7 and earlier *</em></td> 
                        </tr> 
                        <tr> 
                            <th scope="row" valign="top"><label for="focus">Categories to exclude:</label></th> 
                            <td><ul><?php 
            wp_category_checklist(0, 0, $raw_excluded_cats);
            ?>
</ul></td> 
                        </tr> 
                    </table> 
                    <br/> 
                    <span class="submit" style="border: 0;"><input type="submit" name="submit" value="Save Settings" /></span> 
                </form> 
            </div> 
<?php 
        }
Esempio n. 22
0
 /**
  * Outputs the category list where the user can select categories.
  * @param $q_id int id of the queued photo for which to choose cats
  * @param $default int id of the default photoq category
  * @param $selectedCats array category ids of categories that should appear selected
  */
 function showCategoryCheckboxList($q_id = 0, $default = 0, $selectedCats = array())
 {
     if (!$selectedCats) {
         // No selected categories, set to default
         $selectedCats[] = $default;
     }
     //$q_id = preg_replace('/\./','_',$q_id); //. in post vars become _
     // check the fold option
     $oc =& PhotoQSingleton::getInstance('PhotoQOptionController');
     $closed = $oc->getValue('foldCats') ? 'closed' : '';
     echo '<div class="postbox ' . $closed . '">';
     echo '<h3 class="postbox-handle"><span>' . __('Categories', 'PhotoQ') . '</span></h3>';
     echo '<div class="inside">';
     echo '<ul>';
     //$this->category_checklist(0,0,$selectedCats,$q_id);
     wp_category_checklist(0, 0, $selectedCats, false, new Walker_PhotoQ_Category_Checklist($q_id));
     echo '</ul></div></div>';
 }
Esempio n. 23
0
 $x = new WP_Ajax_Response();
 foreach ($names as $cat_name) {
     $cat_name = trim($cat_name);
     $category_nicename = sanitize_title($cat_name);
     if ('' === $category_nicename) {
         continue;
     }
     $cat_id = wp_create_category($cat_name, $parent);
     $checked_categories[] = $cat_id;
     if ($parent) {
         // Do these all at once in a second
         continue;
     }
     $category = get_category($cat_id);
     ob_start();
     wp_category_checklist(0, $cat_id, $checked_categories, $popular_ids);
     $data = ob_get_contents();
     ob_end_clean();
     $x->add(array('what' => 'category', 'id' => $cat_id, 'data' => $data, 'position' => -1));
 }
 if ($parent) {
     // Foncy - replace the parent and all its children
     $parent = get_category($parent);
     ob_start();
     dropdown_categories(0, $parent);
     $data = ob_get_contents();
     ob_end_clean();
     $x->add(array('what' => 'category', 'id' => $parent->term_id, 'old_id' => $parent->term_id, 'data' => $data, 'position' => -1));
 }
 $x->send();
 break;
?>
</a></li>
</ul>

<div id="categories-pop" class="ui-tabs-panel" style="display: none;">
	<ul id="categorychecklist-pop" class="categorychecklist form-no-clear" >
		<?php 
$popular_ids = wp_popular_terms_checklist('category');
?>
	</ul>
</div>

<div id="categories-all" class="ui-tabs-panel">
	<ul id="categorychecklist" class="list:category categorychecklist form-no-clear">
		<?php 
wp_category_checklist($post_ID);
?>
	</ul>
</div>

</div>
</div>

<?php 
do_meta_boxes('post', 'normal', $post);
?>

<?php 
do_action('edit_form_advanced');
?>
Esempio n. 25
0
/**
 * SACK response function for getting post categories and compiling them into a category checklist
 *
 * @since 2.3.5
 * @author scripts@schloebe.de
 * @uses wp_category_checklist()
 */
function ame_ajax_get_categories()
{
    global $wpdb, $post;
    $ame_id = intval($_POST['postid']);
    echo '<div id="categorychoose' . $ame_id . '" class="categorydiv">';
    echo '<div class="button-group">';
    echo '<a href="javascript:void(0);" class="button small" onclick="ame_check_all(' . $ame_id . ', true);">' . __('Check All') . '</a><a href="javascript:void(0);" class="button small" onclick="ame_check_all(' . $ame_id . ', false);">' . __('Uncheck All') . '</a>';
    echo '</div><br />';
    echo '<ul id="categorychecklist" class="list:category categorychecklist form-no-clear" style="height:365px;overflow:auto;">';
    wp_category_checklist($ame_id, 0, get_option('default_category'));
    echo '</ul>';
    echo '<div style="text-align:center;">';
    echo get_submit_button(__('Save'), 'button button-primary primary large', 'save', false, 'onclick="ame_ajax_save_categories(' . $ame_id . ');return false;"');
    echo "&nbsp;";
    echo get_submit_button(__('Cancel'), 'button button-secondary secondary', 'cancel', false, 'onclick="tb_remove();"');
    echo '</div>';
    echo '</div>';
    die("");
}
function woo_tumblog_dashboard_widget_output()
{
    //security check
    if (current_user_can('publish_posts')) {
        $tumblog_items = array('articles' => get_option('woo_articles_term_id'), 'images' => get_option('woo_images_term_id'), 'audio' => get_option('woo_audio_term_id'), 'video' => get_option('woo_video_term_id'), 'quotes' => get_option('woo_quotes_term_id'), 'links' => get_option('woo_links_term_id'));
        ?>

		<script type="text/javascript" src="<?php 
        echo get_template_directory_uri();
        ?>
/functions/js/ajaxupload.js"></script>
		<script type="text/javascript">
		//No Conflict Mode
		jQuery.noConflict();
		//AJAX Functions
		jQuery(document).ready(function(){

			 //JQUERY DATEPICKER
			jQuery( '.date-picker').each(function (){
				jQuery( '#' + jQuery(this).attr( 'id')).datepicker({showOn: 'button', buttonImage: '<?php 
        echo get_template_directory_uri();
        ?>
/functions/images/calendar.gif', buttonImageOnly: true});
			});

			jQuery( '#advanced-options-toggle').click(function () {
				jQuery( '#meta-fields').toggle();
				if ( jQuery(this).text() == 'View Advanced Options' ) {
					jQuery(this).text( 'Hide Advanced Options' );
				} else {
					jQuery(this).text( 'View Advanced Options' );
				}
			});

			//MENU BUTTON CLICK EVENTS
			jQuery( '#articles-menu-button').click(function ()
			{
				jQuery( '#article-fields').removeAttr( 'class' );
				jQuery( '#image-fields').removeAttr( 'class' );
				jQuery( '#image-fields').attr( 'class','hide-fields' );
				jQuery( '#link-fields').removeAttr( 'class' );
				jQuery( '#link-fields').attr( 'class','hide-fields' );
				jQuery( '#audio-fields').removeAttr( 'class' );
				jQuery( '#audio-fields').attr( 'class','hide-fields' );
				jQuery( '#video-fields').removeAttr( 'class' );
				jQuery( '#video-fields').attr( 'class','hide-fields' );
				jQuery( '#quote-fields').removeAttr( 'class' );
				jQuery( '#quote-fields').attr( 'class','hide-fields' );
				jQuery( '#tumblog-submit-fields').removeAttr( 'class' );
				jQuery( '#tumblog-type').attr( 'value','article' );
				jQuery( '#content-fields').removeAttr( 'class' );
				jQuery( '#tag-fields').removeAttr( 'class' );
				<?php 
        if (get_option('woo_tumblog_content_method') != 'post_format') {
            ?>

				//Additional Tumblogs Checks
				jQuery( '#additional-tumblogs input').each(function(){

					var elementid = jQuery(this).val();
					<?php 
            $term_array =& get_term($tumblog_items['articles'], 'tumblog');
            ?>

					var catid = <?php 
            echo $tumblog_items['articles'];
            ?>
;

					if (elementid == catid) {
						//make invisible
						jQuery(this).addClass( 'hide-cat' );
						jQuery(this).attr( 'checked', false);
					} else {
						//make visible
						jQuery(this).removeAttr( 'class' );
						jQuery(this).attr( 'checked', false);
					}
				});

				jQuery( '#additional-tumblogs li').each(function(){

					var elementname = jQuery(this).text();
					var catname = '<?php 
            echo $term_array->name;
            ?>
';
					var elementnamesub = elementname.substring(1);

					if (elementnamesub == catname) {
						//make invisible
						jQuery(this).addClass( 'hide-cat' );
					} else {
						//make visible
						jQuery(this).removeAttr( 'class' );
					}
				});
				<?php 
        }
        ?>

				if (nicEditors.findEditor( 'test-content') == undefined) {
					myNicEditor = new nicEditor({ buttonList : ['bold','italic','underline','ol','ul','left','center','right','justify','link','unlink','strikeThrough','xhtml','image'], iconsPath : '<?php 
        echo get_template_directory_uri();
        ?>
/functions/images/nicEditorIcons.gif'}).panelInstance( 'test-content' );
				} else {
					myNicEditor = nicEditors.findEditor( 'test-content' );
				}
				jQuery( '#note-title').focus();
				nicEditors.findEditor( 'test-content').setContent( '' );
				jQuery( '#content-fields > div').addClass( 'editorwidth' );
			});
			jQuery( '#images-menu-button').click(function ()
			{
				jQuery( '#image-fields').removeAttr( 'class' );
				jQuery( '#article-fields').removeAttr( 'class' );
				jQuery( '#article-fields').attr( 'class','hide-fields' );
				jQuery( '#link-fields').removeAttr( 'class' );
				jQuery( '#link-fields').attr( 'class','hide-fields' );
				jQuery( '#audio-fields').removeAttr( 'class' );
				jQuery( '#audio-fields').attr( 'class','hide-fields' );
				jQuery( '#video-fields').removeAttr( 'class' );
				jQuery( '#video-fields').attr( 'class','hide-fields' );
				jQuery( '#quote-fields').removeAttr( 'class' );
				jQuery( '#quote-fields').attr( 'class','hide-fields' );
				jQuery( '#tumblog-submit-fields').removeAttr( 'class' );
				jQuery( '#tumblog-type').attr( 'value','image' );
				jQuery( '#content-fields').removeAttr( 'class' );
				jQuery( '#tag-fields').removeAttr( 'class' );
				<?php 
        if (get_option('woo_tumblog_content_method') != 'post_format') {
            ?>

				//Additional Tumblogs Checks
				jQuery( '#additional-tumblogs input').each(function(){

					var elementid = jQuery(this).val();
					<?php 
            $term_array =& get_term($tumblog_items['images'], 'tumblog');
            ?>

					var catid = <?php 
            echo $tumblog_items['images'];
            ?>
;

					if (elementid == catid) {
						//make invisible
						jQuery(this).addClass( 'hide-cat' );
						jQuery(this).attr( 'checked', false);
					} else {
						//make visible
						jQuery(this).removeAttr( 'class' );
						jQuery(this).attr( 'checked', false);
					}
				});

				jQuery( '#additional-tumblogs li').each(function(){

					var elementname = jQuery(this).text();
					var catname = '<?php 
            echo $term_array->name;
            ?>
';
					var elementnamesub = elementname.substring(1);

					if (elementnamesub == catname) {
						//make invisible
						jQuery(this).addClass( 'hide-cat' );
					} else {
						//make visible
						jQuery(this).removeAttr( 'class' );
					}
				});
				<?php 
        }
        ?>

				if (nicEditors.findEditor( 'test-content') == undefined) {
					myNicEditor = new nicEditor({ buttonList : ['bold','italic','underline','ol','ul','left','center','right','justify','link','unlink','strikeThrough','xhtml','image'], iconsPath : '<?php 
        echo get_template_directory_uri();
        ?>
/functions/images/nicEditorIcons.gif'}).panelInstance( 'test-content' );
				} else {
					myNicEditor = nicEditors.findEditor( 'test-content' );
				}
				jQuery( '#image-title').focus();
				nicEditors.findEditor( 'test-content').setContent( '' );
				jQuery( '#content-fields > div').addClass( 'editorwidth' );
			});
			jQuery( '#links-menu-button').click(function ()
			{
				jQuery( '#link-fields').removeAttr( 'class' );
				jQuery( '#image-fields').removeAttr( 'class' );
				jQuery( '#image-fields').attr( 'class','hide-fields' );
				jQuery( '#article-fields').removeAttr( 'class' );
				jQuery( '#article-fields').attr( 'class','hide-fields' );
				jQuery( '#audio-fields').removeAttr( 'class' );
				jQuery( '#audio-fields').attr( 'class','hide-fields' );
				jQuery( '#video-fields').removeAttr( 'class' );
				jQuery( '#video-fields').attr( 'class','hide-fields' );
				jQuery( '#quote-fields').removeAttr( 'class' );
				jQuery( '#quote-fields').attr( 'class','hide-fields' );
				jQuery( '#tumblog-submit-fields').removeAttr( 'class' );
				jQuery( '#tumblog-type').attr( 'value','link' );
				jQuery( '#content-fields').removeAttr( 'class' );
				jQuery( '#tag-fields').removeAttr( 'class' );
				<?php 
        if (get_option('woo_tumblog_content_method') != 'post_format') {
            ?>

				//Additional Tumblogs Checks
				jQuery( '#additional-tumblogs input').each(function(){

					var elementid = jQuery(this).val();
					<?php 
            $term_array =& get_term($tumblog_items['links'], 'tumblog');
            ?>

					var catid = <?php 
            echo $tumblog_items['links'];
            ?>
;

					if (elementid == catid) {
						//make invisible
						jQuery(this).addClass( 'hide-cat' );
						jQuery(this).attr( 'checked', false);
					} else {
						//make visible
						jQuery(this).removeAttr( 'class' );
						jQuery(this).attr( 'checked', false);
					}
				});

				jQuery( '#additional-tumblogs li').each(function(){

					var elementname = jQuery(this).text();
					var catname = '<?php 
            echo $term_array->name;
            ?>
';
					var elementnamesub = elementname.substring(1);

					if (elementnamesub == catname) {
						//make invisible
						jQuery(this).addClass( 'hide-cat' );
					} else {
						//make visible
						jQuery(this).removeAttr( 'class' );
					}
				});
				<?php 
        }
        ?>

				if (nicEditors.findEditor( 'test-content') == undefined) {
					myNicEditor = new nicEditor({ buttonList : ['bold','italic','underline','ol','ul','left','center','right','justify','link','unlink','strikeThrough','xhtml','image'], iconsPath : '<?php 
        echo get_template_directory_uri();
        ?>
/functions/images/nicEditorIcons.gif'}).panelInstance( 'test-content' );
				} else {
					myNicEditor = nicEditors.findEditor( 'test-content' );
				}
				jQuery( '#link-title').focus();
				nicEditors.findEditor( 'test-content').setContent( '' );
				jQuery( '#content-fields > div').addClass( 'editorwidth' );
			});
			jQuery( '#audio-menu-button').click(function ()
			{
				jQuery( '#audio-fields').removeAttr( 'class' );
				jQuery( '#image-fields').removeAttr( 'class' );
				jQuery( '#image-fields').attr( 'class','hide-fields' );
				jQuery( '#link-fields').removeAttr( 'class' );
				jQuery( '#link-fields').attr( 'class','hide-fields' );
				jQuery( '#article-fields').removeAttr( 'class' );
				jQuery( '#article-fields').attr( 'class','hide-fields' );
				jQuery( '#video-fields').removeAttr( 'class' );
				jQuery( '#video-fields').attr( 'class','hide-fields' );
				jQuery( '#quote-fields').removeAttr( 'class' );
				jQuery( '#quote-fields').attr( 'class','hide-fields' );
				jQuery( '#tumblog-submit-fields').removeAttr( 'class' );
				jQuery( '#tumblog-type').attr( 'value','audio' );
				jQuery( '#content-fields').removeAttr( 'class' );
				jQuery( '#tag-fields').removeAttr( 'class' );
				<?php 
        if (get_option('woo_tumblog_content_method') != 'post_format') {
            ?>

				//Additional Tumblogs Checks
				jQuery( '#additional-tumblogs input').each(function(){

					var elementid = jQuery(this).val();
					<?php 
            $term_array =& get_term($tumblog_items['audio'], 'tumblog');
            ?>

					var catid = <?php 
            echo $tumblog_items['audio'];
            ?>
;

					if (elementid == catid) {
						//make invisible
						jQuery(this).addClass( 'hide-cat' );
						jQuery(this).attr( 'checked', false);
					} else {
						//make visible
						jQuery(this).removeAttr( 'class' );
						jQuery(this).attr( 'checked', false);
					}
				});

				jQuery( '#additional-tumblogs li').each(function(){

					var elementname = jQuery(this).text();
					var catname = '<?php 
            echo $term_array->name;
            ?>
';
					var elementnamesub = elementname.substring(1);

					if (elementnamesub == catname) {
						//make invisible
						jQuery(this).addClass( 'hide-cat' );
					} else {
						//make visible
						jQuery(this).removeAttr( 'class' );
					}
				});
				<?php 
        }
        ?>

				if (nicEditors.findEditor( 'test-content') == undefined) {
					myNicEditor = new nicEditor({ buttonList : ['bold','italic','underline','ol','ul','left','center','right','justify','link','unlink','strikeThrough','xhtml','image'], iconsPath : '<?php 
        echo get_template_directory_uri();
        ?>
/functions/images/nicEditorIcons.gif'}).panelInstance( 'test-content' );
				} else {
					myNicEditor = nicEditors.findEditor( 'test-content' );
				}
				jQuery( '#audio-title').focus();
				nicEditors.findEditor( 'test-content').setContent( '' );
				jQuery( '#content-fields > div').addClass( 'editorwidth' );
			});
			jQuery( '#videos-menu-button').click(function ()
			{
				jQuery( '#video-fields').removeAttr( 'class' );
				jQuery( '#image-fields').removeAttr( 'class' );
				jQuery( '#image-fields').attr( 'class','hide-fields' );
				jQuery( '#link-fields').removeAttr( 'class' );
				jQuery( '#link-fields').attr( 'class','hide-fields' );
				jQuery( '#audio-fields').removeAttr( 'class' );
				jQuery( '#audio-fields').attr( 'class','hide-fields' );
				jQuery( '#article-fields').removeAttr( 'class' );
				jQuery( '#article-fields').attr( 'class','hide-fields' );
				jQuery( '#quote-fields').removeAttr( 'class' );
				jQuery( '#quote-fields').attr( 'class','hide-fields' );
				jQuery( '#tumblog-submit-fields').removeAttr( 'class' );
				jQuery( '#tumblog-type').attr( 'value','video' );
				jQuery( '#content-fields').removeAttr( 'class' );
				jQuery( '#tag-fields').removeAttr( 'class' );
				<?php 
        if (get_option('woo_tumblog_content_method') != 'post_format') {
            ?>

				//Additional Tumblogs Checks
				jQuery( '#additional-tumblogs input').each(function(){

					var elementid = jQuery(this).val();
					<?php 
            $term_array =& get_term($tumblog_items['video'], 'tumblog');
            ?>

					var catid = <?php 
            echo $tumblog_items['video'];
            ?>
;

					if (elementid == catid) {
						//make invisible
						jQuery(this).addClass( 'hide-cat' );
						jQuery(this).attr( 'checked', false);
					} else {
						//make visible
						jQuery(this).removeAttr( 'class' );
						jQuery(this).attr( 'checked', false);
					}
				});

				jQuery( '#additional-tumblogs li').each(function(){

					var elementname = jQuery(this).text();
					var catname = '<?php 
            echo $term_array->name;
            ?>
';
					var elementnamesub = elementname.substring(1);

					if (elementnamesub == catname) {
						//make invisible
						jQuery(this).addClass( 'hide-cat' );
					} else {
						//make visible
						jQuery(this).removeAttr( 'class' );
					}
				});
				<?php 
        }
        ?>

				if (nicEditors.findEditor( 'test-content') == undefined) {
					myNicEditor = new nicEditor({ buttonList : ['bold','italic','underline','ol','ul','left','center','right','justify','link','unlink','strikeThrough','xhtml','image'], iconsPath : '<?php 
        echo get_template_directory_uri();
        ?>
/functions/images/nicEditorIcons.gif'}).panelInstance( 'test-content' );
				} else {
					myNicEditor = nicEditors.findEditor( 'test-content' );
				}
				jQuery( '#video-title').focus();
				nicEditors.findEditor( 'test-content').setContent( '' );
				jQuery( '#content-fields > div').addClass( 'editorwidth' );
			});
			jQuery( '#quotes-menu-button').click(function ()
			{
				jQuery( '#quote-fields').removeAttr( 'class' );
				jQuery( '#image-fields').removeAttr( 'class' );
				jQuery( '#image-fields').attr( 'class','hide-fields' );
				jQuery( '#link-fields').removeAttr( 'class' );
				jQuery( '#link-fields').attr( 'class','hide-fields' );
				jQuery( '#audio-fields').removeAttr( 'class' );
				jQuery( '#audio-fields').attr( 'class','hide-fields' );
				jQuery( '#video-fields').removeAttr( 'class' );
				jQuery( '#video-fields').attr( 'class','hide-fields' );
				jQuery( '#article-fields').removeAttr( 'class' );
				jQuery( '#article-fields').attr( 'class','hide-fields' );
				jQuery( '#tumblog-submit-fields').removeAttr( 'class' );
				jQuery( '#tumblog-type').attr( 'value','quote' );
				jQuery( '#content-fields').removeAttr( 'class' );
				jQuery( '#tag-fields').removeAttr( 'class' );
				<?php 
        if (get_option('woo_tumblog_content_method') != 'post_format') {
            ?>

				//Additional Tumblogs Checks
				jQuery( '#additional-tumblogs input').each(function(){

					var elementid = jQuery(this).val();
					<?php 
            $term_array =& get_term($tumblog_items['quotes'], 'tumblog');
            ?>

					var catid = <?php 
            echo $tumblog_items['quotes'];
            ?>
;

					if (elementid == catid) {
						//make invisible
						jQuery(this).addClass( 'hide-cat' );
						jQuery(this).attr( 'checked', false);
					} else {
						//make visible
						jQuery(this).removeAttr( 'class' );
						jQuery(this).attr( 'checked', false);
					}
				});

				jQuery( '#additional-tumblogs li').each(function(){

					var elementname = jQuery(this).text();
					var catname = '<?php 
            echo $term_array->name;
            ?>
';
					var elementnamesub = elementname.substring(1);

					if (elementnamesub == catname) {
						//make invisible
						jQuery(this).addClass( 'hide-cat' );
					} else {
						//make visible
						jQuery(this).removeAttr( 'class' );
					}
				});
				<?php 
        }
        ?>

				if (nicEditors.findEditor( 'test-content') == undefined) {
					myNicEditor = new nicEditor({ buttonList : ['bold','italic','underline','ol','ul','left','center','right','justify','link','unlink','strikeThrough','xhtml','image'], iconsPath : '<?php 
        echo get_template_directory_uri();
        ?>
/functions/images/nicEditorIcons.gif'}).panelInstance( 'test-content' );
				} else {
					myNicEditor = nicEditors.findEditor( 'test-content' );
				}
				jQuery( '#quote-title').focus();
				nicEditors.findEditor( 'test-content').setContent( '' );
				jQuery( '#content-fields > div').addClass( 'editorwidth' );
			});


			//AJAX FORM POST
			jQuery( '#tumblog-form').ajaxForm(
			{
	  			name: 'formpost',
	  			data: { // Additional data to send
							action: 'woo_tumblog_post',
							type: 'upload',
							data: 'formpost' },
				// handler function for success event
				success: function(responseText, statusText)
					{
						jQuery( '#test-response').html( '<span class="success">'+'Published!'+'</span>').fadeIn( '3000').animate({ opacity: 1.0 },2000).fadeOut();
						jQuery( '#ajax-loader').hide();
						resetTumblogQuickPress();
					},
				// handler function for errors
				error: function(request)
				{
					// parse it for WordPress error
					if (request.responseText.search(/<title>WordPress &rsaquo; Error<\/title>/) != -1)
					{
						var data = request.responseText.match(/<p>(.*)<\/p>/);
						jQuery( '#test-response').html( '<span class="error">'+ data[1] +'</span>' );
					}
					else
					{
						jQuery( '#test-response').html( '<span class="error">An error occurred, please notify the administrator.</span>' );
					}
				},
				beforeSubmit: function(formData, jqForm, options)
				{
					jQuery( '#ajax-loader').show();
				}
			});
			//AJAX IMAGE UPLOAD
			new AjaxUpload( '#image_upload_button', {
	  			action: '<?php 
        echo admin_url("admin-ajax.php");
        ?>
',
	  			name: 'userfile',
	  			data: { // Additional data to send
							action: 'woo_tumblog_media_upload',
							type: 'upload',
							data: 'userfile' },
	  			onSubmit : function(file , ext){
	        	        if (! (ext && /^(jpg|png|jpeg|gif|bmp|tiff|tif|ico|jpe)$/.test(ext))){
	           	             // extension is not allowed
	           	             alert( 'Error: invalid file extension' );
	           	             // cancel upload
	           	             return false;
	           	     	}
	           	     	else {
	           	     		jQuery( '#test-response').html( '<span class="success">'+'Image Uploading...'+'</span>').fadeIn( '3000').animate({ opacity: 1.0 },2000);
	           	     	}
	        	},
				onComplete: function(file, response) {
					jQuery( '#test-response').html( '<span class="success">'+'Image Uploaded!'+'</span>').fadeIn( '3000').animate({ opacity: 1.0 },2000).fadeOut();
					var splitResults = response.split( '|' );
					jQuery( '#image-upload').attr( 'value',splitResults[0]);
					jQuery( '#image-id').attr( 'value',splitResults[1]);
				}
			});
			//AJAX AUDIO UPLOAD
			new AjaxUpload( '#audio_upload_button', {
	  			action: '<?php 
        echo admin_url("admin-ajax.php");
        ?>
',
	  			name: 'userfile',
	  			data: { // Additional data to send
							action: 'woo_tumblog_media_upload',
							type: 'upload',
							data: 'userfile' },
	  			onSubmit : function(file , ext){
	        	        if (! (ext && /^(mp3|mp4|ogg|wma|midi|mid|wav|wmx|wmv|avi|mov|qt|mpeg|mpg|asx|asf)$/.test(ext))){
	           	             // extension is not allowed
	           	             alert( 'Error: invalid file extension' );
	           	             // cancel upload
	           	             return false;
	           	     	}
	           	     	else {
	           	     		jQuery( '#test-response').html( '<span class="success">'+'Audio Uploading...'+'</span>').fadeIn( '3000').animate({ opacity: 1.0 },2000);
	           	     	}
	        	},
				onComplete: function(file, response) {
					jQuery( '#test-response').html( '<span class="success">'+'Audio Uploaded!'+'</span>').fadeIn( '3000').animate({ opacity: 1.0 },2000).fadeOut();
					var splitResults = response.split( '|' );
					jQuery( '#audio-upload').attr( 'value',splitResults[0]);
					jQuery( '#audio-id').attr( 'value',splitResults[1]);
				}
			});
		});

		</script>
	<div id="tumblog-post">

		<form name="tumblog-form" onsubmit="updateContent();" id="tumblog-form" method="post" action="<?php 
        echo admin_url("admin-ajax.php");
        ?>
">

		<img id="ajax-loader" src="<?php 
        echo get_template_directory_uri();
        ?>
/functions/images/ajax-loader.gif" />

		<div id="test-response"></div>

		<div id="tumblog-menu">
			<a id="articles-menu-button" href="#" title="#">Article</a>
			<a id="images-menu-button" href="#" title="#">Image</a>
			<a id="links-menu-button" href="#" title="#">Link</a>
			<a id="audio-menu-button" href="#" title="#">Audio</a>
			<a id="videos-menu-button" href="#" title="#">Video</a>
			<a id="quotes-menu-button" href="#" title="#">Quote</a>
		</div>

		<div id="article-fields" class="hide-fields">
			<h4 id="quick-post-title"><label for="note-title">Title</label></h4>
			<div>
				<input name="note-title" id="note-title" tabindex="1" autocomplete="off" value="" type="text" class="tumblog-title">
			</div>
		</div>

		<div id="video-fields" class="hide-fields">
			<h4 id="quick-post-title"><label for="video-title">Title</label></h4>
			<div>
				<input name="video-title" id="video-title" tabindex="1" autocomplete="off" value="" type="text" class="tumblog-title">
			</div>
			<h4 id="quick-post-title"><label for="video-embed">Embed Video Code</label></h4>
			<textarea style="width:100%" id="video-embed" name="video-embed" tabindex="2"></textarea>
		</div>

		<div id="image-fields" class="hide-fields">
			<h4 id="quick-post-title"><label for="image-title">Title</label></h4>
			<div>
				<input name="image-title" id="image-title" tabindex="1" autocomplete="off" value="" type="text" class="tumblog-title">
			</div>
			<div id="image-option-upload" style="display:none;">
				<h4 id="quick-post-title"><label for="image-upload">Upload Image</label> | <label id="image-url-button">Image URL instead</label></h4>
				<div>
					<input name="image-upload" id="image-upload" tabindex="2" autocomplete="off" value="" type="text">
				</div>
				<input name="image_upload_button" type="button" id="image_upload_button" class="button" value="Upload Image" />
			</div>
			<div id="image-option-url">
				<h4 id="quick-post-title"><label for="image-url">Image URL</label> | <label id="image-upload-button">Upload Image instead</label></h4>
				<div>
					<input name="image-url" id="image-url" tabindex="2" autocomplete="off" value="" type="text">
				</div>
			</div>
			<input type="hidden" id="image-id" name="image-id" value="" />
		</div>

		<div id="link-fields" class="hide-fields">
			<h4 id="quick-post-title"><label for="link-title">Title</label></h4>
			<div>
				<input name="link-title" id="link-title" tabindex="1" autocomplete="off" value="" type="text" class="tumblog-title">
			</div>
			<h4 id="quick-post-title"><label for="link-url">Link URL</label></h4>
			<div>
				<input name="link-url" id="link-url" tabindex="2" autocomplete="off" value="" type="text">
			</div>
		</div>

		<div id="quote-fields" class="hide-fields">
			<h4 id="quick-post-title"><label for="quote-title">Title</label></h4>
			<div>
				<input name="quote-title" id="quote-title" tabindex="1" autocomplete="off" value="" type="text" class="tumblog-title">
			</div>
			<h4 id="quick-post-title"><label for="quote-copy">Quote</label></h4>
			<textarea style="width:100%" id="quote-copy" name="quote-copy" tabindex="2"></textarea>
			<h4 id="quick-post-title"><label for="quote-url">Quote URL</label></h4>
			<div>
				<input name="quote-url" id="quote-url" tabindex="3" autocomplete="off" value="" type="text">
			</div>
			<h4 id="quick-post-title"><label for="quote-quote">Quote Author</label></h4>
			<div>
				<input name="quote-author" id="quote-author" tabindex="4" autocomplete="off" value="" type="text">
			</div>
		</div>

		<div id="audio-fields" class="hide-fields">
			<h4 id="quick-post-title"><label for="audio-title">Title</label></h4>
			<div>
				<input name="audio-title" id="audio-title" tabindex="1" autocomplete="off" value="" type="text" class="tumblog-title">
			</div>
			<div id="audio-option-upload" style="display:none;">
				<h4 id="quick-post-title"><label for="audio-upload">Upload Audio</label> | <label id="audio-url-button">Audio URL instead</label></h4>
				<div>
					<input name="audio-upload" id="audio-upload" tabindex="2" autocomplete="off" value="" type="text">
				</div>
				<input name="audio_upload_button" type="button" id="audio_upload_button" class="button" value="Upload Audio" />
			</div>
			<div id="audio-option-url">
				<h4 id="quick-post-title"><label for="audio-url">Audio URL</label> | <label id="audio-upload-button">Upload Audio instead</label></h4>
				<div>
					<input name="audio-url" id="audio-url" tabindex="2" autocomplete="off" value="" type="text">
				</div>
			</div>
			<input type="hidden" id="audio-id" name="audio-id" value="" />
		</div>

		<div id="content-fields" class="hide-fields">
			<?php 
        if (current_user_can('upload_files')) {
            ?>

				<?php 
            //the_editor( '', $id = 'content', $prev_id = 'title', $media_buttons = false, $tab_index = 5);
            ?>

				<textarea tabindex="5" id="test-content" style="width:100%;height:100px;"></textarea>
			<?php 
        }
        ?>

			<input type="hidden" id="tumblog-content" name="tumblog-content" value="" />
			<input type="hidden" id="tumblog-type" name="tumblog-type" value="article" />
			<p><a id="advanced-options-toggle" onclick="">View Advanced Options</a></p>
		</div>

		<div id="meta-fields" class="hide-fields">
			<p>
				<?php 
        // START - POST STATUS AND DATE TIME
        ?>

				<strong><label for="tumblog-status">Post Status : </label></strong> <select style="margin-left:10px;" id="tumblog-status" name="tumblog-status" tabindex="6">
					<option value="publish">Published</option>
					<option value="draft">Draft</option>
				</select>
			</p>
			<p>
				<?php 
        $date_formatted = date_i18n("m/d/Y");
        ?>

				<?php 
        $time_now_hours = date_i18n("H");
        ?>

				<?php 
        $time_now_mins = date_i18n("i");
        ?>

				<?php 
        $post_id = 0;
        ?>

				<strong><label for="tumblog-date">Post Date : </label></strong> <input name="tumblog-date" id="tumblog-date" tabindex="7" value="<?php 
        echo esc_attr($date_formatted);
        ?>
" type="text" class="date-picker" style="width:100px;margin-left:20px;"> @ <input class="tumblog-time" name="tumblog-hours" id="tumblog-hours" maxlength="2" size="2" value="<?php 
        echo esc_attr($time_now_hours);
        ?>
" type="text">:<input class="tumblog-time" name="tumblog-mins" id="tumblog-mins" maxlength="2" size="2" value="<?php 
        echo esc_attr($time_now_mins);
        ?>
" type="text">
				<?php 
        // END - POST STATUS AND DATE TIME
        ?>

			</p>
			<br />
			<div id="additional-categories" style="width:<?php 
        if (get_option('woo_tumblog_content_method') != 'post_format') {
            ?>
47%;float:left;<?php 
        } else {
            ?>
94%;<?php 
        }
        ?>
">
				<strong><label for="post_category[]">Additional Categories : </label></strong>
				<?php 
        // START - MULTI CATEGORY DROP DOWN
        ?>

				<?php 
        $taxonomy = 'category';
        ?>

				<div id="<?php 
        echo $taxonomy;
        ?>
-all" class="tabs-panel" style="height:100px;overflow:auto;border: 1px solid #CCCCCC;margin-top:6px;margin-bottom:6px;">
				<?php 
        $name = $taxonomy == 'category' ? 'post_category' : 'tax_input[' . $taxonomy . ']';
        ?>

				<ul id="<?php 
        echo $taxonomy;
        ?>
checklist" class="list:<?php 
        echo $taxonomy;
        ?>
 categorychecklist form-no-clear">
					<?php 
        if (function_exists('wp_terms_checklist')) {
            wp_terms_checklist($post_id, array('taxonomy' => $taxonomy));
            ?>

					<?php 
        } else {
            wp_category_checklist();
        }
        ?>

				</ul>
				<?php 
        // END - MULTI CATEGORY DROP DOWN
        ?>

				</div>
			</div>
			<?php 
        if (get_option('woo_tumblog_content_method') != 'post_format') {
            ?>

			<div id="additional-tumblogs" style="width:47%;float:right;">
				<strong><label for="post_tumblog[]">Additional Tumblogs : </label></strong>
				<?php 
            // START - MULTI TUMBLOG DROP DOWN
            ?>

				<?php 
            $taxonomy = 'tumblog';
            ?>

				<div id="<?php 
            echo $taxonomy;
            ?>
-all" class="tabs-panel" style="height:100px;overflow:auto;border: 1px solid #CCCCCC;margin-top:6px;margin-bottom:6px;">
				<?php 
            $name = $taxonomy == 'tumblog' ? 'post_tumblog' : 'tax_input[' . $taxonomy . ']';
            ?>

				<ul id="<?php 
            echo $taxonomy;
            ?>
checklist" class="list:<?php 
            echo $taxonomy;
            ?>
 categorychecklist form-no-clear">
					<?php 
            if (function_exists('wp_terms_checklist')) {
                wp_terms_checklist($post_id, array('taxonomy' => $taxonomy));
                ?>

					<?php 
            } else {
                wp_category_checklist();
            }
            ?>

				</ul>
				<?php 
            // END - MULTI TUMBLOG DROP DOWN
            ?>

				</div>
			</div>
			<?php 
        }
        ?>

		</div>

		<div id="tag-fields" class="hide-fields" style="clear:both;padding-top:10px;">
			<h4 id="tumblog-tags-title"><label for="tumblog-tags">Tags</label></h4>
			<div>
				<input name="tumblog-tags" id="tumblog-tags" tabindex="6" autocomplete="off" value="" type="text">
			</div>
		</div>

		<div id="tumblog-submit-fields" class="hide-fields">
			<input name="tumblogsubmit" type="submit" id="tumblogsubmit" class="button-primary" tabindex="7" value="Submit" onclick="return validateInput();" />
			<input name="tumblogreset" type="reset" id="tumblogreset" class="button" tabindex="8" value="Reset" />
		</div>

		</form>

	</div><div id="debug-tumblog"></div>

	<?php 
    }
}
Esempio n. 27
0
function dropdown_categories($default = 0, $parent = 0, $popular_ids = array())
{
    global $post_ID;
    wp_category_checklist($post_ID);
}
Esempio n. 28
0
/**
 * {@internal Missing Short Description}}
 *
 * @since 0.71
 * @deprecated 2.6.0
 * @deprecated Use wp_category_checklist()
 * @see wp_category_checklist()
 *
 * @param unknown_type $default
 * @param unknown_type $parent
 * @param unknown_type $popular_ids
 */
function dropdown_categories($default = 0, $parent = 0, $popular_ids = array())
{
    _deprecated_function(__FUNCTION__, '2.6', 'wp_category_checklist()');
    global $post_ID;
    wp_category_checklist($post_ID);
}
Esempio n. 29
0
    <fieldset class="inline-edit-col-center inline-edit-categories"><div class="inline-edit-col">
        <span class="title inline-edit-categories-label"><?php 
_e('Categories');
?>
            <span class="catshow"><?php 
_e('[more]');
?>
</span>
            <span class="cathide" style="display:none;"><?php 
_e('[less]');
?>
</span>
        </span>  
        <ul class="cat-checklist">
            <?php 
wp_category_checklist();
?>
        </ul>    
    </div></fieldset>

    <div class="heybutton heypostremove">Remove</div>
    
</div>
<div class="submit"><input type="submit" name="Submit" value="Create" /></div>
</form>
</div>
<?php 
if (isset($_POST['submitted'])) {
    ?>
<div id="sideblock" style="float:right;width:220px;margin-left:10px;">
<div id="postedlabel">POSTed</div>
Esempio n. 30
-1
 /**
  * Retrieves the panel content for the Output panel.
  *
  * @since 2.0.0
  *
  * @param string HTML string of panel content.
  */
 public function get_output_panel_content()
 {
     $html = array();
     $html['enabled'] = $this->get_checkbox_field('enabled', $this->get_checkbox_setting('display', 'enabled', 1), __('Enable optin on site?', 'optin-monster'), __('The optin will not be displayed on this site unless this setting is checked.', 'optin-monster'));
     $html['global'] = $this->get_checkbox_field('global', $this->get_checkbox_setting('display', 'global', 0), __('Load optin globally?', 'optin-monster'), __('If checked, the optin code will be loaded on all pages of your site.', 'optin-monster'));
     $html['never'] = $this->get_custom_field('never', $this->get_post_selection('never', (array) $this->get_display_setting('never')), __('Never load optin on:', 'optin-monster'), __('Never loads the optin on the selected posts.', 'optin-monster'));
     $html['exclusive'] = $this->get_custom_field('exclusive', $this->get_post_selection('exclusive', (array) $this->get_display_setting('exclusive')), __('Load optin exclusively on:', 'optin-monster'), __('Loads the optin only on the selected posts.', 'optin-monster'));
     // Possibly load the categories setting if they exist.
     $categories = get_categories();
     if ($categories) {
         ob_start();
         wp_category_checklist(0, 0, (array) $this->get_display_setting('categories'), false, null, false);
         $value = ob_get_clean();
         $html['categories'] = $this->get_custom_field('categories', $value, __('Load on post categories:', 'optin-monster'), __('Loads the optin on posts that are in one of the selected categories.', 'optin-monster'));
     }
     $html['show'] = $this->get_custom_field('show', $this->get_optin_show_fields(), __('Load optin on:', 'optin-monster'), __('Loads the optin on posts that match the selection criteria.', 'optin-monster'));
     // Allow fileds to be filtered.
     $html = apply_filters('optin_monster_panel_output_fields', $html, $this);
     return apply_filters('optin_monster_panel_output', implode("\n", $html), $html, $this);
 }