當前位置: 首頁>>代碼示例>>PHP>>正文


PHP GoogleSitemapGenerator::GetRedirectLink方法代碼示例

本文整理匯總了PHP中GoogleSitemapGenerator::GetRedirectLink方法的典型用法代碼示例。如果您正苦於以下問題:PHP GoogleSitemapGenerator::GetRedirectLink方法的具體用法?PHP GoogleSitemapGenerator::GetRedirectLink怎麽用?PHP GoogleSitemapGenerator::GetRedirectLink使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在GoogleSitemapGenerator的用法示例。


在下文中一共展示了GoogleSitemapGenerator::GetRedirectLink方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: HtmlShowOptionsPage

    /**
     * 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);
//.........這裏部分代碼省略.........
開發者ID:SymbiSoft,項目名稱:litprojects,代碼行數:101,代碼來源:sitemap-ui.php

示例2: HtmlShowOptionsPage


//.........這裏部分代碼省略.........
            }
            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>
開發者ID:songsanren,項目名稱:My-blog,代碼行數:67,代碼來源:sitemap-ui.php


注:本文中的GoogleSitemapGenerator::GetRedirectLink方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。