/**
  * Gets a standalone channel's embed code.
  *
  * @param string $path The channel's remote path.
  * @param array $args The channel's embed arguments.
  * @param bool $echo Whether to echo or return the markup
  * @return string|void The embed code or void, if echoing.
  * @author Paul Hughes
  * @since 3.0.2
  */
 public static function getChannelEmbedMarkup($path, $args = array(), $echo = false)
 {
     $id_attr = muut()->getWrapperCssId() ? 'id="' . muut()->getWrapperCssId() . '"' : '';
     $settings = muut()->getEmbedAttributesString($args);
     $embed = '<a ' . $id_attr . ' class="' . muut()->getWrapperCssClass() . '" ' . $settings . ' href="' . muut()->getContentPathPrefix() . 'i/' . muut()->getForumName() . '/' . $path . '">' . __('Comments', 'muut') . '</a>';
     $embed = apply_filters('muut_channel_embed_content', $embed, $path);
     if ($echo) {
         echo $embed;
         return;
     } else {
         return $embed;
     }
 }
Exemplo n.º 2
0
/**
 * Initializes the main plugin class.
 *
 * @return void
 * @author Paul Hughes
 * @since  3.0
 */
function muut_initialize_plugin()
{
    if (file_exists(dirname(__FILE__) . '/lib/muut.class.php')) {
        require_once dirname(__FILE__) . '/lib/muut.class.php';
        if (class_exists('Muut')) {
            muut();
        } else {
            add_action('admin_notices', 'muut_show_plugin_load_fail_message');
        }
    } else {
        add_action('admin_notices', 'muut_show_plugin_load_fail_message');
    }
    $plugin_dir = trailingslashit(basename(dirname(__FILE__)));
    load_plugin_textdomain('muut', false, $plugin_dir . 'lang/');
}
 /**
  * Enqueues the JS required for this widget.
  *
  * @return void
  * @author Paul Hughes
  * @since 3.0.2
  */
 public function enqueueWidgetScripts()
 {
     if (is_active_widget(false, false, $this->id_base, true)) {
         wp_enqueue_script('muut-widget-online-users', muut()->getPluginUrl() . 'resources/muut-widget-online-users.js', array('jquery'), Muut::VERSION, true);
         // Localization translation strings.
         $localizations = array('anonymous_users' => _x('anonymous', 'anonymous users', 'muut'));
         wp_localize_script('muut-widget-online-users', 'muut_widget_online_users_localized', $localizations);
     }
 }
<?php

/**
 * The content for the Muut settings contextual SSO/Federated Identities help tab.
 *
 * @package   Muut
 * @copyright 2014 Muut Inc
 */
?>
<p>
	<?php 
printf(__('Federated Identities (previously called Single Sign-On, or SSO) lets your users use WordPress registration and login instead of Muut\'s. For this to work you need to %supgrade%s your forum to support Federated Identities with the Small or Medium subscription and then enable input your API keys in the Signed Setup section.', 'muut'), '<a class="muut_upgrade_community_link" href="' . muut()->getUpgradeUrl() . '" target="_blank">', '</a>');
?>
</p>
<p>
	<?php 
_e('Once enabled, Federated Identities will be used on all the forum and commenting instances created by this plugin.', 'muut');
?>
</p>
 /**
  * Enqueues the JS required for this widget.
  *
  * @return void
  * @author Paul Hughes
  * @since 3.0.2
  */
 public function enqueueWidgetScripts()
 {
     if (is_active_widget(false, false, $this->id_base, true)) {
         wp_enqueue_script('muut-widget-latest-comments', muut()->getPluginUrl() . 'resources/muut-widget-latest-comments.js', array('jquery', 'muut-widgets-initialize'), Muut::VERSION, true);
     }
 }
 /**
  * Grabs the proper markup from the return body for Forum root that should be rendered.
  *
  * @param string $content The markup we will be filtering.
  * @return string The content we actually want to display.
  * @author Paul Hughes
  * @since 3.0.1
  */
 protected function getForumIndexContent($content)
 {
     // Make sure to only get the content we want.
     $new_content = $content;
     $new_content = strstr($new_content, '<ul id="forums">');
     $new_content = substr($new_content, 0, strpos($new_content, '</body>'));
     // Replace links within the threaded response with new hasbang urls (to lead to the "share" location.
     $new_content = str_replace('<a href="/i/' . muut()->getForumName() . '/', '<a href="' . get_permalink() . '#!/', $new_content);
     if ($new_content) {
         $content = $new_content;
     }
     return $content;
 }
 /**
  * Displays the dismissible admin notice requesting a review.
  *
  * @return void
  * @author Paul Hughes
  * @since 3.0.2.3
  */
 public function maybeShowReviewRequestNotice()
 {
     $dismissed_notices = muut()->getOption('dismissed_notices', array());
     if (!isset($dismissed_notices['review_request']) || !$dismissed_notices['review_request']) {
         $update_timestamps = muut()->getOption('update_timestamps', array());
         $update_time = !empty($update_timestamps) ? array_pop($update_timestamps) : false;
         if ($update_time && time() - $update_time > 604800) {
             echo '<div class="updated muut_admin_notice" id="muut_dismiss_review_request_notice">';
             wp_nonce_field('muut_dismiss_notice', 'dismiss_nonce');
             echo '<span style="float: right" class="dismiss_notice_button"><a href="#" class="dismiss_notice">X</a></span>';
             echo '<p>' . sprintf(__('Enjoying Muut? We\'d love it you would pop over to the %splugin page%s and leave a rating and review!', 'muut'), '<a class="dismiss_notice" target="_blank" href="https://wordpress.org/plugins/muut/">', '</a>') . '</p>';
             echo '</div>';
         }
     }
 }
 /**
  * Gets the ID of the page that is being used as the main forum page.
  *
  * @return int|false The ID of the forum page, or false on failure.
  * @author Paul Hughes
  * @since 3.0
  */
 public static function getForumPageId()
 {
     $forum_page_id = muut()->getOption('forum_page_id', false);
     if ('publish' != get_post_status($forum_page_id)) {
         return false;
     } else {
         return $forum_page_id;
     }
 }
 /**
  * Enqueues the JS required for this widget.
  *
  * @return void
  * @author Paul Hughes
  * @since 3.0.2
  */
 public function enqueueWidgetScripts()
 {
     if (muut_is_webhooks_active()) {
         wp_enqueue_script('muut-widget-trending-posts', muut()->getPluginUrl() . 'resources/muut-widget-trending-posts.js', array('jquery', 'muut-widgets-initialize'), Muut::VERSION, true);
     }
 }
 /**
  * Add new Muut Reply.
  *
  * @param array $args The comment args.
  *                    This array should follow the following structure:
  *                    'key' => The Muut thread key
  *                    'path' => The main thread path.
  *                    'user' => The *Muut* username.
  *                    'body' => The reply content.
  * @return int The comment id.
  * @author Paul Hughes
  * @since 3.0.2
  */
 public function addMuutReplyData($args = array())
 {
     if (empty($args['key']) || empty($args['path']) || empty($args['user']) || !isset($args['body'])) {
         return false;
     }
     $comment_type = self::MUUT_REPLY_TYPE_NAME;
     // If everything is there, lets add the thread.
     extract($args);
     // Check if a WP post exists in the database that would match the path of the "post" request (for threaded commenting).
     $query_args = array('post_type' => Muut_Custom_Post_Types::MUUT_THREAD_CPT_NAME, 'post_status' => Muut_Custom_Post_Types::MUUT_PUBLIC_POST_STATUS, 'meta_query' => array(array('key' => 'muut_path', 'value' => $path)), 'posts_per_page' => 1);
     // Get the post data.
     $posts_query = new WP_Query();
     $posts = $posts_query->query($query_args);
     $post_id = isset($posts[0]->ID) ? $posts[0]->ID : 0;
     // Update the post modified date for the parent thread WP post.
     if ($post_id > 0) {
         wp_update_post(array('ID' => $post_id));
     }
     $comment_args = array('comment_post_ID' => $post_id, 'comment_content' => $body, 'comment_type' => $comment_type, 'comment_agent' => 'Muut ' . muut()->getMuutVersion() . '; ' . muut()->getForumName());
     // Add the thread to the Posts table.
     $inserted_reply = wp_insert_comment($comment_args);
     if ($inserted_reply == 0) {
         return false;
     }
     // Add the muut comment meta.
     update_comment_meta($inserted_reply, 'muut_user', $user);
     update_comment_meta($inserted_reply, 'muut_key', $key);
     update_comment_meta($inserted_reply, 'muut_path', $path);
     // Return the comment id.
     return $inserted_reply;
 }
 /**
  * Renders the content for the Commenting-meta-box-tab help tab on the post editor.
  *
  * @param WP_Screen $screen The current screen.
  * @param array $tab The current tab array.
  * @return void
  * @author Paul Hughes
  * @since 3.0
  */
 public function renderMuutWidgetsHelpTabContent($screen, $tab)
 {
     include muut()->getPluginPath() . 'views/blocks/help-tab-muut-widgets.php';
 }
 /**
  * Removes the commenting tab if replace commenting is not enabled.
  *
  * @param array $tabs The current array of tabs.
  * @return array The modified array.
  * @author Paul Hughes
  * @since 3.0
  */
 public function removeCommentsTabIfDisabled($tabs)
 {
     if (isset($tabs['commenting']) && !muut()->getOption('replace_comments')) {
         unset($tabs['commenting']);
     }
     return $tabs;
 }
 /**
  * Render the admin form for widget customization.
  *
  * @param array $instance The widget instance parameters.
  * @return void
  * @author Paul Hughes
  * @since 3.0.2
  */
 public function form($instance)
 {
     include muut()->getPluginPath() . 'views/widgets/admin-widget-channel-embed.php';
 }
Exemplo n.º 14
0
 /**
  * Displays a dismissible admin notice if the Muut uploads directory is not writeable.
  *
  * @return void
  * @author Paul Hughes
  * @since 3.0.4
  */
 public function maybeShowUploadsDirectoryFailureNotice()
 {
     $dismissed_notices = muut()->getOption('dismissed_notices', array());
     if ((!isset($dismissed_notices['uploads_dir_fail_notice']) || !$dismissed_notices['uploads_dir_fail_notice']) && !Muut_Files_Utility::checkMuutUploadsDirectory('/')) {
         $wp_upload_dir = wp_upload_dir();
         $muut_uploads_dir = trailingslashit($wp_upload_dir['basedir']) . Muut_Files_Utility::UPLOADS_DIR_NAME;
         echo '<div class="updated muut_admin_notice" id="muut_uploads_dir_fail_notice">';
         wp_nonce_field('muut_dismiss_notice', 'dismiss_nonce');
         echo '<span class="dismiss_notice_button"><a href="#" class="dismiss_notice">X</a></span>';
         echo '<p>' . sprintf(__('The %sMuut Plugin%s has some advanced functionality that requires your uploads directory be writeable. You should create a directory with permissions 755 at %s, or change the permissions of the main uploads directory to 755. There are instrucitons on how to do that %shere%s.', 'muut'), '<b>', '</b>', $muut_uploads_dir, '<a href="http://codex.wordpress.org/Changing_File_Permissions">', '</a>') . '</p>';
         echo '</div>';
     }
 }
Exemplo n.º 15
0
<?php

/**
 * The post/page editor tab for forum preferences.
 *
 * @package   Muut
 * @copyright 2014 Muut Inc
 */
global $post;
$tab;
$meta_name = $tab['meta_name'];
$forum_settings = Muut_Post_Utility::getPostOption($post->ID, 'forum_settings');
$forum_defaults = muut()->getOption('forum_defaults');
$forum_update_default = muut()->getOption('show_comments_in_forum_default');
$forum_defaults['show_comments_in_forum'] = $forum_update_default ? $forum_update_default : $forum_defaults['show_comments_in_forum'];
$hide_online = isset($forum_settings['hide_online']) ? $forum_settings['hide_online'] : $forum_defaults['hide_online'];
$disable_uploads = isset($forum_settings['disable_uploads']) ? $forum_settings['disable_uploads'] : $forum_defaults['disable_uploads'];
$forum_show_comments = isset($forum_settings['show_comments_in_forum']) ? $forum_settings['show_comments_in_forum'] : $forum_defaults['show_comments_in_forum'];
$forum_page_id = Muut_Post_Utility::getForumPageId();
if (!$forum_page_id || $forum_page_id == $post->ID) {
    ?>
	<p>
		<span class="checkbox_row"><input type="checkbox" name="<?php 
    echo $tab['meta_name'];
    ?>
[enabled-tab]" class="muut_enable_<?php 
    echo $tab['name'];
    ?>
" id="muut_enable_tab-<?php 
    echo $tab['name'];
    ?>
Exemplo n.º 16
0
 /**
  * Updates the current version option for the installed plugin.
  *
  * @param string $old_version The version from which we are upgrading.
  * @param string $new_version The version to which we are upgrading.
  * @return void
  * @author Paul Hughes
  * @since 3.0
  */
 public function updateVersionNumber($old_version, $new_version)
 {
     muut()->setOption('current_version', $new_version);
     $update_timestamps = muut()->getOption('update_timestamps', array());
     $update_timestamps[$new_version] = time();
     muut()->setOption('update_timestamps', $update_timestamps);
 }
Exemplo n.º 17
0
 /**
  * Static function for checking if (and what is) the post ID that a given muut path is commenting on.
  *
  * @param string $path The path we are comparing/checking for.
  * @return int|false The post ID, if it is a comment on a given post or false, if not found.
  */
 public static function getPostIdRepliedTo($path)
 {
     // Used to allow the adding of other "allowed" comments base domains if it has changed or whatnot.
     $comments_base_domains = apply_filters('muut_webhooks_allowed_comments_base_domains', array(muut()->getOption('comments_base_domain')));
     $matches = array();
     // Check if the comment path is in the Muut post comment path format.
     foreach ($comments_base_domains as $base_domain) {
         preg_match_all('/^\\/' . addslashes(muut()->getForumName()) . '\\/' . addslashes($base_domain) . '\\/([0-9]+)(?:\\/|\\#)?.*$/', $path, $matches);
         // If there is a match, return it and exit this loop and function.
         if (!empty($matches) && isset($matches[1][0]) && is_numeric($matches[1][0]) && Muut_Post_Utility::isMuutCommentingPost($matches[1][0])) {
             return $matches[1][0];
         }
     }
 }
Exemplo n.º 18
0
 /**
  * Includes the proper Muut embed achor.
  * We also will be dumping this shortcode.
  *
  * @param array $params The parameters for the shortcode.
  * @return string
  * @author Paul Hughes
  */
 public function shortcode($params)
 {
     extract(shortcode_atts(array('forum' => false, 'threaded' => false, 'path' => false), $params));
     $forum_name = muut()->getForumName();
     if ($forum_name == null) {
         return "";
     }
     $id_attr = muut()->getWrapperCssId() ? 'id="' . muut()->getWrapperCssId() . '"' : '';
     $tag = '<a ' . $id_attr . ' class="' . muut()->getWrapperCssClass() . '" href="' . muut()->getContentPathPrefix() . 'i/' . $forum_name;
     $page_slug = sanitize_title(get_the_title());
     // (bool ? this : that) not working
     if ($forum) {
         return $tag . '">' . $forum_name . 'forums</a>';
     }
     if ($threaded) {
         return $tag . '/wordpress/' . $page_slug . '">Comments</a>';
     }
     if ($path) {
         return $tag . '/' . $path . '">Comments are here</a>';
     }
     return $tag . '/wordpress:' . $page_slug . '">Comments</a>';
 }
/**
 * The post/page editor tab for commenting.
 *
 * @package   Muut
 * @copyright 2014 Muut Inc
 */
global $post;
$tab;
$post_type_tabs = Muut_Admin_Post_Editor::instance()->getMetaBoxTabsForCurrentPostType();
unset($post_type_tabs[$tab['slug']]);
$post_type_object = get_post_type_object($post->post_type);
$post_type_label = $post_type_object->labels->singular_name;
$meta_name = $tab['meta_name'];
$comments_settings = Muut_Post_Utility::getPostOption($post->ID, 'commenting_settings');
$commenting_defaults = muut()->getOption('commenting_defaults');
$type = isset($comments_settings['type']) ? $comments_settings['type'] : $commenting_defaults['type'];
$disable_uploads = isset($comments_settings['disable_uploads']) ? $comments_settings['disable_uploads'] : $commenting_defaults['disable_uploads'];
?>
<p>
	<span class="checkbox_row"><input type="checkbox" name="<?php 
echo $tab['meta_name'];
?>
[enabled-tab]" class="muut_enable_<?php 
echo $tab['name'];
?>
" id="muut_enable_tab-<?php 
echo $tab['name'];
?>
" <?php 
checked(true, Muut_Post_Utility::isMuutCommentingPost($post->ID));
Exemplo n.º 20
0
	</p>
<?php 
}
?>
	</form>
	<div id="muut_settings_webhooks_setup_instructions" style="display: none">
		<div class="center_screenshot">
			<h3><?php 
_e('To complete your webhooks setup...', 'muut');
?>
</h3>
			<p><?php 
_e('From your main forum page, open the Muut settings, select the integrations tab, and create a new integration as below using the following URL and secret:', 'muut');
?>
</p>
			<p><input type="text" class="muut_autoselect"  value="<?php 
echo site_url() . '/' . Muut_Webhooks::instance()->getEndpointSlug();
?>
" style="width: 500px;" readonly /><br />
			<input type="text" class="muut_autoselect" value="<?php 
echo $current_values['webhooks_secret'];
?>
" readonly />
			</p>
			<img class="retinaise" style="height: 480px" src="<?php 
echo muut()->getPluginUrl() . '/resources/images/webhooks-instructions.png';
?>
">
		</div>
	</div>
</div>
<?php

/**
 * The content for the Muut settings contextual Webhooks help tab.
 *
 * @package   Muut
 * @copyright 2014 Muut Inc
 */
?>
<p>
	<?php 
_e('Muut Webhooks are HTTP callbacks triggered by Muut events. They communicate with your WordPress website to send event notifications on Muut actions (replies, likes, etc.), that then add support for advanced features and widgets.', 'muut');
?>
</p>
<p>
	<?php 
printf(__('To use webhooks, you need to %supgrade%s your forum to support Outgoing Webhooks with a Small or Medium license.', 'muut'), '<a class="muut_upgrade_to_developer_link" href="' . muut()->getUpgradeUrl() . '" target="_blank">', '</a>');
?>
</p>
<p>
	<?php 
_e('Once you have enabled webhooks here, you need to visit your Muut forum settings and create a new integration under the Integrations section; give the integration a name, enter the URL and Secret specified on this page under "Webhooks" section and make sure that all the events are enabled.', 'muut');
?>
</p>
Exemplo n.º 22
0
 /**
  * Checks some things in the admin and, from there, knows which libraries to initialize.
  *
  * @return void
  * @author Paul Hughes
  * @since 3.0
  */
 public function adminInits()
 {
     if (version_compare(Muut::VERSION, muut()->getOption('current_version', '0'), '>')) {
         $this->initUpdater();
     }
     if (defined('DOING_AJAX') && DOING_AJAX || isset($_GET['page']) && $_GET['page'] == 'muut') {
         $this->initAdminSettings();
     }
     $this->initContextualHelp();
     $this->initFieldValidationUtility();
 }
 /**
  * Gets (and caches) the comment counts for posts in the main query.
  *
  * @param array $posts The array of WP_Post objects that were fetched in the main query.
  * @return array The same array.
  * @author Paul Hughes
  * @since 3.0
  */
 public function fetchCommentCountForMuutPosts()
 {
     global $wp_query;
     // Only execute this functionality if "do not fetch" is not set.
     // That filter can be used (set to true) to prevent any of this from executing.
     if (!apply_filters('muut_do_not_fetch_post_counts', false) && $wp_query->is_main_query()) {
         $post_count_queue = array();
         $posts = $wp_query->posts;
         foreach ($posts as $post) {
             if (Muut_Post_Utility::isMuutCommentingPost($post->ID) && wp_cache_get("muut-comments-{$post->ID}", 'counts') === false && get_post_meta($post->ID, 'muut_comments_count', true) === '') {
                 $path = '/' . $this->getCommentsPath($post->ID, true);
                 $post_count_queue[$post->ID] = $path;
             }
         }
         // As long as there is at least one post that uses Muut commenting and doesn't have a cached value...
         if (count($post_count_queue) > 0) {
             global $wp_version;
             $api_endpoint = 'https://' . Muut::MUUTAPISERVER . '/postcounts';
             $api_args = '?path=' . join('&path=', $post_count_queue);
             $api_call = $api_endpoint . $api_args;
             $fetch_args = array('user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo('url') . ' MuutForum/' . muut()->getForumName(), 'timeout' => apply_filters('muut_api_post_counts_timeout', '2'));
             $response = wp_remote_get($api_call, $fetch_args);
             if (is_wp_error($response) && (muut()->isInDevelopMode() || !apply_filters('muut_suppress_api_errors', true))) {
                 error_log('Something went wrong fetching Muut API: ' . $response->get_error_message());
             } else {
                 if (wp_remote_retrieve_response_code($response) == 200) {
                     $body = wp_remote_retrieve_body($response);
                     $return_array = json_decode($body);
                     // Cache values for each returned post comment count.
                     if (!is_null($return_array)) {
                         $post_array = array_flip($post_count_queue);
                         foreach ($post_array as $url => $id) {
                             update_post_meta($id, 'muut_comments_count', $return_array->{$url}->size);
                             wp_cache_set("muut-comments-{$id}", $return_array->{$url}->size, 'counts');
                         }
                     }
                 }
             }
         }
     }
     return $posts;
 }
Exemplo n.º 24
0
echo muut()->getWrapperCssClass();
?>
" <?php 
echo $settings;
?>
  data-url="<?php 
echo muut()->getContentPathPrefix();
?>
i/<?php 
echo muut()->getForumName();
?>
">

	<!-- Muut API -->

	<a class="muut-url" href="<?php 
echo muut()->getContentPathPrefix();
?>
i/<?php 
echo muut()->getForumName();
?>
"><?php 
echo get_the_title();
?>
</a>

	<!-- Custom HTML -->
	<?php 
do_action('muut_forum_custom_navigation');
?>
</div>
<?php

/**
 * The post/page editor tab for channel preferences.
 *
 * @package   Muut
 * @copyright 2014 Muut Inc
 */
global $post;
$tab;
$meta_name = $tab['meta_name'];
$channel_settings = Muut_Post_Utility::getPostOption($post->ID, 'channel_settings');
$channel_defaults = muut()->getOption('channel_defaults');
$hide_online = isset($channel_settings['hide_online']) ? $channel_settings['hide_online'] : $channel_defaults['hide_online'];
$disable_uploads = isset($channel_settings['disable_uploads']) ? $channel_settings['disable_uploads'] : $channel_defaults['disable_uploads'];
$channel_path = isset($channel_settings['channel_path']) ? '/' . $channel_settings['channel_path'] : '';
?>
<p>
	<span class="checkbox_row"><input type="checkbox" name="<?php 
echo $tab['meta_name'];
?>
[enabled-tab]" class="muut_enable_<?php 
echo $tab['name'];
?>
" id="muut_enable_tab-<?php 
echo $tab['name'];
?>
" <?php 
checked($active_tab, $tab['name']);
?>
 value="1" /><label for="muut_enable_tab-<?php 
 /**
  * Locates the proper template file, whether it is in the plugin templates directory or a sub-directory of the
  * active theme.
  *
  * @param string $template The template file name (not path).
  * @return string The path to the template file that should be loaded.
  * @author Paul Hughes
  * @since 3.0
  */
 public function locateTemplate($template)
 {
     // Other locations can be added by filtering them into this array (in priority order).
     $locations_to_search = apply_filters('muut_template_directories', array('theme' => get_stylesheet_directory() . '/muut/', 'muut' => muut()->getPluginPath() . 'templates/'));
     $template_path = '';
     while ($template_path == '' && !empty($locations_to_search)) {
         $location = array_shift($locations_to_search);
         if (file_exists($location . $template)) {
             $template_path = $location . $template;
         }
     }
     return $template_path;
 }
<?php

/**
 * The content for the Muut settings contextual Signed Setup help tab.
 *
 * @package   Muut
 * @copyright 2014 Muut Inc
 */
?>
<p>
	<?php 
_e('If you have a Small or Medium subscription and are using Federated Identities (Small) or Secure Embedding (Medium), you need to enable signed embedding by entering your API credentials in this section. You can get the API keys directly from the forum frontend (either on your embed or at muut.com) by clicking the "Settings" link and copying the API Key and Secret Key from the top bar.', 'muut');
?>
</p>
<p>
	<?php 
printf(__('If you are using a caching plugin, make sure to check the "Caching" checkbox in this section so that the signed data is dynamically fetched. Note that the cache %smust%s be set to expire within every 24 hours.', 'muut'), '<b>', '</b>');
?>
</p>
<p>
	<?php 
_e('This is not required (and is discouraged) if you are not using one of the premium services dependent on it.', 'muut');
?>
</p>
<p>
	<?php 
printf(__('For more information about our premium plans and features, see our %spricing page%s or %supgrade your forum%s now.', 'muut'), '<a target="_blank" href="https://muut.com/pricing/">', '</a>', '<a class="muut_upgrade_community_link" href="' . muut()->getUpgradeUrl() . '" target="_blank">', '</a>');
?>
</p>
Exemplo n.º 28
0
 function muut_get_user_facelink_avatar($username, $display_name, $is_admin = false, $user_url = null, $avatar_url = null, $echo = false)
 {
     if ($echo) {
         muut()->getUserFacelinkAvatar($username, $display_name, $is_admin, $user_url, $avatar_url, true);
     } else {
         return muut()->getUserFacelinkAvatar($username, $display_name, $is_admin, $user_url, $avatar_url, false);
     }
 }
 /**
  * Gets the signed data over AJAX (for sites with caching plugins).
  *
  * @return void
  * @author Paul Hughes
  * @since 3.0.5
  */
 public function ajaxGetSignedMessage()
 {
     check_ajax_referer('muut_get_signed', 'security');
     $result = array('success' => true, 'data' => array('api' => $this->getSignedObjectArray()));
     $additional = array();
     if (muut()->getOption('subscription_use_sso')) {
         $additional['login_url'] = apply_filters('muut_sso_login_url', wp_login_url(get_permalink()));
     }
     $additional = apply_filters('muut_addional_signed_conf_parameters', $additional);
     foreach ($additional as $key => $value) {
         $result['data'][$key] = $value;
     }
     exit(json_encode($result));
 }