Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 5,126 through 5,150 (of 32,518 total)
  • Author
    Search Results
  • #185134
    Stagger Lee
    Participant

    In theme functions.php or custom field with functions.php.
    It gives featured image metaboxes in backend. Then you display featured image on front as any other post type featured. See how your theme is doing this and copy/paste whole code block.

    As you need only fetaured image allowed for admins and moderators you can use this:

    add_post_type_support('topic', array('thumbnail'));
    add_post_type_support('forum', array('thumbnail'));
    /*
    Plugin Name: bbPress - Forum Icons
    Plugin URI: https://gist.github.com/ntwb/8277457
    Description: bbPress - bbPress - Forum Icons
    Version: 0.1
    Author: Stephen Edgar - Netweb
    Author URI: http://netweb.com.au
    */
    // Original Source: http://www.kristarella.com/2013/04/bbpress-forum-icons/
    add_post_type_support('forum', array('thumbnail'));
    function ks_forum_icons() {
    	if ( 'topic' == 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_topic_title','ks_forum_icons');

    I will see later what is the best way to allow all Users to set topic featured images.
    But dont see much point in it. Thousands of forum topics, thousands of images on server x all WP image sizes. Big mess.

    #185130
    kariellen35
    Participant

    Stagger Lee, where did you add this code? Does it only bring up the image in forum or topic lists or does it appear on the forum page?

    #185128
    TKServer
    Participant

    This was missing from bbp-api.php:

    	register_rest_route( 'bbp-api/v1', '/users/(?P<id>\d+)', array(
    		'methods' => 'GET',
    		'callback' => 'bbp_api_users_one',
    	) );

    and users.php was also missing.

    I’m guessing that was intentional?

    #185123
    Chad R. Schulz
    Participant

    They are php templates inside bbPress. The default location in bbPress is /plugins/bbpress/templates/default/bbpress/ look for the ones labelled feedback-no-*****.php and alter/edit the ones you want changed and place them into your theme’s bbpress folder.

    Easy peasy.

    Chad

    #185111

    In reply to: Multisite

    Robin W
    Moderator

    sounds like a whole project, and way beyond a few lines of code.

    #185086
    PinkishHue
    Participant

    Thanks @robin-w, that works on the textarea. Still the topic title input and the fieldset above where it says ‘Create New Topic’ are overflowing out of the viewable area of the screen. Will post back with code if I figure out how to fix it.

    #185078
    Stagger Lee
    Participant

    My code (comment) is for backend, metaboxes. Or so I believe.

    #185071
    Stagger Lee
    Participant

    Seems to still work.

    add_post_type_support('topic', array('thumbnail'));

    add_post_type_support('forum', array('thumbnail'));

    <?php echo get_the_post_thumbnail($post_id, 'full'); ?>

    #185055

    In reply to: Change email sender

    Brandon Allen
    Participant

    @karilistermanyahoocom

    The default from email address for bbPress emails is noreply@(url).com. If you’re seeing wordpress@(url).com, it’s either not an email sent by bbPress, or you’re using a plugin that is changing the from address for all emails sent.

    To change the bbPress email, you would use the filter bbp_get_do_not_reply_address. For most (if not all) emails sent by your WordPress install, you’d use the wp_mail_from filter.

    #185043

    Do you know where I can modify the redirect page so that it only shows the 404 page not found message and not a list of my site’s pages

    It usually depends on the theme, but 404.php is a good start. It probably has some function or functions that put out a sitemap, but that’s just a guess, and every sitemap type plugin is different.

    In addition to bbPress, there are legitimate Membership plugins that are better equipped to handle things like private pages or members-only sections of websites. If you haven’t used any, Restrict Content Pro and Paid Memberships Pro are good ones.

    #185036

    Hi Kari,

    With both the weekend and a major community summit, the past few days have been pretty slow around here.

    This is a hard question to answer, because it depends on your forums and how you have them setup as private.

    There are also security implications to consider. For example, if your forums are only for logged in users, redirecting to a login page vs. showing a 404 hints to hackers that something exists vs. it not existing, which incentivizes the hunt.

    I usually try to recommend that forums use the login widgets, or otherwise have some always-available login form to use instead. That way private forums can still 404 for non-logged-in users, without the redirect hint.

    If you do want to redirect anyways, you’ll need a custom plugin to modify the way bbPress works.

    Unhook bbp_forum_enforce_private and bbp_forum_enforce_hidden, and write your own equivalent functions to use bbp_redirect() rather than bbp_set_404().

    #184998
    kariellen35
    Participant

    I can’t find a search box activation option or short code for a search box. I have activated my theme’s own search function and it doesn’t pick up on words from within the forums pages. Do you have a forum search option?

    Thank you for your time.

    Take care,
    Kari

    #184940
    vahid mohammadi
    Participant

    Hi
    you can use this code:

    add_action( 'bbp_new_reply',  'update_reply', 0, 6 );
    function update_reply( $reply_id = 0, $topic_id = 0, $forum_id = 0, $anonymous_data = false, $author_id = 0, $is_edit = false ) {
    
    	$reply_id = bbp_get_reply_id( $reply_id );
    	$topic_id = bbp_get_topic_id( $topic_id );
    
    	if ( !bbp_is_topic_published( $topic_id ) || !bbp_is_reply_published( $reply_id ) ) return;
    
    	// $topic_email = bbp_get_topic_author_email($topic_id);
    	if (!empty($topic_id)) {
    		// if user is anonymous
    		if (bbp_is_topic_anonymous($topic_id)) {
    			$author_email = get_post_meta($topic_id, '_bbp_anonymous_email', true);
    			if ($author_email == 'nobody@example.com') return;
    
    			$topic_title   = strip_tags( bbp_get_topic_title( $topic_id ) );
    			$reply_content = strip_tags( bbp_get_reply_content( $reply_id ) );
    			$reply_url     = bbp_get_reply_url( $reply_id );
    			$blog_name     = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
    
    			$email_subject = $blog_name . ': ' . __( 'New reply to your topic', 'etuts' ) . '"' . $topic_title . '"';
    			$email_content = __( "New reply to your topic\nIn order to view the reply, open the bellow link\n", 'etuts' ) . $reply_url;
    
    			wp_mail( $author_email, $email_subject, $email_content );
    		}
    	}
    }
    
    InTempest
    Participant

    Reference site http://imapiece.com/

    Ill start by saying im not a developer and can edit php and code, but I cant write it from scratch…. yet

    So ive been moving a guild site over from phpbb into wordpress and am still trying to figure out the best way to handle applicants, I made a post here if anyone had any ideas about that
    https://bbpress.org/?post_type=topic&p=181981

    So I was looking into how to maybe do a multisite with a single forum handling all the main communication among the community as a whole. I was looking through the forum here and everything that said it cant be done is very old. Is there a way to have shortcodes and custom user fields to work around that? Or maybe iframe?

    Here is my thought, ill use car clubs for example

    Root Forum

    1 category – Car Club –
    1-2 forum – public
    1-3 forum – recruitment needs

    2 category – members only
    2-2 forum – New Car Club Applicant
    2-3 forum – Car Club Events
    2-4 forum – ADMIN

    3 categories – (3) Honda – (4) Ford – (5) Mazda
    3-2 forum – news rss
    3-3 forum – brand specific news

    Ok, so lets say on the main site if someone goes there it pulls everything since its the root. But give the car club its own multisite along with any niche sub group. In the custom user groups have shortcodes associated with the different ranks to show them on their member page when they look at the info something like [bbp-single-forum id=$forum_id] and add more to the root of that ranks permission. That way you dont have to add them per user, but per rank per group.

    so in the shortcode for public users they would only have access to 1 and its contents
    people in the honda club who are just members would have access to 1, 2(excluding 2-4) and 3, once they get bumped up to admin rank in that group the shortcode to display 2-4 gets added since its connected to rank roles.

    In the same breath on the front end of the multisite pages you could just have them display the public forums associated with that niche pulling the data from the forum via [bbp-single-forum id=$id ].

    I had a ton of control like this through phpbb using theme styling and domain masking and am trying to find a way to make it work in wordpress but its been a learning curve. I know groups in buddypress have some of this function built in, but it doesn’t seem to be tweak-able between sites. I dont want a guest to see every group in the opt in part of registration off the bat. Would rather have them app on that groups page, members review then they get added and what they see is based on what rank they have in all the groups they are in.

    So am i trying to overthink this? Have I missed something that could solve this idea?

    Thoughts/Suggestions?

    #184918

    In reply to: bbpress custom fields

    Robin W
    Moderator

    the actual hook is quite easy, there are numerous do-action calls within

    templates/default/bbpress/form-topic.php and form-reply.php

    The real issue is getting someone to code the fields, store them in the database, consider the ability for mods etc. to alter them or delete them, and then decide what you want to do with those fields – eg where to display them etc. etc.

    #184915
    Robin W
    Moderator

    have a play with this

    #bbpress-forums div.bbp-the-content-wrapper {
        width: 200px;
    }
    #184905
    Robin W
    Moderator

    bbpress is not designed for backend use by ordinary users – the backend is really for administration, so participants don’t get this area.

    New topics are shown below the forum list, or by creating a page and using one of the shortcodes

    [bbp-topic-form] – Display the ‘New Topic’ form where you can choose from a drop down menu the forum that this topic is to be associated with.
    [bbp-topic-form forum_id=$forum_id] – Display the ‘New Topic Form’ for a specific forum ID.

    or by adding a button, such as in the style pack plugin

    bbp style pack

    #184901

    Topic: Template notice text

    in forum Plugins
    kariellen35
    Participant

    Does anyone know how I can modify the template notice text?

    Here’s the code for it:

    <div class=”bbp-template-notice”>
    <p>Your account has the ability to post unrestricted HTML content.</p>
    </div>

    I would like to change what it says to “Please don’t post anything inappropriate! Our supervisors are invited to this forum.”

    Or I’d like to just delete it altogether then have this sentence be a general forum notice. I’ve started looking through the php files with no luck so far… I wish they’d make it easier to change things like this in the front end of this plugin. My users don’t need to see this and half of them won’t know what it means. I’ve just changed the text and outline to white for now to hide it but it leaves a big empty space.

    I wish I was more familiar with writing code on my own so I can just add it to the front end customizer.

    Thanks so much for your time!!

    Take care,
    Kari

    #184883
    Robin W
    Moderator

    hmm, suspect this is theme related, and would need bespoke code to fix – sorry

    #184878
    UserCentrix
    Participant

    No response in nearly 5 days is leaving me rather concerned to use bbPress. Is this the ussual support response-time?

    Anyway, I figured out a workaround using a plugin called PHP Code Widget.

    The plugin I am using is: https://wordpress.org/plugins/php-code-widget/

    An example of one of the codes I am using is:

    
    <?php
    $forum_id = get_the_ID();
    $forum_add_topic='[bbp-single-topic id ="'.$forum_id.'"]';
    echo do_shortcode($forum_add_topic);
    ?>
    
    #184867
    Alex Stine
    Participant

    Hello,

    Okay, I like something that doesn’t query the DB to much. Would something like this work? I’m somewhat new to arrays and post_meta, but trying to learn fast.

    /*Remove all topics from Amazon CloudSearch if topic is in a private forum*/
    /*Private Forums are added as an integration through a plugin*/
    /*Amazon CloudSearch is added as integration through a plugin*/
    function exclude_topics_in_private_forum() {
    $forum_id = bbp_get_forum_id();
    $query = bbp_get_all_child_ids($forum_id, 'post');
    foreach($query as $q) {
    OR
    foreach($query as $key => $q) {
    if(is_private_forum($forum_id) ) {
    update_post_meta($q, 'exclude', 1);
    OR
    update_post_meta($key, 'exclude', 1);
    } elseif(!is_private_forum($forum_id) ) {
    delete_post_meta($q, 'exclude');
    }
    }
    }
    add_action('bbp_new_forum', 'exclude_topics_in_private_forum' );
    add_action('bbp_edit_forum', 'exclude_topics_in_private_forum' );

    How does that look? Any suggestions?

    Thanks.

    #184857

    Topic: Forums

    in forum Installation
    kariellen35
    Participant

    I would really like to create forums for my website, however, I don’t have this option:

    A. Set Up Sitewide Forums only

    Install and activate bbPress.
    Proceed to bbPress.org Codex to get started in creating your Sitewide Forums.
    If you kept the default “forums” slug in Settings > Forums, you can create a new Page via Pages > Add New. Add Title “Forums” and insert the forums index shortcode and/or other bbPress shortcode you’ll find in the bbPress Codex then publish the new page.
    Add new “Forums” Page in your custom menu via Appearances > Menu

    Can someone please tell me what I am missing?

    Thank you so much for your time!!

    Take care,
    Kari

    #184849
    itayasa
    Participant

    I used the ID field of the parent topic (in table wp_posts).
    I suspect that I’ll have to mess with the wp_postmeta table as well (though at first I didn’t see a direct connection to the messages not appearing on the forum).

    #184819
    itayasa
    Participant

    Hi.
    I have an XML file containing messages (title, date, author and body). I’ve considered three methods of importing these messages into bbPress:

    1. Into the database. I’ve written a PHP script to automate that but because the messages are in Hebrew then the encoding causes the text to be gibberish. When that problem was solved, topics that were inseted into the wp_posts table didn’t appear in the forum page.

    2. Using the custom importing method. The database structure required to import the messages isn’t really understandable, how should my database be organized in order to transition my data from one database into WordPress’?

    3. Using POST requests. I managed to parse the POST request the posting form does in order to make requests of my own. This is complicated, however, due to use of session cookies.

    Right now the option that seems the best to me is (2). Instead of messing with encoding issues or session cookies, I need to create a second database but the question is: in which way should my data be organized? How are the IDs working? I didn’t really manage to catch all of that using the docs available here.

    Robin W
    Moderator

    However, when BBPress is active, this will not work and will always redirecting to Homepage but if BBPress is activated, the custom code will work perfectly.

    Can’t see a difference between the 1st half and the 2nd half of this sentence !!

Viewing 25 results - 5,126 through 5,150 (of 32,518 total)
Skip to toolbar