static function print_options() { $mentions = p2_get('mentions'); get_currentuserinfo(); $page_options['nonce'] = wp_create_nonce('ajaxnonce'); $page_options['prologue_updates'] = 1; $page_options['prologue_comments_updates'] = 1; $page_options['prologue_tagsuggest'] = 1; $page_options['prologue_inlineedit'] = 1; $page_options['prologue_comments_inlineedit'] = 1; $page_options['is_single'] = (int) is_single(); $page_options['is_page'] = (int) is_page(); $page_options['is_front_page'] = (int) is_front_page(); $page_options['is_first_front_page'] = (int) (is_front_page() && !is_paged()); $page_options['is_user_logged_in'] = (int) is_user_logged_in(); $page_options['login_url'] = wp_login_url((!empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); ?> <script type="text/javascript"> // <![CDATA[ // P2 Configuration var ajaxUrl = "<?php echo esc_js(esc_url_raw(P2_JS::ajax_url())); ?> "; var ajaxReadUrl = "<?php echo esc_js(esc_url_raw(P2_JS::ajax_read_url())); ?> "; var updateRate = "30000"; // 30 seconds var nonce = "<?php echo esc_js($page_options['nonce']); ?> "; var login_url = "<?php echo $page_options['login_url']; ?> "; var templateDir = "<?php echo esc_js(get_template_directory_uri()); ?> "; var isFirstFrontPage = <?php echo $page_options['is_first_front_page']; ?> ; var isFrontPage = <?php echo $page_options['is_front_page']; ?> ; var isSingle = <?php echo $page_options['is_single']; ?> ; var isPage = <?php echo $page_options['is_page']; ?> ; var isUserLoggedIn = <?php echo $page_options['is_user_logged_in']; ?> ; var prologueTagsuggest = <?php echo $page_options['prologue_tagsuggest']; ?> ; var prologuePostsUpdates = <?php echo $page_options['prologue_updates']; ?> ; var prologueCommentsUpdates = <?php echo $page_options['prologue_comments_updates']; ?> ; var getPostsUpdate = 0; var getCommentsUpdate = 0; var inlineEditPosts = <?php echo $page_options['prologue_inlineedit']; ?> ; var inlineEditComments = <?php echo $page_options['prologue_comments_inlineedit']; ?> ; var wpUrl = "<?php echo esc_js(site_url()); ?> "; var rssUrl = "<?php esc_js(get_bloginfo('rss_url')); ?> "; var pageLoadTime = "<?php echo gmdate('Y-m-d H:i:s'); ?> "; var commentsOnPost = new Array; var postsOnPage = new Array; var postsOnPageQS = ''; var currPost = -1; var currComment = -1; var commentLoop = false; var lcwidget = false; var hidecomments = false; var commentsLists = ''; var newUnseenUpdates = 0; var mentionData = <?php echo json_encode($mentions->user_suggestion()); ?> ; var p2CurrentVersion = <?php echo (int) $GLOBALS['p2']->db_version; ?> ; var p2StoredVersion = <?php echo (int) $GLOBALS['p2']->get_option('db_version'); ?> ; // ]]> </script> <?php }
function print_options() { global $current_blog; $mentions = p2_get('mentions'); get_currentuserinfo(); $page_options['nonce'] = wp_create_nonce('ajaxnonce'); $page_options['prologue_updates'] = 1; $page_options['prologue_comments_updates'] = 1; $page_options['prologue_tagsuggest'] = 1; $page_options['prologue_inlineedit'] = 1; $page_options['prologue_comments_inlineedit'] = 1; $page_options['is_single'] = (int) is_single(); $page_options['is_page'] = (int) is_page(); $page_options['is_front_page'] = (int) is_front_page(); $page_options['is_first_front_page'] = (int) (is_front_page() && !is_paged()); $page_options['is_user_logged_in'] = (int) is_user_logged_in(); $page_options['login_url'] = wp_login_url((!empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); // Generate the ajax url based on the current scheme $admin_url = admin_url('admin-ajax.php?p2ajax=true', is_ssl() ? 'https' : 'http'); // If present, take domain mapping into account if (isset($current_blog->primary_redirect)) { $admin_url = preg_replace('|https?://' . preg_quote($current_blog->domain) . '|', 'http://' . $current_blog->primary_redirect, $admin_url); } ?> <script type="text/javascript"> // <![CDATA[ // P2 Configuration var ajaxUrl = "<?php echo $admin_url; ?> "; var updateRate = "30000"; // 30 seconds var nonce = "<?php echo esc_js($page_options['nonce']); ?> "; var login_url = "<?php echo $page_options['login_url']; ?> "; var templateDir = "<?php echo esc_js(get_template_directory_uri()); ?> "; var isFirstFrontPage = <?php echo $page_options['is_first_front_page']; ?> ; var isFrontPage = <?php echo $page_options['is_front_page']; ?> ; var isSingle = <?php echo $page_options['is_single']; ?> ; var isPage = <?php echo $page_options['is_page']; ?> ; var isUserLoggedIn = <?php echo $page_options['is_user_logged_in']; ?> ; var prologueTagsuggest = <?php echo $page_options['prologue_tagsuggest']; ?> ; var prologuePostsUpdates = <?php echo $page_options['prologue_updates']; ?> ; var prologueCommentsUpdates = <?php echo $page_options['prologue_comments_updates']; ?> ; var getPostsUpdate = 0; var getCommentsUpdate = 0; var inlineEditPosts = <?php echo $page_options['prologue_inlineedit']; ?> ; var inlineEditComments = <?php echo $page_options['prologue_comments_inlineedit']; ?> ; var wpUrl = "<?php echo esc_js(site_url()); ?> "; var rssUrl = "<?php esc_js(get_bloginfo('rss_url')); ?> "; var pageLoadTime = "<?php echo gmdate('Y-m-d H:i:s'); ?> "; var original_title = document.title; var commentsOnPost = new Array; var postsOnPage = new Array; var postsOnPageQS = ''; var currPost = -1; var currComment = -1; var commentLoop = false; var lcwidget = false; var hidecomments = false; var commentsLists = ''; var newUnseenUpdates = 0; var mentionData = <?php echo json_encode($mentions->user_suggestion()); ?> ; // ]]> </script> <?php }