public static function init_sidenotes_script()
 {
     if (!self::display_sidenotes()) {
         return false;
     }
     Livefyre_Apps::init_auth();
     LFAPPS_View::render_partial('script', array(), 'sidenotes');
 }
 /**
  * Initialise Livefyre auth
  */
 public static function init_auth()
 {
     if (self::$auth_initiated) {
         return false;
     }
     self::$auth_initiated = true;
     LFAPPS_View::render_partial('script_auth');
 }
 public static function init_shortcode($atts = array())
 {
     if (!self::show_blog()) {
         return;
     }
     if (isset($atts['article_id'])) {
         $articleId = $atts['article_id'];
         $title = isset($pagename) ? $pagename : 'Comments (ID: ' . $atts['article_id'];
         global $wp;
         $url = add_query_arg($_SERVER['QUERY_STRING'], '', home_url($wp->request));
         $tags = array();
     } else {
         global $post;
         if (get_the_ID() !== false) {
             $articleId = apply_filters('livefyre_article_id', get_the_ID());
             $title = apply_filters('livefyre_collection_title', get_the_title(get_the_ID()));
             $url = apply_filters('livefyre_collection_url', get_permalink(get_the_ID()));
             $tags = array();
             $posttags = get_the_tags($post->ID);
             if ($posttags) {
                 foreach ($posttags as $tag) {
                     array_push($tags, $tag->name);
                 }
             }
         } else {
             return;
         }
     }
     Livefyre_Apps::init_auth();
     $network = get_option('livefyre_apps-livefyre_domain_name', 'livefyre.com');
     $network = $network == '' ? 'livefyre.com' : $network;
     $siteId = get_option('livefyre_apps-livefyre_site_id');
     $siteKey = get_option('livefyre_apps-livefyre_site_key');
     $network_key = get_option('livefyre_apps-livefyre_domain_key', '');
     $network = Livefyre::getNetwork($network, strlen($network_key) > 0 ? $network_key : null);
     $site = $network->getSite($siteId, $siteKey);
     $collectionMetaToken = $site->buildCollectionMetaToken($title, $articleId, $url, array("tags" => $tags, "type" => "liveblog"));
     $checksum = $site->buildChecksum($title, $url, $tags, 'liveblog');
     $strings = apply_filters('livefyre_custom_blog_strings', null);
     $livefyre_element = 'livefyre-blog-' . $articleId;
     return LFAPPS_View::render_partial('script', compact('siteId', 'siteKey', 'network', 'articleId', 'collectionMetaToken', 'checksum', 'strings', 'livefyre_element'), 'blog', true);
 }
예제 #4
0
 target="_blank">Livefyre Admin</a>
                        <br/>
                        <a href="http://support.livefyre.com" target="_blank">Livefyre Support</a>
                    </div>
                </div>
            </div>
        </div>        
    </div>
</div>

<?php 
add_thickbox();
?>

<?php 
if (!get_option('livefyre_apps-initial_modal_shown', false)) {
    ?>
<script>
    jQuery(document).ready(function(){
        tb_show("","#TB_inline?inlineId=lfapps-initial-modal&width=680&height=310");
    });
</script>
<?php 
}
?>
<div id='lfapps-initial-modal' style='display:none'>
    <?php 
LFAPPS_View::render_partial('initial_modal');
?>
</div>
<?php

$import_status = get_option('livefyre_apps-livefyre_import_status');
if ($import_status !== 'complete') {
    ?>
    <?php 
    LFAPPS_View::render_partial('import_script', array(), 'comments');
    ?>
    <div class="postbox-container postbox-large">
        <div id="normal-sortables" class="meta-box-sortables ui-sortable">
            <div id="referrers" class="postbox livefyre-import-postbox">
                <div class="handlediv" title="Click to toggle"><br></div>
                <h3 class="hndle"><span><?php 
    esc_html_e('Livefyre Import Status', 'lfapps-comments');
    ?>
</span></h3>
                <div class='inside'>
                <?php 
    if ($import_status === 'error') {
        ?>
                    <h4><?php 
        esc_html_e('Status:', 'lfapps-comments');
        ?>
 <span><?php 
        esc_html_e('Failed', 'lfapps-comments');
        ?>
 </span></h4>

                    <?php 
        echo "<p>Message: " . esc_html(get_option('livefyre_apps-livefyre_import_message', '')) . "</p>";
        ?>