public function introduction() {
		admin_header(_r('Google Reader Importer'));
?>
<h1><?php _e('Google Reader Importer') ?></h1>
<p><?php _e('There are several ways to import from Google Reader.'); ?></p>
<h2><?php _e('Method 1'); ?></h2>
<p><?php printf(
	_r('<a href="%1$s">Export</a> your feeds from Google reader and then use the <a href="%2$s">OPML importer</a>.'),
	'http://www.google.com/reader/subscriptions/export',
	'feed-import.php?service=opml'
	); ?></p>
<h2><?php _e('Method 2'); ?></h2>
<p><?php _e("We can grab your OPML file for you, but we'll need your username and password. This information won't be stored anywhere and is only used once. (It sucks, we know, but Google doesn't offer any other way.)"); ?>
<form action="feed-import.php" method="POST">
	<button id="continue"><?php _e('Start Method 2'); ?></button>
	<fieldset id="greader">
		<legend><?php _e('Import Feeds'); ?></legend>
		<div class="row">
			<label for="user"><?php _e('Username (Email address)'); ?>:</label>
			<input type="text" name="user" id="user" />
		</div>
		<div class="row">
			<label for="pass"><?php _e('Password'); ?>:</label>
			<input type="password" name="pass" id="pass" />
		</div>
		<input type="submit" value="<?php _e('Import'); ?>" class="submit" name="submit" />
		<input type="hidden" name="step" value="1" />
		<input type="hidden" name="service" value="opml" />
	</fieldset>
</form>
<?php
		admin_footer();
	}
Example #2
0
function rss_login_form($uname = null, $pass = null)
{
    admin_header();
    echo "\n<div id=\"channel_admin\" class=\"frame\">";
    echo "<form id=\"admin_login\" onsubmit=\"return loginHandler();\" \n\t\tstyle=\"text-align:center\" action=\"" . $_SERVER['PHP_SELF'] . "\" method=\"post\">\n" . "<fieldset>" . "<legend>" . __('Please log in') . "</legend>\n" . "<p><label style=\"display:block\" for=\"username\">" . __('Username') . ":</label>\n" . "<input type=\"text\" id=\"username\" name=\"username\" /></p>\n" . "<p><label style=\"display:block\" for=\"password\">" . __('Password') . ":</label>\n" . "<input type=\"password\" id=\"password\" name=\"password\" /></p>\n" . "<p id=\"admin_login_submit\"><input type=\"submit\" value=\"" . __('Login') . "\" /></p>\n" . "<span style=\"display:inline;\" id=\"admin_login_result\"></span>\n" . "</fieldset>\n" . "</form>\n";
    echo "</div>\n";
    admin_footer();
    exit;
}
Example #3
0
					<td><a href="settings.php?deactivate_plugin=<?php 
        echo $plugin_file;
        ?>
"><?php 
        _e('Dectivate');
        ?>
</a></td>
<?php 
    } else {
        ?>
					<td><a href="settings.php?activate_plugin=<?php 
        echo $plugin_file;
        ?>
"><?php 
        _e('Activate');
        ?>
</a></td>
<?php 
    }
    ?>
				</tr>
<?php 
}
?>
			</tbody>
		</table>
	</fieldset>
</form>
<?php 
admin_footer();
Example #4
0
function admin_msg($message, $url_forward = '', $msgtype = 'message', $extra = '')
{
    extract($GLOBALS, EXTR_SKIP);
    eval("\$message = \"" . (isset($msglang[$message]) ? $msglang[$message] : $message) . "\";");
    if ($msgtype == 'form') {
        $message = "<form method=\"post\" action=\"{$url_forward}\">" . "<br><br><br>{$message}{$extra}<br><br><br><br>\n" . "<input type=\"submit\" name=\"confirmed\" value=\"{$lang['ok']}\"> &nbsp; \n" . "<input type=\"button\" value=\"{$lang['cancel']}\" onClick=\"history.go(-1);\"></form><br>";
    } else {
        if ($url_forward) {
            $message .= "<br><br><br><a href=\"{$url_forward}\">{$lang['message_redirect']}</a>";
            $url_forward = transsid($url_forward);
            $message .= "<script>setTimeout(\"redirect('{$url_forward}');\", 1250);</script>";
        } elseif (strpos($message, $lang['return'])) {
            $message .= "<br><br><br><a href=\"javascript:history.go(-1);\" class=\"mediumtxt\">{$lang['message_return']}</a>";
        }
        $message = "<br><br><br>{$message}{$extra}<br><br>";
    }
    echo "<br><br><br><br><br>\r\n<table cellspacing=1 cellpadding=0 width=80% align=center class=tableborder>\r\n<tr class=header><td height=25>&nbsp;&nbsp;{$lang['cyask_message']}</td></tr>\r\n<tr><td bgcolor=#FFFFFF align=center>\r\n<table border=0 width=90% cellspacing=0 cellpadding=0>\r\n<tr><td width=100% align=center>\r\n{$message}<br /><br />\r\n</td></tr></table>\r\n</td></tr></table>\r\n<br><br><br>";
    admin_footer();
}
 protected function import()
 {
     if (!empty($_POST['cancel']) && $_POST['cancel'] == 'cancel') {
         header('HTTP/1.1 302 Found', true, 302);
         header('Location: ' . get_option('baseurl') . 'admin/feed-import.php');
         die;
     }
     if (empty($_POST['url']) && empty($_FILES['file'])) {
         $_POST['step']--;
         $this->dispatch();
         return;
     }
     admin_header(_r('Other (OPML) Importer'));
     try {
         $opml = '';
         if (!empty($_POST['url'])) {
             $http = new HTTPRequest('', 10, 'Lilina/' . LILINA_CORE_VERSION);
             $opml = $http->get($opml_url);
             $opml = $opml->body;
         }
         if (!empty($_FILES['file'])) {
             $opml = file_get_contents($_FILES['file']['tmp_name']);
         }
         $feeds = $this->import_opml($opml);
         import($feeds);
     } catch (Exception $e) {
         $this->error($e);
     }
     admin_footer();
     return;
 }
Example #6
0
# Requerir instacia de Wordpress.
require_once './wp-config.php';
# Requerir funciones de administración.
require_once APP_PATH . '/escritorio/admin_functions.php';
if (is_user_logged_in() && current_user_can('administrator')) {
    echo admin_header();
    require_once APP_PATH . '/escritorio/Menu.js.php';
    if ($_GET['jsfile']) {
        $jsfile = sanitize_text_field(trim($_GET['jsfile'])) . '.js.php';
        if ($jsfile == 'FormImportarUsers.js.php') {
            if ($_SESSION['super'] == 'true') {
                require_once APP_PATH . '/escritorio/' . $jsfile;
            }
        } else {
            if ($jsfile == 'FormMDigitalXpath.js.php') {
                if ($_SESSION['super'] == 'true') {
                    require_once APP_PATH . '/escritorio/' . $jsfile;
                }
            } else {
                require_once APP_PATH . '/escritorio/' . $jsfile;
            }
        }
    }
    require_once APP_PATH . '/escritorio/FormAbout.js.php';
    require_once APP_PATH . '/escritorio/FormLogout.js.php';
    require_once APP_PATH . '/escritorio/FormManual.js.php';
    require_once APP_PATH . '/escritorio/FormPassword.js.php';
    echo admin_footer();
} else {
    wp_redirect(APP_URL . '/escritorio/index.php');
}
Example #7
0
 protected function import()
 {
     admin_header($this->name);
     try {
         // I'm not in favour of allowing user input to pass through
         // unsanitized, but it's URL encoded in the request library, so
         // we'll let Google handle it.
         $this->api = new GoogleReaderAPI($_POST['user'], $_POST['pass']);
         $this->api->connect();
         $opml = $this->api->call();
         $feeds = $this->import_opml($opml);
         import($feeds);
     } catch (Exception $e) {
         $this->error($e);
     }
     admin_footer();
 }
 protected function import()
 {
     if (empty($_POST['url'])) {
         $_POST['step']--;
         $this->dispatch();
         return;
     }
     admin_header(_r('Other (OPML) Importer'));
     import($this->import_opml($_POST['url']));
     admin_footer();
     return;
 }
Example #9
0
    public function admin_page()
    {
        if (isset($_POST['clear'])) {
            $this->log = array();
            $this->save_log();
            header('HTTP/1.1 302 Found', true, 302);
            header('Location: ' . get_option('baseurl') . 'admin/admin.php?page=usl-admin&cleared=1');
            die;
        }
        $this->log = get_option('updaterspeedlog-log', array());
        // Adding it here to avoid putting on other pages
        add_action('admin_header', array(&$this, 'admin_header'));
        admin_header('Updater Speed Log');
        if (!empty($_GET['cleared'])) {
            echo '<div class="message"><p>Cleared log.</p></div>';
        }
        $feeds = array();
        foreach ($this->log as $item) {
            if ($item['name'] == 'Starting feed processing') {
                $feeds[$item['feed']] = array('start' => $item['time'], 'processed' => 0, 'added' => 0);
            } elseif ($item['name'] == 'Loaded feed') {
                $feeds[$item['feed']]['loaded'] = $item['time'];
            } elseif ($item['name'] == 'Finish feed processing') {
                echo '<tr></tr>';
                $feeds[$item['feed']]['finish'] = $item['time'];
            } elseif ($item['name'] == 'Item about to be checked') {
                $feeds[$item['feed']]['processed']++;
            } elseif ($item['name'] == 'Added item to database') {
                $feeds[$item['feed']]['added']++;
            }
        }
        ?>
		<h1>Updater Speed Log</h1>
<?php 
        if (empty($this->log)) {
            ?>
		<p>No logging data yet! Try updating your feeds.</p>
<?php 
        } else {
            ?>
		<form action="" method="POST" id="clear-form">
			<input type="hidden" name="clear" value="clear" />
			<button type="submit">Clear log</button>
		</form>
		<h2>Summary</h2>
		<table class="item-table">
			<thead>
				<tr>
					<th>Feed</th>
					<th>Load Time</th>
					<th>Time Processing</th>
					<th>Total Time</th>
					<th>Items Processed</th>
					<th><abbr title="Average">Avg</abbr> Processing Time Per Item</th>
				</tr>
			</thead>
			<tbody>
<?php 
            foreach ($feeds as $id => $feed) {
                $the_feed = Feeds::get_instance()->get($id);
                $avg_time = $feed['finish'] - $feed['loaded'];
                $avg_time = $avg_time / $feed['processed'];
                ?>
				<tr id="feed-<?php 
                echo $id;
                ?>
">
					<td><?php 
                echo $the_feed['name'];
                ?>
</td>
					<td><?php 
                echo round($feed['loaded'] - $feed['start'], 3);
                ?>
</td>
					<td><?php 
                echo round($feed['finish'] - $feed['loaded'], 3);
                ?>
</td>
					<td><?php 
                echo round($feed['finish'] - $feed['start'], 3);
                ?>
</td>
					<td><?php 
                echo $feed['added'] . ' / ' . $feed['processed'];
                ?>
</td>
					<td><?php 
                echo round($avg_time, 3);
                ?>
</td>
				</tr>
<?php 
            }
            ?>
			</tbody>
		</table>
		<h3>Full Log</h3>
		<table class="item-table" id="full-log">
			<thead>
				<tr>
					<th>Type</th>
					<th>Time Since Init</th>
					<th>Feed</th>
				</tr>
			</thead>
			<tbody>
<?php 
            $start = 0;
            foreach ($this->log as $item) {
                $class = '';
                if ($item['name'] == 'Initialized Lilina') {
                    $start = $item['time'];
                    $class = ' init';
                }
                if ($item['name'] == 'Skipped item') {
                    $class = ' skipped';
                }
                if ($item['name'] == 'Added item to database') {
                    $class = ' added';
                }
                $feed = Feeds::get_instance()->get($item['feed']);
                $since = round($item['time'] - $start, 3);
                if (!$feed) {
                    $feed = array('name' => 'n/a');
                }
                ?>
				<tr class="<?php 
                echo $class;
                ?>
">
					<td><?php 
                echo $item['name'];
                ?>
</td>
					<td><?php 
                echo $since;
                ?>
</td>
					<td><a href="#feed-<?php 
                echo $item['feed'];
                ?>
"><?php 
                echo $feed['name'];
                ?>
</a></td>
				</tr>
<?php 
                if ($item['name'] == 'Finish feed processing') {
                    echo '
				<tr class="header">
					<th>Type</th>
					<th>Time Since Init</th>
					<th>Feed</th>
				</tr>';
                }
            }
            ?>
			</tbody>
		</table>
		<script type="text/javascript">
		jQuery(document).ready(function ($) {
			$("#full-log").hide();
			$("<p class='hideshow'><span>Show full log</span></p>").insertBefore("#full-log").click(function () {
				$("#full-log").show();
				$(this).hide();
			});
		});
		</script>
<?php 
        }
        admin_footer();
    }