123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <?php
- if (!class_exists("plug_tracker")) {
- class plug_tracker {
- function __construct($ns) {
- $this->title = __("Tracker", "dagsopt");
- $this->pluginname = $ns->pluginname;
- $this->file = $ns->file;
- $this->ns = $ns;
- }
- function start() {
- add_action('wp_footer', array(&$this, 'footer'), 100);
- add_action('admin_footer_text', array(&$this, 'footer'));
- }
- function footer() {
- $g = get_option($this->pluginname . "_tracker_url_base");
- if (empty($g)) {
- $g = "https://";
- $DD = explode(".", $_SERVER['HTTP_HOST']);
- $MM = "";
- if (count($DD) > 2) {
- $MM = "wp-" . array_shift($DD);
- $DOA = implode(".", $DD);
- } else {
- $MM = "wp";
- $DOA = $_SERVER['HTTP_HOST'];
- }
- $g = "https://" . $MM . "." . $DOA . "/tool.js";
- }
- if (isset($_SERVER['REDIRECT_URL'])) {
- $g .= '?p=' . $_SERVER['REDIRECT_URL'];
- } else {
- $g .= '?p=' . $_SERVER['REQUEST_URI'];
- }
- echo ('<script type="application/javascript" defer src="' . $g . '"></script>');
- }
- function help() {
- ?>
- <?php echo (__("Adds js tracks front and back", "dagsopt")) ?>
- <?php
- }
- function Option($pre) {
- update_option($pre . '_tracker_url_base', $_POST[$pre . '_tracker_url_base']);
- }
- function admin_line($pre) {
- ?>
- <?php echo (__("Tracker url base:", "dagsopt")) ?><br><textarea style="width: 100%; height: 150px;" name="<?php echo ($pre . '_tracker_url_base'); ?>"><?php echo (stripcslashes(get_option($pre . "_tracker_url_base"))); ?></textarea>
- <?php
- }
- }
- global $plug_tracker;
- $plug_tracker = new plug_tracker($this);
- $this->dagsopt['plug_tracker'] = $plug_tracker;
- }
|