Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 16,201 through 16,225 (of 32,519 total)
  • Author
    Search Results
  • #105570
    Oleksandr Kramer
    Participant

    Solved!

    $wpdb->query("UPDATE wp_posts SET post_author = '0' WHERE ID =".$inserted_topic.";");

    #100470
    Oleksandr Kramer
    Participant

    Solved!

    $wpdb->query("UPDATE wp_posts SET post_author = '0' WHERE ID =".$inserted_topic.";");

    #105569
    Oleksandr Kramer
    Participant

    Please tell me what to write here

    Now the author of topic is always admin.

    //Topic Author - Guest (What code here?)

    if(!($sp_topic->user_id))

    {

    echo("  Guest start topic: {$sp_posts[0]->guest_name}n");

    // update_post_meta( $inserted_topic, '_bbp_anonymous_name', "{$sp_posts[0]->guest_name}" );

    // update_post_meta( $inserted_topic, '_bbp_anonymous_email', "{$sp_posts[0]->guest_email}" );

    // ??????

    }

    I am a newbie in php – use at your own risk!!!

    <?php

    /*

    Plugin Name: Simple Press to bbPress

    Plugin URI: http://www.4-14.org.uk/

    Description: Import Simple Press forums to bbPress

    Author: Mark Barnes

    Version: 0.1

    Author URI: http://www.4-14.org.uk/

    using: http://site.com?bbpressimport=1&delete=1

    */

    if (isset($_GET))

    add_action (‘init’, ‘mbbb_init’);

    function mbbb_init () {

    global $wpdb;

    define(‘WP_IMPORTING’, true);

    //Delete existing posts

    if (isset($_GET)) {

    $post_ids = $wpdb->get_results(“SELECT ID from {$wpdb->posts} WHERE post_type IN (‘forum’, ‘reply’, ‘topic’)”);

    if ($post_ids)

    foreach ($post_ids as $post_id)

    wp_delete_post ($post_id->ID, true);

    }

    // Import forums

    $forum_map = array();

    $sp_forums = $wpdb->get_results(“SELECT forum_desc, forum_name, forum_slug, forum_seq, forum_id FROM {$wpdb->prefix}sfforums ORDER BY forum_seq”);

    if ($sp_forums) {

    foreach ($sp_forums as $sp_forum) {

    $post_id = $wpdb->get_var (“SELECT post_id FROM {$wpdb->prefix}postmeta WHERE meta_value=’forum_{$sp_forum->forum_id}’ AND meta_key=’_mbbb_sp_id'”);

    if (!$post_id) {

    $inserted_forum = wp_insert_post( array(

    ‘post_author’ => get_current_user_id(),

    ‘post_content’ => $sp_forum->forum_desc,

    ‘post_title’ => $sp_forum->forum_name,

    ‘post_excerpt’ => ”,

    ‘post_status’ => ‘publish’,

    ‘comment_status’ => ‘closed’,

    ‘ping_status’ => ‘closed’,

    ‘post_name’ => $sp_forum->forum_slug,

    ‘post_parent’ => 0,

    ‘post_type’ => bbp_get_forum_post_type(),

    ‘menu_order’ => $sp_forum->forum_seq

    ) );

    if ($inserted_forum) {

    echo “Added {$sp_forum->forum_name}n”;

    update_post_meta( $inserted_forum, ‘_mbbb_sp_id’, “forum_{$sp_forum->forum_id}” );

    } else

    echo “Failed to add {$sp_forum->forum_name}n”;

    } else

    $inserted_forum = $post_id;

    $forum_map[$sp_forum->forum_id] = $inserted_forum;

    }

    }

    // Import topics

    $topic_count = 0;

    $sp_topics = $wpdb->get_results (“SELECT forum_id, user_id, topic_name, topic_slug, topic_date, topic_id FROM {$wpdb->prefix}sftopics ORDER BY topic_date ASC”);

    if ($sp_topics) {

    foreach ($sp_topics as $sp_topic) {

    $post_id = $wpdb->get_var (“SELECT post_id FROM {$wpdb->prefix}postmeta WHERE meta_value=’topic_{$sp_topic->topic_id}’ AND meta_key=’_mbbb_sp_id'”);

    $sp_posts = $wpdb->get_results (“SELECT topic_id, user_id, post_date, guest_name, guest_email, post_content, poster_ip, post_id from {$wpdb->prefix}sfposts WHERE topic_id = ‘{$sp_topic->topic_id}’ ORDER BY post_date ASC”);

    if (isset($forum_map[$sp_topic->forum_id]) && $sp_posts) {

    if (!$post_id) {

    if(! empty($sp_posts[0]->guest_name))

    {

    echo(“Topic: {$sp_topic->topic_name}n”);

    echo(“Guest name: {$sp_posts[0]->guest_name}n”);

    $inserted_topic = wp_insert_post( array(

    ‘post_parent’ => $forum_map[$sp_topic->forum_id],

    ‘post_content’ => $sp_posts[0]->post_content,

    ‘post_title’ => $sp_topic->topic_name,

    ‘post_name’ => $sp_topic->topic_slug,

    ‘post_status’ => ‘publish’,

    ‘post_date_gmt’ => $sp_topic->topic_date,

    ‘post_date’ => get_date_from_gmt( $sp_topic->topic_date ),

    ‘post_type’ => bbp_get_topic_post_type(),

    ) );

    if ($inserted_topic) {

    update_post_meta( $inserted_topic, ‘_bbp_forum_id’, $forum_map[$sp_topic->forum_id] );

    update_post_meta( $inserted_topic, ‘_bbp_topic_id’, $inserted_topic );

    update_post_meta( $inserted_topic, ‘_mbbb_sp_id’, “topic_{$sp_topic->topic_id}” );

    update_post_meta( $inserted_topic, ‘_bbp_anonymous_name’, “{$sp_posts[0]->guest_name}” );

    update_post_meta( $inserted_topic, ‘_bbp_anonymous_email’, “{$sp_posts[0]->guest_email}” );

    } else

    echo “Failed to add {$sp_forum->topic_name}n”;

    }

    else

    {

    if(!($sp_posts[0]->user_id))

    echo(“Guest TOPICStart: {$sp_posts[0]->guest_name}n”);

    $inserted_topic = wp_insert_post( array(

    ‘post_parent’ => $forum_map[$sp_topic->forum_id],

    ‘post_author’ => $sp_posts[0]->user_id,

    ‘post_content’ => $sp_posts[0]->post_content,

    ‘post_title’ => $sp_topic->topic_name,

    ‘post_name’ => $sp_topic->topic_slug,

    ‘post_status’ => ‘publish’,

    ‘post_date_gmt’ => $sp_topic->topic_date,

    ‘post_date’ => get_date_from_gmt( $sp_topic->topic_date ),

    ‘post_type’ => bbp_get_topic_post_type(),

    ) );

    if ($inserted_topic) {

    echo “Added {$sp_topic->topic_name}n”;

    update_post_meta( $inserted_topic, ‘_bbp_forum_id’, $forum_map[$sp_topic->forum_id] );

    update_post_meta( $inserted_topic, ‘_bbp_topic_id’, $inserted_topic );

    update_post_meta( $inserted_topic, ‘_mbbb_sp_id’, “topic_{$sp_topic->topic_id}” );

    } else

    echo “Failed to add {$sp_forum->topic_name}n”;

    }

    }

    else{

    echo “ADD”;

    $inserted_topic = $post_id;

    }

    }

    //Import posts

    $post_count = 0;

    if ($sp_posts) {

    foreach ($sp_posts as $sp_post) {

    $post_id = $wpdb->get_var (“SELECT post_id FROM {$wpdb->prefix}postmeta WHERE meta_value=’post_{$sp_post->post_id}’ AND meta_key=’_mbbb_sp_id'”);

    if (!$post_id) {

    if ($post_count != 0) {

    if(! empty($sp_post->guest_name))

    {

    echo(”    Reply To: {$sp_topic->topic_name}n”);

    echo(”    Guest name: {$sp_post->guest_name}n”);

    $inserted_post = wp_insert_post( array(

    ‘post_parent’ => $inserted_topic,

    ‘post_date_gmt’ => $sp_post->post_date,

    ‘post_date’ => get_date_from_gmt( $sp_post->post_date ),

    ‘post_title’ => ‘Reply To: ‘.$sp_topic->topic_name,

    ‘post_status’ => ‘publish’,

    ‘post_type’ => bbp_get_reply_post_type(),

    ‘post_content’ => $sp_post->post_content

    ) );

    if ($inserted_post) {

    update_post_meta( $inserted_post, ‘_bbp_author_ip’, $sp_post->poster_ip );

    update_post_meta( $inserted_post, ‘_bbp_forum_id’, $forum_map[$sp_topic->forum_id] );

    update_post_meta( $inserted_post, ‘_bbp_topic_id’, $inserted_topic );

    update_post_meta( $inserted_post, ‘_mbbb_sp_id’, “post_{$sp_post->post_id}” );

    update_post_meta( $inserted_post, ‘_bbp_anonymous_name’, “{$sp_post->guest_name}” );

    update_post_meta( $inserted_post, ‘_bbp_anonymous_email’, “{$sp_post->guest_email}” );

    bbp_update_reply_walker( $inserted_post );

    }

    }

    else

    {

    $inserted_post = wp_insert_post( array(

    ‘post_parent’ => $inserted_topic,

    ‘post_author’ => $sp_post->user_id,

    ‘post_date_gmt’ => $sp_post->post_date,

    ‘post_date’ => get_date_from_gmt( $sp_post->post_date ),

    ‘post_title’ => ‘Reply To: ‘.$sp_topic->topic_name,

    ‘post_status’ => ‘publish’,

    ‘post_type’ => bbp_get_reply_post_type(),

    ‘post_content’ => $sp_post->post_content

    ) );

    if ($inserted_post) {

    update_post_meta( $inserted_post, ‘_bbp_author_ip’, $sp_post->poster_ip );

    update_post_meta( $inserted_post, ‘_bbp_forum_id’, $forum_map[$sp_topic->forum_id] );

    update_post_meta( $inserted_post, ‘_bbp_topic_id’, $inserted_topic );

    update_post_meta( $inserted_post, ‘_mbbb_sp_id’, “post_{$sp_post->post_id}” );

    bbp_update_reply_walker( $inserted_post );

    }

    }

    }

    else

    update_post_meta( $inserted_topic, ‘_bbp_author_ip’, $sp_post->poster_ip );

    } else

    {

    $inserted_post = $post_id;

    // echo(“Guest start topic:n”);

    }

    $post_count ++;

    }

    }

    // echo(“Guest start topic:{$sp_topic->user_id}n”);

    update_post_meta( $inserted_topic, ‘_bbp_last_reply_id’, $inserted_post );

    update_post_meta( $inserted_topic, ‘_bbp_last_active_id’, $inserted_post ? $inserted_post : $inserted_topic );

    update_post_meta( $inserted_topic, ‘_bbp_last_active_time’, $inserted_post ? $sp_post->post_date : $sp_topic->topic_date );

    update_post_meta( $inserted_topic, ‘_bbp_reply_count’, $post_count -1 );

    update_post_meta( $inserted_topic, ‘_bbp_hidden_reply_count’, 0 );

    //Topic Author – Guest (What code here?)

    if(!($sp_topic->user_id))

    {

    echo(”  Guest start topic: {$sp_posts[0]->guest_name}n”);

    // update_post_meta( $inserted_topic, ‘_bbp_anonymous_name’, “{$sp_posts[0]->guest_name}” );

    // update_post_meta( $inserted_topic, ‘_bbp_anonymous_email’, “{$sp_posts[0]->guest_email}” );

    // ??????

    }

    bbp_update_topic_walker( $inserted_topic );

    $topic_count ++;

    }

    }

    global $wp_rewrite;

    $wp_rewrite->flush_rules(false);

    }

    #100469
    Oleksandr Kramer
    Participant

    Please tell me what to write here

    Now the author of topic is always admin.

    //Topic Author - Guest (What code here?)

    if(!($sp_topic->user_id))

    {

    echo("  Guest start topic: {$sp_posts[0]->guest_name}n");

    // update_post_meta( $inserted_topic, '_bbp_anonymous_name', "{$sp_posts[0]->guest_name}" );

    // update_post_meta( $inserted_topic, '_bbp_anonymous_email', "{$sp_posts[0]->guest_email}" );

    // ??????

    }

    I am a newbie in php – use at your own risk!!!

    <?php

    /*

    Plugin Name: Simple Press to bbPress

    Plugin URI: http://www.4-14.org.uk/

    Description: Import Simple Press forums to bbPress

    Author: Mark Barnes

    Version: 0.1

    Author URI: http://www.4-14.org.uk/

    using: http://site.com?bbpressimport=1&delete=1

    */

    if (isset($_GET))

    add_action (‘init’, ‘mbbb_init’);

    function mbbb_init () {

    global $wpdb;

    define(‘WP_IMPORTING’, true);

    //Delete existing posts

    if (isset($_GET)) {

    $post_ids = $wpdb->get_results(“SELECT ID from {$wpdb->posts} WHERE post_type IN (‘forum’, ‘reply’, ‘topic’)”);

    if ($post_ids)

    foreach ($post_ids as $post_id)

    wp_delete_post ($post_id->ID, true);

    }

    // Import forums

    $forum_map = array();

    $sp_forums = $wpdb->get_results(“SELECT forum_desc, forum_name, forum_slug, forum_seq, forum_id FROM {$wpdb->prefix}sfforums ORDER BY forum_seq”);

    if ($sp_forums) {

    foreach ($sp_forums as $sp_forum) {

    $post_id = $wpdb->get_var (“SELECT post_id FROM {$wpdb->prefix}postmeta WHERE meta_value=’forum_{$sp_forum->forum_id}’ AND meta_key=’_mbbb_sp_id'”);

    if (!$post_id) {

    $inserted_forum = wp_insert_post( array(

    ‘post_author’ => get_current_user_id(),

    ‘post_content’ => $sp_forum->forum_desc,

    ‘post_title’ => $sp_forum->forum_name,

    ‘post_excerpt’ => ”,

    ‘post_status’ => ‘publish’,

    ‘comment_status’ => ‘closed’,

    ‘ping_status’ => ‘closed’,

    ‘post_name’ => $sp_forum->forum_slug,

    ‘post_parent’ => 0,

    ‘post_type’ => bbp_get_forum_post_type(),

    ‘menu_order’ => $sp_forum->forum_seq

    ) );

    if ($inserted_forum) {

    echo “Added {$sp_forum->forum_name}n”;

    update_post_meta( $inserted_forum, ‘_mbbb_sp_id’, “forum_{$sp_forum->forum_id}” );

    } else

    echo “Failed to add {$sp_forum->forum_name}n”;

    } else

    $inserted_forum = $post_id;

    $forum_map[$sp_forum->forum_id] = $inserted_forum;

    }

    }

    // Import topics

    $topic_count = 0;

    $sp_topics = $wpdb->get_results (“SELECT forum_id, user_id, topic_name, topic_slug, topic_date, topic_id FROM {$wpdb->prefix}sftopics ORDER BY topic_date ASC”);

    if ($sp_topics) {

    foreach ($sp_topics as $sp_topic) {

    $post_id = $wpdb->get_var (“SELECT post_id FROM {$wpdb->prefix}postmeta WHERE meta_value=’topic_{$sp_topic->topic_id}’ AND meta_key=’_mbbb_sp_id'”);

    $sp_posts = $wpdb->get_results (“SELECT topic_id, user_id, post_date, guest_name, guest_email, post_content, poster_ip, post_id from {$wpdb->prefix}sfposts WHERE topic_id = ‘{$sp_topic->topic_id}’ ORDER BY post_date ASC”);

    if (isset($forum_map[$sp_topic->forum_id]) && $sp_posts) {

    if (!$post_id) {

    if(! empty($sp_posts[0]->guest_name))

    {

    echo(“Topic: {$sp_topic->topic_name}n”);

    echo(“Guest name: {$sp_posts[0]->guest_name}n”);

    $inserted_topic = wp_insert_post( array(

    ‘post_parent’ => $forum_map[$sp_topic->forum_id],

    ‘post_content’ => $sp_posts[0]->post_content,

    ‘post_title’ => $sp_topic->topic_name,

    ‘post_name’ => $sp_topic->topic_slug,

    ‘post_status’ => ‘publish’,

    ‘post_date_gmt’ => $sp_topic->topic_date,

    ‘post_date’ => get_date_from_gmt( $sp_topic->topic_date ),

    ‘post_type’ => bbp_get_topic_post_type(),

    ) );

    if ($inserted_topic) {

    update_post_meta( $inserted_topic, ‘_bbp_forum_id’, $forum_map[$sp_topic->forum_id] );

    update_post_meta( $inserted_topic, ‘_bbp_topic_id’, $inserted_topic );

    update_post_meta( $inserted_topic, ‘_mbbb_sp_id’, “topic_{$sp_topic->topic_id}” );

    update_post_meta( $inserted_topic, ‘_bbp_anonymous_name’, “{$sp_posts[0]->guest_name}” );

    update_post_meta( $inserted_topic, ‘_bbp_anonymous_email’, “{$sp_posts[0]->guest_email}” );

    } else

    echo “Failed to add {$sp_forum->topic_name}n”;

    }

    else

    {

    if(!($sp_posts[0]->user_id))

    echo(“Guest TOPICStart: {$sp_posts[0]->guest_name}n”);

    $inserted_topic = wp_insert_post( array(

    ‘post_parent’ => $forum_map[$sp_topic->forum_id],

    ‘post_author’ => $sp_posts[0]->user_id,

    ‘post_content’ => $sp_posts[0]->post_content,

    ‘post_title’ => $sp_topic->topic_name,

    ‘post_name’ => $sp_topic->topic_slug,

    ‘post_status’ => ‘publish’,

    ‘post_date_gmt’ => $sp_topic->topic_date,

    ‘post_date’ => get_date_from_gmt( $sp_topic->topic_date ),

    ‘post_type’ => bbp_get_topic_post_type(),

    ) );

    if ($inserted_topic) {

    echo “Added {$sp_topic->topic_name}n”;

    update_post_meta( $inserted_topic, ‘_bbp_forum_id’, $forum_map[$sp_topic->forum_id] );

    update_post_meta( $inserted_topic, ‘_bbp_topic_id’, $inserted_topic );

    update_post_meta( $inserted_topic, ‘_mbbb_sp_id’, “topic_{$sp_topic->topic_id}” );

    } else

    echo “Failed to add {$sp_forum->topic_name}n”;

    }

    }

    else{

    echo “ADD”;

    $inserted_topic = $post_id;

    }

    }

    //Import posts

    $post_count = 0;

    if ($sp_posts) {

    foreach ($sp_posts as $sp_post) {

    $post_id = $wpdb->get_var (“SELECT post_id FROM {$wpdb->prefix}postmeta WHERE meta_value=’post_{$sp_post->post_id}’ AND meta_key=’_mbbb_sp_id'”);

    if (!$post_id) {

    if ($post_count != 0) {

    if(! empty($sp_post->guest_name))

    {

    echo(”    Reply To: {$sp_topic->topic_name}n”);

    echo(”    Guest name: {$sp_post->guest_name}n”);

    $inserted_post = wp_insert_post( array(

    ‘post_parent’ => $inserted_topic,

    ‘post_date_gmt’ => $sp_post->post_date,

    ‘post_date’ => get_date_from_gmt( $sp_post->post_date ),

    ‘post_title’ => ‘Reply To: ‘.$sp_topic->topic_name,

    ‘post_status’ => ‘publish’,

    ‘post_type’ => bbp_get_reply_post_type(),

    ‘post_content’ => $sp_post->post_content

    ) );

    if ($inserted_post) {

    update_post_meta( $inserted_post, ‘_bbp_author_ip’, $sp_post->poster_ip );

    update_post_meta( $inserted_post, ‘_bbp_forum_id’, $forum_map[$sp_topic->forum_id] );

    update_post_meta( $inserted_post, ‘_bbp_topic_id’, $inserted_topic );

    update_post_meta( $inserted_post, ‘_mbbb_sp_id’, “post_{$sp_post->post_id}” );

    update_post_meta( $inserted_post, ‘_bbp_anonymous_name’, “{$sp_post->guest_name}” );

    update_post_meta( $inserted_post, ‘_bbp_anonymous_email’, “{$sp_post->guest_email}” );

    bbp_update_reply_walker( $inserted_post );

    }

    }

    else

    {

    $inserted_post = wp_insert_post( array(

    ‘post_parent’ => $inserted_topic,

    ‘post_author’ => $sp_post->user_id,

    ‘post_date_gmt’ => $sp_post->post_date,

    ‘post_date’ => get_date_from_gmt( $sp_post->post_date ),

    ‘post_title’ => ‘Reply To: ‘.$sp_topic->topic_name,

    ‘post_status’ => ‘publish’,

    ‘post_type’ => bbp_get_reply_post_type(),

    ‘post_content’ => $sp_post->post_content

    ) );

    if ($inserted_post) {

    update_post_meta( $inserted_post, ‘_bbp_author_ip’, $sp_post->poster_ip );

    update_post_meta( $inserted_post, ‘_bbp_forum_id’, $forum_map[$sp_topic->forum_id] );

    update_post_meta( $inserted_post, ‘_bbp_topic_id’, $inserted_topic );

    update_post_meta( $inserted_post, ‘_mbbb_sp_id’, “post_{$sp_post->post_id}” );

    bbp_update_reply_walker( $inserted_post );

    }

    }

    }

    else

    update_post_meta( $inserted_topic, ‘_bbp_author_ip’, $sp_post->poster_ip );

    } else

    {

    $inserted_post = $post_id;

    // echo(“Guest start topic:n”);

    }

    $post_count ++;

    }

    }

    // echo(“Guest start topic:{$sp_topic->user_id}n”);

    update_post_meta( $inserted_topic, ‘_bbp_last_reply_id’, $inserted_post );

    update_post_meta( $inserted_topic, ‘_bbp_last_active_id’, $inserted_post ? $inserted_post : $inserted_topic );

    update_post_meta( $inserted_topic, ‘_bbp_last_active_time’, $inserted_post ? $sp_post->post_date : $sp_topic->topic_date );

    update_post_meta( $inserted_topic, ‘_bbp_reply_count’, $post_count -1 );

    update_post_meta( $inserted_topic, ‘_bbp_hidden_reply_count’, 0 );

    //Topic Author – Guest (What code here?)

    if(!($sp_topic->user_id))

    {

    echo(”  Guest start topic: {$sp_posts[0]->guest_name}n”);

    // update_post_meta( $inserted_topic, ‘_bbp_anonymous_name’, “{$sp_posts[0]->guest_name}” );

    // update_post_meta( $inserted_topic, ‘_bbp_anonymous_email’, “{$sp_posts[0]->guest_email}” );

    // ??????

    }

    bbp_update_topic_walker( $inserted_topic );

    $topic_count ++;

    }

    }

    global $wp_rewrite;

    $wp_rewrite->flush_rules(false);

    }

    #44709
    russwittmann
    Member

    What are you using for the code allowed option on the text field here on these forums? Id like to use on my forums as well?

    #105568
    Gautam Gupta
    Participant

    It looks like this importer doesn’t support anonymous replies. You’d have to add the appropriate conditions yourself and re-import. :)

    #100468
    Gautam Gupta
    Participant

    It looks like this importer doesn’t support anonymous replies. You’d have to add the appropriate conditions yourself and re-import. :)

    Do you remember to change the forum slug in Setting > Forums in your dashboard? By default, both of them are using the page slug “forums” so there’re conflict between Group Forum & Sitewide Forum.

    Read here for more info:

    https://codex.buddypress.org/getting-started/installing-group-and-sitewide-forums/

    For installing group & sitewide forums:

    https://codex.buddypress.org/getting-started/installing-group-and-sitewide-forums/3/

    #113583
    JenniferNM
    Member

    Is there some sort of code we could put into one or more of the bbpress php files to exclude it?

    #44690

    pagination for all topic listing in archive forum page is not working.

    http://mydemozone.com/vividmagazine/web/?post_type=forum

    but it is working well for topics in particular forum but in the archive-forum.php page where all topics are listing,pagination not working.

    I need a help to implement pagination in the archive forum page where all topics are listed by short code and php code . but pagination not working.

    #112047

    pagination is not working for topic list in archive forum page. but it is working in particular forum page.

    link is here

    http://mydemozone.com/vividmagazine/web/?post_type=forum

    when I click on 2 then it shows page not found.

    how will I set pagination for topic list in archive-forum.php page.

    #44679
    javiarques
    Member

    Hi, I’m trying to activate post-thumbnail in forum post type, but it still fails. I tried with this code:

    function forum_post_thumbnails () {
    add_theme_support( 'post-thumbnails', array( 'forum', 'topic', 'reply', 'post', 'page' ) ); // Posts and Movies
    }
    add_action('after_setup_theme', 'forum_post_thumbnails');

    But it didn’t work. Any ideas on how activate it?

    Thanks

    #112081
    dannyjimmy
    Participant
    #112080
    dannyjimmy
    Participant

    I’m having a bit of trouble with this as well. And I too am on a BP install, though it would seem to me that it shouldn’t matter.

    I used it like this:

    - [bbp-login]

    - [bbp-single-topic-tag id="35"]

    - [bbp-single-topic-tag id="link"]

    - [bbp-single-topic-tag $id="35"]

    - [bbp-single-topic-tag $id="link"]

    - [bbp-single-topic-tag id=$topic_id]

    - [bbp-single-topic-tag id=35]

    (this is when I found the codex file for bbpress shortcodes at https://codex.bbpress.org/shortcodes/ and formatted accordingly)

    - [bbp-single-topic-tag id=$35]

    - [bbp-single-topic-tag id=$tag_id]

    And I got no forums rendered. Very confusing, since the last two were copy paste from the codex.

    #113509
    kennymcnett
    Member

    I considered Buddypress, but it’s way more robust than what I’m needing, and installing it was breaking my custom theme (jquery conflict somewhere).

    Thanks for looking at this.

    For anyone else out there, here’s my solution for restricting bbPress access using s2member. In short, this checks if the current user has access to the most distant ancestor of the current page. For example:

    Level 1 Forum/Category > Subforum1 > Subcategory > Subforum2 > Current Topic

    No matter which page they arrive at in the tree, they must have access via s2member to the top-most level. Then it’s a simple matter of assigning a ccap to that Forum, or a membership level.

    1. Include the following in your functions.php file

    2. Include a call to the function in EACH of your bbPress template files BEFORE the template calls for the forum content. Match the HTML structure of the error message to suit your theme. You need to include closing tags for any open divs.

    3. Test!

    /******* bbPress Forum Access *******/

    function checkForumAccess() {

    if(get_post_type() == 'forum' OR get_post_type() == 'topic' OR get_post_type() == 'reply') { // check if user is viewing a forum page. If so, continue.

    //check if they have access to the top-most parent forum/category (both are Pages in wordpress). If not, show the error verbiage. If they have access, continue and show the content like normal

    $parent = array_reverse(get_post_ancestors($post->ID)); // get an array of all the parent pages in order from most distant to closest.

    $first_parent = get_page($parent[0]); //get the first page in the array, which is the most distant parent

    $int = apply_filters(‘the_ID’, $first_parent->ID); //filter the $first_parent to get only the wordpress page/post ID, which is an integer like 49 or 565. store it as a variable $int

    if (!is_page_permitted_by_s2member($int)) { // this is an s2member function. Check if the current user can access the $first_parent, via the stored page/post ID in the $int variable

    // here comes your custom error message. Remember to escape any apostrophes

    echo ‘

    <div>

    <h1 class=”entry-title”>Sorry!</h1>

    <div class=”entry-content”>

    <p>It looks like you don’t have access to this forum.</p>

    <p>If this is an error and you should have access, please contact us here: (contact URL)

    </div>

    </div><!–.postWrapper–>

    </div><!– #content –>

    </div><!– #contentWrapper –>

    </div><!– #primary –>

    ‘;

    get_sidebar();

    get_footer();

    exit; // Important. This prevents the rest of the page (the secure forum content) from displaying

    }

    }

    }

    chr313
    Member

    Just giving this a bump. I would think there was some short code etc for this functionality that I might have missed somewhere.

    #113498

    In reply to: BBpress will continue?

    cavenewt
    Participant

    ‘This questions sound a bit silly, but is it helpful if someone tag a spam topic as “spam”, “spams”, “spamming”, or “spammer”? (I always do this when I see a spam topic)’

    That explains why, when I come here looking for spam-fighting solutions, I turn up so much spam. :(

    #44637
    Nate
    Participant

    Problem: Remove sidebar from bbPress

    Solution: My theme has a Full Width option

    I know that if I input my shortcode into a Page, it will display the forum in the Template of my choosing. Presto, the forum index is within Full Width.

    Yet when the user decides to choose a forum, they’re relegated to the Theme’s default Template, which includes the sidebar.

    Meeeeh.

    Is there a quick and dirty way to tell bbPress to use the Full Width template that’s already available?

    #113541

    Looks like you accidentally add unnecessary line in your style.css

    Find the following lines:

    .reply {
    float:right;
    margin-left:18px;

    }

    Remove the “float:right;” from it, leaving:

    .reply {
    margin-left:18px;

    }

    This should solve the problem.

    I recently noticed that when I try to start a topic or posting a reply, it’s taking about 30+ second before the topic/reply is show up. If you try to tell me there may be a “bad plugin” and try to disable all of it except bbPress, save it. I have tried the following:

    1. Using different browser.

    I find out that when I try to use Firefox 12.0 to post, it’s loading extremely slow. But this is not happening in Internet Explorer 9 or Google Chrome 18.

    Try to start Firefox in safe mode? Yes I have tried to do that but it doesn’t make a difference.

    2. Using different user/computer.

    It’s still the same.

    3. Try to post a comment in a normal post.

    I was able to comment a post without any problems, so I think it may be a “bad plugin” problem.

    4. Disable all plugin (except bbPress & BuddyPress)

    But the same thing happen. FYI I don’t edit either the bbPress or BuddyPress files.

    5. Using different theme.

    I replace my modified custom community theme with BuddyPress Default theme and see if I putting bad codes in my theme. But this doesn’t solve problem even I tried other themes.

    6. Change permalink structure.

    It doesn’t make any changes, and I don’t think it will help.

    7. Reinstall WordPress, bbPress & BuddyPress

    Still doesn’t make any changes.

    8. Create a new install in another domain.

    I use http://scirefs.com/ as my main and http://www.scirefs.org as a sandbox (with the same configuration as in SCIREFs.com) with only bbPress and BuddyPress activated. But everything works fine in SCIREFs.org with either bbPress 2.02 or 2.1 and I have no issue with Firefox 12.

    9. The Cloudflare……

    Since I have Cloudflare as my CDN for SCIREfs.com but not SCIREFs.org, I tried to remove SCIREFs.com from Cloudflare and add SCIREfs.org to it and see what happens. The result: The issue with Firefox at SCIREFs.com disappear but SCIREfs.org is now facing the old issue.

    Do anyone here have any ideas what’s wrong with it? Or someone here is facing the same problem? This seems to be the first and the only problem I can’t figure it myself.

    You can login to SCIREFs.org using the following information:

    Username: demo

    Password: demo

    URL of the forums: http://www.scirefs.org/test-forums

    And try to start a topic or post a reply using Firefox and see if it’s happening to you.

    #113518

    In reply to: email notification

    pimarts
    Participant

    If you know your way around Javascript / jQuery: You could do a workaround with that to tick that box automatically upon page load and hide it immediately… It’s a dirty fix though :)

    ZedsDed
    Member

    Hello! I’d love to see some examples of sites that utilize WordPress for its blog and bbPress for its forum/messageboard. I’m poking around this forum now for examples but would love to see any that you may know of. Thank you :)

    Stephen Edgar
    Keymaster

    The page /forums is a generic page part of bbPress.

    You can create your own page/s and use the bbPress Shortcodes

    https://bbpress.org/forums/topic/bbpress-20-shortcodes

    Go to Appearance > Pages and give it a title (Discussion, The Teams, Leagues etc)

    Then in the content of that page use the bbPress shortcodes with how and what you want on that page.

    This for example would show what you currently have on /forums plus add the ‘new topic form’ below that list.

    [bbp-forum-index]

    [bbp-topic-form]

    You could also create a page called ‘New Topic’ and just have [bbp-topic-form] on that page and then using the same method from Jarad above add those pages as menu items.

    #109942
    kennymcnett
    Member

    Thanks mattsimo and jaredatch. Worked the charm.

    Here are all of the $args and the defaults, FYI (pulled from bbPress core file: bbp-common-template.php)

    // HTML
    'before' => '<div class="bbp-breadcrumb"><p>',
    'after' => '</p></div>',
    'sep' => is_rtl() ? __( '&lsaquo;', 'bbpress' ) : __( '&rsaquo;', 'bbpress' ),
    'pad_sep' => 1,

    // Home
    'include_home' => $pre_include_home,
    'home_text' => $pre_front_text,

    // Forum root
    'include_root' => $pre_include_root,
    'root_text' => $pre_root_text,

    // Current
    'include_current' => $pre_include_current,
    'current_text' => $pre_current_text

    #108139
    damjtoh
    Member

    I edit the template.php bbp-forum, although I do not sound right to modify the core.

    I changed bbp_list_forums function () original:

    function bbp_list_forums( $args = '' ) {

    [...]

    // Build this sub forums link

    $output .= $link_before . '' . $title . $counts . '' . $show_sep . $link_after;

    }

    // Output the list

    echo $before . $output . $after;

    }

    }

    by:

    function bbp_list_forums( $args = '' ) {

    [...]

    // Build this sub forums link

    //$output .= $link_before . '' . $title . $counts . '' . $show_sep . $link_after;

    $output[] = array(

    'permalink'=>$permalink,

    'title'=>$title,

    'count'=>$count

    );

    }

    // Output the list

    return $output;

    }

    }

    and I returned:

    Array

    (

    [0] => Array

    (

    [permalink] => http://localhost/wpv1/foros/seccion/dota2/torneos-y-competencias

    [title] => Torneos y competencias

    [count] => Array

    (

    [topic] => 1

    [reply] => 5

    )

    )

    [1] => Array

    (

    [permalink] => http://localhost/wpv1/foros/seccion/dota2/dota-chat

    [title] => Dota chat

    [count] => Array

    (

    [topic] => 0

    [reply] => 0

    )

    )

    )

    The only drawback is that I can not get the last comment of each forum.

Viewing 25 results - 16,201 through 16,225 (of 32,519 total)
Skip to toolbar