Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 9,101 through 9,125 (of 32,519 total)
  • Author
    Search Results
  • Robkk
    Moderator

    @mentions is not part of bbPress yet.

    but for now you can use the @mentions feature from BuddyPress and use on forums with this code.

    copy this into your child themes functions.php or use a functionality plugin.

    function custom_bbpress_maybe_load_mentions_scripts( $retval = false ) {
    	if ( function_exists( 'bbpress' ) && is_bbpress() ) {
    		$retval = true;
    	}
     
    	return $retval;
    }
    add_filter( 'bp_activity_maybe_load_mentions_scripts', 'custom_bbpress_maybe_load_mentions_scripts' );

    and i think you would get an email notification from BuddyPress anytime you get @mentioned

    for multiple users you can just separate it with a space.

    #160389
    Robkk
    Moderator

    There is a way using the wp user query

    https://codex.wordpress.org/Class_Reference/WP_User_Query

    plugins like BuddyPress have this type of feature too.

    bbPress does not have a feature/shortcode like this, but if you use BuddyPress , bbPress is compatible with it.

    #160384
    Lisa
    Participant

    Thank you, Stephen, for taking the time to create a mapping graphic. Much appreciated!

    One question: In my Forum code, the Forum_Parent, which is “0” (zero) identifies it as a thread starter, and because the Forum_Ancestor is not “0” (zero), lists it as a reply, underneath the parent, and multiples are ordered by date DESC. How does bbPress handle this? If I understand the methodology, I’ll do better at the mapping. Do I simply use the Forum_Parent for ALL?

    Hope I am clear in my question…

    Lisa

    #160381
    tummybos
    Participant

    I have a bbPress driven forum on http://ictgiants.com/questions/category/all and I want to create a page that will display the registered users on my website similar to http://stackoverflow.com/users.

    Please if there is a plugin or shortcode that does this, that is what I need
    Any idea and links will be appreciated.
    Thanks in advance

    #160377
    mvasicm
    Participant

    Hi there,
    I have bbp-register shortcode, but I need to implement next step in the registration. Im using Paid Membership Pro to make membership levels. For now, I have only registration into bbpress, but the user is not redirected on the page where he can choose his membership level…Every new member is registered without any membership.

    Is it possible to add this feature into registration process?

    Thanks!!

    #160372
    Robin W
    Moderator

    ok, undo that previous change by deleting that file, it was rubbish !

    Then in your function file add

    function default_reply_subscribed() {
    
    		// Get _POST data  IE is this a first post of a topic?
    		if ( bbp_is_post_request() && isset( $_POST['bbp_topic_subscription'] ) ) {
    			$topic_subscribed = (bool) $_POST['bbp_topic_subscription'];
    
    		// Get edit data  IE either the author or someone else is editing a topic or reply
    		} elseif ( bbp_is_topic_edit() || bbp_is_reply_edit() ) {
    
    			// Get current posts author
    			$post_author = bbp_get_global_post_field( 'post_author', 'raw' );
    
    			// Post author is not the current user EG a moderator is altering this. In this case we'll leave the default to blank, 
    			//as much of the time mods are correcting or moderating, their not interested in the topic itself !
    			if ( bbp_get_current_user_id() !== $post_author ) {
    				$topic_subscribed = bbp_is_user_subscribed_to_topic( $post_author );
    
    			// Post author is the current user  IE you're editing your own post, so default should be to see any replies
    			} else {
    				$topic_subscribed = true ;
    				//the next line is what it used to say instead of true
    				//bbp_is_user_subscribed_to_topic( bbp_get_current_user_id() );
    			}
    
    		// Get current status
    		} elseif ( bbp_is_single_topic() ) {
    			//the user is writing a new reply ?
    			$topic_subscribed = true ;
    			//the next line is what it used to say instead of true
    			//bbp_is_user_subscribed_to_topic( bbp_get_current_user_id() );
    
    		// No data
    		} else {
    			$topic_subscribed = true;
    			//used to say false !
    		}
    
    		// Get checked output
    		$checked = checked( $topic_subscribed, true, false );
    
    		return apply_filters( 'default_reply_subscribed', $checked, $topic_subscribed );
    	}
    	
    add_filter ('bbp_get_form_topic_subscribed', 'default_reply_subscribed') ;
    
    function default_log_edit_false() {
    
    		// Get _POST data
    		if ( bbp_is_post_request() && isset( $_POST['bbp_log_reply_edit'] ) ) {
    			$reply_revision = $_POST['bbp_log_reply_edit'];
    
    		// No data
    		} else {
    			$reply_revision = 0;
    		}
    
    		return apply_filters( 'default_log_edit_false', checked( $reply_revision, true, false ) );
    	}
    
    add_filter ('bbp_get_form_reply_log_edit', 'default_log_edit_false' ) ;

    Functions files and child themes – explained !

    that should do both topic edit and reply subscribed.

    #160368
    WutHirsch
    Participant

    O.K. Guys, i find the problem by my own.
    Typing Error, the right code is:

    #bbpress-forums, .article, div#content_box.sidebar_layout {
    	width: 100%;
    }

    But now my Start Page got a full width too, again.
    Hmm, ok so i have to try to fix it again.
    It would be easier if i would find the Page id from the forum root.

    But i dont know, where can i find it.
    Normaly i can see the page id in the urls.
    Its not possible here.

    #160366
    WutHirsch
    Participant

    Hello everyone,

    i am very new to CSS & HTMl, i tried to solve my problem by my own, but i didn’t get it.
    Maybe someone has a idea how i can fix my new bbpressforum.

    Only half of the site is used by BBpress. BBpress should use all the remaining free space.

    Thats why i tried yet.
    The widget area dissapeard and bbpress should fill out the empty space.
    But yeah, how you can see its not working. (http://www.forest-game.de)

    My Code:

    #bbpress-forums .article, div#content_box.sidebar_layout {
    	width: 100%;
    }
    #bbpress-forums .article, .sidebar.c-4-12 {
    	display: none;
    }

    Edit:, oh i did something wrong. The widgets areas on the other sites dissapeared too ^-^

    Kindly regards

    #160362
    Stephen Edgar
    Keymaster

    You may need to extract the users out to a separate table, or you may be able to treat these users as “anonymous users”, I’d suggest first though I’d look at mapping some of the fields for the content only as that should not take much time to get up and running.

    First you want to do this with bbPress 2.6 ‘alpha’ rather than the current 2.5.6 release as there are significant improvements to the importers in the upcoming version.

    You can get your hands on 2.6 alpha via https://wordpress.org/plugins/bbpress/developers/ and it is listed under “Other Versions” as “Development Version”
    Or the direct download link https://downloads.wordpress.org/plugin/bbpress.zip

    Next you want to make a copy of Example.php from the includes/admin/converters folder of the plugin to MyConverter.php and in that file replace any instance of Example with MyConverter (this is case sensitive to be mindful of that)

    Next up start mapping the fields from your schema to the fields in MyConverter.php

    In the following screenshot I’ve mapped drawn lines to the easily concluded fields, any field mappings that you do not use you can simply delete, ideally using as many as you can will ensure the best bbPress experience for your data though.

    Take a stab at doing the above for the rest of your database, topics, replies etc and get back to us.

    If you need a place to host code snippets, use GitHub Gists: http://gist.github.com

    #160361
    David13_13
    Participant

    I have changed this code too:

    `<input name=”bbp_log_reply_edit” id=”bbp_log_reply_edit” type=”checkbox” value=”0″ <?php bbp_form_reply_log_edit(); ?> tabindex=”<?php bbp_tab_index(); ?>” />

    in the form-reply.php, but the checkbox is still checked by default

    #160358
    Robin W
    Moderator

    ok thanks I can see it now.

    create a directory on your theme called ‘bbpress’
    ie wp-content/themes/%your-theme-name%/bbpress

    where %your-theme-name% is the name of your theme

    find
    wp-content/plugins/bbpress/templates/default/bbpress/form-topic.php
    Make a copy of this file, and put in in the directory called bbpress that you created above, so you end up with
    wp-content/themes/%your-theme-name%/bbpress/form-topic.php
    bbPress will now use this template instead of the original

    then edit this file to change line 183

    <input name="bbp_log_topic_edit" id="bbp_log_topic_edit" type="checkbox" value="1" 
    

    etc.

    to

    <input name="bbp_log_topic_edit" id="bbp_log_topic_edit" type="checkbox" value="0" 
    

    etc.

    It will then be unchecked by default

    #160344
    Robin W
    Moderator

    writing an entire forum code for wordpress as a solo project seems to be a significant challenge, so using bbpress and amending that would seem to be a good strategy.

    ok, since you seem to be very php savvy, suggest you go to

    https://codex.bbpress.org/import-forums/

    and simply amend one of the templates there for your forum.

    #160343
    Lisa
    Participant

    I’ve made the decision to develop my new websites using WordPress. My goal is to eventually re-write my PHP code as a WordPress plugin, but, until then I need to use what’s available, and bbPress seems like a good option. I need to import/map my current tables to work with bbPRess, but not sure how?

    Here is the existing schema along with one parent record, and one child record:

    Forum_1962 (
    Forum mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
    Forum_Title varchar(200) NOT NULL DEFAULT ”,
    Forum_Author varchar(100) NOT NULL DEFAULT ”,
    Forum_Author_Email varchar(100) NOT NULL DEFAULT ”,
    Forum_Text text NOT NULL,
    Forum_Parent mediumint(8) unsigned NOT NULL DEFAULT ‘0’,
    Forum_Ancestor mediumint(8) unsigned NOT NULL DEFAULT ‘0’,
    Forum_Category smallint(5) unsigned NOT NULL DEFAULT ‘0’,
    Forum_Approved enum(‘0′,’1’) NOT NULL DEFAULT ‘1’,
    Forum_Entered_by varchar(10) NOT NULL DEFAULT ‘0’,
    Forum_Date_Created datetime NOT NULL DEFAULT ‘0000-00-00 00:00:00’,
    Forum_Last_Changed timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    PRIMARY KEY (Forum),
    KEY Forum_Parent (Forum_Parent),
    KEY Forum_Category (Forum_Category),
    KEY Forum_Approved (Forum_Approved),
    FULLTEXT KEY Forum_Title (Forum_Title),
    FULLTEXT KEY Forum_Text (Forum_Text)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;

    Parent thread
    =============
    (19261, ‘Can I rent an RV?’, ‘BillB’, ‘bill@web-crafter.net’, ‘I\’d like to give RVing a try, but there\’s no way I\’m going to plunk down thousands of $$ to buy an RV. Is it possible to rent an RV like you\’d a car?’, 0, 19261, 1962, ‘1’, ‘rvcn’, ‘2002-12-12 13:52:29’, ‘2002-12-12 13:53:25’);

    Ancestor thread
    ===============
    (19262, ‘Re: Can I rent an RV?’, ‘Mark’, ‘mark@ittelligent.com’, ‘No problem. Just check your yellow pages for a rental agency in your area. I know there are a few national outfits too. Cruise America and El Monte come to mind off the top of my head.’, 19261, 19261, 1962, ‘1’, ”, ‘2002-12-12 13:59:42’, ‘2002-12-12 13:59:42’);

    You’ll notice that there are fields for both parent and ancestor, which allows for infinite sub-topic threads (those replies to replies under one parent). Also, I the author name and email are also stored in this table, and not tied to a separate user table (so will need to address that). Each MySQL dump is between 1MB and 3MB.

    Need any more information? Please advise.

    My goal is one of two options:

    1. Import/Map existing table dumps in several websites to WordPress and bbPress using above forum schema as source, OR
    2. Convert my existing PHP forum code to be compatible with WordPress and forget about bbPress altogether if I can’t easily map the table (I don’t know WordPress enough to even think about doing this myself, even though the code is simple and fast, and will ne advice on someone who can)

    I am doing this so I can better control the mobile templates and have a more robust way of controlling my websites. I need to do this for about 6 websites, and would like the method to do this myself after the first time.

    Thanks in advance,

    Lisa

    #160332

    In reply to: Not the heading I want

    Robin W
    Moderator
    #160330
    Shaktimaan
    Participant

    Thanks it is fixed.

    I used patch below for bbPress: Version 2.5.6

    // Get the activity stream item, bail if it doesn't exist
    $existing = bp_activity_get_specific( array( 'activity_ids' => $activity_id, 'show_hidden' => true, 'spam' => 'all', ) ); 
    if ( empty( $existing['total'] ) || ( 1 !== (int) $existing['total'] ) ) { 
    $existing = new BP_Activity_Activity( $activity_id ); 
    if ( empty( $existing->component ) )
    return null; 
    }
    #160320

    Check in bbpress/templates/default/bbpress/content-search.php

    bbPress employs some “theme compatibility” magic to insert itself into your existing WordPress theme, and that directory is where those template parts live to try and fill in the gaps

    #160319
    patifonik
    Participant

    Hi!
    PLease, help me to fix this!

    I don’t understand: bbpress in my site uses template page.php. In this template we have:
    <?php get_template_part('inc/page-title'); ?>.
    In /inc/page-title.php we have:
    <?php elseif ( is_page() ): ?><h2><?php echo alx_page_title(); ?></h2>

    But in http://muzl.it/forums/ we have title
    <div class="page-title pad group"><h2>Темы</h2></div>
    and in http://muzl.it/forums/topic/lorem-ipsum/ we haven’t title:
    <div class="page-title pad group"><ul class="meta-single group"><li class="category"></div>

    How to fix it?

    Chad R. Schulz
    Participant

    I’m building what while be a discussion board style website. I will embed a single forum through a shortcode in each/every post.

    This will allow standard WordPress navigation and give each forum its own post/page.

    I will not allow users access to any part of the natural bbpress forum hierarchy (categories/forums/subforums/etc.) and will use redirects to ensure that all requests for specific forums end up on the appropriate post/page that uses the embedded shortcode.

    My question: Without the need to query numerous (potentially hundreds) of individual forums through traditional forum navigation, do I still need to spread the forums out among multiple categories/sub-categories when building the forums on the backend.

    Remember, no user will ever need, nor get, access to the forum hierarchy/structure. ALL forums links will redirect to the appropriate post.

    Having to create a needlessly complex hierarchy/structure is daunting and would make a mess for moderators to dig through.

    Just curious. Appreciate any guidance in this matter.

    Thanks,
    Chad Schulz

    #160316

    In reply to: Not the heading I want

    manavforum
    Participant

    Where to put the above code?

    #160314
    screenwavemedia
    Participant

    I’m extending an existing WordPress theme with bbpress functionality. I’ve gotten everything up and running except I can’t seem to find the base template for search results to customize everything AROUND the BBPress search results code. It looks like by default it’s pulling from page.php or single.php, but I would like to use a more specific template for it. I’m not seeing anything in Extras that fits the bill.

    #160310
    goclones
    Participant

    Thanks. I replace the code with what you suggested and I don’t see any changes. Although the file is in the bbpress > templates > defauly > bbpress folder. Is that where it should be?

    #160308
    goclones
    Participant

    Robkk, can you tell me which file this code is in?

    #160305
    Robkk
    Moderator

    @andrew55

    I’m still hungup on getting the overflow figured out.

    link to your site and i could help with that.

    It appears they have the avatar somehow wrapped in a span, and the span has the overflow assigned to it.

    i dont think you need a span for it , i could add it into the code but im sure it will be fine with just a float:left;


    @stagger-lee

    what is that ? Is that bbPress forum ?

    that was not a bbPress forum, its something else.

    #160300
    Stagger Lee
    Participant

    This is for custom info block above comment form:

    function ntwb_custom_topic_form_notice() {
    	?>
    	<div class="bbp-template-notice">
    		<p>Something here...</p>
    		<p>Something else...</p>
    	</div>
    	<?php
    
    }
    add_action( 'bbp_theme_before_topic_form_notices', 'ntwb_custom_topic_form_notice' );
    #160298
    Stagger Lee
    Participant

    Try with this:
    (I am not sure if it is this 100%, but try)

    //* Notice the line 7, 8, 10 and 11
    function my_bbp_change_avatar_size($author_avatar, $topic_id, $size) {
        $author_avatar = '';
        if ($size == 14) {
            return $author_avatar;
        }
        if ($size == 80) {
            $size = 110;
        }
        $topic_id = bbp_get_topic_id( $topic_id );
        if ( !empty( $topic_id ) ) {
            if ( !bbp_is_topic_anonymous( $topic_id ) ) {
                $author_avatar = get_avatar( bbp_get_topic_author_id( $topic_id ), $size );
            } else {
                $author_avatar = get_avatar( get_post_meta( $topic_id, '_bbp_anonymous_email', true ), $size );
            }
        }
        return $author_avatar;
    }
    
    /* Add priority (default=10) and number of arguments */
    add_filter('bbp_get_topic_author_avatar', 'my_bbp_change_avatar_size', 20, 3);
    add_filter('bbp_get_reply_author_avatar', 'my_bbp_change_avatar_size', 20, 3);
    add_filter('bbp_get_current_user_avatar', 'my_bbp_change_avatar_size', 20, 3);
Viewing 25 results - 9,101 through 9,125 (of 32,519 total)
Skip to toolbar