Example #1
0
/** Baidu sitemap page **/
function baidu_sitemap_optionpage()
{
    /** Perform any action **/
    if (isset($_POST["action"])) {
        if ($_POST["action"] == 'build_options') {
            update_baidu_sitemap();
        }
        if ($_POST["action"] == 'build_xml') {
            build_baidu_sitemap();
        }
    }
    /** Definition **/
    echo '<div class="wrap"><div style="background: url(' . GetPluginUrl() . 'img/liucheng_name32.png) no-repeat;" class="icon32"><br /></div>';
    echo '<h2>Baidu Sitemap Generator</h2>';
    /** Introduction **/
    echo '<p>' . _e('This pulgin generates a Baidu XML-Sitemap for WordPress Blog. Also Build a real Static Sitemap-Page for all Search Engine.', 'baidu_sitemap') . '</p>';
    /** show the option Form **/
    baidu_sitemap_form();
    //test_form();
    /** Show the plugins Author **/
    lc_sidebar();
    //echo '</div>';
}
Example #2
0
function baidu_sitemap_by_post($post_ID)
{
    $get_baidu_sitemap_options = get_option(NEW_BAIDU_SITEMAP_OPTION);
    if (isset($get_baidu_sitemap_options['lc_is_update_sitemap_when_post'])) {
        if ($get_baidu_sitemap_options['lc_is_update_sitemap_when_post'] == '1') {
            build_baidu_sitemap();
        }
    }
    return $post_ID;
}