예제 #1
0
 public static function get_instance()
 {
     if (!isset(self::$instance)) {
         self::$instance = new self();
     }
     return self::$instance;
 }
예제 #2
0
    public function render_page()
    {
        if (!current_user_can('manage_options')) {
            wp_die(__('Access Denied', 'live-blogging'));
        } else {
            ?>
			<div class="wrap">
				<h2><?php 
            _e('Meteor Status', 'live-blogging');
            ?>
</h2>
				<pre><?php 
            LiveBlogging::get_instance()->updater->fetch_stats();
            ?>
</pre>
			</div><?php 
        }
    }
예제 #3
0
    public static function process_shortcode($atts, $id = null)
    {
        global $post;
        if (!empty($id)) {
            $id = 'legacy-' . $id;
        } else {
            $id = $post->ID;
        }
        $liveblog = new self($id);
        ob_start();
        if (LiveBlogging_Setting_UpdateMethod::is_enabled() && $liveblog->is_active_liveblog()) {
            LiveBlogging::get_instance()->updater->javascript();
        }
        ?>
		<div id="liveblog-<?php 
        echo esc_attr($id);
        ?>
">
			<?php 
        foreach ($liveblog->get_liveblog_entries() as $entry) {
            ?>
				<div id="liveblog-entry-<?php 
            echo esc_attr($entry->id);
            ?>
"><?php 
            $entry->body();
            ?>
</div>
			<?php 
        }
        ?>
		</div><?php 
        $content = ob_get_contents();
        ob_end_clean();
        return $content;
    }
예제 #4
0
<?php

/*
    Live Blogging for WordPress
    Copyright (C) 2010 Chris Northwood <*****@*****.**>

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License along
    with this program; if not, write to the Free Software Foundation, Inc.,
    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
// Twitter callback - save access token
require '../../../wp-blog-header.php';
LiveBlogging::get_instance()->twitter->handle_callback();
header('Location: ' . get_bloginfo('wpurl') . '/wp-admin/options-general.php?page=live-blogging-options');
예제 #5
0
/*
Plugin Name: Live Blogging
Plugin URI: http://cnorthwood.github.io/liveblogging/
Description: Plugin to support automatic live blogging
Version: 2.3
Author: Chris Northwood
Author URI: http://www.pling.org.uk/
Text-Domain: live-blogging

Live Blogging for WordPress
Copyright (C) 2010-2013 Chris Northwood <*****@*****.**>
Contributors: Gabriel Koen, Corey Gilmore, Juliette

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
require 'LiveBlogging.php';
LiveBlogging::get_instance()->init();
예제 #6
0
    public function render()
    {
        ?>
		<div class="wrap">
			<h2><?php 
        _e('Live Blogging Options', 'live-blogging');
        ?>
</h2>

			<?php 
        if (LiveBlogging_Legacy::exists()) {
            ?>
				<?php 
            $this->render_migration_prompt();
            ?>
			<?php 
        }
        ?>


			<form method="post" action="options.php">
				<?php 
        settings_fields('live-blogging');
        ?>
				<h3><?php 
        _e('Automatic Updating', 'live-blogging');
        ?>
</h3>
				<table class="form-table">
					<?php 
        $this->render_setting('LiveBlogging_Setting_UpdateMethod');
        ?>
					<?php 
        $this->render_setting('LiveBlogging_Setting_Comments');
        ?>
					<?php 
        $this->render_setting('LiveBlogging_Setting_TimedUpdatedFrequency');
        ?>
				</table>

				<h3><?php 
        _e('Posting to Twitter', 'live-blogging');
        ?>
</h3>
				<table class="form-table">
					<?php 
        if (function_exists('curl_init')) {
            ?>
						<?php 
            LiveBlogging::get_instance()->twitter->render_admin();
            ?>
					<?php 
        } else {
            ?>
						<tr>
							<td colspan="2">
								<strong><em>
									<?php 
            _e('Twitter functionality disabled due to missing PHP CURL module', 'live-blogging');
            ?>
								</em></strong>
							</td>
						</tr>
					<?php 
        }
        ?>
					<?php 
        if (LiveBlogging::get_instance()->twitter->twitter_authorised()) {
            ?>
						<?php 
            $this->render_setting('LiveBlogging_Setting_Twitter');
            ?>
						<?php 
            $this->render_setting('LiveBlogging_Setting_TwitterComments');
            ?>
					<?php 
        }
        ?>
				</table>

				<h3><?php 
        _e('Live Blog Style', 'live-blogging');
        ?>
</h3>
				<table class="form-table">
					<?php 
        $this->render_setting('LiveBlogging_Setting_UpdateStyle');
        ?>
					<?php 
        $this->render_setting('LiveBlogging_Setting_DateStyle');
        ?>
					<?php 
        $this->render_setting('LiveBlogging_Setting_PostStyle');
        ?>
				</table>

				<h3><?php 
        _e('Meteor Configuration', 'live-blogging');
        ?>
</h3>
				<table class="form-table">
					<?php 
        $this->render_setting('LiveBlogging_Setting_MeteorSubscriber');
        ?>
					<?php 
        $this->render_setting('LiveBlogging_Setting_MeteorController');
        ?>
					<?php 
        $this->render_setting('LiveBlogging_Setting_MeteorControllerPort');
        ?>
					<?php 
        $this->render_setting('LiveBlogging_Setting_MeteorNamespace');
        ?>
				</table>

				<h3><?php 
        _e('Advanced Settings', 'live-blogging');
        ?>
</h3>
				<table class="form-table">
					<?php 
        $this->render_setting('LiveBlogging_Setting_ContentHooks');
        ?>
				</table>

				<p class="submit">
					<input type="submit" class="button-primary" value="<?php 
        _e('Save Changes');
        ?>
" />
				</p>

			</form>
		</div>
		<?php 
    }