Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 4,276 through 4,300 (of 32,518 total)
  • Author
    Search Results
  • quigley05
    Participant

    I’m customizing my buddypress/bbpress user pages to be taken out of their traditional framework and placing that data on indvidual pages. However, when I do this the code has issues recognizing the current user and automatically ignores the logged in user. Does anyone know how to resolve this issue?

    URL: http://obeii.com/discussions-topics-started/

    CODE: (topics started)

    <?php do_action( 'bbp_template_before_user_topics_created' ); ?>
    
    	<div id="bbp-user-topics-started" class="bbp-user-topics-started">
    		<div class="bbp-user-section">
    
    			<?php if ( bbp_get_user_topics_started() ) : ?>
    
    				<?php bbp_get_template_part( 'pagination', 'topics' ); ?>
    
    				<?php bbp_get_template_part( 'loop',       'topics' ); ?>
    
    				<?php bbp_get_template_part( 'pagination', 'topics' ); ?>
    
    			<?php else : ?>
    
    				<p><?php bbp_is_user_home() ? _e( 'You have not started any topics.', 'bbpress' ) : _e( 'This user has not started any topics.', 'bbpress' ); ?></p>
    
    			<?php endif; ?>
    
    		</div>
    	</div><!-- #bbp-user-topics-started -->
    
    <?php do_action( 'bbp_template_after_user_topics_created' ); ?>
    #193727

    In reply to: Change user color

    Robin W
    Moderator

    that code alters the names, but doesn’t help me in the ‘status legend’ – how is that legend created ?

    #193726

    In reply to: Change user color

    sopliar
    Participant

    Hello @robin-w, this is the code

    add_filter( 'bbp_get_dynamic_roles', 'ntwb_bbpress_custom_role_names' );
    function ntwb_bbpress_custom_role_names() {
    	return array(
    		// Keymaster
    		bbp_get_keymaster_role() => array(
    			'name'         => 'Amministratore',
    			'capabilities' => bbp_get_caps_for_role( bbp_get_keymaster_role() )
    		),
    		// Moderator
    		bbp_get_moderator_role() => array(
    			'name'         => 'Moderatore',
    			'capabilities' => bbp_get_caps_for_role( bbp_get_moderator_role() )
    		),
    		// Participant
    		bbp_get_participant_role() => array(
    			'name'         => 'Utente',
    			'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() )
    		),
    		// Spectator
    		bbp_get_spectator_role() => array(
    			'name'         => 'Visitatore',
    			'capabilities' => bbp_get_caps_for_role( bbp_get_spectator_role() )
    		),
    		// Blocked
    		bbp_get_blocked_role() => array(
    			'name'         => 'Bannato',
    			'capabilities' => bbp_get_caps_for_role( bbp_get_blocked_role() )
    		)
    	);
    }
    
    #193719

    In reply to: Change user color

    Robin W
    Moderator

    you will need to post the code you put in your functions file that does the status legend

    #193717

    In reply to: Change user color

    Robin W
    Moderator

    it is not good practise to amend bbpress (or any plugin) files.

    The code should go in the custom css area of your there if it has one, or via a plugin such as https://en-gb.wordpress.org/plugins/simple-custom-css/

    for the threads are, the simplest would be to use my style pack plugin

    bbp style pack

    and change the roles in

    dashboard>settings>bbp style pack>forum roles

    for your specific area, we would need the code you added in your functions file, but that should be able to then use the plugin settings above

    #193716

    Topic: Change user color

    in forum Themes
    sopliar
    Participant

    Hello BBPRESS community,

    I really want to change color of my usergroups in my forum made by bbpress.
    I have the standard role (keymaster, moderator, blocked ecc) but with names modified by editing the file functions.php in my theme folder.

    Now I would like to change the color in the status bar and in the topic/threads, example Administrator in the red, moderators in blue ecc.
    I tried a insert this code in bbpress/templates/default/css/bbpress.css:

    .bbp-author-role-keymaster {
    background:blue;
    color:white;
    padding:0 5px;
    }

    but it does not change anything, why?
    I want to change color here

    View post on imgur.com


    and in threads/topic discussion.
    How I do?
    Thank you very much.

    #193701

    In reply to: PM button in posts

    alriknijdam
    Participant

    Got an error when the user no longer exists.
    Edited your code, this one doesn’t give an error and hides the PM link:

    function ntwb_bbp_bp_pm() {
    	if(function_exists('bp_send_private_message_link') && is_user_logged_in() ) {
    		global $bp;
    		if ($bp->loggedin_user->id !== bbp_get_reply_author_id()){
    			$user = get_userdata( bbp_get_reply_author_id()  );
    			
    			if ( !empty( $user->user_nicename ) ) {
    				$user_nicename = $user->user_nicename;
    				$compose = bp_loggedin_user_domain() . bp_get_messages_slug() . '/compose/?r=' . $user_nicename;
    				
    				?>
    				<div class="forum-pm"><a href="<?php echo $compose ?>" title="Private Message">Private Message</a></div>
    				<?php
    			}
    		}
    	}
    }
    add_action( 'bbp_theme_after_reply_author_details', 'ntwb_bbp_bp_pm' );

    Thank you very much for your code shpitzyl.

    Josh
    Participant

    Hey, this is a bit of a unique situation, so I’m not sure how much you’ll be able to help. We had a bbPress forum which we closed in 2015. The “topics” we migrated to a custom post type so that we could keep them published, but without the forum framework.

    Recently, we’ve decided to re-open the forums on a new site. I exported the Forums, the Topics (which I switched back to the “topic” custom post type), and the Replies. We’re having two issues:

    1) The topics are not longer associated with their respective forums. Same for the replies with their topics. I know we can manually re-associate them, but there are hundreds of topics and replies. I’ve tried the Repair tool under the Tools menu, but it didn’t fix anything. Are there any other options?

    2) Additionally, the replies are not appearing in admin at all. I can see that there are 300+ published replies but where the list should be, I instead get this fatal error:

    Fatal error</b>: Allowed memory size of 33554432 bytes exhausted (tried to allocate 4096 bytes) in <b>xxxxxx\wp-includes\class-wp-hook.php</b> on line <b>279</b>

    Any help on either of these would be much appreciated. Thanks!

    #193649

    In reply to: Subscibe link location

    Robin W
    Moderator
    #193629
    u_Oi
    Participant

    Hi @pauldlb

    Try this… Paste the follow code into function.php (Appearance – Editor – Functions.php)

    /* Remove SideBar From bbPress Profiles and Topics*/
    function disable_all_widgets( $sidebars_widgets ) {
    if ( function_exists('is_bbpress') ) {
    if (is_bbpress()) {
    $sidebars_widgets = array(false);
    remove_all_actions('bp_register_widgets');
    unregister_sidebar( 'bp_core_widgets' );
    }
    }
    return $sidebars_widgets;
    }
    add_filter('sidebars_widgets', 'disable_all_widgets', 1, 1);
    #193605
    Stephen Edgar
    Keymaster

    Checkout the phpBB converter, it’s one of the best example implementations.

    Use _bbp_old_topic_id to grab your old topic id:
    https://bbpress.trac.wordpress.org/browser/trunk/src/includes/admin/converters/phpBB.php#L183

    p.s. The above phpBB converter uses bbPress 2.6 alpha which has many new refinements for the importer over bbPress 2.5, I’d suggest you use bbPress 2.6 alpha for any imports due to those improvements, it can be found here https://bbpress.org/download (bbPress.org and wordpress.org both use bbPress 2.6)

    #193604
    shagee
    Participant

    I get the error message “Oh bother! No topics were found here!”. I have installed bbpress and working on a divi theme. My shortcode for forum works but not my topics or index short code and I get this error. https://motionspecificrelease.ca/msr-community/

    #193602
    webmasterfreya
    Participant

    tools.php

    function bbp_admin_repair_user_favorites() {
    
    643		$values[]         = "('{$user->user_id}', '{$key}, '{$favorites_joined}')";

    Should be

    function bbp_admin_repair_user_favorites() {
    
    643		$values[]         = "('{$user->user_id}', '{$key}','{$favorites_joined}')";
    #193594
    u_Oi
    Participant

    You can put a default IP for all registered activity:

    add_filter( 'bbp_current_author_ip', function() {
     return '127.0.0.1';
    } );

    127.0.0.1 is the default ip in this case.

    #193587
    jameshogan03
    Participant

    @atmojones @slomeli79 @cjerrells

    Can one of you give me a bit more instruction on where and how to enter this code? I get a syntax error when checking this code…

    A little help would be hugely appreciated!

    #193583
    u_Oi
    Participant

    Code goes into the file functions.php that you can find on Appearance – Editor – Function.php. Open the file and paste it at the end. Just be careful because depending the theme code it can work fine or break your wordpress (if it breaks the wp just remove the code using cpanel or ftp).

    The code allow you to upload featured image for bbpress forums. Then you can give it css style for a better looking.

    To do this you need administrator access.

    #193582
    cclemens
    Participant

    Thanks, Arutam!

    I love Yoast. But, to be able to upload an image for sharing networks, doesn’t that require being able to access a URL in the Page editor? I think that’s the problem I’m having is there’s no way for me to do that. Does using this code supply that function?

    And, where does the code get installed? I’m not a dev at all, so most of my knowledge is plug-and-play.

    #193581
    u_Oi
    Participant

    With follow code you can upload a featured image for forums… But if you want a good looking image on social networks I recommend you install Yoast (for example) to upload a custom image for share options.

    /* Add Featured Image to bbPress Forums */
    add_post_type_support('forum', array('thumbnail'));
    function ks_forum_icons() {
    if ( 'forum' == get_post_type() ) {
    global $post;
    if ( has_post_thumbnail($post->ID) )
    echo get_the_post_thumbnail($post->ID,'thumbnail',array('class' => 'alignleft forum-icon'));
    }
    }
    add_action('bbp_theme_before_forum_title','ks_forum_icons');

    Source Link

    #193571
    Martin J
    Participant

    Thanks for the follow up. Here is what I did…

    1. Disabled all plugins except bbpress
    2. I switched to a WP default theme, ie: twentyfifteen and twentyseventeen
    3. Did the above with Chrome, Firefox, and MS Edge browsers

    Same thing still happens. So with the admin bar disabled, and logging in from the default WP login screen, and with bbpress enabled, I just get redirected to the site’s front page — no admin page. So I still have to add wp-admin/ at the end of the url address to get into the admin area. If I disable bbpress, then everything works normal. Enable it again, goes back to the issue.

    As mentioned, I’ve encountered this for at least a couple years. So based on testing, it’s not theme related and not plugin (other plugins) related. Something about bbpress is redirecting after logging in with the default WP login and not sending me directly into the admin.

    If there is something coded in bbpress for “Forum logging in” for front-end users, then I can see this being relevant. However, logging into the admin, is the problem.

    #193557
    webmasterfreya
    Participant

    Hi,

    I have the following code in my themes functions.php
    function bbp_reverse_reply_order( $query = array() ) { // bbp_has_replies_query is depricated ?
    $query['order']='DESC';
    return $query;
    }
    add_filter('bbp_has_replies_query','bbp_reverse_reply_order');

    This works fine except when a new reply is added, you get redirected to the page with the oldest replies instead of the page that contains the just added reply. This seems to be an old problem, have tried various plugins, but they all lead to the same outcome.

    So the question is how to force, after adding a new reply, to be directed to the right page.

    site freya.nl, latest versions WordPress and bbPress.

    #193531
    ohkevmanaol
    Participant

    I would love to know how to hide buttons like login or register when the user is logged in and vice versa for opposite scenarios.

    Im surprised that’s not how it functions by default. Why can i access the log in page when im logged in? There should be redirect options for this.

    Does anyone have any suggestions that does not involve a ton of code. Remember, that’s the whole point of WP and plugins.

    #193504
    favog
    Participant

    We have a BBPress forum that is behind a membership site, and we give them the capability of subscribing to threads. Our problem is that if a person stops subscribing they no longer have access to the site, and therefore have no way of unsubscribing from a topic.

    Is there a way that we can generate a script/link to force an automatic unsubscribe from all topics when removing the user? Even if we need to manually create the link, it would be an improvement.

    I can generate code if necessary-just don’t know where to start.

    Thanks,
    Bob

    #193496
    matty19901
    Participant

    FYI I’m using version 4.9.6 of wordpress and version 2.5.14 of bbPress.

    I added custom code to my theme functions.php page to add customized roles for bbPress. The roles show up when I edit users and want to change their roles, but when I go to save it, they just default back to a participant role. How can I fix this? Here is the code I used below:

    /* bbPress Custom Roles */
    function add_custom_role( $bbp_roles ) {
     
    
    $bbp_roles['my_custom_role2'] = array(
    'name' => 'Producer',
    'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // the same capabilities as participants
    );
    $bbp_roles['my_custom_role3'] = array(
    'name' => 'Engineer',
    'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // the same capabilities as participants
    );
    $bbp_roles['my_custom_role4'] = array(
    'name' => 'Songwriter',
    'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // the same capabilities as participants
    );
    $bbp_roles['my_custom_role5'] = array(
    'name' => 'Staff',
    'capabilities' => bbp_get_caps_for_role( bbp_get_moderator_role() ) // the same capabilities as keymaster
    );
    $moderator = bbp_get_moderator_role() ;
    $bbp_roles[$moderator] = array(
    'name' => 'Moderator',
    'capabilities' => bbp_get_caps_for_role( bbp_get_moderator_role() ) // the same capabilities as keymaster
    );
    $keymaster = bbp_get_keymaster_role() ;
    $bbp_roles[$keymaster] = array(
    'name' => 'Chief Executive Officer',
    'capabilities' => bbp_get_caps_for_role( bbp_get_keymaster_role() ) // the same capabilities as keymaster
    );
    $apprentice = bbp_get_participant_role() ;
    $bbp_roles[$apprentice] = array(
    'name' => 'Member',
    'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // the same capabilities as participants
    );
    return $bbp_roles;
    }
    add_filter( 'bbp_get_dynamic_roles', 'add_custom_role', 1 );
    #193491
    Helmuts
    Participant

    @michent1 – thank you – your updated version + the original shortcode by op works as a charm (had some issues with the original one).

    #193487
    pigpotato
    Participant

    I fixed it like this.

    1. make css folder in wordpress>wp-content>theme>[mytheme]
    2. cp wordpress>wp-content>plugins>bbpress>templates>default>css>bbpress.css wordpress>wp-content>theme>[mytheme]>css
    3. add these code lines in the css file.
    #bbpress-forums fieldset.bbp-form input[id=bbp_anonymous_email]{ display: none; }
    4. cp wordpress>wp-content>plugins>bbpress>templates>default>bbpress>form-anonymous.php wordpress>wp-content>theme>[mytheme]>bbpress
    5. fix any email address in email textfield. Edit the form-anonymous.php
    <input type=”text” id=”bbp_anonymous_email” value=”guest@guest.com” ….

Viewing 25 results - 4,276 through 4,300 (of 32,518 total)
Skip to toolbar