Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 2,376 through 2,400 (of 32,462 total)
  • Author
    Search Results
  • #214092
    Robin W
    Moderator

    These are all issues with your theme, not bbpress.

    However in the spirit of helpfulness, I’ll do this last one, but after that you need to refer to your theme’s support channels.

    So the best I can do without spending considerable time is :

    @media only screen and (max-width: 480px) {
    
    #bbpress-forums div.bbp-reply-author img.avatar {
    	position: relative !important ;
    }
    
    #bbpress-forums .bbp-body div.bbp-reply-author {
    	padding-left: 0px !important;
    }

    Which puts it on then left, but is not perfect

    #214069
    Robin W
    Moderator

    oops sorry the value should be transparent

    so

    background-color: transparent !important;

    and padding in the original code is causing the name issue

    so

    padding: 5px 20px;

    makes it wrap

    add

    padding : none !important ;

    so you end up with

    .reply a {
    font-size: 12px !important;
    background-color: transparent !important;
    padding : none !important ;
    }
    #214064
    Robin W
    Moderator

    your themes style sheet

    http://www.rockin-wildcat.com/rwc/wp-content/themes/blog-diary-pro/style.css

    has line 2201 with

    .reply a {
    	display: inline-block;
    	border-radius: 0;
    	color: #fff;
    	position: relative;
    	font-size: 16px;
    	background-color: #46c4f3;
    	padding: 5px 20px;
    	-webkit-transition: all 0.3s ease-in-out;
    	-moz-transition: all 0.3s ease-in-out;
    	-ms-transition: all 0.3s ease-in-out;
    	-o-transition: all 0.3s ease-in-out;
    	transition: all 0.3s ease-in-out;
    }

    the background-color: #46c4f3; element is causing the box issue, and the font-size: 16px; the text issue

    I’d suggest you add these to the custom css area of your theme

    .reply a {
    	
    	font-size: 12px !important;
    	background-color: none !important;
    }

    you can adjust the font-size to whatever value you wish

    #214056
    Robin W
    Moderator

    yes this seems to be a bug.

    in

    \bbpress\includes\forums\functions.php

    line 197 has

    // No forum parent was passed (should never happen)
    	if ( empty( $forum_parent_id ) ) {
    		bbp_add_error( 'bbp_new_forum_missing_parent', __( '<strong>ERROR</strong>: Your forum must have a parent.', 'bbpress' ) );

    but a top level forum will have zero so empty !

    (I’m not a bbpress author, I just help moderate here, so not under my direct powers to change)

    To correct this for another user, I did the following :

    created a hidden forum – then noted the ID (in this case 4537)

    then in

    \bbpress\templates\default\bbpress\form-forum.php

    changed line 138 etc. from

    <p>
    						<label for="bbp_forum_parent_id"><?php esc_html_e( 'Parent Forum:', 'bbpress' ); ?></label><br />
    
    						<?php
    							bbp_dropdown( array(
    								'select_id' => 'bbp_forum_parent_id',
    								'show_none' => esc_html__( '&mdash; No parent &mdash;', 'bbpress' ),
    								'selected'  => bbp_get_form_forum_parent(),
    								'exclude'   => bbp_get_forum_id()
    							) );
    						?>
    					</p>

    to

    <?php
    					//the code in incudes/forums/functions won't let post parent be blank.
    					//to get this to work, we have created a hidden forum in the site.  This forums ID is 4537
    					//if the hidden forum exists, then use this forums id 
    					//otherwise show the post parent section
    					$forum_parent_id = bbp_get_forum_id( 4537 );
    					if (!empty( $forum_parent_id )) { ?>
    					 <input type="hidden" id="bbp_forum_parent_id" name="bbp_forum_parent_id" value="4537">
    					 <?php
    					}
    					else {
    					?>
    					<p>
    						<label for="bbp_forum_parent_id"><?php esc_html_e( 'Parent Forum:', 'bbpress' ); ?></label><br />
    
    						<?php
    							bbp_dropdown( array(
    								'select_id' => 'bbp_forum_parent_id',
    								'show_none' => esc_html__( '&mdash; No parent &mdash;', 'bbpress' ),
    								'selected'  => bbp_get_form_forum_parent(),
    								'exclude'   => bbp_get_forum_id()
    							) );
    						?>
    					</p>
    					<?php } ?>

    This template then gets saved to your child themes directory as

    wp-content/themes/%your-theme-name%/bbpress/form-forum.php

    bbPress will now use this template instead of the original

    Finally, add an action to re-write the parent forum from 4537 to zero post forum creation

    add_action( 'bbp_new_forum_post_extras', 'ltc_limit_forum', 10 ,1  );
    
    function ltc_limit_forum ($forum_id) {
    	//this function is fired when a forum is created
    	//set post parent to zero
    	wp_update_post(
    		array(
    			'ID' => $forum_id, 
    			'post_parent' => 0
    			)
    	);
    }

    Put this in your child theme’s function file –

    ie wp-content/themes/%your-theme-name%/functions.php

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

    or use

    Code Snippets

    You could amend that function to have an if statement so if forum parent is 4537 then create forum parent as 0, but in this case there were no times when a sub forum was being created, so it was not needed.

    I know this is quite convoluted, but it worked !!

    There is a trac ticket for this issue somewhere, so the authors are aware

    #214054
    deandimarzo
    Participant

    I’m using the [bbp-forum-form] shortcode to allow forum moderators to add subforums on our site (is there a better way to do this?) and when submitting the form I get the error “ERROR: Your forum must have a parent.”

    I’ve dug through the source code thoroughly to figure out what would be causing this and I just can’t track it down. Any ideas?

    #214050
    smith512
    Participant

    Sorry, I forgot to add a code.
    add_filter( 'bbp_after_has_search_results_parse_args' , 'my_bbp_filter_search_results' );

    Thank you for pointing it out.

    #214049
    Milan Petrovic
    Participant

    Your code doesn’t look complete. You posted ‘my_bbp_filter_search_results’, but there is no filter it is tied into. Which filter did you use to hook this function too?

    I can recommend you trying my advanced search plugin: GD Power Search for bbPress – https://wordpress.org/plugins/gd-power-search-for-bbpress/ it allows you to select forums to search through and other things.

    Milan

    #214048
    smith512
    Participant

    After user searched key wards in one of the parent forums, I want to suggest topics that are a member of the parent forum.
    For example,
    Forum Top |- Forum B |-topic A
    | |-topic F
    |
    |- Forum C |-topic A
    |-topic Z

    If an user now in Forum B searches topic A, only show topic A in Forum B, not Forum C’s topic A.

    What I tried
    First, I add this cord to my child theme’s function.php.
    `function my_bbp_search_form(){
    ?>
    <div class=”bbp-search-form”>

    <?php bbp_get_template_part( ‘form’, ‘search’ ); ?>

    </div>
    <?php
    }
    add_action( ‘bbp_template_before_single_forum’, ‘my_bbp_search_form’ );`

    Next, Add a field to the search form. I override form-search.php in my child themeโ€™s /bbpress directory.

    if ( bbp_allow_search() ) : ?>
    <?php $forum_id = bbp_get_forum_id(); ?>
    <div class="bbp-search-form">
    	<form role="search" id="bbp-search-form" method="get" action="">
    		<input type="text" value="" placeholder="Search <?php the_title(); ?> Topics"  name="s"/>
    		<input type="hidden" name="forum_id" value="<?php echo $forum_id; ?>"/>
    		<input type="submit"/>
    	</form>
    </div>

    Finally, I filter the search query to only search a specific forum. I add this code to my functions.php.

    
    <?php 
    function my_bbp_filter_search_results( $r ){
    	$s=htmlspecialchars($_GET['s'], ENT_QUOTES, 'UTF-8');
    	$forum_id = htmlspecialchars($_GET['forum_id'], ENT_QUOTES, 'UTF-8');
    if(isset($s)){
    	$args=array(
    	's'->$s,
    	'post_parent'->$forum_id,
    	);
            }
            return $r;
    }
    ?>

    However, it didn’t work so I want to know how to achieve this.

    In addition, I challenged another way like this.

    if(bbp_has_topics(array('s'->$s, 'post_parent'->$forum_id)))
            bbp_get_template_part('bbpress/loop', 'topics');

    This code is that I edited above last additional functon “my_bbp_filter_search_results()” in function.php.
    However, I can’t get search’s value(name=’s’) in the first place. I tried to use “echo $s;”, $s didn’t output the value. Where is the search results file of bbpress?

    Please advise me. Thanks for reading.

    #214045
    Robin W
    Moderator
    #214030
    uksentinel
    Participant

    If it is a direct copy, then I am not surprised it was rejected – thank you for spending your time with this challenge, but unless the code / design is unique, bbpress will keep rejecting.

    FYI – I have got around the problem by using a widget that works and created a short code from that and placed that shortcode in the top menu on my page, a bit of a fudge but it will do for now.

    Thanks for trying ๐Ÿ˜‰

    #214027
    hellojesse
    Participant

    My plugin is rejeceted, here is their reply:
    Your plugin has been rejected because it is a duplicate of another plugin, already hosted on WordPress.org

    My answer was this:
    The reason why I did it is because, I do have client and he checked your plugin and he said that "This plugin hasnโ€™t been tested with the latest 3 major releases of WordPress." So he feels insecure. I have tested with WordPress and bbPress and it works fine.

    #214015
    petergariepy
    Participant

    A boatload unfortunately.

    Admin Columns
    Adminimize
    Advanced Classifieds and Directory Pro
    Advanced Custom Fields
    Advanced Custom Fields PRO
    All-in-One WP Migration
    All-in-One WP Migration Unlimited Extension
    amr shortcode any widget
    bbP shortcodes
    bbPress
    bbPress Style
    bbpress wp4 fix
    bbpress wp4 fix2
    Better Search Replace
    Bulk Delete
    Check Email
    Classic Editor
    Code Snippets
    Contact Form 7
    Envato Market
    Events Manager
    Events Manager Pro
    GA Google Analytics
    Goodlayers Core
    Goodlayers Personnel Post Type
    Goodlayers Portfolio Post Type
    Goodlayers Twitter
    Google XML Sitemaps
    Horizontal scrolling announcements
    If Menu – Visibility control for menu items
    Image Upload for BBPress
    Image Upload for bbPress Pro
    Intuitive Custom Post Order
    Login or Logout Menu Item
    Magic Liquidizer Responsive Table
    Maintenance
    ManageWP – Worker
    Media Cleaner
    Media Deduper
    MemberPress Developer Tools
    MemberPress Importer
    MemberPress Plus
    PAS Vehicle
    PDF Embedder
    Plugin
    Pricing Table by Supsystic
    Really Simple CSV Importer
    Redux Framework
    Reveal IDs
    Search & Replace
    Simple File List
    Simple Lightbox
    Slider Revolution
    Snazzy Maps
    Toolset Types
    Toolset Views
    UpdraftPlus – Backup/Restore
    User Role Editor
    User Switching
    WordPress Importer
    WP All Export Pro
    WP All Import – ACF Add-On
    WP All Import Pro
    WP Engine Automated Migration
    WP Google Map Plugin
    WP phpMyAdmin
    WP-Optimize – Clean, Compress, Cache
    WPForms
    WPForms Custom Captcha
    WPForms PayPal Standard
    WPForms Stripe

    neon67
    Participant

    ะow to restrict create new tags for topic & answers by users?
    preferably without new plugins and role settings.
    Now I can close the tag field with the css method – but may be through the code better?

    #213974
    hellojesse
    Participant

    Sure,

    1. Indentify template file of forum index in template directory of plugin and copy it to your theme, but place it in bbpress folder.

    2. place the code what I have sent, you have link above the forum to profile.

    I can do same as profile menu as is here above forum, but it require more coding and probably you will experience difficulties with integration. Only solution is I can send you custom theme to demonstrate what I can do ๐Ÿ™‚

    #213973
    uksentinel
    Participant

    If you could explain the whole process of what I need to do, and the code needed and where it goes, then I am sure others would be interested in reading this thread ?

    #213972
    uksentinel
    Participant

    There used to be a plugin called ‘bbPress Profile Link Shortcode’ created by ‘Tyler Tervooren’

    Alas this plugin is out of date, is there any equivalents ?

    bbPress Profile Link Shortcode

    #213964
    hellojesse
    Participant

    Combined html with php

    <a href="<?php echo bbp_get_user_profile_url( get_current_user_id() ); ?>">Profile</a>

    Can you share theme? I will customize it and you will just activate it ๐Ÿ˜‰

    #213963
    uksentinel
    Participant

    The Profile works as a hyperlink, but I am unable to get the link to a users profile by combining the php code into the Profile html link

    Could you detail how I combine the two code sources to work together ?

    I have realized I cannot code ;-(

    #213959
    hellojesse
    Participant

    You do not want to give access to profile subpages to other forum participants.

    Yes, you are rock.

    I do not use operand and. I like &&.

    Glad you like it ๐Ÿ˜Š๐Ÿฑ๐Ÿ˜

    #213958
    robertherold
    Participant

    Thank you very much, it was very good. I added a bit because I want the user to access their own links, but not other users.

    I did it well?

    add_action( 'template_redirect', 'redirect_user_to_profile_from_subpages' );
    function redirect_user_to_profile_from_subpages() {
    	
    	global $wp;
    	
    	$user_id = bbp_get_displayed_user_id();
    
    	// subpage - enagements
    	if ($wp->query_vars["bbp_engagements"] == 1 and $user_id != get_current_user_id() ) {
    		wp_safe_redirect( bbp_get_user_profile_url( $user_id ) );
    		exit;
    	}
    
    	// subpage - topics created
    	if (bbp_is_topics_created() and $user_id != get_current_user_id() ) {
    		wp_safe_redirect( bbp_get_user_profile_url( $user_id ) );
    		exit;
    	}
    
    	// subpage - replies created
    	if (bbp_is_replies_created() and $user_id != get_current_user_id() ) {
    		wp_safe_redirect( bbp_get_user_profile_url( $user_id ) );
    		exit;
    	}
    
    	// subpage - subscriptions
    	if (bbp_is_subscriptions() and $user_id != get_current_user_id() ) {
    		wp_safe_redirect( bbp_get_user_profile_url( $user_id ) );
    		exit;
    	}
    }
    #213956

    In reply to: Looking for a feature

    hellojesse
    Participant

    Yes, @delta5

    Auto-embed links:
    Embed media (YouTube, Twitter, Flickr, etc…) directly into topics and replies

    Go to -> Settings -> Forums -> Forum Features (section) -> Auto-embed links

    #213954
    hellojesse
    Participant

    All right so you have above defined 4 links. 4 subpages and we want to redirect redirect them to user profile main page.

    We need to use hook to redirect those pages

    add_action( 'template_redirect', 'redirect_user_to_profile_from_subpages' );
    function redirect_user_to_profile_from_subpages() {
    	
    	global $wp;
    
    	// subpage - enagements
    	if ($wp->query_vars["bbp_engagements"] == 1 ) {
    		wp_safe_redirect( bbp_get_user_profile_url( get_current_user_id() ) );
    		exit;
    	}
    
    	// subpage - topics created
    	if (bbp_is_topics_created()) {
    		wp_safe_redirect( bbp_get_user_profile_url( get_current_user_id() ) );
    		exit;
    	}
    
    	// subpage - replies created
    	if (bbp_is_replies_created()) {
    		wp_safe_redirect( bbp_get_user_profile_url( get_current_user_id() ) );
    		exit;
    	}
    
    	// subpage - subscriptions
    	if (bbp_is_subscriptions()) {
    		wp_safe_redirect( bbp_get_user_profile_url( get_current_user_id() ) );
    		exit;
    	}
    }

    Let me know if this works for you.

    #213947
    hellojesse
    Participant

    Sure, contact anytime. ๐Ÿ˜‰

    This can help as well.

    We can use action hook. Here is explation how to use it. There are files where you can find the place.

    https://codex.bbpress.org/bbp_theme_before_forum_title/

    #213945
    hellojesse
    Participant

    This code will generate html link if you combine with code above:

    <a href="[php_code]">Profile</a>

    Place it above the forum maybe?

    #213944
    uksentinel
    Participant

    Correct and many thanks

    where should I place profile code ?

    <?php echo bbp_get_user_profile_url( get_current_user_id() ); ?>

Viewing 25 results - 2,376 through 2,400 (of 32,462 total)
Skip to toolbar