/** * Check if plugin dependencies are satisfied and add an admin notice if not * * @return bool */ public static function is_dependency_satisfied() { if (class_exists('bbPress') && version_compare(bbp_get_version(), self::PLUGIN_MIN_VERSION, '>=')) { return true; } return false; }
/** * Adds the default bbPress styles into the editor * * @see bbp_default_styles filter * @see BBP_Default->enqueue_styles() */ public function sandwich_bbpress_enqueue_editor_styles($styles) { foreach ($styles as $handle => $attributes) { $styleUrl = bbp_enqueue_style($handle, $attributes['file'], $attributes['dependencies'], bbp_get_version(), 'screen'); add_editor_style($styleUrl); } return $styles; }
/** * Component global variables * * Note that this function is currently commented out in the constructor. * It will only be used if you copy this file into your current theme and * uncomment the line above. * * You'll want to customize the values in here, so they match whatever your * needs are. * * @since bbPress (r3732) * @access private */ private function setup_globals() { $bbp = bbpress(); $this->id = 'default'; $this->name = __('bbPress Default', 'bbpress'); $this->version = bbp_get_version(); $this->dir = trailingslashit($bbp->themes_dir . 'default'); $this->url = trailingslashit($bbp->themes_url . 'default'); }
/** * Component global variables * * @since bbPress (r2626) * @access private * @uses bbp_get_version() To get the bbPress version * @uses get_stylesheet_directory() To get the stylesheet path * @uses get_stylesheet_directory_uri() To get the stylesheet uri */ private function setup_globals() { $bbp = bbpress(); $this->id = 'bbp-twentyten'; $this->name = __('Twenty Ten (bbPress)', 'bbpress'); $this->version = bbp_get_version(); $this->dir = trailingslashit($bbp->themes_dir . 'bbp-twentyten'); $this->url = trailingslashit($bbp->themes_url . 'bbp-twentyten'); }
/** * Get version of the bbPress. * * @param string $ret what version format to return: code or version * @return mixed version value */ function d4p_bbpress_version($ret = 'code') { if (!d4p_has_bbpress()) { return null; } $version = bbp_get_version(); if (isset($version)) { if ($ret == 'code') { return substr(str_replace('.', '', $version), 0, 2); } else { return $version; } } return null; }
public static function get_remote_request_params() { $_key = pp_get_option('support_key'); if (is_array($_key) && isset($_key[1])) { $key = $_key[1]; } else { $key = ''; } global $wpdb; $data = array('call' => 'pp', 'key' => $key, 'core' => PPC_VERSION, 'wp' => get_bloginfo('version'), 'is_ms' => PP_MULTISITE, 'php' => phpversion(), 'mysql' => $wpdb->db_version()); $data['bp'] = defined('BP_VERSION') ? BP_VERSION : 0; $data['bbp'] = function_exists('bbp_get_version') ? bbp_get_version() : 0; $data['rvy'] = defined('RVY_VERSION') ? RVY_VERSION : 0; $data['cme'] = defined('CAPSMAN_ENH_VERSION') ? CAPSMAN_ENH_VERSION : 0; global $pp_extensions; foreach ($pp_extensions as $slug => $ext) { $data[$slug] = isset($ext->version) ? $ext->version : 0; } $data['beta_updates'] = pp_get_option('beta_updates'); return $data; }
/** * Add some general styling to the admin area * * @since bbPress (r2464) * * @uses bbp_get_forum_post_type() To get the forum post type * @uses bbp_get_topic_post_type() To get the topic post type * @uses bbp_get_reply_post_type() To get the reply post type * @uses sanitize_html_class() To sanitize the classes */ public function admin_head() { // Remove the individual recount and converter menus. // They are grouped together by h2 tabs remove_submenu_page('tools.php', 'bbp-repair'); remove_submenu_page('tools.php', 'bbp-converter'); remove_submenu_page('tools.php', 'bbp-reset'); // The /wp-admin/images/ folder $wp_admin_url = admin_url('images/'); // Icons for top level admin menus $version = bbp_get_version(); $menu_icon_url = $this->images_url . 'menu.png?ver=' . $version; $icon32_url = $this->images_url . 'icons32.png?ver=' . $version; $menu_icon_url_2x = $this->images_url . 'menu-2x.png?ver=' . $version; $icon32_url_2x = $this->images_url . 'icons32-2x.png?ver=' . $version; // Top level menu classes $forum_class = sanitize_html_class(bbp_get_forum_post_type()); $topic_class = sanitize_html_class(bbp_get_topic_post_type()); $reply_class = sanitize_html_class(bbp_get_reply_post_type()); ?> <style type="text/css" media="screen"> /*<![CDATA[*/ #bbp-dashboard-right-now p.sub, #bbp-dashboard-right-now .table, #bbp-dashboard-right-now .versions { margin: -12px; } #bbp-dashboard-right-now .inside { font-size: 12px; padding-top: 20px; margin-bottom: 0; } #bbp-dashboard-right-now p.sub { padding: 5px 0 15px; color: #8f8f8f; font-size: 14px; position: absolute; top: -17px; left: 15px; } body.rtl #bbp-dashboard-right-now p.sub { right: 15px; left: 0; } #bbp-dashboard-right-now .table { margin: 0; padding: 0; position: relative; } #bbp-dashboard-right-now .table_content { float: left; border-top: #ececec 1px solid; width: 45%; } body.rtl #bbp-dashboard-right-now .table_content { float: right; } #bbp-dashboard-right-now .table_discussion { float: right; border-top: #ececec 1px solid; width: 45%; } body.rtl #bbp-dashboard-right-now .table_discussion { float: left; } #bbp-dashboard-right-now table td { padding: 3px 0; white-space: nowrap; } #bbp-dashboard-right-now table tr.first td { border-top: none; } #bbp-dashboard-right-now td.b { padding-right: 6px; text-align: right; font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif; font-size: 14px; width: 1%; } body.rtl #bbp-dashboard-right-now td.b { padding-left: 6px; padding-right: 0; } #bbp-dashboard-right-now td.b a { font-size: 18px; } #bbp-dashboard-right-now td.b a:hover { color: #d54e21; } #bbp-dashboard-right-now .t { font-size: 12px; padding-right: 12px; padding-top: 6px; color: #777; } body.rtl #bbp-dashboard-right-now .t { padding-left: 12px; padding-right: 0; } #bbp-dashboard-right-now .t a { white-space: nowrap; } #bbp-dashboard-right-now .spam { color: red; } #bbp-dashboard-right-now .waiting { color: #e66f00; } #bbp-dashboard-right-now .approved { color: green; } #bbp-dashboard-right-now .versions { padding: 6px 10px 12px; clear: both; } #bbp-dashboard-right-now .versions .b { font-weight: bold; } #bbp-dashboard-right-now a.button { float: right; clear: right; position: relative; top: -5px; } body.rtl #bbp-dashboard-right-now a.button { float: left; clear: left; } /* Icon 32 */ #icon-edit.icon32-posts-<?php echo $forum_class; ?> , #icon-edit.icon32-posts-<?php echo $topic_class; ?> , #icon-edit.icon32-posts-<?php echo $reply_class; ?> { background: url('<?php echo $icon32_url; ?> '); background-repeat: no-repeat; } /* Icon Positions */ #icon-edit.icon32-posts-<?php echo $forum_class; ?> { background-position: -4px 0px; } #icon-edit.icon32-posts-<?php echo $topic_class; ?> { background-position: -4px -90px; } #icon-edit.icon32-posts-<?php echo $reply_class; ?> { background-position: -4px -180px; } /* Icon 32 2x */ @media only screen and (-webkit-min-device-pixel-ratio: 1.5) { #icon-edit.icon32-posts-<?php echo $forum_class; ?> , #icon-edit.icon32-posts-<?php echo $topic_class; ?> , #icon-edit.icon32-posts-<?php echo $reply_class; ?> { background-image: url('<?php echo $icon32_url_2x; ?> '); background-size: 45px 255px; } } /* Menu */ #menu-posts-<?php echo $forum_class; ?> .wp-menu-image, #menu-posts-<?php echo $topic_class; ?> .wp-menu-image, #menu-posts-<?php echo $reply_class; ?> .wp-menu-image, #menu-posts-<?php echo $forum_class; ?> :hover .wp-menu-image, #menu-posts-<?php echo $topic_class; ?> :hover .wp-menu-image, #menu-posts-<?php echo $reply_class; ?> :hover .wp-menu-image, #menu-posts-<?php echo $forum_class; ?> .wp-has-current-submenu .wp-menu-image, #menu-posts-<?php echo $topic_class; ?> .wp-has-current-submenu .wp-menu-image, #menu-posts-<?php echo $reply_class; ?> .wp-has-current-submenu .wp-menu-image { background: url('<?php echo $menu_icon_url; ?> '); background-repeat: no-repeat; } /* Menu Positions */ #menu-posts-<?php echo $forum_class; ?> .wp-menu-image { background-position: 0px -32px; } #menu-posts-<?php echo $forum_class; ?> :hover .wp-menu-image, #menu-posts-<?php echo $forum_class; ?> .wp-has-current-submenu .wp-menu-image { background-position: 0px 0px; } #menu-posts-<?php echo $topic_class; ?> .wp-menu-image { background-position: -70px -32px; } #menu-posts-<?php echo $topic_class; ?> :hover .wp-menu-image, #menu-posts-<?php echo $topic_class; ?> .wp-has-current-submenu .wp-menu-image { background-position: -70px 0px; } #menu-posts-<?php echo $reply_class; ?> .wp-menu-image { background-position: -35px -32px; } #menu-posts-<?php echo $reply_class; ?> :hover .wp-menu-image, #menu-posts-<?php echo $reply_class; ?> .wp-has-current-submenu .wp-menu-image { background-position: -35px 0px; } /* Menu 2x */ @media only screen and (-webkit-min-device-pixel-ratio: 1.5) { #menu-posts-<?php echo $forum_class; ?> .wp-menu-image, #menu-posts-<?php echo $topic_class; ?> .wp-menu-image, #menu-posts-<?php echo $reply_class; ?> .wp-menu-image, #menu-posts-<?php echo $forum_class; ?> :hover .wp-menu-image, #menu-posts-<?php echo $topic_class; ?> :hover .wp-menu-image, #menu-posts-<?php echo $reply_class; ?> :hover .wp-menu-image, #menu-posts-<?php echo $forum_class; ?> .wp-has-current-submenu .wp-menu-image, #menu-posts-<?php echo $topic_class; ?> .wp-has-current-submenu .wp-menu-image, #menu-posts-<?php echo $reply_class; ?> .wp-has-current-submenu .wp-menu-image { background-image: url('<?php echo $menu_icon_url_2x; ?> '); background-size: 100px 64px; } } <?php if ('bbpress' == get_user_option('admin_color')) { ?> /* Green Scheme Images */ .post-com-count { background-image: url('<?php echo $wp_admin_url; ?> bubble_bg.gif'); } .button, .submit input, .button-secondary { background-image: url('<?php echo $wp_admin_url; ?> white-grad.png'); } .button:active, .submit input:active, .button-secondary:active { background-image: url('<?php echo $wp_admin_url; ?> white-grad-active.png'); } .curtime #timestamp { background-image: url('<?php echo $wp_admin_url; ?> date-button.gif'); } .tagchecklist span a, #bulk-titles div a { background-image: url('<?php echo $wp_admin_url; ?> xit.gif'); } .tagchecklist span a:hover, #bulk-titles div a:hover { background-image: url('<?php echo $wp_admin_url; ?> xit.gif'); } #screen-meta-links a.show-settings { background-image: url('<?php echo $wp_admin_url; ?> arrows.png'); } #screen-meta-links a.show-settings.screen-meta-active { background-image: url('<?php echo $wp_admin_url; ?> arrows.png'); } #adminmenushadow, #adminmenuback { background-image: url('<?php echo $wp_admin_url; ?> menu-shadow.png'); } #adminmenu li.wp-has-current-submenu.wp-menu-open .wp-menu-toggle, #adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle { background-image: url('<?php echo $wp_admin_url; ?> arrows-dark.png'); } #adminmenu .wp-has-submenu:hover .wp-menu-toggle, #adminmenu .wp-menu-open .wp-menu-toggle { background-image: url('<?php echo $wp_admin_url; ?> arrows.png'); } #collapse-button div { background-image: url('<?php echo $wp_admin_url; ?> arrows.png'); } /* menu and screen icons */ .icon16.icon-dashboard, #adminmenu .menu-icon-dashboard div.wp-menu-image { background-image: url('<?php echo $wp_admin_url; ?> menu.png?ver=20100531'); } #adminmenu .menu-icon-dashboard:hover div.wp-menu-image, #adminmenu .menu-icon-dashboard.wp-has-current-submenu div.wp-menu-image, #adminmenu .menu-icon-dashboard.current div.wp-menu-image { background-image: url('<?php echo $wp_admin_url; ?> menu.png?ver=20100531'); } .icon16.icon-post, #adminmenu .menu-icon-post div.wp-menu-image { background-image: url('<?php echo $wp_admin_url; ?> menu.png?ver=20100531'); } #adminmenu .menu-icon-post:hover div.wp-menu-image, #adminmenu .menu-icon-post.wp-has-current-submenu div.wp-menu-image { background-image: url('<?php echo $wp_admin_url; ?> menu.png?ver=20100531'); } .icon16.icon-media, #adminmenu .menu-icon-media div.wp-menu-image { background-image: url('<?php echo $wp_admin_url; ?> menu.png?ver=20100531'); } #adminmenu .menu-icon-media:hover div.wp-menu-image, #adminmenu .menu-icon-media.wp-has-current-submenu div.wp-menu-image { background-image: url('<?php echo $wp_admin_url; ?> menu.png?ver=20100531'); } .icon16.icon-links, #adminmenu .menu-icon-links div.wp-menu-image { background-image: url('<?php echo $wp_admin_url; ?> menu.png?ver=20100531'); } #adminmenu .menu-icon-links:hover div.wp-menu-image, #adminmenu .menu-icon-links.wp-has-current-submenu div.wp-menu-image { background-image: url('<?php echo $wp_admin_url; ?> menu.png?ver=20100531'); } .icon16.icon-page, #adminmenu .menu-icon-page div.wp-menu-image { background-image: url('<?php echo $wp_admin_url; ?> menu.png?ver=20100531'); } #adminmenu .menu-icon-page:hover div.wp-menu-image, #adminmenu .menu-icon-page.wp-has-current-submenu div.wp-menu-image { background-image: url('<?php echo $wp_admin_url; ?> menu.png?ver=20100531'); } .icon16.icon-comments, #adminmenu .menu-icon-comments div.wp-menu-image { background-image: url('<?php echo $wp_admin_url; ?> menu.png?ver=20100531'); } #adminmenu .menu-icon-comments:hover div.wp-menu-image, #adminmenu .menu-icon-comments.wp-has-current-submenu div.wp-menu-image, #adminmenu .menu-icon-comments.current div.wp-menu-image { background-image: url('<?php echo $wp_admin_url; ?> menu.png?ver=20100531'); } .icon16.icon-appearance, #adminmenu .menu-icon-appearance div.wp-menu-image { background-image: url('<?php echo $wp_admin_url; ?> menu.png?ver=20100531'); } #adminmenu .menu-icon-appearance:hover div.wp-menu-image, #adminmenu .menu-icon-appearance.wp-has-current-submenu div.wp-menu-image { background-image: url('<?php echo $wp_admin_url; ?> menu.png?ver=20100531'); } .icon16.icon-plugins, #adminmenu .menu-icon-plugins div.wp-menu-image { background-image: url('<?php echo $wp_admin_url; ?> menu.png?ver=20100531'); } #adminmenu .menu-icon-plugins:hover div.wp-menu-image, #adminmenu .menu-icon-plugins.wp-has-current-submenu div.wp-menu-image { background-image: url('<?php echo $wp_admin_url; ?> menu.png?ver=20100531'); } .icon16.icon-users, #adminmenu .menu-icon-users div.wp-menu-image { background-image: url('<?php echo $wp_admin_url; ?> menu.png?ver=20100531'); } #adminmenu .menu-icon-users:hover div.wp-menu-image, #adminmenu .menu-icon-users.wp-has-current-submenu div.wp-menu-image, #adminmenu .menu-icon-users.current div.wp-menu-image { background-image: url('<?php echo $wp_admin_url; ?> menu.png?ver=20100531'); } .icon16.icon-tools, #adminmenu .menu-icon-tools div.wp-menu-image { background-image: url('<?php echo $wp_admin_url; ?> menu.png?ver=20100531'); } #adminmenu .menu-icon-tools:hover div.wp-menu-image, #adminmenu .menu-icon-tools.wp-has-current-submenu div.wp-menu-image, #adminmenu .menu-icon-tools.current div.wp-menu-image { background-image: url('<?php echo $wp_admin_url; ?> menu.png?ver=20100531'); } .icon16.icon-settings, #adminmenu .menu-icon-settings div.wp-menu-image { background-image: url('<?php echo $wp_admin_url; ?> menu.png?ver=20100531'); } #adminmenu .menu-icon-settings:hover div.wp-menu-image, #adminmenu .menu-icon-settings.wp-has-current-submenu div.wp-menu-image { background-image: url('<?php echo $wp_admin_url; ?> menu.png?ver=20100531'); } .icon16.icon-site, #adminmenu .menu-icon-site div.wp-menu-image { background-image: url('<?php echo $wp_admin_url; ?> menu.png?ver=20100531'); } #adminmenu .menu-icon-site:hover div.wp-menu-image, #adminmenu .menu-icon-site.wp-has-current-submenu div.wp-menu-image { background-image: url('<?php echo $wp_admin_url; ?> menu.png?ver=20100531'); } /* end menu and screen icons */ /* Screen Icons */ .icon32.icon-post, #icon-edit, #icon-post { background-image: url('<?php echo $wp_admin_url; ?> icons32.png?ver=20100531'); } .icon32.icon-dashboard, #icon-index { background-image: url('<?php echo $wp_admin_url; ?> icons32.png?ver=20100531'); } .icon32.icon-media, #icon-upload { background-image: url('<?php echo $wp_admin_url; ?> icons32.png?ver=20100531'); } .icon32.icon-links, #icon-link-manager, #icon-link, #icon-link-category { background-image: url('<?php echo $wp_admin_url; ?> icons32.png?ver=20100531'); } .icon32.icon-page, #icon-edit-pages, #icon-page { background-image: url('<?php echo $wp_admin_url; ?> icons32.png?ver=20100531'); } .icon32.icon-comments, #icon-edit-comments { background-image: url('<?php echo $wp_admin_url; ?> icons32.png?ver=20100531'); } .icon32.icon-appearance, #icon-themes { background-image: url('<?php echo $wp_admin_url; ?> icons32.png?ver=20100531'); } .icon32.icon-plugins, #icon-plugins { background-image: url('<?php echo $wp_admin_url; ?> icons32.png?ver=20100531'); } .icon32.icon-users, #icon-users, #icon-profile, #icon-user-edit { background-image: url('<?php echo $wp_admin_url; ?> icons32.png?ver=20100531'); } .icon32.icon-tools, #icon-tools, #icon-admin { background-image: url('<?php echo $wp_admin_url; ?> icons32.png?ver=20100531'); } .icon32.icon-settings, #icon-options-general { background-image: url('<?php echo $wp_admin_url; ?> icons32.png?ver=20100531'); } .icon32.icon-site, #icon-ms-admin { background-image: url('<?php echo $wp_admin_url; ?> icons32.png?ver=20100531'); } /* end screen icons */ .meta-box-sortables .postbox:hover .handlediv { background-image: url('<?php echo $wp_admin_url; ?> arrows.png'); } .tablenav .tablenav-pages a { background-image: url('<?php echo $wp_admin_url; ?> menu-bits.gif?ver=20100610'); } .view-switch #view-switch-list { background-image: url('<?php echo $wp_admin_url; ?> list.png'); } .view-switch .current #view-switch-list { background-image: url('<?php echo $wp_admin_url; ?> list.png'); } .view-switch #view-switch-excerpt { background-image: url('<?php echo $wp_admin_url; ?> list.png'); } .view-switch .current #view-switch-excerpt { background-image: url('<?php echo $wp_admin_url; ?> list.png'); } #header-logo { background-image: url('<?php echo $wp_admin_url; ?> wp-logo.png?ver=20110504'); } .sidebar-name-arrow { background-image: url('<?php echo $wp_admin_url; ?> arrows.png'); } .sidebar-name:hover .sidebar-name-arrow { background-image: url('<?php echo $wp_admin_url; ?> arrows-dark.png'); } .item-edit { background-image: url('<?php echo $wp_admin_url; ?> arrows.png'); } .item-edit:hover { background-image: url('<?php echo $wp_admin_url; ?> arrows-dark.png'); } .wp-badge { background-image: url('<?php echo $wp_admin_url; ?> wp-badge.png'); background-image: url('<?php echo $wp_admin_url; ?> wp-badge.png'), -ms-linear-gradient(top, #378aac, #165d84); /* IE10 */ background-image: url('<?php echo $wp_admin_url; ?> wp-badge.png'), -moz-linear-gradient(top, #378aac, #165d84); /* Firefox */ background-image: url('<?php echo $wp_admin_url; ?> wp-badge.png'), -o-linear-gradient(top, #378aac, #165d84); /* Opera */ background-image: url('<?php echo $wp_admin_url; ?> wp-badge.png'), -webkit-gradient(linear, left top, left bottom, from(#378aac), to(#165d84)); /* old Webkit */ background-image: url('<?php echo $wp_admin_url; ?> wp-badge.png'), -webkit-linear-gradient(top, #378aac, #165d84); /* new Webkit */ background-image: url('<?php echo $wp_admin_url; ?> wp-badge.png'), linear-gradient(top, #378aac, #165d84); /* proposed W3C Markup */ } .rtl .post-com-count { background-image: url('<?php echo $wp_admin_url; ?> bubble_bg-rtl.gif'); } /* Menu */ .rtl #adminmenushadow, .rtl #adminmenuback { background-image: url('<?php echo $wp_admin_url; ?> menu-shadow-rtl.png'); } .rtl #adminmenu li.wp-has-current-submenu.wp-menu-open .wp-menu-toggle, .rtl #adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle { background-image: url('<?php echo $wp_admin_url; ?> arrows-dark.png'); } .rtl #adminmenu .wp-has-submenu:hover .wp-menu-toggle, .rtl #adminmenu .wp-menu-open .wp-menu-toggle { background-image: url('<?php echo $wp_admin_url; ?> arrows.png'); } .rtl .meta-box-sortables .postbox:hover .handlediv { background-image: url('<?php echo $wp_admin_url; ?> arrows.png'); } .rtl .tablenav .tablenav-pages a { background-image: url('<?php echo $wp_admin_url; ?> menu-bits-rtl.gif?ver=20100610'); } .rtl .sidebar-name-arrow { background-image: url('<?php echo $wp_admin_url; ?> arrows.png'); } .rtl .sidebar-name:hover .sidebar-name-arrow { background-image: url('<?php echo $wp_admin_url; ?> arrows-dark.png'); } @media only screen and (-webkit-min-device-pixel-ratio: 1.5) { .icon32.icon-post, #icon-edit, #icon-post, .icon32.icon-dashboard, #icon-index, .icon32.icon-media, #icon-upload, .icon32.icon-links, #icon-link-manager, #icon-link, #icon-link-category, .icon32.icon-page, #icon-edit-pages, #icon-page, .icon32.icon-comments, #icon-edit-comments, .icon32.icon-appearance, #icon-themes, .icon32.icon-plugins, #icon-plugins, .icon32.icon-users, #icon-users, #icon-profile, #icon-user-edit, .icon32.icon-tools, #icon-tools, #icon-admin, .icon32.icon-settings, #icon-options-general, .icon32.icon-site, #icon-ms-admin { background-image: url('<?php echo $wp_admin_url; ?> icons32-2x.png?ver=20120412') !important; background-size: 708px 45px; } .icon16.icon-dashboard, .menu-icon-dashboard div.wp-menu-image, .icon16.icon-post, .menu-icon-post div.wp-menu-image, .icon16.icon-media, .menu-icon-media div.wp-menu-image, .icon16.icon-links, .menu-icon-links div.wp-menu-image, .icon16.icon-page, .menu-icon-page div.wp-menu-image, .icon16.icon-comments, .menu-icon-comments div.wp-menu-image, .icon16.icon-appearance, .menu-icon-appearance div.wp-menu-image, .icon16.icon-plugins, .menu-icon-plugins div.wp-menu-image, .icon16.icon-users, .menu-icon-users div.wp-menu-image, .icon16.icon-tools, .menu-icon-tools div.wp-menu-image, .icon16.icon-settings, .menu-icon-settings div.wp-menu-image, .icon16.icon-site, .menu-icon-site div.wp-menu-image { background-image: url('<?php echo $wp_admin_url; ?> menu-2x.png?ver=20120412') !important; background-size: 390px 64px; } } <?php } ?> /*]]>*/ </style> <?php }
/** * Register bundled theme packages * * Note that since we currently have complete control over bbp-themes and * the bbp-theme-compat folders, it's fine to hardcode these here. If at a * later date we need to automate this, and API will need to be built. * * @since bbPress (r3829) */ public function register_theme_packages() { /** Default Theme *****************************************************/ bbp_register_theme_package(array('id' => 'default', 'name' => __('bbPress Default', 'bbpress'), 'version' => bbp_get_version(), 'dir' => trailingslashit($this->plugin_dir . 'bbp-theme-compat'), 'url' => trailingslashit($this->plugin_url . 'bbp-theme-compat'))); /** Twenty Ten ********************************************************/ bbp_register_theme_package(array('id' => 'bbp-twentyten', 'name' => __('Twenty Ten (bbPress)', 'bbpress'), 'version' => bbp_get_version(), 'dir' => trailingslashit($this->themes_dir . 'bbp-twentyten'), 'url' => trailingslashit($this->themes_url . 'bbp-twentyten'))); }
/** * Output the bbPress version * * @since 2.0.0 bbPress (r3468) * * @uses bbp_get_version() To get the bbPress version */ function bbp_version() { echo bbp_get_version(); }
/** * Output the credits screen * * @since bbPress (r4159) */ public function credits_screen() { $display_version = bbp_get_version(); ?> <div class="wrap about-wrap"> <h1><?php printf(__('Welcome to bbPress %s'), $display_version); ?> </h1> <div class="about-text"><?php printf(__('Thank you for updating to the latest version! bbPress %s is ready to make your community a safer, faster, and better looking place to hang out!'), $display_version); ?> </div> <div class="bbp-badge"><?php printf(__('Version %s'), $display_version); ?> </div> <h2 class="nav-tab-wrapper"> <a href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'bbp-about'), 'index.php'))); ?> " class="nav-tab"> <?php _e('What’s New'); ?> </a><a href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'bbp-credits'), 'index.php'))); ?> " class="nav-tab nav-tab-active"> <?php _e('Credits'); ?> </a> </h2> <div class="return-to-dashboard"> <a href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'bbp-settings'), 'index.php'))); ?> "><?php _e('Go to Forum Settings'); ?> </a> </div> </div> <?php }
/** * Stuff to do when the bbPress plugin is ready. * * @since 3.4.1 */ function ass_bbp_ready() { /** * bbPress v2.5.4 changed how emails are sent out. * * They now send one BCC email to their subscribers, so we have to filter out * the topic subscribers before their email is sent. */ if (version_compare(bbp_get_version(), '2.5.4') >= 0) { add_filter('bbp_subscription_mail_title', 'ass_bbp_add_topic_subscribers_filter', 99); add_action('bbp_pre_notify_subscribers', 'ass_bbp_remove_topic_subscribers_filter', 0); // bbPress <= v2.5.3 } else { add_filter('bbp_subscription_mail_message', 'ass_bbp_disable_email', 10, 4); } }
/** * Submit data to Akismet service with unique bbPress User Agent * * This code is directly taken from the akismet_http_post() function and * documented to bbPress 2.0 standard. * * @since 2.0.0 bbPress (r3466) * * @param string $request The request we are sending * @param string $host The host to send our request to * @param string $path The path from the host * @param string $port The port to use * @param string $ip Optional Override $host with an IP address * @uses bbp_get_version() To get the current bbPress version * @return mixed WP_Error on error, array on success, empty on failure */ private function http_post($request, $host, $path, $port = 80, $ip = '') { // Preload required variables $bbp_version = bbp_get_version(); $http_host = $host; $blog_charset = get_option('blog_charset'); $response = ''; // Untque User Agent $akismet_ua = "bbPress/{$bbp_version} | "; $akismet_ua .= 'Akismet/' . constant('AKISMET_VERSION'); // Use specific IP (if provided) if (!empty($ip) && long2ip(ip2long($ip))) { $http_host = $ip; } // Setup the arguments $http_args = array('body' => $request, 'headers' => array('Content-Type' => 'application/x-www-form-urlencoded; charset=' . $blog_charset, 'Host' => $host, 'User-Agent' => $akismet_ua), 'httpversion' => '1.0', 'timeout' => 15); // Where we are sending our request $akismet_url = 'http://' . $http_host . $path; // Send the request $response = wp_remote_post($akismet_url, $http_args); // Bail if the response is an error if (is_wp_error($response)) { return ''; } // No errors so return response return array($response['headers'], $response['body']); }
/** * Output the credits screen * * Hardcoding this in here is pretty janky. It's fine for 2.2, but we'll * want to leverage api.wordpress.org eventually. * * @since bbPress (r4159) */ public function credits_screen() { list($display_version) = explode('-', bbp_get_version()); ?> <div class="wrap about-wrap"> <h1><?php printf(__('Welcome to bbPress %s'), $display_version); ?> </h1> <div class="about-text"><?php printf(__('Thank you for updating to the latest version! bbPress %s is ready to make your community a safer, faster, and better looking place to hang out!'), $display_version); ?> </div> <div class="bbp-badge"><?php printf(__('Version %s'), $display_version); ?> </div> <h2 class="nav-tab-wrapper"> <a href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'bbp-about'), 'index.php'))); ?> " class="nav-tab"> <?php _e('What’s New'); ?> </a><a href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'bbp-credits'), 'index.php'))); ?> " class="nav-tab nav-tab-active"> <?php _e('Credits'); ?> </a> </h2> <p class="about-description"><?php _e('bbPress is created by a worldwide swarm of busy, busy bees.', 'bbpress'); ?> </p> <h4 class="wp-people-group"><?php _e('Project Leaders', 'bbpress'); ?> </h4> <ul class="wp-people-group " id="wp-people-group-project-leaders"> <li class="wp-person" id="wp-person-matt"> <a href="http://profiles.wordpress.org/matt"><img src="http://0.gravatar.com/avatar/767fc9c115a1b989744c755db47feb60?s=60" class="gravatar" alt="Matt Mullenweg" /></a> <a class="web" href="http://profiles.wordpress.org/matt">Matt Mullenweg</a> <span class="title"><?php _e('Founding Developer', 'bbpress'); ?> </span> </li> <li class="wp-person" id="wp-person-johnjamesjacoby"> <a href="http://profiles.wordpress.org/johnjamesjacoby"><img src="http://0.gravatar.com/avatar/81ec16063d89b162d55efe72165c105f?s=60" class="gravatar" alt="John James Jacoby" /></a> <a class="web" href="http://profiles.wordpress.org/johnjamesjacoby">John James Jacoby</a> <span class="title"><?php _e('Lead Developer', 'bbpress'); ?> </span> </li> </ul> <h4 class="wp-people-group"><?php _e('Contributing Developers', 'bbpress'); ?> </h4> <ul class="wp-people-group " id="wp-people-group-contributing-developers"> <li class="wp-person" id="wp-person-jmdodd"> <a href="http://profiles.wordpress.org/jmdodd"><img src="http://0.gravatar.com/avatar/6a7c997edea340616bcc6d0fe03f65dd?s=60" class="gravatar" alt="Jennifer M. Dodd" /></a> <a class="web" href="http://profiles.wordpress.org/jmdodd">Jennifer M. Dodd</a> <span class="title"></span> </li> <li class="wp-person" id="wp-person-jaredatch"> <a href="http://profiles.wordpress.org/jaredatch"><img src="http://0.gravatar.com/avatar/e341eca9e1a85dcae7127044301b4363?s=60" class="gravatar" alt="Jared Atchison" /></a> <a class="web" href="http://profiles.wordpress.org/jaredatch">Jared Atchison</a> <span class="title"></span> </li> <li class="wp-person" id="wp-person-gautamgupta"> <a href="http://profiles.wordpress.org/gautamgupta"><img src="http://0.gravatar.com/avatar/b0810422cbe6e4eead4def5ae7a90b34?s=60" class="gravatar" alt="Gautam Gupta" /></a> <a class="web" href="http://profiles.wordpress.org/gautamgupta">Gautam Gupta</a> <span class="title"></span> </li> </ul> <h4 class="wp-people-group"><?php _e('Codex Rockstars', 'bbpress'); ?> </h4> <ul class="wp-people-group " id="wp-people-group-codex-rockstars"> <li class="wp-person" id="wp-person-masonjames"> <a href="http://profiles.wordpress.org/masonjames"><img src="http://0.gravatar.com/avatar/99dee4d5287d0f9e26ff72e7228d97ac?s=60" class="gravatar" alt="Mason James" /></a> <a class="web" href="http://profiles.wordpress.org/masonjames">Mason James</a> <span class="title"></span> </li> <li class="wp-person" id="wp-person-wordsforwp"> <a href="http://profiles.wordpress.org/wordsforwp"><img src="http://0.gravatar.com/avatar/5437119b446adad1af813c44944e6c9c?s=60" class="gravatar" alt="Siobhan McKeown" /></a> <a class="web" href="http://profiles.wordpress.org/wordsforwp">Siobhan McKeown</a> <span class="title"></span> </li> <li class="wp-person" id="wp-person-JarretC"> <a href="http://profiles.wordpress.org/JarretC"><img src="http://0.gravatar.com/avatar/e00501bf782b42d5db19ff75fca14f6a?s=60" class="gravatar" alt="Jarret Cade" /></a> <a class="web" href="http://profiles.wordpress.org/JarretC">Jarret Cade</a> <span class="title"></span> </li> </ul> <h4 class="wp-people-group"><?php _e('Core Contributors to bbPress 2.2', 'bbpress'); ?> </h4> <p class="wp-credits-list"> <a href="http://profiles.wordpress.org/alexvorn2">alexvorn2</a>, <a href="http://profiles.wordpress.org/anointed">anointed</a>, <a href="http://profiles.wordpress.org/boonebgorges">boonebgorges</a>, <a href="http://profiles.wordpress.org/chexee">chexee</a>, <a href="http://profiles.wordpress.org/cnorris23">cnorris23</a>, <a href="http://profiles.wordpress.org/DanielJuhl">DanielJuhl</a>, <a href="http://profiles.wordpress.org/daveshine">daveshine</a>, <a href="http://profiles.wordpress.org/dimadin">dimadin</a>, <a href="http://profiles.wordpress.org/DJPaul">DJPaul</a>, <a href="http://profiles.wordpress.org/duck_">duck_</a>, <a href="http://profiles.wordpress.org/gawain">gawain</a>, <a href="http://profiles.wordpress.org/iamzippy">iamzippy</a>, <a href="http://profiles.wordpress.org/isaacchapman">isaacchapman</a>, <a href="http://profiles.wordpress.org/jane">jane</a>, <a href="http://profiles.wordpress.org/jkudish">jkudish</a>, <a href="http://profiles.wordpress.org/mamaduka">mamaduka</a>, <a href="http://profiles.wordpress.org/mercime">mercime</a>, <a href="http://profiles.wordpress.org/mesayre">mesayre</a>, <a href="http://profiles.wordpress.org/mordauk">mordauk</a>, <a href="http://profiles.wordpress.org/MZAWeb">MZAWeb</a>, <a href="http://profiles.wordpress.org/netweb">netweb</a>, <a href="http://profiles.wordpress.org/nexia">nexia</a>, <a href="http://profiles.wordpress.org/Omicron7">Omicron7</a>, <a href="http://profiles.wordpress.org/otto42">otto42</a>, <a href="http://profiles.wordpress.org/pavelevap">pavelevap</a>, <a href="http://profiles.wordpress.org/plescheff">plescheff</a>, <a href="http://profiles.wordpress.org/scribu">scribu</a>, <a href="http://profiles.wordpress.org/sorich87">sorich87</a>, <a href="http://profiles.wordpress.org/SteveAtty">SteveAtty</a>, <a href="http://profiles.wordpress.org/tmoorewp">tmoorewp</a>, <a href="http://profiles.wordpress.org/tott">tott</a>, <a href="http://profiles.wordpress.org/tungdo">tungdo</a>, <a href="http://profiles.wordpress.org/vibol">vibol</a>, <a href="http://profiles.wordpress.org/wonderboymusic">wonderboymusic</a>, <a href="http://profiles.wordpress.org/westi">westi</a>, <a href="http://profiles.wordpress.org/xiosen">xiosen</a>, </p> <div class="return-to-dashboard"> <a href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'bbpress'), 'options-general.php'))); ?> "><?php _e('Go to Forum Settings'); ?> </a> </div> </div> <?php }
/** * The main bbPress (Default) Loader * * @since bbPress (r3732) * * @uses BBP_IOA::setup_globals() * @uses BBP_IOA::setup_actions() */ public function __construct($properties = array()) { parent::__construct(bbp_parse_args($properties, array('id' => 'IOA', 'name' => __('BBPress IOA', 'bbpress'), 'version' => bbp_get_version(), 'dir' => trailingslashit(get_template_directory() . '/external/bbpress'), 'url' => trailingslashit(get_template_directory_uri() . '/external/bbpress')), 'default_theme')); $this->setup_actions(); }
/** * bbPress Dashboard Right Now Widget * * Adds a dashboard widget with forum statistics * * @since 2.0.0 bbPress (r2770) * * @deprecated 2.6.0 bbPress (r5268) * * @uses bbp_get_version() To get the current bbPress version * @uses bbp_get_statistics() To get the forum statistics * @uses current_user_can() To check if the user is capable of doing things * @uses bbp_get_forum_post_type() To get the forum post type * @uses bbp_get_topic_post_type() To get the topic post type * @uses bbp_get_reply_post_type() To get the reply post type * @uses get_admin_url() To get the administration url * @uses add_query_arg() To add custom args to the url * @uses do_action() Calls 'bbp_dashboard_widget_right_now_content_table_end' * below the content table * @uses do_action() Calls 'bbp_dashboard_widget_right_now_table_end' * below the discussion table * @uses do_action() Calls 'bbp_dashboard_widget_right_now_discussion_table_end' * below the discussion table * @uses do_action() Calls 'bbp_dashboard_widget_right_now_end' below the widget */ function bbp_dashboard_widget_right_now() { // Get the statistics $r = bbp_get_statistics(); ?> <div class="table table_content"> <p class="sub"><?php esc_html_e('Discussion', 'bbpress'); ?> </p> <table> <tr class="first"> <?php $num = $r['forum_count']; $text = _n('Forum', 'Forums', $r['forum_count'], 'bbpress'); if (current_user_can('publish_forums')) { $link = add_query_arg(array('post_type' => bbp_get_forum_post_type()), get_admin_url(null, 'edit.php')); $num = '<a href="' . esc_url($link) . '">' . $num . '</a>'; $text = '<a href="' . esc_url($link) . '">' . $text . '</a>'; } ?> <td class="first b b-forums"><?php echo $num; ?> </td> <td class="t forums"><?php echo $text; ?> </td> </tr> <tr> <?php $num = $r['topic_count']; $text = _n('Topic', 'Topics', $r['topic_count'], 'bbpress'); if (current_user_can('publish_topics')) { $link = add_query_arg(array('post_type' => bbp_get_topic_post_type()), get_admin_url(null, 'edit.php')); $num = '<a href="' . esc_url($link) . '">' . $num . '</a>'; $text = '<a href="' . esc_url($link) . '">' . $text . '</a>'; } ?> <td class="first b b-topics"><?php echo $num; ?> </td> <td class="t topics"><?php echo $text; ?> </td> </tr> <tr> <?php $num = $r['reply_count']; $text = _n('Reply', 'Replies', $r['reply_count'], 'bbpress'); if (current_user_can('publish_replies')) { $link = add_query_arg(array('post_type' => bbp_get_reply_post_type()), get_admin_url(null, 'edit.php')); $num = '<a href="' . esc_url($link) . '">' . $num . '</a>'; $text = '<a href="' . esc_url($link) . '">' . $text . '</a>'; } ?> <td class="first b b-replies"><?php echo $num; ?> </td> <td class="t replies"><?php echo $text; ?> </td> </tr> <?php if (bbp_allow_topic_tags()) { ?> <tr> <?php $num = $r['topic_tag_count']; $text = _n('Topic Tag', 'Topic Tags', $r['topic_tag_count'], 'bbpress'); if (current_user_can('manage_topic_tags')) { $link = add_query_arg(array('taxonomy' => bbp_get_topic_tag_tax_id(), 'post_type' => bbp_get_topic_post_type()), get_admin_url(null, 'edit-tags.php')); $num = '<a href="' . esc_url($link) . '">' . $num . '</a>'; $text = '<a href="' . esc_url($link) . '">' . $text . '</a>'; } ?> <td class="first b b-topic_tags"><span class="total-count"><?php echo $num; ?> </span></td> <td class="t topic_tags"><?php echo $text; ?> </td> </tr> <?php } ?> <?php do_action('bbp_dashboard_widget_right_now_content_table_end'); ?> </table> </div> <div class="table table_discussion"> <p class="sub"><?php esc_html_e('Users & Moderation', 'bbpress'); ?> </p> <table> <tr class="first"> <?php $num = $r['user_count']; $text = _n('User', 'Users', $r['user_count'], 'bbpress'); if (current_user_can('edit_users')) { $link = get_admin_url(null, 'users.php'); $num = '<a href="' . $link . '">' . $num . '</a>'; $text = '<a href="' . $link . '">' . $text . '</a>'; } ?> <td class="b b-users"><span class="total-count"><?php echo $num; ?> </span></td> <td class="last t users"><?php echo $text; ?> </td> </tr> <?php if (isset($r['topic_count_hidden'])) { ?> <tr> <?php $num = $r['topic_count_hidden']; $text = _n('Hidden Topic', 'Hidden Topics', $r['topic_count_hidden'], 'bbpress'); $link = add_query_arg(array('post_type' => bbp_get_topic_post_type()), get_admin_url(null, 'edit.php')); if ('0' !== $num) { $link = add_query_arg(array('post_status' => bbp_get_spam_status_id()), $link); } $num = '<a href="' . esc_url($link) . '" title="' . esc_attr($r['hidden_topic_title']) . '">' . $num . '</a>'; $text = '<a class="waiting" href="' . esc_url($link) . '" title="' . esc_attr($r['hidden_topic_title']) . '">' . $text . '</a>'; ?> <td class="b b-hidden-topics"><?php echo $num; ?> </td> <td class="last t hidden-replies"><?php echo $text; ?> </td> </tr> <?php } ?> <?php if (isset($r['reply_count_hidden'])) { ?> <tr> <?php $num = $r['reply_count_hidden']; $text = _n('Hidden Reply', 'Hidden Replies', $r['reply_count_hidden'], 'bbpress'); $link = add_query_arg(array('post_type' => bbp_get_reply_post_type()), get_admin_url(null, 'edit.php')); if ('0' !== $num) { $link = add_query_arg(array('post_status' => bbp_get_spam_status_id()), $link); } $num = '<a href="' . esc_url($link) . '" title="' . esc_attr($r['hidden_reply_title']) . '">' . $num . '</a>'; $text = '<a class="waiting" href="' . esc_url($link) . '" title="' . esc_attr($r['hidden_reply_title']) . '">' . $text . '</a>'; ?> <td class="b b-hidden-replies"><?php echo $num; ?> </td> <td class="last t hidden-replies"><?php echo $text; ?> </td> </tr> <?php } ?> <?php if (bbp_allow_topic_tags() && isset($r['empty_topic_tag_count'])) { ?> <tr> <?php $num = $r['empty_topic_tag_count']; $text = _n('Empty Topic Tag', 'Empty Topic Tags', $r['empty_topic_tag_count'], 'bbpress'); $link = add_query_arg(array('taxonomy' => bbp_get_topic_tag_tax_id(), 'post_type' => bbp_get_topic_post_type()), get_admin_url(null, 'edit-tags.php')); $num = '<a href="' . esc_url($link) . '">' . $num . '</a>'; $text = '<a class="waiting" href="' . esc_url($link) . '">' . $text . '</a>'; ?> <td class="b b-hidden-topic-tags"><?php echo $num; ?> </td> <td class="last t hidden-topic-tags"><?php echo $text; ?> </td> </tr> <?php } ?> <?php do_action('bbp_dashboard_widget_right_now_discussion_table_end'); ?> </table> </div> <?php do_action('bbp_dashboard_widget_right_now_table_end'); ?> <div class="versions"> <span id="wp-version-message"> <?php printf(__('You are using <span class="b">bbPress %s</span>.', 'bbpress'), bbp_get_version()); ?> </span> </div> <br class="clear" /> <?php do_action('bbp_dashboard_widget_right_now_end'); }
/** * Add some general styling to the admin area * * @since bbPress (r2464) * * @uses bbp_get_forum_post_type() To get the forum post type * @uses bbp_get_topic_post_type() To get the topic post type * @uses bbp_get_reply_post_type() To get the reply post type * @uses sanitize_html_class() To sanitize the classes */ public function admin_head() { // Remove the individual recount and converter menus. // They are grouped together by h2 tabs remove_submenu_page('tools.php', 'bbp-repair'); remove_submenu_page('tools.php', 'bbp-converter'); remove_submenu_page('tools.php', 'bbp-reset'); // Icons for top level admin menus $version = bbp_get_version(); $menu_icon_url = $this->images_url . 'menu.png?ver=' . $version; $icon32_url = $this->images_url . 'icons32.png?ver=' . $version; $menu_icon_url_2x = $this->images_url . 'menu-2x.png?ver=' . $version; $icon32_url_2x = $this->images_url . 'icons32-2x.png?ver=' . $version; // Top level menu classes $forum_class = sanitize_html_class(bbp_get_forum_post_type()); $topic_class = sanitize_html_class(bbp_get_topic_post_type()); $reply_class = sanitize_html_class(bbp_get_reply_post_type()); ?> <style type="text/css" media="screen"> /*<![CDATA[*/ #bbp-dashboard-right-now p.sub, #bbp-dashboard-right-now .table, #bbp-dashboard-right-now .versions { margin: -12px; } #bbp-dashboard-right-now .inside { font-size: 12px; padding-top: 20px; margin-bottom: 0; } #bbp-dashboard-right-now p.sub { padding: 5px 0 15px; color: #8f8f8f; font-size: 14px; position: absolute; top: -17px; left: 15px; } body.rtl #bbp-dashboard-right-now p.sub { right: 15px; left: 0; } #bbp-dashboard-right-now .table { margin: 0; padding: 0; position: relative; } #bbp-dashboard-right-now .table_content { float: left; border-top: #ececec 1px solid; width: 45%; } body.rtl #bbp-dashboard-right-now .table_content { float: right; } #bbp-dashboard-right-now .table_discussion { float: right; border-top: #ececec 1px solid; width: 45%; } body.rtl #bbp-dashboard-right-now .table_discussion { float: left; } #bbp-dashboard-right-now table td { padding: 3px 0; white-space: nowrap; } #bbp-dashboard-right-now table tr.first td { border-top: none; } #bbp-dashboard-right-now td.b { padding-right: 6px; text-align: right; font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif; font-size: 14px; width: 1%; } body.rtl #bbp-dashboard-right-now td.b { padding-left: 6px; padding-right: 0; } #bbp-dashboard-right-now td.b a { font-size: 18px; } #bbp-dashboard-right-now td.b a:hover { color: #d54e21; } #bbp-dashboard-right-now .t { font-size: 12px; padding-right: 12px; padding-top: 6px; color: #777; } body.rtl #bbp-dashboard-right-now .t { padding-left: 12px; padding-right: 0; } #bbp-dashboard-right-now .t a { white-space: nowrap; } #bbp-dashboard-right-now .spam { color: red; } #bbp-dashboard-right-now .waiting { color: #e66f00; } #bbp-dashboard-right-now .approved { color: green; } #bbp-dashboard-right-now .versions { padding: 6px 10px 12px; clear: both; } #bbp-dashboard-right-now .versions .b { font-weight: bold; } #bbp-dashboard-right-now a.button { float: right; clear: right; position: relative; top: -5px; } body.rtl #bbp-dashboard-right-now a.button { float: left; clear: left; } /* Icon 32 */ #icon-edit.icon32-posts-<?php echo $forum_class; ?> , #icon-edit.icon32-posts-<?php echo $topic_class; ?> , #icon-edit.icon32-posts-<?php echo $reply_class; ?> { background: url('<?php echo $icon32_url; ?> '); background-repeat: no-repeat; } /* Icon Positions */ #icon-edit.icon32-posts-<?php echo $forum_class; ?> { background-position: -4px 0px; } #icon-edit.icon32-posts-<?php echo $topic_class; ?> { background-position: -4px -90px; } #icon-edit.icon32-posts-<?php echo $reply_class; ?> { background-position: -4px -180px; } /* Icon 32 2x */ @media only screen and (-webkit-min-device-pixel-ratio: 1.5) { #icon-edit.icon32-posts-<?php echo $forum_class; ?> , #icon-edit.icon32-posts-<?php echo $topic_class; ?> , #icon-edit.icon32-posts-<?php echo $reply_class; ?> { background-image: url('<?php echo $icon32_url_2x; ?> '); background-size: 45px 255px; } } /* Menu */ #menu-posts-<?php echo $forum_class; ?> .wp-menu-image, #menu-posts-<?php echo $topic_class; ?> .wp-menu-image, #menu-posts-<?php echo $reply_class; ?> .wp-menu-image, #menu-posts-<?php echo $forum_class; ?> :hover .wp-menu-image, #menu-posts-<?php echo $topic_class; ?> :hover .wp-menu-image, #menu-posts-<?php echo $reply_class; ?> :hover .wp-menu-image, #menu-posts-<?php echo $forum_class; ?> .wp-has-current-submenu .wp-menu-image, #menu-posts-<?php echo $topic_class; ?> .wp-has-current-submenu .wp-menu-image, #menu-posts-<?php echo $reply_class; ?> .wp-has-current-submenu .wp-menu-image { background: url('<?php echo $menu_icon_url; ?> '); background-repeat: no-repeat; } /* Menu Positions */ #menu-posts-<?php echo $forum_class; ?> .wp-menu-image { background-position: 0px -32px; } #menu-posts-<?php echo $forum_class; ?> :hover .wp-menu-image, #menu-posts-<?php echo $forum_class; ?> .wp-has-current-submenu .wp-menu-image { background-position: 0px 0px; } #menu-posts-<?php echo $topic_class; ?> .wp-menu-image { background-position: -70px -32px; } #menu-posts-<?php echo $topic_class; ?> :hover .wp-menu-image, #menu-posts-<?php echo $topic_class; ?> .wp-has-current-submenu .wp-menu-image { background-position: -70px 0px; } #menu-posts-<?php echo $reply_class; ?> .wp-menu-image { background-position: -35px -32px; } #menu-posts-<?php echo $reply_class; ?> :hover .wp-menu-image, #menu-posts-<?php echo $reply_class; ?> .wp-has-current-submenu .wp-menu-image { background-position: -35px 0px; } /* Menu 2x */ @media only screen and (-webkit-min-device-pixel-ratio: 1.5) { #menu-posts-<?php echo $forum_class; ?> .wp-menu-image, #menu-posts-<?php echo $topic_class; ?> .wp-menu-image, #menu-posts-<?php echo $reply_class; ?> .wp-menu-image, #menu-posts-<?php echo $forum_class; ?> :hover .wp-menu-image, #menu-posts-<?php echo $topic_class; ?> :hover .wp-menu-image, #menu-posts-<?php echo $reply_class; ?> :hover .wp-menu-image, #menu-posts-<?php echo $forum_class; ?> .wp-has-current-submenu .wp-menu-image, #menu-posts-<?php echo $topic_class; ?> .wp-has-current-submenu .wp-menu-image, #menu-posts-<?php echo $reply_class; ?> .wp-has-current-submenu .wp-menu-image { background-image: url('<?php echo $menu_icon_url_2x; ?> '); background-size: 100px 64px; } } /*]]>*/ </style> <?php }
/** * Submit data to Akismet service with unique bbPress User Agent * * This code is directly taken from the akismet_http_post() function and * documented to bbPress 2.0 standard. * * @since bbPress (r3466) * * @param string $request The request we are sending * @param string $host The host to send our request to * @param string $path The path from the host * @param string $port The port to use * @param string $ip Optional Override $host with an IP address * @uses bbp_get_version() To get the current bbPress version * @return mixed WP_Error on error, array on success, empty on failure */ private function http_post($request, $host, $path, $port = 80, $ip = '') { // Preload required variables $bbp_version = bbp_get_version(); $content_length = strlen($request); $http_host = $host; $blog_charset = get_option('blog_charset'); $response = ''; $errno = null; $errstr = null; // Untque User Agent $akismet_ua = "bbPress/{$bbp_version} | "; $akismet_ua .= 'Akismet/' . constant('AKISMET_VERSION'); // Use specific IP (if provided) if (!empty($ip) && long2ip(ip2long($ip))) { $http_host = $ip; } // WP HTTP class is available if (function_exists('wp_remote_post')) { // Setup the arguments $http_args = array('body' => $request, 'headers' => array('Content-Type' => 'application/x-www-form-urlencoded; charset=' . $blog_charset, 'Host' => $host, 'User-Agent' => $akismet_ua), 'httpversion' => '1.0', 'timeout' => 15); // Where we are sending our request $akismet_url = 'http://' . $http_host . $path; // Send the request $response = wp_remote_post($akismet_url, $http_args); // Bail if the response is an error if (is_wp_error($response)) { return ''; } // No errors so return response return array($response['headers'], $response['body']); // WP HTTP class is not available (Why not?) } else { // Header info to use with our socket $http_request = "POST {$path} HTTP/1.0\r\n"; $http_request .= "Host: {$host}\r\n"; $http_request .= "Content-Type: application/x-www-form-urlencoded; charset={$blog_charset}\r\n"; $http_request .= "Content-Length: {$content_length}\r\n"; $http_request .= "User-Agent: {$akismet_ua}\r\n"; $http_request .= "\r\n"; $http_request .= $request; // Open a socket connection if (false != ($fs = @fsockopen($http_host, $port, $errno, $errstr, 10))) { // Write our request to the pointer fwrite($fs, $http_request); // Loop through pointer and compile a response while (!feof($fs)) { // One TCP-IP packet at a time $response .= fgets($fs, 1160); } // Close our socket fclose($fs); // Explode the response into usable data $response = explode("\r\n\r\n", $response, 2); } // Return the response ('' if error/empty) return $response; } }
/** * The main bbPress (Default) Loader * * @since bbPress (r3732) * * @uses BBP_Default::setup_globals() * @uses BBP_Default::setup_actions() */ public function __construct($properties = array()) { parent::__construct(bbp_parse_args($properties, array('id' => 'default', 'name' => __('bbPress Default', 'bbpress'), 'version' => bbp_get_version(), 'dir' => trailingslashit(bbpress()->themes_dir . 'default'), 'url' => trailingslashit(bbpress()->themes_url . 'default')), 'default_theme')); $this->setup_actions(); }
function pp_refresh_options() { global $wpdb, $pp_site_options; do_action('pp_refresh_options'); $pp_site_options = array(); foreach ($wpdb->get_results("SELECT option_name, option_value FROM {$wpdb->options} WHERE option_name LIKE 'pp_%'") as $row) { $pp_site_options[$row->option_name] = $row->option_value; } // this would normally be handled in PPP, but leave here so bbp roles are never listed as WP role groups if (function_exists('bbp_get_version') && version_compare(bbp_get_version(), '2.2', '>=')) { $pp_only_roles = isset($pp_site_options['pp_supplemental_role_defs']) ? maybe_unserialize($pp_site_options['pp_supplemental_role_defs']) : array(); $pp_site_options['pp_supplemental_role_defs'] = serialize(array_merge($pp_only_roles, array('bbp_participant', 'bbp_moderator', 'bbp_keymaster', 'bbp_blocked', 'bbp_spectator'))); } $pp_site_options = apply_filters('pp_options', $pp_site_options); }
function processAdminGeneral($post) { global $wp_roles; // Create a new role. if (!empty($post['CreateRole'])) { if ($newrole = $this->createRole($post['create-name'])) { ak_admin_notify(__('New role created.', $this->cm->ID)); $this->cm->current = $newrole; } else { if (empty($post['create-name']) && (!defined('WPLANG') || !WPLANG)) { ak_admin_error('Error: No role name specified.', $this->cm->ID); } else { ak_admin_error(__('Error: Failed creating the new role.', $this->cm->ID)); } } // Copy current role to a new one. } elseif (!empty($post['CopyRole'])) { $current = get_role($post['current']); if ($newrole = $this->createRole($post['copy-name'], $current->capabilities)) { ak_admin_notify(__('New role created.', $this->cm->ID)); $this->cm->current = $newrole; } else { if (empty($post['copy-name']) && (!defined('WPLANG') || !WPLANG)) { ak_admin_error('Error: No role name specified.', $this->cm->ID); } else { ak_admin_error(__('Error: Failed creating the new role.', $this->cm->ID)); } } // Save role changes. Already saved at start with self::saveRoleCapabilities(). } elseif (!empty($post['SaveRole'])) { if (MULTISITE) { global $wp_roles; if (method_exists($wp_roles, 'reinit')) { $wp_roles->reinit(); } } $this->saveRoleCapabilities($post['current'], $post['caps'], $post['level']); if (defined('PP_ACTIVE')) { // log customized role caps for subsequent restoration // for bbPress < 2.2, need to log customization of roles following bbPress activation $plugins = function_exists('bbp_get_version') && version_compare(bbp_get_version(), '2.2', '<') ? array('bbpress.php') : array(); // back compat if (!($customized_roles = get_option('pp_customized_roles'))) { $customized_roles = array(); } $customized_roles[$post['role']] = (object) array('caps' => array_map('boolval', $post['caps']), 'plugins' => $plugins); update_option('pp_customized_roles', $customized_roles); global $wpdb; $wpdb->query("UPDATE {$wpdb->options} SET autoload = 'no' WHERE option_name = 'pp_customized_roles'"); } // Create New Capability and adds it to current role. } elseif (!empty($post['AddCap'])) { if (MULTISITE) { global $wp_roles; if (method_exists($wp_roles, 'reinit')) { $wp_roles->reinit(); } } $role = get_role($post['current']); $role->name = $post['current']; // bbPress workaround if ($newname = $this->createNewName($post['capability-name'])) { $role->add_cap($newname['name']); $this->cm->message = __('New capability added to role.'); // for bbPress < 2.2, need to log customization of roles following bbPress activation $plugins = function_exists('bbp_get_version') && version_compare(bbp_get_version(), '2.2', '<') ? array('bbpress.php') : array(); // back compat if (!($customized_roles = get_option('pp_customized_roles'))) { $customized_roles = array(); } $customized_roles[$post['role']] = (object) array('caps' => array_merge($role->capabilities, array($newname['name'] => 1)), 'plugins' => $plugins); update_option('pp_customized_roles', $customized_roles); global $wpdb; $wpdb->query("UPDATE {$wpdb->options} SET autoload = 'no' WHERE option_name = 'pp_customized_roles'"); } else { $this->cm->message = __('Incorrect capability name.'); } } elseif (!empty($post['update_filtered_types'])) { if (cme_update_pp_usage()) { ak_admin_notify(__('Capability settings saved.', $this->cm->ID)); } else { ak_admin_error(__('Error saving capability settings.', $this->cm->ID)); } } else { // TODO: Implement exceptions. This must be a fatal error. ak_admin_error(__('Bad form received.', $this->cm->ID)); } if (!empty($newrole) && defined('PP_ACTIVE')) { if (!empty($post['CreateRole']) && !empty($_REQUEST['new_role_pp_only']) || !empty($post['CopyRole']) && !empty($_REQUEST['copy_role_pp_only'])) { $pp_only = (array) pp_get_option('supplemental_role_defs'); $pp_only[] = $newrole; pp_update_option('supplemental_role_defs', $pp_only); _cme_pp_default_pattern_role($newrole); pp_refresh_options(); } } }
/** * Enqueue a script from the highest priority location in the template stack. * * Registers the style if file provided (does NOT overwrite) and enqueues. * * @since bbPress (r5180) * * @param string $handle Name of the script. * @param string|bool $file Relative path to the script. Example: '/js/myscript.js'. * @param array $deps An array of registered handles this script depends on. Default empty array. * @param string|bool $ver Optional. String specifying the script version number, if it has one. This parameter * is used to ensure that the correct version is sent to the client regardless of caching, * and so should be included if a version number is available and makes sense for the script. * @param bool $in_footer Optional. Whether to enqueue the script before </head> or before </body>. * Default 'false'. Accepts 'false' or 'true'. * * @return string The script filename if one is located. */ function bbp_enqueue_script($handle = '', $file = '', $dependencies = array(), $version = false, $in_footer = 'all') { // No file found yet $located = false; // Trim off any slashes from the template name $file = ltrim($file, '/'); // Make sure there is always a version if (empty($version)) { $version = bbp_get_version(); } // Loop through template stack foreach ((array) bbp_get_template_stack() as $template_location) { // Continue if $template_location is empty if (empty($template_location)) { continue; } // Check child theme first if (file_exists(trailingslashit($template_location) . $file)) { $located = trailingslashit($template_location) . $file; break; } } // Enqueue if located if (!empty($located)) { $content_dir = constant('WP_CONTENT_DIR'); // IIS (Windows) here // Replace back slashes with forward slash if (strpos($located, '\\') !== false) { $located = str_replace('\\', '/', $located); $content_dir = str_replace('\\', '/', $content_dir); } // Make path to file relative to site URL $located = str_replace($content_dir, WP_CONTENT_URL, $located); // Enqueue the style wp_enqueue_script($handle, $located, $dependencies, $version, $in_footer); } return $located; }
/** * Output the credits screen * * Hardcoding this in here is pretty janky. It's fine for 2.2, but we'll * want to leverage api.wordpress.org eventually. * * @since bbPress (r4159) */ public function credits_screen() { list($display_version) = explode('-', bbp_get_version()); ?> <div class="wrap about-wrap"> <h1><?php printf(esc_html__('Welcome to bbPress %s', 'bbpress'), $display_version); ?> </h1> <div class="about-text"><?php printf(esc_html__('Thank you for updating! bbPress %s is waxed, polished, and ready for you to take it for a lap or two around the block!', 'bbpress'), $display_version); ?> </div> <div class="bbp-badge"><?php printf(esc_html__('Version %s', 'bbpress'), $display_version); ?> </div> <h2 class="nav-tab-wrapper"> <a href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'bbp-about'), 'index.php'))); ?> " class="nav-tab"> <?php esc_html_e('What’s New', 'bbpress'); ?> </a><a href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'bbp-credits'), 'index.php'))); ?> " class="nav-tab nav-tab-active"> <?php esc_html_e('Credits', 'bbpress'); ?> </a> </h2> <p class="about-description"><?php esc_html_e('bbPress is created by a worldwide swarm of busy, busy bees.', 'bbpress'); ?> </p> <h4 class="wp-people-group"><?php esc_html_e('Project Leaders', 'bbpress'); ?> </h4> <ul class="wp-people-group " id="wp-people-group-project-leaders"> <li class="wp-person" id="wp-person-matt"> <a href="http://profiles.wordpress.org/matt"><img src="http://0.gravatar.com/avatar/767fc9c115a1b989744c755db47feb60?s=60" class="gravatar" alt="Matt Mullenweg" /></a> <a class="web" href="http://profiles.wordpress.org/matt">Matt Mullenweg</a> <span class="title"><?php esc_html_e('Founding Developer', 'bbpress'); ?> </span> </li> <li class="wp-person" id="wp-person-johnjamesjacoby"> <a href="http://profiles.wordpress.org/johnjamesjacoby"><img src="http://0.gravatar.com/avatar/81ec16063d89b162d55efe72165c105f?s=60" class="gravatar" alt="John James Jacoby" /></a> <a class="web" href="http://profiles.wordpress.org/johnjamesjacoby">John James Jacoby</a> <span class="title"><?php esc_html_e('Lead Developer', 'bbpress'); ?> </span> </li> <li class="wp-person" id="wp-person-jmdodd"> <a href="http://profiles.wordpress.org/jmdodd"><img src="http://0.gravatar.com/avatar/6a7c997edea340616bcc6d0fe03f65dd?s=60" class="gravatar" alt="Jennifer M. Dodd" /></a> <a class="web" href="http://profiles.wordpress.org/jmdodd">Jennifer M. Dodd</a> <span class="title"><?php esc_html_e('Feature Developer', 'bbpress'); ?> </span> </li> <li class="wp-person" id="wp-person-netweb"> <a href="http://profiles.wordpress.org/netweb"><img src="http://0.gravatar.com/avatar/97e1620b501da675315ba7cfb740e80f?s=60" class="gravatar" alt="Stephen Edgar" /></a> <a class="web" href="http://profiles.wordpress.org/netweb">Stephen Edgar</a> <span class="title"><?php esc_html_e('Converter Specialist', 'bbpress'); ?> </span> </li> </ul> <h4 class="wp-people-group"><?php esc_html_e('Contributing Developers', 'bbpress'); ?> </h4> <ul class="wp-people-group " id="wp-people-group-contributing-developers"> <li class="wp-person" id="wp-person-jaredatch"> <a href="http://profiles.wordpress.org/jaredatch"><img src="http://0.gravatar.com/avatar/e341eca9e1a85dcae7127044301b4363?s=60" class="gravatar" alt="Jared Atchison" /></a> <a class="web" href="http://profiles.wordpress.org/jaredatch">Jared Atchison</a> <span class="title"><?php esc_html_e('Bug Testing', 'bbpress'); ?> </span> </li> <li class="wp-person" id="wp-person-gautamgupta"> <a href="http://profiles.wordpress.org/gautamgupta"><img src="http://0.gravatar.com/avatar/b0810422cbe6e4eead4def5ae7a90b34?s=60" class="gravatar" alt="Gautam Gupta" /></a> <a class="web" href="http://profiles.wordpress.org/gautamgupta">Gautam Gupta</a> <span class="title"><?php esc_html_e('Feature Developer', 'bbpress'); ?> </span> </li> </ul> <h4 class="wp-people-group"><?php esc_html_e('Core Contributors to bbPress 2.5', 'bbpress'); ?> </h4> <p class="wp-credits-list"> <a href="http://profiles.wordpress.org/alex-ye">alex-ye</a>, <a href="http://profiles.wordpress.org/alexvorn2">alexvorn2</a>, <a href="http://profiles.wordpress.org/aliso">aliso</a>, <a href="http://profiles.wordpress.org/boonebgorges">boonebgorges</a>, <a href="http://profiles.wordpress.org/daveshine">daveshine</a>, <a href="http://profiles.wordpress.org/DJPaul">DJPaul</a>, <a href="http://profiles.wordpress.org/ethitter">ethitter</a>, <a href="http://profiles.wordpress.org/fanquake">fanquake</a>, <a href="http://profiles.wordpress.org/GargajCNS">GargajCNS</a>, <a href="http://profiles.wordpress.org/GautamGupta">GautamGupta</a>, <a href="http://profiles.wordpress.org/imath">imath</a>, <a href="http://profiles.wordpress.org/jkudish">jkudish</a>, <a href="http://profiles.wordpress.org/kobenland">kobenland</a>, <a href="http://profiles.wordpress.org/lakrisgubben">lakrisgubben</a>, <a href="http://profiles.wordpress.org/loki_racer">loki_racer</a>, <a href="http://profiles.wordpress.org/mamaduka">mamaduka</a>, <a href="http://profiles.wordpress.org/Maty">Maty</a>, <a href="http://profiles.wordpress.org/mercime">mercime</a>, <a href="http://profiles.wordpress.org/mordauk">mordauk</a>, <a href="http://profiles.wordpress.org/mrcl">mrcl</a>, <a href="http://profiles.wordpress.org/MZAWeb">MZAWeb</a>, <a href="http://profiles.wordpress.org/r-a-y">r-a-y</a>, <a href="http://profiles.wordpress.org/strangerstudios">strangerstudios</a>, <a href="http://profiles.wordpress.org/thebrandonallen">thebrandonallen</a>, <a href="http://profiles.wordpress.org/tlovett1">tlovett1</a>, <a href="http://profiles.wordpress.org/wpdennis">wpdennis</a>, </p> <div class="return-to-dashboard"> <a href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'bbpress'), 'options-general.php'))); ?> "><?php esc_html_e('Go to Forum Settings', 'bbpress'); ?> </a> </div> </div> <?php }
/** * Register bundled theme packages * * Note that since we currently have complete control over bbp-themes and * the bbp-theme-compat folders, it's fine to hardcode these here. If at a * later date we need to automate this, and API will need to be built. * * @since bbPress (r3829) */ public function register_theme_packages() { // Register the default theme compatibility package bbp_register_theme_package(array('id' => 'default', 'name' => __('bbPress Default', 'bbpress'), 'version' => bbp_get_version(), 'dir' => trailingslashit($this->themes_dir . 'default'), 'url' => trailingslashit($this->themes_url . 'default'))); // Register the basic theme stack. This is really dope. bbp_register_template_stack('get_stylesheet_directory', 10); bbp_register_template_stack('get_template_directory', 12); bbp_register_template_stack('bbp_get_theme_compat_dir', 14); }