Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'forum css/'

Viewing 25 results - 51 through 75 (of 101 total)
  • Author
    Search Results
  • #133060
    lucop1
    Participant

    Hi,

    i’ve just installed buddypress 1.7 and bbpress 2.2.4.

    I created a custom theme for bbpress doing the following steps:
    1. create a folder bbpress inside wp-content/themes/mytheme/
    2. moved all the php files that were inside plugins/bbpress/templates/default
    3. moved the css file inside wp-content/themes/mytheme/css/

    after that

    I turned on the functionality to include the bbpress forum inside buddypress groups but I found and issue with the topic subscription and add to favorites.

    Because when i click on that link in the single topic view it open a blank page.
    I checked the bbp-function.php files stored in plugins/bbpress/templates/default and I found that it enqueue all the ajax function for the topic subscribe option and add to favorite options.

    But when I go the forum page inside BuddyPress Group and open the source code I don’t see any enqueue ajax files or functions.

    So what should I do to let it works?

    thanks

    #131109

    In reply to: forum uses theme css

    You can’t really.

    You’ll either want to tweak your theme’s CSS so it doesn’t conflict or (and probably the way I would go) create a copy of the bbPress CSS and tweak it as needed.

    Copy: `wp-content/plugins/bbpress/templates/default/css/bbpress.css` to: `wp-content/themes/[YOUR-THEME]/css/bbpress.css` and make changes as needed.

    #131093
    Chrisp2408
    Participant

    Hi all,
    Running WordPress version 3.5.1 and bbPress version 2.2.4 My them is Everest by Elegant Themes.
    All works well with the whole site, and wanted to add Forum functionality with bbPress. The CSS doesn’t appear to be showing at all for the forum. It really is horribly dull and small fonts.

    Although this is on a staging / testing server, you will see what I mean:

    http://letstrav.cpanel1prelive.ireckonhosting.com/interaction/forum/

    Can someone help please? I have copied the original bbPress css file into the /themes/everest/css/ folder but still get the same issue.

    Thnks in advance.
    Chris

    #131058
    Nazaire
    Participant

    I’m wanting to edit the css of bbPress to tweak the appearance of my forums, specifically the font size. I’m running WordPress 3.5.1, bbPress 2.2.4, and using a twentytwelve-child theme. My forums are at

    I found the “bbPress Custom CSS File” plug-in but according to the description I do not need it.

    ** This plugin is for bbPress 2.1.x. If you are using bbPress 2.0.x please upgrade. If you are using bbPress 2.2, read below.**

    bbPress 2.2+: As of bbPress 2.2 this plugin is NOT needed. bbPress will auto-detect the CSS file if it exists in the right location.

    Copy the CSS file from wp-content/plugins/bbpress/bbp-themes/bbp-default/css/bbpress.css to wp-content/themes/[yourtheme]/bbpress.css.

    Following the instructions above I have copied the bbpress.css file from the bbpress plugin’s css folder to “wp-content/themes/twentytwelve-child/bbpress.css”. When I go into the WordPress dashboard under appearance-edit the bbpress.css is available for editing.

    So assuming I have the bbpress.css file in the right place (if I don’t please instruct me where I need to put it for editing), which line of code in the bbpress.css file do I need to edit to change the font size on my forums.

    Any assistance in this matter will be greatly appreciated. Thanks.

    #126384
    zilveer
    Participant

    @pantheism: you need to go to your file located at:

    http://pantheismnow.org/wp-content/plugins/bbpress/templates/default/css/bbpress.css?ver=2.2.4

    And after that change the line 28:

    background-color: #FBFBFB;

    to whatever you want for the background color.

    Have you worked with CSS before?

    You can change the font family at line 14 located in the file:
    http://pantheismnow.org/wp-content/themes/autumn-almanac/style.css

    You are using “Trebuchet MS” for the moment.

    #125536
    mintertweed
    Participant

    Okay, so I physically replaced bbpress.css located in bbpress/templates/default/css/ with the newly named style-forums.css and the styles are working fine. But I immediately replaced it with the original bbpress.css because my forums are still not appearing properly. So…first problem solved! Yay. Now, how do I make my forums appear once again? Thank you for your help thus far!

    #125450
    captjones
    Participant

    There does not seem to be a step by step manual.

    `To customize bbPress:
    The directory “wp-content/plugins/bbpress/templates/default/” contains the directories “bbpress”, “css”, “extras”, and “js”, and the file “bbpress-functions.php”.

    “bbpress” contains template files; copy any you want to modify into a directory named “bbpress” in your theme’s root. eg. /wp-content/mytheme/bbpress/
    “extras” contains optional page templates and things to make life a little easier when customizing; copy any you want to use or modify into the same ‘bbpress’ folder. eg. /wp-content/mytheme/bbpress/
    “css” contains style sheets; copy any you want to modify into a directory named “css” in your theme’s root. eg. /wp-content/mytheme/css/
    Edit the new files for complete control over bbPress display in your theme.`

    ^ I did all this and the forum stopped working at all. No other option?
    Thanks.

    #125377
    spookyloot
    Participant

    Today when i tested my websites for flaws i saw that the visual editor box text color had changed into white instead of black. This made the text invisible unless you highlighted the written text.

    When i did some research on how to change it i saw that this problem goes back years.
    Most forum threads didn’t even got solved.

    I have found a simple solution for this problem.
    When i checked my source code i saw that the visual editor .css was located in public-html/wp-includes/css/editor.min.css

    Call it a lucky guess but when i searched for ‘white’ it got me to this part of the code:
    wp-editor-area{color:black}

    I changed it into wp-editor-area{color:white} and this solved my problem.

    I hope this helps allot of frustrated people!.

    #125376
    spookyloot
    Participant

    I found he solution for the white text in visual editor problem when using BBpress.
    Go to your ftp and open public-html/wp-includes/css/editor.min.css ( I found it viewing my site’s source code)

    You will see a whole bunch of code making it almost impossible to find the right part to change.
    Call it a lucky guess but when i searched the word ‘white’ i only found 1 code:
    -wp-editor-area{color:white}

    I changed it into black and this solved the white text problem!
    so just search for wp-editor-area{color:white} and change it into:
    -wp-editor-area{color:black}

    Martin ( Martin_C )
    Participant

    Hmm, tried overflow:auto on .bbp-user-section, but it didn’t work. The stuff I posted above worked for me at AppGlobe:

    Try it with firefox here:

    http://appglobe.com/forums/users/martin/topics/

    …I think I’ve added a width of 100% as well as W3c suggests.

     

    #122455
    sureshtmp-456
    Participant

    WP 3.4.2
    BBPress Plugin – 2.2.2

    1) Installed BBPress plugin. Did basic setting in admin for the plugin.
    2) Copied archive-forum.php and single-forum.php from bbpress plugin directory to mytheme root directory.
    3) Copied “css/bbpress.css” to mytheme root directory and then customized.
    4) Installed “bbPress Search Widget” plugin. Put it in Primary Area.
    5) That’s it. I have not created any new template/page for the forum.

    All look fine and working but I have this problem.
    If you go to this page http://www.clouni.com/askquestions/
    You will notice the search widget in lower right side. How can I put it above the forum breadcrumb “CLOUNI › Forums” ?

    #122454
    sureshtmp-456
    Participant

    WP 3.4.2
    BBPress Plugin – 2.2.2

    1) Installed BBPress plugin. Did basic setting in admin for the plugin.
    2) Copied archive-forum.php and single-forum.php from bbpress plugin directory to mytheme root directory.
    3) Copied “css/bbpress.css” to mytheme root directory and then customized.
    4) That’s it. I have not created any new template/page for the forum.

    All look fine and working but I have this problem.

    If you go to this link http://www.clouni.com/askquestions/

    You will notice the title “Forums” in left side. How can I hide it ? If I understand correctly, it is page title generated through wordpress. But how to hide it only for forum pages and not other page in wordpress ??

    #121194

    Topic: Custom CSS not working

    in forum Themes
    MatthewRuddy
    Participant

    Hey. Not sure if I’m missing something, but I’ve been looking around the forums following advice on using a custom bbPress CSS file, but it isn’t working.

    I’m creating a theme based on underscores.me 1000 headstart theme.

    I’ve copied the CSS file from ‘plugins/bbpress/templates/default/css/bbpress.css’ to ‘themes/underscores/bbpress.css’. I’ve read previously that that bbPress will then detect the custom CSS file and use it. Doesn’t appear to be the case.

    Have I missed something?

    #119276
    Phill
    Participant

    I, like most people using BBpress, have had an issue removing the sidebar from my new BBpress forums. I tried editing template files, adding files into my theme’s root, commenting our sidebar commands and whatever else has been recommended on these forums. Not to say those don’t work – I just couldn’t figure them out which is most likely due to my complete lack of php knowledge. I’m posting this for those of you like me, who have no idea how to do those fancy things.

    Here’s how I removed my sidebar:

    First, I copied over the CSS folder from my BBpress plugin folder /bbp-theme-compat to my theme’s root folder. (From your server root it should be wp-content/plugins/bbpress/bbp-theme-compat/)

    Then, I found the CSS class my theme was using to design the main content of my wordpress blog (should be a style.css file in your theme’s folder). Mine happened to be #main_content. Next, I found the the sidebar CSS in my theme’s style.css file which was simply #sidebar.

    Note: I found the CSS class by right clicking the main content area of my website (where posts show) and selecting “Inspect Element”.

    After finding those I created BBpress specific classes and pasted those into the bbpress.css file now located at {you_theme’s_root}/CSS/bbpress.css.

    Here’s what I pasted in:

    .bbPress #sidebar { 
    width: 0px;
    display:none; }
    
    .bbPress #main-content { width: 940px; !important } 
    

    Most likely you won’t need the sidebar’s width attribute but I added it in just in case.

    And finally, after hours of trying to figure this out I went to my BBress forums page to discover that the forums fit perfectly into my theme without any sign of a sidebar.

    I hope this helps!

    #118442
    judy1950
    Participant

    I have a WordPress site (3.4.2) which uses a premium theme that I want to keep. I just activated the BBPress plugin (ver 2.1.2) and created a forum and topic etc. The forum and topic pages appear and look ok, but I would like to customize the template and css that is being used in this. I am finding BBP documentation on this somewhat confusing.

    My Plan: I will create my own BBP template based on page.php from my main theme and modify the layout etc.

    To implement this new template I create, I am guessing that I can replace $new_template (shown below; code taken from bhp-template-loader.php (wp-content/plugins/bbpress/bbp-includes) with the name of my new template, such as “bbp-new-page.php”). Is this correct?

    // bbPress template file exists
    if ( !empty( $new_template ) ) {
    
        // Override the WordPress template with a bbPress one
        $template = $new_template;
    

    And to modify the css, I can simply hack “bbpress.css” (wp-content/plugins/bbpress/
    bbp-theme-compat/css/bbpress.css)?

    This approach seems really hacky/inelegant however.

    On a slightly separate note, it appears that implementing the steps for theme-compatibility (http://codex.bbpress.org/theme-compatibility) are necessary only if you are going to use a single (custom) theme (or child theme?) for both WP and BBP?

    Finding it a little confusing to untangle the methods and their purposes in BBP theming.

    Thanks to anyone who can help!
    Judy Wilson
    Nashville TN

    #117409
    Roger Coathup
    Participant

    I had the same issue… see: https://bbpress.org/forums/topic/how-to-override-bbpress-css/

    I walked through the bbPress code, and discovered where it looked for its css. Amazed it wasn’t documented!

    Melindrea
    Participant

    The likeliest from what I can see in those screenshots is that there is an extra container somewhere that messes up the stylesheet. Unfortunately, it’s kind of hard to see off of screenshots exactly where the tags go wrong — do you know your way around CSS/HTML to figure it out from there?

    Hi there,

    I am totally new to wordpress and so far bumbling along happily using plugins. I have figured out how to get in via ftp access but haven’t a clue what I am doing there, so talk of editing css/ files/ .php’s etc is way over my head.

    I have installed bbpress and am trying to set up the forum so that it runs full width/ no sidebars/ no wordpress widgets. But I cannot get it to do that. I have gone into the easel theme options and turned off sidebars to no avail, it still squishes the forum up in the middle of the page with all the bbpress widgets and options shoved underneath and almost impossible to see.

    Can someone please give me an idiot’s guide (VERY simple explanation) of how to get a full width forum on my site please?

    #116064
    Janus12
    Member

    problem 2 was solved by adding

    #bbpress-forums div.reply {
    height: auto;}
    

    however the other problem is still not solved and I believe the style.css is missing files.

    This is litteraly my whole css file


    /*
    

    Theme Name: Custom Community
    Theme URI: http://themekraft.com/custom-community/
    Description: Create your individual website within minutes. Custom Community is a WordPress and BuddyPress theme framework that enables you to build your site with all the features you love. Easy to use jQuery slideshow. List posts under your pages in magazine layouts. Use powerful theme settings to customize every part of the theme. 20 widget areas, 5 special widgets and 2 custom WP 3.0 header menus. 3 predefined colour schemes (white, grey, black) with clean and simple browsersafe css design to start from. Support forum at http://themekraft.com/forums.
    Version: 1.8.9.1
    Author: Themekraft
    Author URI: http://themekraft.com/
    Tags: buddypress, translation-ready, dark, light, white, left-sidebar, right-sidebar, two-columns, three-columns, fixed-width, flexible-width, custom-header, custom-menu, custom-colors, custom-background, theme-options
    License: GNU General Public License v2.0 / License URI: http://www.gnu.org/licenses/gpl-2.0.html
    */

    /* Reset browser defaults */

    @import
    url( _inc/css/reset.css );

    .aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
    }

    .alignleft {
    float: left;
    margin-right: 15px;
    }

    .alignright {
    float: right;
    margin-left: 15px;
    }

    div.post .wp-caption {
    text-align: center;
    background-color: ##f3f3f3
    padding-top: 4px;
    -moz-border-radius: 3px;
    -webkit-border-radius: 3px;
    border-radius: 3px;
    margin-bottom:12px;
    }

    div.post dd.wp-caption p.wp-caption-text, div.post .wp-caption p.wp-caption-text {
    font-size: 0.9em;
    line-height: 17px;
    padding: 0 4px 5px 0;
    margin: 0;
    }

    div.credits{display:none;}

    bbpress-forums div.reply {

    height: auto;
    

    }


    I am fairly new to web design but I have a feeling there must be more somewhere.

    Does anyone know what code I could input to this file in order to fix problem one?

    Also as a bonus could anyone give me a code that could work for changing the background of the forum colour?

    I apologize for my “rookieness”

    Thanks in advance!

    #115613
    Sama Web
    Member

    https://bbpress.trac.wordpress.org/ticket/1819 gave a solution to the problem that I am pretty sure worked. However, I just want to note that the issue still exists and help anyone that might be having this problem.

    If your replies are being covered up like the picture above, you can fix it by adding the following comment into your bbpress.css file (wp-content/plugins/bbpress/bbp-theme-compat/css/bbpress.css):

    #bbpress-forums div.reply {
    height: auto;
    }

    As with the author of this bug request, I am also using custom-community.

    #115252
    Stephen Edgar
    Keymaster

    You should be good to go by removing ‘clear: both;’ on line 15 of the bbPress CSS file

    http://www.wvko1580.com/wp-content/plugins/bbpress/bbp-theme-compat/css/bbpress.css

    #110609
    enderandrew
    Participant

    The layout issue appears to be with the theme. It is adding 275px of padding for the sidebar twice on the forum template pages. Even if I replace page.php in my child theme with a no sidebar template, it is still happening. I think that is a CSS issue I’ll have to fix myself.

    However, wp-content/plugins/bbpress/bbp-theme-compat/css/bbpress.css loading in addition to the bbpress.css in my theme appears to be a bug as far as I can tell. I’ll file a ticket in Trac.

    You can find it in /bbpress/bbp-includes/bbp-forum-template.php (I’m using bbPress 2.02)

    Remove the following lines:

    // Forum

    else

    $retstr = sprintf( __( ‘This forum contains %1$s and %2$s, and was last updated by %3$s %4$s ago.’, ‘bbpress’ ), $topic_count, $reply_count, $last_updated_by, $time_since );

    and these lines:

    // Forum

    else

    $retstr = sprintf( __( ‘This forum contains %1$s and %2$s.’, ‘bbpress’ ), $topic_count, $reply_count );

    and also these lines:

    ‘before’ => ‘<div class=”bbp-template-notice info”><p class=”bbp-forum-description”>’,

    You’ll need to remove those lines in bbpress.css (Assume I’m using bbp-twentyten, so the location is /bbpress/bbp-themes/bbp-twentyten/css/bbpress.css):

    div.bbp-template-notice.info {

    border: #cee1ef 1px solid;

    background-color: #f0f8ff;

    }

    This should remove the “this forum contains … topics… replies … ” while you still can see the “this topic contains … voices … replies… ” in each topic (Do you want to remove that too?)

    Keep in mind that this is not a recommended way of changing the bbPress, as you’ll lose the setting when you perform an update (so you have to keep changing after each update), although there’s nobody to make such plugin to do that.

    #110546
    harnold007
    Member

    My installation instructions.

    1. Installed plugin and activated in WordPress.

    2. Copied the contents of /wp-content/plugins/bbpress/bbp-theme-compat/ into my themes root folder /wp-content/themes/YOURTHEMENAME/

    3. Modified bbpress.css in /wp-content/themes/YOURTHEMENAME/css/

    4. Put in this line in my header.php <link rel=”stylesheet” href=”<?php bloginfo(‘template_directory’); ?>/css/bbpress.css”>

    5. Modified my page.php in /wp-content/themes/YOURTHEMENAME/ (please note if you have any other pages using page.php in your theme modifying this file will also modify those pages utilizing this wordpress page template). I modified it so my forum would be full width without the sidebar. This will vary depending on your theme.

    6. Created my forums in my wordpress admin panel under the forum section.

    7. Tested, everything is working great!

    #43456
    Millen
    Participant

    I have run into some problems while theming bbp-twenty ten on my site. BBpress is installed, The forum fits within my custom theme after changing the template files. But some CSS does not seem to stick and my forum got issues with padding/margins and width or height at many places.

    Some guidance would be much appreciated!

    Here is my forum: http://www.fruitpickingjobs.com.au/forums

    I started with copying all files from bbp-twenty ten folder to my own wp theme folder. I have also changed all template files so the forum fits within my theme with sidebar.

    I have also added nesecery code to functions.php

    like instructed here: http://www.youtube.com/watch?v=lB2Oodx2GJw

    This is how my functions.php file looks like:

    // bbpress functions below this line

    add_theme_support( ‘bbpress’ );

    /**

    * Functions of bbPress’s Twenty Ten theme

    *

    * @package bbPress

    * @subpackage BBP_Twenty_Ten

    * @since Twenty Ten 1.1

    */

    // Exit if accessed directly

    if ( !defined( ‘ABSPATH’ ) ) exit;

    /** Theme Setup ***************************************************************/

    if ( !class_exists( ‘BBP_Twenty_Ten’ ) ) :

    /**

    * Loads bbPress Twenty Ten Theme functionality

    *

    * Usually functions.php contains a few functions wrapped in function_exisits()

    * checks. Since bbp-twenty-ten is intended to be used both as a child theme and

    * for Theme Compatibility, we’ve moved everything into one convenient class

    * that can be copied or extended.

    *

    * See @link BBP_Theme_Compat() for more.

    *

    * @since bbPress (r3277)

    *

    * @package bbPress

    * @subpackage BBP_Twenty_Ten

    */

    class BBP_Twenty_Ten extends BBP_Theme_Compat {

    /** Functions *************************************************************/

    /**

    * The main bbPress (Twenty Ten) Loader

    *

    * @since bbPress (r3277)

    *

    * @uses BBP_Twenty_Ten::setup_globals()

    * @uses BBP_Twenty_Ten::setup_actions()

    */

    public function __construct() {

    $this->setup_globals();

    $this->setup_actions();

    }

    /**

    * Component global variables

    *

    * @since bbPress (r2626)

    * @access private

    *

    * @uses plugin_dir_path() To generate bbPress plugin path

    * @uses plugin_dir_url() To generate bbPress plugin url

    * @uses apply_filters() Calls various filters

    */

    private function setup_globals() {

    global $bbp;

    // Theme name to help identify if it’s been extended

    $this->name = ‘bbPress (Twenty Ten)’;

    // Version of theme in YYYMMDD format

    $this->version = ‘20110921’;

    // Setup the theme path

    $this->dir = $bbp->themes_dir . ‘/bbp-twentyten’;

    // Setup the theme URL

    $this->url = $bbp->themes_url . ‘/bbp-twentyten’;

    }

    /**

    * Setup the theme hooks

    *

    * @since bbPress (r3277)

    * @access private

    *

    * @uses add_filter() To add various filters

    * @uses add_action() To add various actions

    */

    private function setup_actions() {

    // Add theme support for bbPress

    add_action( ‘after_setup_theme’, array( $this, ‘add_theme_support’ ) );

    // Enqueue theme CSS

    add_action( ‘bbp_enqueue_scripts’, array( $this, ‘enqueue_styles’ ) );

    // Enqueue theme JS

    add_action( ‘bbp_enqueue_scripts’, array( $this, ‘enqueue_scripts’ ) );

    // Enqueue theme script localization

    add_filter( ‘bbp_enqueue_scripts’, array( $this, ‘localize_topic_script’ ) );

    // Output some extra JS in the <head>

    add_action( ‘bbp_head’, array( $this, ‘head_scripts’ ) );

    // Handles the ajax favorite/unfavorite

    add_action( ‘wp_ajax_dim-favorite’, array( $this, ‘ajax_favorite’ ) );

    // Handles the ajax subscribe/unsubscribe

    add_action( ‘wp_ajax_dim-subscription’, array( $this, ‘ajax_subscription’ ) );

    }

    /**

    * Sets up theme support for bbPress

    *

    * Because this theme comes bundled with bbPress template files, we add it

    * to the list of things this theme supports. Note that the function

    * “add_theme_support()” does not /enable/ theme support, but is instead an

    * API for telling WordPress what it can already do on its own.

    *

    * If you’re looking to add bbPress support into your own custom theme, you’ll

    * want to make sure it includes all of the template files for bbPress, and then

    * use: add_theme_support( ‘bbpress’ ); in your functions.php.

    *

    * @since bbPress (r2652)

    */

    public function add_theme_support() {

    add_theme_support( ‘bbpress’ );

    }

    /**

    * Load the theme CSS

    *

    * @since bbPress (r2652)

    *

    * @uses wp_enqueue_style() To enqueue the styles

    */

    public function enqueue_styles() {

    // Right to left

    if ( is_rtl() ) {

    // TwentyTen

    wp_enqueue_style( ‘twentyten’, get_template_directory_uri() . ‘/style.css’, ”, $this->version, ‘screen’ );

    wp_enqueue_style( ‘twentyten-rtl’, get_template_directory_uri() . ‘/rtl.css’, ‘twentyten’, $this->version, ‘screen’ );

    // bbPress specific

    wp_enqueue_style( ‘bbp-twentyten-bbpress’, get_stylesheet_directory_uri() . ‘/css/bbpress-rtl.css’, ‘twentyten-rtl’, $this->version, ‘screen’ );

    // Left to right

    } else {

    // TwentyTen

    wp_enqueue_style( ‘twentyten’, get_template_directory_uri() . ‘/style.css’, ”, $this->version, ‘screen’ );

    // bbPress specific

    wp_enqueue_style( ‘bbp-twentyten-bbpress’, get_stylesheet_directory_uri() . ‘/css/bbpress.css’, ‘twentyten’, $this->version, ‘screen’ );

    }

    }

    /**

    * Enqueue the required Javascript files

    *

    * @since bbPress (r2652)

    *

    * @uses bbp_is_single_topic() To check if it’s the topic page

    * @uses get_stylesheet_directory_uri() To get the stylesheet directory uri

    * @uses bbp_is_single_user_edit() To check if it’s the profile edit page

    * @uses wp_enqueue_script() To enqueue the scripts

    */

    public function enqueue_scripts() {

    if ( bbp_is_single_topic() )

    wp_enqueue_script( ‘bbp_topic’, get_stylesheet_directory_uri() . ‘/js/topic.js’, array( ‘wp-lists’ ), $this->version );

    if ( bbp_is_single_user_edit() )

    wp_enqueue_script( ‘user-profile’ );

    }

    /**

    * Put some scripts in the header, like AJAX url for wp-lists

    *

    * @since bbPress (r2652)

    *

    * @uses bbp_is_single_topic() To check if it’s the topic page

    * @uses admin_url() To get the admin url

    * @uses bbp_is_single_user_edit() To check if it’s the profile edit page

    */

    public function head_scripts() {

    if ( bbp_is_single_topic() ) : ?>

    <script type=’text/javascript’>

    /* <![CDATA[ */

    var ajaxurl = ‘<?php echo admin_url( ‘admin-ajax.php’ ); ?>’;

    /* ]]> */

    </script>

    <?php elseif ( bbp_is_single_user_edit() ) : ?>

    <script type=”text/javascript” charset=”utf-8″>

    if ( window.location.hash == ‘#password’ ) {

    document.getElementById(‘pass1’).focus();

    }

    </script>

    <?php

    endif;

    }

    /**

    * Load localizations for topic script

    *

    * These localizations require information that may not be loaded even by init.

    *

    * @since bbPress (r2652)

    *

    * @uses bbp_is_single_topic() To check if it’s the topic page

    * @uses is_user_logged_in() To check if user is logged in

    * @uses bbp_get_current_user_id() To get the current user id

    * @uses bbp_get_topic_id() To get the topic id

    * @uses bbp_get_favorites_permalink() To get the favorites permalink

    * @uses bbp_is_user_favorite() To check if the topic is in user’s favorites

    * @uses bbp_is_subscriptions_active() To check if the subscriptions are active

    * @uses bbp_is_user_subscribed() To check if the user is subscribed to topic

    * @uses bbp_get_topic_permalink() To get the topic permalink

    * @uses wp_localize_script() To localize the script

    */

    public function localize_topic_script() {

    // Bail if not viewing a single topic

    if ( !bbp_is_single_topic() )

    return;

    // Bail if user is not logged in

    if ( !is_user_logged_in() )

    return;

    $user_id = bbp_get_current_user_id();

    $localizations = array(

    ‘currentUserId’ => $user_id,

    ‘topicId’ => bbp_get_topic_id(),

    );

    // Favorites

    if ( bbp_is_favorites_active() ) {

    $localizations = 1;

    $localizations = bbp_get_favorites_permalink( $user_id );

    $localizations = (int) bbp_is_user_favorite( $user_id );

    $localizations = __( ‘favorites’, ‘bbpress’ );

    $localizations = __( ‘?’, ‘bbpress’ );

    $localizations = __( ‘This topic is one of your %favLinkYes% [%favDel%]’, ‘bbpress’ );

    $localizations = __( ‘%favAdd% (%favLinkNo%)’, ‘bbpress’ );

    $localizations = __( ‘×’, ‘bbpress’ );

    $localizations = __( ‘Add this topic to your favorites’, ‘bbpress’ );

    } else {

    $localizations = 0;

    }

    // Subscriptions

    if ( bbp_is_subscriptions_active() ) {

    $localizations = 1;

    $localizations = (int) bbp_is_user_subscribed( $user_id );

    $localizations = __( ‘Subscribe’, ‘bbpress’ );

    $localizations = __( ‘Unsubscribe’, ‘bbpress’ );

    $localizations = bbp_get_topic_permalink();

    } else {

    $localizations = 0;

    }

    wp_localize_script( ‘bbp_topic’, ‘bbpTopicJS’, $localizations );

    }

    /**

    * Add or remove a topic from a user’s favorites

    *

    * @since bbPress (r2652)

    *

    * @uses bbp_get_current_user_id() To get the current user id

    * @uses current_user_can() To check if the current user can edit the user

    * @uses bbp_get_topic() To get the topic

    * @uses check_ajax_referer() To verify the nonce & check the referer

    * @uses bbp_is_user_favorite() To check if the topic is user’s favorite

    * @uses bbp_remove_user_favorite() To remove the topic from user’s favorites

    * @uses bbp_add_user_favorite() To add the topic from user’s favorites

    */

    public function ajax_favorite() {

    $user_id = bbp_get_current_user_id();

    $id = intval( $_POST );

    if ( !current_user_can( ‘edit_user’, $user_id ) )

    die( ‘-1’ );

    if ( !$topic = bbp_get_topic( $id ) )

    die( ‘0’ );

    check_ajax_referer( ‘toggle-favorite_’ . $topic->ID );

    if ( bbp_is_user_favorite( $user_id, $topic->ID ) ) {

    if ( bbp_remove_user_favorite( $user_id, $topic->ID ) ) {

    die( ‘1’ );

    }

    } else {

    if ( bbp_add_user_favorite( $user_id, $topic->ID ) ) {

    die( ‘1’ );

    }

    }

    die( ‘0’ );

    }

    /**

    * Subscribe/Unsubscribe a user from a topic

    *

    * @since bbPress (r2668)

    *

    * @uses bbp_is_subscriptions_active() To check if the subscriptions are active

    * @uses bbp_get_current_user_id() To get the current user id

    * @uses current_user_can() To check if the current user can edit the user

    * @uses bbp_get_topic() To get the topic

    * @uses check_ajax_referer() To verify the nonce & check the referer

    * @uses bbp_is_user_subscribed() To check if the topic is in user’s

    * subscriptions

    * @uses bbp_remove_user_subscriptions() To remove the topic from user’s

    * subscriptions

    * @uses bbp_add_user_subscriptions() To add the topic from user’s subscriptions

    */

    public function ajax_subscription() {

    if ( !bbp_is_subscriptions_active() )

    return;

    $user_id = bbp_get_current_user_id();

    $id = intval( $_POST );

    if ( !current_user_can( ‘edit_user’, $user_id ) )

    die( ‘-1’ );

    if ( !$topic = bbp_get_topic( $id ) )

    die( ‘0’ );

    check_ajax_referer( ‘toggle-subscription_’ . $topic->ID );

    if ( bbp_is_user_subscribed( $user_id, $topic->ID ) ) {

    if ( bbp_remove_user_subscription( $user_id, $topic->ID ) ) {

    die( ‘1’ );

    }

    } else {

    if ( bbp_add_user_subscription( $user_id, $topic->ID ) ) {

    die( ‘1’ );

    }

    }

    die( ‘0’ );

    }

    }

    /**

    * Instantiate a new BBP_Twenty_Ten class inside the $bbp global. It is

    * responsible for hooking itself into WordPress where apprpriate.

    */

    if ( ‘bbPress’ == get_class( $bbp ) ) {

    $bbp->theme_compat->theme = new BBP_Twenty_Ten();

    }

    endif;

    ?>

Viewing 25 results - 51 through 75 (of 101 total)
Skip to toolbar