コード例 #1
0
    function sr_console_common()
    {
        ?>
		<div class="wrap">
		<!-- <div id="icon-smart-reporter" class="icon32"><br /> -->
		</div>
		<style>
		    div#TB_window {
		        background: lightgrey;
		    }
		</style>    
		<?php 
        if (SR_WPSC_RUNNING === true) {
            $json_filename = 'json';
        } else {
            if (SR_WOO_RUNNING === true) {
                $json_filename = 'json-woo';
            }
        }
        define('SR_JSON_URL', SR_PLUGIN_DIRNAME . "/sr/{$json_filename}.php");
        //set the number of days data to show in lite version.
        define('SR_AVAIL_DAYS', 30);
        $latest_version = get_latest_version(SR_PLUGIN_FILE);
        $is_pro_updated = is_pro_updated();
        if (isset($_GET['action']) && $_GET['action'] == 'sr-settings') {
            sr_settings_page(SR_PLUGIN_FILE);
        } else {
            $base_path = WP_PLUGIN_DIR . '/' . str_replace(basename(__FILE__), "", plugin_basename(__FILE__)) . 'sr/';
            ?>
		<div class="wrap">
		<div id="icon-smart-reporter" class="icon32"><img alt="Smart Reporter"
			src="<?php 
            echo SR_IMG_URL . '/logo.png';
            ?>
"></div>
		<h2><?php 
            echo _e('Smart Reporter');
            echo ' ';
            if (SRPRO === true) {
                echo _e('Pro');
            } else {
                echo _e('Lite');
            }
            ?>


   	<p class="wrap" style="font-size: 12px">
	   	<span style="float: right;margin-right: 2.25em;"> <?php 
            if (SRPRO === true && !is_multisite()) {
                if (SR_WPSC_RUNNING == true) {
                    $plug_page = 'wpsc';
                } elseif (SR_WOO_RUNNING == true) {
                    $plug_page = 'woo';
                }
            } else {
                $before_plug_page = '';
                $after_plug_page = '';
                $plug_page = '';
            }
            if (isset($_GET['tab']) && $_GET['tab'] == "smart_reporter_old") {
                $switch_version = '<a href="' . admin_url('admin.php?page=smart-reporter-woo') . '" title="' . __('Switch back to new version', 'smart-reporter') . '"> ' . __('Switch back to new version', 'smart-reporter') . '</a>';
            } else {
                $switch_version = '<a href="' . admin_url('admin.php?page=smart-reporter-woo&tab=smart_reporter_old') . '" title="' . __('Switch to earlier version', 'smart-reporter') . '"> ' . __('Problem? Switch to earlier version', 'smart-reporter') . '</a>';
            }
            if (SRPRO === true) {
                if (!wp_script_is('thickbox')) {
                    if (!function_exists('add_thickbox')) {
                        require_once ABSPATH . 'wp-includes/general-template.php';
                    }
                    add_thickbox();
                }
                // <a href="edit.php#TB_inline?max-height=420px&inlineId=smart_manager_post_query_form" title="Send your query" class="thickbox" id="support_link">Need Help?</a>
                $before_plug_page = ' | <a href="admin.php#TB_inline?max-height=420px&inlineId=sr_post_query_form" title="Send your query" class="thickbox" id="support_link">Feedback / Help?</a>';
                // if ( !isset($_GET['tab']) && ( isset($_GET['page']) && $_GET['page'] == 'smart-reporter-woo') && SR_BETA == "true") {
                // 	// $before_plug_page .= ' | <a href="#" class="show_hide" rel="#slidingDiv">Settings</a>';
                // 	$after_plug_page = '';
                // 	$plug_page = '';
                // }
                // else {
                $before_plug_page .= ' | <a href="admin.php?page=smart-reporter-';
                $after_plug_page = '&action=sr-settings">Settings</a>';
                // }
            }
            printf(__('%1s%2s%3s%4s'), $switch_version, $before_plug_page, $plug_page, $after_plug_page);
            ?>
		</span>
		<?php 
            echo __('Store analysis like never before.');
            ?>
	</p>
	<h6 align="right"><?php 
            if (isset($is_pro_updated) && !$is_pro_updated) {
                $admin_url = ADMIN_URL . "plugins.php";
                $update_link = "An upgrade for Smart Reporter Pro  {$latest_version} is available. <a align='right' href={$admin_url}> Click to upgrade. </a>";
                sr_display_notice($update_link);
            }
            ?>
   </h6>
   <h6 align="right">
</h2>
</div>

<?php 
            if (SRPRO === false) {
                ?>
<div id="message" class="updated fade">
<p><?php 
                printf(__("<b>Important:</b> To get the sales and sales KPI's for more than 30 days upgrade to Pro . Take a <a href='%2s' target=_livedemo> Live Demo here </a>."), 'http://demo.storeapps.org/');
                ?>
</p>
</div>
<?php 
            }
            $error_message = '';
            if (file_exists(WP_PLUGIN_DIR . '/wp-e-commerce/wp-shopping-cart.php') && file_exists(WP_PLUGIN_DIR . '/woocommerce/woocommerce.php')) {
                if (isset($_GET['post_type']) && $_GET['post_type'] == 'wpsc-product' || isset($_GET['page']) && $_GET['page'] == 'smart-reporter-wpsc') {
                    if (is_plugin_active('wp-e-commerce/wp-shopping-cart.php')) {
                        require_once WPSC_FILE_PATH . '/wp-shopping-cart.php';
                        if (defined('SR_IS_WPSC37') && SR_IS_WPSC37 || defined('SR_IS_WPSC38') && SR_IS_WPSC38) {
                            if (file_exists($base_path . 'reporter-console.php')) {
                                include_once $base_path . 'reporter-console.php';
                                return;
                            } else {
                                $error_message = __("A required Smart Reporter file is missing. Can't continue.", 'smart-reporter');
                            }
                        } else {
                            $error_message = __('Smart Reporter currently works only with WP e-Commerce 3.7 or above.', 'smart-reporter');
                        }
                    }
                } else {
                    if (is_plugin_active('woocommerce/woocommerce.php')) {
                        if (defined('SR_IS_WOO13') && SR_IS_WOO13 == "true") {
                            $error_message = __('Smart Reporter currently works only with WooCommerce 1.4 or above.', 'smart-reporter');
                        } else {
                            if (file_exists($base_path . 'reporter-console.php')) {
                                include_once $base_path . 'reporter-console.php';
                                return;
                            } else {
                                $error_message = __("A required Smart Reporter file is missing. Can't continue.", 'smart-reporter');
                            }
                        }
                    } else {
                        $error_message = "<b>" . __('Smart Reporter', 'smart-reporter') . "</b> " . __('add-on requires', 'smart-reporter') . " " . '<a href="http://www.storeapps.org/wpec/">' . __('WP e-Commerce', 'smart-reporter') . "</a>" . " " . __('plugin or', 'smart-reporter') . " " . '<a href="http://www.storeapps.org/woocommerce/">' . __('WooCommerce', 'smart-reporter') . "</a>" . " " . __('plugin. Please install and activate it.', 'smart-reporter');
                    }
                }
            } else {
                if (file_exists(WP_PLUGIN_DIR . '/wp-e-commerce/wp-shopping-cart.php')) {
                    if (is_plugin_active('wp-e-commerce/wp-shopping-cart.php')) {
                        require_once WPSC_FILE_PATH . '/wp-shopping-cart.php';
                        if (defined('SR_IS_WPSC37') && SR_IS_WPSC37 || defined('SR_IS_WPSC38') && SR_IS_WPSC38) {
                            if (file_exists($base_path . 'reporter-console.php')) {
                                include_once $base_path . 'reporter-console.php';
                                return;
                            } else {
                                $error_message = __("A required Smart Reporter file is missing. Can't continue.", 'smart-reporter');
                            }
                        } else {
                            $error_message = __('Smart Reporter currently works only with WP e-Commerce 3.7 or above.', 'smart-reporter');
                        }
                    } else {
                        $error_message = __('WP e-Commerce plugin is not activated.', 'smart-reporter') . "<br/><b>" . _e('Smart Reporter', 'smart-reporter') . "</b> " . _e('add-on requires WP e-Commerce plugin, please activate it.', 'smart-reporter');
                    }
                } else {
                    if (file_exists(WP_PLUGIN_DIR . '/woocommerce/woocommerce.php')) {
                        if (is_plugin_active('woocommerce/woocommerce.php')) {
                            if (defined('SR_IS_WOO13') && SR_IS_WOO13 == "true") {
                                $error_message = __('Smart Reporter currently works only with WooCommerce 1.4 or above.', 'smart-reporter');
                            } else {
                                if (file_exists($base_path . 'reporter-console.php')) {
                                    include_once $base_path . 'reporter-console.php';
                                    return;
                                } else {
                                    $error_message = __("A required Smart Reporter file is missing. Can't continue.", 'smart-reporter');
                                }
                            }
                        } else {
                            $error_message = __('WooCommerce plugin is not activated.', 'smart-reporter') . "<br/><b>" . __('Smart Reporter', 'smart-reporter') . "</b> " . __('add-on requires WooCommerce plugin, please activate it.', 'smart-reporter');
                        }
                    } else {
                        $error_message = "<b>" . __('Smart Reporter', 'smart-reporter') . "</b> " . __('add-on requires', 'smart-reporter') . " " . '<a href="http://www.storeapps.org/wpec/">' . __('WP e-Commerce', 'smart-reporter') . "</a>" . " " . __('plugin or', 'smart-reporter') . " " . '<a href="http://www.storeapps.org/woocommerce/">' . __('WooCommerce', 'smart-reporter') . "</a>" . " " . __('plugin. Please install and activate it.', 'smart-reporter');
                    }
                }
            }
            if ($error_message != '') {
                sr_display_err($error_message);
            }
        }
    }
コード例 #2
0
ファイル: update.php プロジェクト: hshoghi/cms
    <h2>This website uses the following codebases:</h2>
</div>
<table class="listing">
	<tr>
		<th>Codebase</th>
        <th>Code Version</th>
        <th>DB Version</th>
        <th></th>
        <th></th>
	</tr>
<?php 
$codebases = get_codebases();
foreach ($codebases as $cb) {
    $codebase_name = $cb['codebase'];
    $database = $schemas[$codebase_name];
    $latest_version = get_latest_version($codebase_name);
    ?>
	<tr>
		<td><?php 
    echo $codebase_name;
    ?>
</td>
		<td>
<?php 
    if ($cb['release'] == 'stable') {
        echo $cb['version'];
    } else {
        echo 'Trunk ' . $cb['version'] . '+';
    }
    ?>
        </td>
コード例 #3
0
<?php

// Disallow direct access to this file for security reasons
if (!defined("IN_MYBB")) {
    die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
}
$page->add_breadcrumb_item("CloudFlare Manager", "index.php?module=cloudflare");
$page->add_breadcrumb_item("About Plugin", "index.php?module=cloudflare-about_plugin");
if (!$mybb->input['action']) {
    $page->output_header("CloudFlare Manager - About Plugin");
    $table = new Table();
    $table->construct_header("Item", array("colspan" => 1));
    $table->construct_header("Value", array("colspan" => 1));
    $table->construct_cell("<strong>Author</strong>", array('width' => '25%'));
    $table->construct_cell("<strong><a href=\"http://community.mybb.com/user-27579.html\" target=\"_blank\">Nathan Malcolm</a></strong>", array('width' => '25%'));
    $table->construct_row();
    $table->construct_cell("<strong>Release Date</strong>", array('width' => '200'));
    $table->construct_cell("June 18 2012", array('width' => '200'));
    $table->construct_row();
    $table->construct_cell("<strong>Compatibility</strong>", array('width' => '200'));
    $table->construct_cell("MyBB 1.6 Series", array('width' => '200'));
    $table->construct_row();
    $table->construct_cell("<strong>Version</strong>", array('width' => '200'));
    $table->construct_cell(get_version() . " (Latest: " . get_latest_version() . ")", array('width' => '200'));
    $table->construct_row();
    $table->output("About This Plugin");
    $page->output_footer();
}
コード例 #4
0
ファイル: index.php プロジェクト: deanbrabec/news_slider
            continue;
        } else {
            $var = get_page_data($p_file, false);
            if (isset($var['author']) && !empty($var['author'])) {
                $pages[$var['id']] = array('id' => $var['id'], 'timestamp' => $var['timestamp'], 'title' => $var['title'], 'friendly_url' => $var['friendly_url'], 'author' => $var['author'], 'parent_id' => 0, 'order' => $var['order']);
            } else {
                continue;
            }
        }
    }
    mn_put_contents($file['pages'], DIE_LINE . serialize($pages));
}
$auth = user_auth('0');
if (!isset($conf['admin_update_check']) || $conf['admin_update_check'] == true) {
    if (isset($_GET['check-version']) || !isset($_COOKIE['mn_latest_version'])) {
        $latest_version = get_latest_version();
        if (!empty($latest_version)) {
            setcookie('mn_latest_version', $latest_version, time() + 60 * 60 * 24 * MN_VERSION_CHECK);
        }
    } else {
        $latest_version = $_COOKIE['mn_latest_version'];
    }
    if (!empty($latest_version) && str_replace('.', '', $latest_version) > str_replace('.', '', MN_VERSION)) {
        $info['new_version'] = true;
    } else {
        $info['new_version'] = false;
    }
} else {
    $info['new_version'] = false;
}
if (isset($_COOKIE['mn_db_counts'])) {
<?php

// Disallow direct access to this file for security reasons
if (!defined("IN_MYBB")) {
    die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
}
if (get_version() == get_latest_version()) {
    flash_message("Congratulations! You are using the latest version of this plugin (" . get_latest_version() . ").", "success");
} else {
    flash_message("You are not using the latest version of this plugin. You are using " . get_version() . ", and the latest version is " . get_latest_version() . ".", "error");
}
admin_redirect("index.php?module=cloudflare");
コード例 #6
0
                    $response[$slug]['url'] = $latest_package['url'];
                }
                // Info URL
            }
        }
        if (count($response) > 0) {
            print json_encode(array('new' => $response));
        } else {
            print json_encode(array('ok' => 'no updates'));
        }
        die;
        break;
    case 'plugin_information':
        if (isset($data['get'])) {
            $slug = $data['get'];
            $latest_vesion = get_latest_version($slug);
            $latest_package = get_version_data($slug, $latest_vesion);
            if (empty($latest_package)) {
                print json_encode(array('error' => 'not found', 'reason' => 'no package for ' . $slug));
            } else {
                print json_encode(array('info' => $latest_package));
            }
            die;
        }
        // let it error out 'casue the request is invalid
        break;
}
/// go away!
http_response_code(403);
print json_encode(array('error' => 'Access denied', 'reason' => 'No direct access'));
/* eof */