Exemplo n.º 1
0
function xt_admin_notices()
{
    global $wpdb;
    $option_env = get_option(XT_OPTION_ENV);
    $env = IS_BAE ? 'BAE' : (IS_SAE ? 'SAE' : 'VPS');
    if (empty($option_env)) {
        update_option(XT_OPTION_ENV, $env);
    } else {
        if ($env != $option_env) {
            update_option(XT_OPTION_ENV, $env);
        }
    }
    $permalink_structure = get_option('permalink_structure');
    if (empty($permalink_structure)) {
        add_action('admin_notices', 'xt_admin_notice_permalink_structure');
        return true;
    }
    //HOME
    $base = xt_base();
    if (!empty($base)) {
        $home_id = $wpdb->get_var("SELECT id FROM `" . $wpdb->posts . "` WHERE `post_name` = '" . $base . "'\tAND `post_type` != 'revision'");
        if (empty($home_id)) {
            require_once XT_PLUGIN_DIR . '/xt-core/xt-installer-functions.php';
            $home_id = xt_install_home();
        }
    }
    //MENUS
    $global = get_option(XT_OPTION_GLOBAL);
    if (!$global['isMenu']) {
        require_once XT_PLUGIN_DIR . '/xt-core/xt-installer-functions.php';
        xt_install_menu($global);
    }
    $isInstalled = get_option(XT_OPTION_INSTALLED);
    if (!$isInstalled) {
        add_action('admin_notices', 'xt_admin_notice_installing');
    } else {
        if (!file_exists(get_template_directory() . '/xt-page.php')) {
            if (!@copy(XT_THEME_PATH . '/xt-page.php', get_template_directory() . '/xt-page.php')) {
                add_action('admin_notices', 'xt_admin_notice_template');
                return true;
            }
        }
        $app = xt_is_ready();
        if (empty($app)) {
            add_action('admin_notices', 'xt_admin_notice_app');
            return true;
        }
        $app = xt_taobao_is_ready();
        if (empty($app)) {
            add_action('admin_notices', 'xt_admin_notice_app_taobao');
            return true;
        }
        if (!isset($app['tkpid']) || empty($app['tkpid'])) {
            add_action('admin_notices', 'xt_admin_notice_app_taobao_tkpid');
            return true;
        }
        if (!isset($app['s8pid']) || empty($app['s8pid'])) {
            add_action('admin_notices', 'xt_admin_notice_app_taobao_s8pid');
            return true;
        }
        //        $app = xt_taobao_is_session_ready();
        //        if (empty($app)) {
        //            add_action('admin_notices', 'xt_admin_notice_app_taobao_session');
        //            return true;
        //        }
        $app = xt_paipai_is_ready();
        if (empty($app)) {
            add_action('admin_notices', 'xt_admin_notice_app_paipai');
            return true;
        }
        $app = xt_paipai_is_session_ready();
        if (empty($app)) {
            add_action('admin_notices', 'xt_admin_notice_app_paipai_session');
            return true;
        }
    }
}
Exemplo n.º 2
0
            <th class="manage-column" style="width: 60px"><span>状态</span></th>
        </tr>
    </tfoot>
    <tbody id="the-list" class="list:tag">
        <?php 
$_order_count = 0;
foreach ($_orders as $order) {
    xt_row_order($order, $_order_count, 'paipai');
    $_order_count++;
}
?>
    </tbody>
</table>
<div id="X_Fanxian-Order-Get-Box" style="display:none;">
    <?php 
if (xt_paipai_is_session_ready()) {
    $_currentDate = date('Y-m-d', time());
    ?>
        <p>手动获取订单时间段最多只能选择30天。已经获取了的交易记录将自动忽略。</p>
        <p id="X_Fanxian-Order-Get-Date" style="text-align:center;">
            <input type="text" value="<?php 
    echo date('Y-m-d', strtotime("-7 day"));
    ?>
" id="X_Fanxian-Order-StartDate">&nbsp;至&nbsp;
            <input type="text" value="<?php 
    echo $_currentDate;
    ?>
" id="X_Fanxian-Order-EndDate">
        </p>
        <p style="text-align:center;">
            <input id="X_Fanxian-Order-Get-Submit" type="button" class="button-primary" value="获取交易记录">