Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 9,426 through 9,450 (of 32,522 total)
  • Author
    Search Results
  • #158769

    In reply to: Post submission hooks

    s1r0n
    Participant

    Ya ok i got something figured out. its very basic but you can easily add to this. here’s the code

    This basically ads a field call ‘lp_post_honey_post’ with the question “I am a robot”. if the user answers anything other than ‘no’ the post craps out with an error. currently the error message is that the post parameters are wrong, but maybe if somebody can tell me how to set the bbpress error message I can fix that.

    You can see the filter in action here

    http://www.thelightningpath.com/forums/room/lobby/pre-registration/

    There are a few tweaks you could make to this. if you have a plugin like piklist you can easily have a settings page where you could set both the question and the answer. And of course you can change the question in the hard code.

    I choose the wp_insert_post_empty_content filter because it fires early on in the wp_update_post routine, saving some CPU cycles.

    If somebody wants to help me set this up as a wordpress plugin we could make this a plugin pretty easily. I’m guessing there would be a lot of interest in this.
    incorrect code removed ! - correct version below

    #158762

    In reply to: Post submission hooks

    s1r0n
    Participant

    ok that’s a start. where can I find the hooks to deal with the post content just before it gets posted into the database. so somebody hits the submit button and I can intercept that submission with what action/filter.

    I tried searching the bbs code, but faster if somebody can just say

    #158761
    Robkk
    Moderator

    @tools4toni

    ideas for plugin exploration

    there is a plugin section on this site, it basically pulls information from the wordpress.org plugin section on any plugin tagged “bbpress”

    i’d say search the plugins section

    search the forums on this site so you would find some developed plugins that are not yet on wordpress.org

    check some in the list here https://codex.bbpress.org/feature-plugins-tracking/

    on gist.github.com/ there are a few snippets in plugin format , especially netweb’s gists https://gist.github.com/ntwb

    there are also paid plugins on sites like codecanyon

    and there is always google.com

    #158759
    Robkk
    Moderator

    see if this custom CSS can help

    .widget_display_topics .avatar {
    float:none;
    }
    #158754

    In reply to: Profile page

    Robkk
    Moderator

    try this CSS

    .bbpress .vcard .avatar {
    position: relative;
    left: auto;
    top: auto;
    }
    #158747
    Sudar Muthu
    Participant

    Is wp_mail getting called at least?

    #158746

    In reply to: Login bar

    jeroenkosterr
    Participant

    Already figured it out!

    Here is the code i used:

    <?php
    
    $current_user = wp_get_current_user();
            global $current_user;
            get_currentuserinfo();
    		
    if ( is_user_logged_in() ) {
      echo '<b>Welcome,</b> ' . $current_user->user_login . ''; 
      echo ' ';
      echo get_avatar( $current_user->ID, 20 );
    } else {
    	echo '<b>Welcome,</b> Guest! <a href="http://hardstyle-united.nl/register/">Register</a> or ';
    }
    ?> 
    	<?php wp_loginout(); ?>
    #158745
    Robin W
    Moderator

    great -besy way to learn, I knew nothing of bbpress two years ago !

    Come back if you get stuck, and if I can help with quick pointers I will.

    In the spirit of community, it would also be great if you shard the solution if you get there, this is occasionally asked for, and I’ll add it to the codex.

    key bit is on the topics widget for most recent replies, which you would copy and use

    // Order by most recent replies
    case ‘freshness’ :
    $topics_query = array(
    ‘post_type’ => bbp_get_topic_post_type(),
    ‘post_parent’ => $settings[‘parent_forum’],
    ‘posts_per_page’ => (int) $settings[‘max_shown’],
    ‘post_status’ => array( bbp_get_public_status_id(), bbp_get_closed_status_id() ),
    ‘ignore_sticky_posts’ => true,
    ‘no_found_rows’ => true,
    ‘meta_key’ => ‘_bbp_last_active_time’,
    ‘orderby’ => ‘meta_value’,
    ‘order’ => ‘DESC’,
    );
    break;

    that’s where the meta key bit is, so if your plugin stores as ‘_rating’, then that’s what would go in the meta_key line.

    #158744

    In reply to: Login bar

    jeroenkosterr
    Participant

    I am not searching for a plugin actually. Need the php code to show these options.
    Maybe its a wordpress thing or maybe its a BBpress thing or maybe both.

    #158736
    Robin W
    Moderator

    Most replied to is already in the topics widget (as most popular), so it would be nicking that query code.

    It would not be tons of code to do a rating, as long as the rating system stores the score in post_meta, then a simple query with that meta would do it.

    Just that I haven’t got time to code it at the moment.

    suggest you

    a) look at bbpress rating plugins
    b) check that they store scores in post_meta
    c) either code yourself (see bbpress/includes/common/widgets) for the widget code,
    d) or pay someone to do it http://jobs.wordpress.net/

    #158728
    bazaarocommunity
    Participant

    I’ve been struggling for a while now to get the forum import tool to run efficiently. I notice that for some forums, the mysql query code is supplied, but for others it is not. It seems that the process would run a lot faster if I performed the entire operation in mysql instead of using the import tool. I have ~2M posts I need to import. Does anyone have the MYSQL queries for converting Xenforo to BbPress?

    Thanks!

    #158702
    jtstables
    Participant

    OK, working on it.

    Two weeks ago you helped me with an issue under the topic, “Stop users from making topics”.

    You had me to change the following code:

    <?php

    /**
    * Single Forum Content Part
    *
    * @package bbPress
    * @subpackage Theme
    */

    ?>

    <div id=”bbpress-forums”>

    <?php bbp_breadcrumb(); ?>

    <?php bbp_forum_subscription_link(); ?>

    <?php do_action( ‘bbp_template_before_single_forum’ ); ?>

    <?php if ( post_password_required() ) : ?>

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

    <?php else : ?>

    <?php bbp_single_forum_description(); ?>

    <?php if ( bbp_has_forums() ) : ?>

    <?php bbp_get_template_part( ‘loop’, ‘forums’ ); ?>

    <?php endif; ?>

    <?php if ( !bbp_is_forum_category() && bbp_has_topics() ) : ?>

    <?php bbp_get_template_part( ‘pagination’, ‘topics’ ); ?>

    <?php bbp_get_template_part( ‘loop’, ‘topics’ ); ?>

    <?php bbp_get_template_part( ‘pagination’, ‘topics’ ); ?>

    <?php elseif ( !bbp_is_forum_category() ) : ?>

    <?php bbp_get_template_part( ‘feedback’, ‘no-topics’ ); ?>

    <?php endif; ?>

    <?php endif; ?>

    <?php do_action( ‘bbp_template_after_single_forum’ ); ?>

    </div>

    Could this have caused the problem when they upgraded WP? LIke I said the forum worked great until the upgrade.

    Thanks

    #158695

    In reply to: how to see forums ?

    Robin W
    Moderator
    #158693
    Robin W
    Moderator

    why not just have one form, referenced by a button at the top.

    function bsp_create_new_topica () {
    	 $text='Create New Topic' ;
    	if ( bbp_current_user_can_access_create_topic_form() && !bbp_is_forum_category() ) echo '<div style="text-align: center;">  <a href ="#topic">'.$text.'</div>' ;
    	}
    
    function bsp_create_new_topicb () {
    	echo '<a name="topic"></a>' ;
    	}
    
    	
    add_action ( 'bbp_template_before_single_forum', 'bsp_create_new_topica' ) ;
    add_action( 'bbp_theme_before_topic_form', 'bsp_create_new_topicb' ) ;
    
    

    (not tested as its cut down code from one of my plugins)

    adds a link which lets you add a link to the top of the page which sends you to the bottom, which you can easily make a button.

    add to your functions file https://codex.bbpress.org/functions-files-and-child-themes-explained/

    or take the guts into the template you’re amending.

    You could probably send it to a collapsing div at the bottom if you tinker

    That way you only have one form

    #158690
    Robin W
    Moderator

    my shortcode

    [bsp-display-topic-index show=’100′]

    in

    https://wordpress.org/plugins/bbp-style-pack/

    will let you change the number displayed, but only one page I’m afraid !

    #158688
    Robin W
    Moderator

    ok, I’ve just finished coding a ‘latest activity’ widget that should do what you want.

    I’ve added it to my bbp-style-pack

    https://wordpress.org/plugins/bbp-style-pack/

    which you can load to the site and just use (there’s lots of other stuff in there), or if you’re code savvy, you can fork it form includes/widgets.php into your functions file

    Hope you enjoy it !

    #158685
    WilRC
    Participant

    I ran into this code:`
    <?php
    function fix_pagination($args) {
    global $wp_query,$bbp;
    $max_pages = $bbp->topic_query->max_num_pages;
    $page = $bbp->topic_query->paged;
    $mybase = get_permalink($wp_query->post->ID);
    $args = array (
    ‘base’ => $mybase.$wp_rewrite->pagination_base.’/%#%/’,
    ‘format’ => ”,
    ‘total’ => $max_pages,
    ‘current’ => $page,
    ‘prev_text’ => ‘←’,
    ‘next_text’ => ‘→’,
    ‘mid_size’ => 1
    );
    return $args;
    }
    add_filter(‘bbp_topic_pagination’,’fix_pagination’); ?>`
    No luck, pagination dissapeard with this code.

    #158684
    WilRC
    Participant

    When using shortcode bbp-topic-index with other shortcode (bbp-forum-index)pagination returning url is different than using topic-index by freshness.
    => with multiple shortcodes: ../forums/page/2/
    => with topics by freshness: ../forum/forumname/page/2/
    How to solve this?

    #158682
    WilRC
    Participant

    The default is 15, you can changes this in the forumsettings to what ever you like.
    The shortcode doesn’t support a parameter.

    #158673
    Robkk
    Moderator

    shortcodes do not post in bbPress

    use this plugin

    https://wordpress.org/plugins/bbpress-do-short-codes/

    a298e
    Participant

    Hello,

    I would like to add 2 more textarea fields in “Create New Topic” page in addition to an original textarea of bbPress.

    I added following code to function.php, but an original textarea of bbPress was disappeared and couldn’t become submit, error of “ERROR: Your topic cannot be empty. “.

    ——————————-
    add_action ( ‘bbp_theme_before_topic_form_content’, ‘bbp_extra_fields’);
    function bbp_extra_fields() {
    $value = get_post_meta( bbp_get_topic_id(), ‘bbp_extra_field1’, true);
    echo ‘<label for=”bbp_extra_field1”>textarea1</label><br>’;
    echo “<textarea name=’bbp_extra_field1′ rows=’10’ cols=’78’ value='”.$value.”‘></p>”;

    $value = get_post_meta( bbp_get_topic_id(), ‘bbp_extra_field2’, true);
    echo ‘<label for=”bbp_extra_field1″>textarea2</label><br>’;
    echo “<textarea name=’bbp_extra_field2′ rows=’10’ cols=’78’ value='”.$value.”‘></p>”;
    }

    add_action ( ‘bbp_new_topic’, ‘bbp_save_extra_fields’, 10, 1 );
    add_action ( ‘bbp_edit_topic’, ‘bbp_save_extra_fields’, 10, 1 );

    function bbp_save_extra_fields($topic_id=0) {
    if (isset($_POST) && $_POST[‘bbp_extra_field1’]!=”)
    update_post_meta( $topic_id, ‘bbp_extra_field1’, $_POST[‘bbp_extra_field1’] );
    if (isset($_POST) && $_POST[‘bbp_extra_field2’]!=”)
    update_post_meta( $topic_id, ‘bbp_extra_field2’, $_POST[‘bbp_extra_field2’] );
    }

    add_action(‘bbp_template_before_replies_loop’, ‘bbp_show_extra_fields’);
    function bbp_show_extra_fields() {
    $topic_id = bbp_get_topic_id();
    $value1 = get_post_meta( $topic_id, ‘bbp_extra_field1’, true);
    $value2 = get_post_meta( $topic_id, ‘bbp_extra_field2’, true);

    echo “textarea1: “.$value1.”<br>”;
    echo “textarea2: “.$value2.”<br>”;
    }
    ——————————-

    What I want to do is;

    ・There are 3 of textarea fields in “Create New Topic” page.
    ・After submitted, the content being input in 3 textarea are shown in 1 original posted textarea like,

    <p>
    content of textarea1
    </p>
    <p>
    content of textarea2
    </p>
    <p>
    content of textarea3
    </p>

    If anyone know it, please help me.

    Thanks,

    #158669

    In reply to: Landing page issues

    critchy
    Participant

    Did anybody find a way to make this work, I have a theme with exactly the same issue and cannot seem to find the correct page template to hook into. Is there another way to solve this? The forum main index and subsequent bbpress pages all display correct just minus the search box and login links etc. If I use the short code they do display correctly.

    #158667
    mvaneijgen
    Participant

    @3sixty would really like to see the code you made 4 years ago.

    #158666
    bandormen
    Participant

    Hi,

    I started to setup my first forum.
    For me it is necessary to share files.
    I’m using the WordpRess Download Manager PlugIn
    https://wordpress.org/plugins/download-manager/
    to share files and I have the following problem:

    I would like to use the Short-Codes (e.g. [wpdm_package id=’120′])
    of the Download Manager to insert files into a Topic, but ist doesn’t work.
    The Topic displays only the commands and doesn’t display the designed download buttons.

    Is anyone able to help? Or should I use an other PlugIn to share files?

    Thx for your help.

    #158653
    Robin W
    Moderator

    You would add the titles in between

    eg

    title a

    [shortcode]

    title b

    [shortcode]

    and use the page styling to make the titles header, or bold or whatever

    The ‘forum’ is a column header

Viewing 25 results - 9,426 through 9,450 (of 32,522 total)
Skip to toolbar