Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 8,976 through 9,000 (of 32,505 total)
  • Author
    Search Results
  • #160994
    Robkk
    Moderator

    use the bbpress stats widget or shortcode [bbp-stats] in a page

    for just all topics it would placing these in a template.

    these come the template content-statistics.php which you could copy into child theme into a folder called bbpress and customize.

    <?php echo esc_html( $stats['topic_count'] ); ?>

    for just replies it would be

    <?php echo esc_html( $stats['reply_count'] ); ?>

    #160993
    Robkk
    Moderator

    i think this would require making a bbpress.php file from a copy of the page.php file and then make sure the sidebar is still there.

    https://codex.bbpress.org/theme-compatibility/getting-started-in-modifying-the-main-bbpress-template/

    if you need help it would be helpful to also contact your theme author about this.

    #160991

    In reply to: Tittle

    Robkk
    Moderator

    i don’t now where to insert the code you told and also thanks for your help

    alright do you know what FTP is?? or how to upload files through your hosts file manager??

    because you would bascially just copy that file from here

    https://github.com/robkk/bbPress-Hierarchical-Forum-and-Category-Layout/

    and put it into your child theme (if you have a child theme) and put it into a folder called bbpress.

    Then you would have to create categories for every forum you have for it to have this effect like phpbb has.

    if you need a better explanation on certain things please just ask and i will try to help you.

    #160976
    KikoPavon
    Participant

    Hello:
    I just changed my theme. Now i am running the eleven 40 pro with Genesis. The problem is that i do lost all the buttons in my html and visual editor of my forums.
    Any idea how to bring them back? I tried https://wordpress.org/plugins/bbpress-enable-tinymce-visual-tab/ bur it doesn´t work. I also tried https://codex.bbpress.org/enable-visual-editor/ but no rusults.
    Help please?

    #160962
    oldmankit
    Participant

    I just installed bbPress version 2.5.6 on WordPress 4.1.1 on a local development server (XAMPP).

    After activiting the plugin, if I visit any frontend page on my site I get an error appear right after the Admin Bar.

    Warning: in_array() expects parameter 2 to be array, null given in localhost\wp-content\plugins\bbpress\includes\common\functions.php on line 1446

    I did some searching and found many people have a conflict with NextGen Gallery, however I don’t have that plugin installed.

    I can confirm this error still happens with 2015 theme.

    #160960

    In reply to: Tittle

    wuichy
    Participant

    The thing is that im new in wordpress this is my webpage http://www.wuichy.com and i don’t now where to insert the code you told and also thanks for your help

    #160931
    Robin W
    Moderator

    sorry without spending a large amount of time and code, best I can come up with.

    #160925
    Robin W
    Moderator

    yes, just create a topic, no forums, and then create a page with the following shortcode

    [bbp-single-topic id=$topic_id]

    That way you’ll just have a page with that one topic.

    #160915

    In reply to: Post Type

    Robin W
    Moderator
    #160912
    Robin W
    Moderator

    ok, so is it the same with plugins disabled and default theme as per

    Before Posting

    and how is your forums page constructed – eg shortcodes, bbpress.php file etc.

    #160888
    Robin W
    Moderator

    ok,

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

    contains a highly customisable latest activity widget

    and

    https://wordpress.org/plugins/amr-shortcode-any-widget/

    turns any widget into shortcode

    katootje
    Participant

    I am looking for a shortcode or code (so I can make my own shortcode) to add the latest x topics from a specific forum. Like the recent topic widgets does. But in this case I can’t use the widget – so I am looking for a code to get the output of that widget somewhere in the text. I hope that is possible. I looked at the shortcodes on the website, but none of them is useful in my case.
    It needs to say show x recent topics of forum with ID=… and then only give the titles with link

    koendb
    Participant

    I got in contact with @shanhard but basically copied most of my code from wp-content/plugins/bbpress/includes/common/widgets.php

    #160844

    In reply to: Topics are not adding

    Robin W
    Moderator

    ok I think you need to strip this down and rebuild

    I’d suggest that you create a test site

    https://codex.bbpress.org/creating-a-test-site/

    then on the test site

    disable all plugins except bbpress AND switch to a default theme such as twentyten

    Then if this doesn’t fix, go into

    tools forums and reset forums to delete all the data

    Then uninstall and reinstall bbpress.

    Then prove that this set-up ie a default theme with no other plugins, just bbpress, works by creating topics, and checking the backend shows forum etc.

    You should then have a working site

    next add you theme back and check again

    Then you can add plugins one at a time to find out what is wrong,testing each time that it still works.

    If it all re-builds ok, then you can do the same reset and re-install to fix the live site

    Lots of work, but until you get to a stripped down working site, you’ll probably not make progress.

    #160834
    Robin W
    Moderator

    either install this

    https://wordpress.org/support/plugin/bbp-style-pack

    or if you’re into php/css, download the plugin and crack open /css/styles.php which has the codes documented within it

    #160828
    wenlujon
    Participant

    I enabled the “add media” button in bbpress through bbpress-enable-tinymce-visual-tab plugin(by enabling “Fancy editor media upload”), and i can see the button in the forum, however i got error when trying to upload a picture:
    “You don’t have permission to attach files to this post.”

    the site role is Author while the forum role is Participant.

    I can add media if in wordpress, and I can also add media if the user is changed from participant to Keymaster.

    the code is in ajax-actions.php, however, if i remove it i got “HTTP error.”

            if ( isset( $_REQUEST['post_id'] ) ) {
                    $post_id = $_REQUEST['post_id'];
                    if ( ! current_user_can( 'edit_post', $post_id ) ) {
                            echo wp_json_encode( array(
                                    'success' => false,
                                    'data'    => array(
                                            'message'  => __( "You don't have permission to attach files to this post." ),
                                            'filename' => $_FILES['async-upload']['name'],
                                    )
                            ) );
    
                            wp_die();
                    }
    
    #160819
    Robkk
    Moderator

    @danajoy2008

    alright as long as the favorite/subscribe links are black then grayish on hover in Firefox , then my code is working fine.

    as for your cache issue make sure to contact other support to help you will this.

    your hosting support and also wordpress.org support should help.

    Support Forums

    and maybe installing the CCleaner program on your CPU will help remove some of chromes internet cache.

    And if you figure out a configuration for the cache function on your site , make sure the setting have it to not having any Admin user and logged in user not have cache since this is usually recommended.

    #160818
    DanaJoy2008
    Participant

    @robkk

    I surely did flush the cache, and I confirmed with my host that it’s the only caching function on my site at present.

    Now here’s the crazy thing: When I have the website open in Chrome, I see the links in blue AND the Favorite/Subscribe buttons in blue. But when I open the site in Firefox, only the links in the posts are blue (as I wanted it to be).

    I’m thinking this is an issue with me now. Your code seems to be totally brilliant and working just fine; my laptop obviously hates me.

    Thank you again so much for all of your help. You really are awesome at this!

    #160815
    DanaJoy2008
    Participant

    I put the code you posted into my CSS just below the other code you gave me, but the Favorite and Subscribe buttons are still blue for me. I think I hit put a return in between the two — was that the right thing to do?

    Robin W
    Moderator

    Why does the Codex not have these details available to the user?

    Unfortunately good coders tend to be rubbish documenters ! I’m just a user of the software I wrote a fair amount of the codex as I was building my first bbpress forum two years ago, when the codex was open for all to contribute. Unfortunately spammers put pay to that, and now only certain people have access.

    but does that not indicate a design flaw within bbPress itself?

    The authors had given a way to switch the code off, and a flaw depends on how you define it. Many themes work perfectly well without the need to create a bbpress.php, so putting it in the plugin is a more logical area – maybe? Anyway not my cause to argue, I just use the software !

    If I ever get the time, I would be more than willing to write up what each template file does within the codex.

    Would be fantastic of you would, send it to me via my website on http://www.rewweb.co.uk and I’ll happily add it to help others, and credit you !

    Glad you got fixed in the end !

    #160812
    markham1421
    Participant

    Well, keep in mind that I’m learning as I go here. I have three wp sites – one is public and two are development sites in separate directories in the public folder. I’m testing the import on one of the development sites.

    I see three different WP databases and in wp_hzue_posts I see posts from the imported forum in my development site.

    On my front end forum page I set up a test forum prior to the import and there I see nothing. I’m guessing I have to change something else.

    On my live WP site I have three forums that I don’t want to change but I’d like to add a fourth with the imported posts. It wouldn’t be the end of the world if I had to start over with the forum on the live site – it’s new and there’s not much there yet.

    Jake Hall
    Participant

    Hey Rob,

    Thanks for that. Why does the Codex not have these details available to the user? I see countless posts on here with people requesting how to do this, and those that help suggest a wide variety of solutions which, in my opinion, aren’t the right way to do it. I guess its the easiest way though, as it avoids the user having to edit 20+ files to remove the breadcrumb, but does that not indicate a design flaw within bbPress itself?

    I’ve essentially fixed that flaw within my installation by removing the breadcrumb in all templates, and adding it to the bbPress.php file. One place to edit, one place to remove – instead of twenty!

    If I ever get the time, I would be more than willing to write up what each template file does within the codex.

    #160797

    In reply to: SMF Import to bbPress

    curvemeister
    Participant

    Hi again,

    Here is an improved version of the SMF to bbPress script. This version supports additional, non-image filetypes, and has more safeguards against inserting attachments multiple times if the script is interrupted and restarted. Since I am not yet savvy in the ways of submitting source code to the forum, I am cutting and pasting, which seems to butcher the syntax horribly…

    Many thanks, again, to Stephen.

    ================================================================
    <?php
    //Standalone script to import smf attachments for the GD bbPress Attachments plugin
    //Mike Russell, April 4, 2015
    //Execute after you have imported smf into bbPress.
    //Run this from the command line, not the web (it will timeout)

    require( ‘wp-load.php’ );
    require( ‘wp-admin/includes/image.php’ );
    global $wpdb;

    $verbose = false;
    $force_attachment_update = false; //normally false. set true to re-write existing attachments
    //$limit = ” LIMIT 0,1″;
    $limit = ” LIMIT 0,99999″;

    // source database connection
    $host=”localhost”;
    $uname=”xxx”;
    $pass=”xxx”;
    $database = “xxx”;
    $site_url = ‘http://www.xxx.com/forum&#8217;;
    $forum_path = ‘forum/attachments/’;

    echo “start smf_attachments-to-bbpress v1.2\n”; flush();

    //get the attachment rows from SMF
    $smf_db = new wpdb($uname, $pass, $database, $host);
    $smf_rows = $smf_db->get_results(”
    SELECT * FROM smf_attachments
    WHERE file_hash != ”
    AND filename NOT LIKE ‘%thumb’
    ORDER BY id_attach”
    .$limit);

    echo “processing “.$smf_db->num_rows.” rows total\n”;

    // process each row
    $count = 0;
    foreach ($smf_rows as $smf_attachment_row) {
    if($verbose) { echo ‘next row, id_attach = ‘.$smf_attachment_row->id_attach.”\n”; flush(); }

    //look for both a new and old style filename to copy. If neither exists, skip this attachment
    $smf_filename = $forum_path.$smf_attachment_row->id_attach.’_’.$smf_attachment_row->file_hash;
    if(!file_exists($smf_filename))
    $smf_filename = $forum_path.$smf_attachment_row->id_attach.’_’.$smf_attachment_row->filename.$smf_attachment_row->file_hash;

    if(!file_exists($smf_filename))
    {
    echo “no file, skipping attachment for SMF attachment “.$smf_attachment_row->id_attach.”, missing SMF file: “.$smf_filename.”\n”; flush();
    continue;
    }

    $uploads = wp_upload_dir(‘SMF’);
    $new_upload_dir = $uploads[‘path’];
    $new_full_filename = $new_upload_dir.’/’.$smf_attachment_row->filename;
    if($verbose) { echo(‘old->new = ‘.$smf_filename.’ -> ‘.$new_full_filename.”\n”); flush(); }

    //copy the enclosed file from SMF to the upload dir if necessary
    if(!file_exists($new_full_filename) && !copy($smf_filename, $new_full_filename) ) {
    echo “cannot copy: “.$smf_filename.”->”.$new_full_filename.”\n”;
    } else {
    //look for a reference to the bbPress-imported parent post for the current attachment
    $parent_args = array(
    ‘post_type’ => array(‘topic’, ‘reply’),
    ‘meta_key’ => ‘_bbp_post_id’,
    ‘meta_value’ => $smf_attachment_row->id_msg
    );
    //echo “$parent_args = “.print_r($parent_args).”\n”;

    $parent_query = new WP_Query($parent_args);
    $parent_query->get_posts();
    if($verbose || $parent_query->post_count > 1) {
    echo $parent_query->post_count.” posts found for smf_post id “.$smf_attachment_row->id_msg.”\n”; flush();
    }

    //add the attachment if there is exactly one parent referencing it
    if($parent_query->have_posts() && $parent_query->post_count == 1) {
    $guid = $uploads[‘url’] . ‘/’ . basename( $new_full_filename );
    $parent_query->the_post();
    $post_id = get_the_ID();

    //if force option is not specified, skip updating an already existing attachment
    if(!$force_attachment_update) {
    $q = $wpdb->prepare(

    SELECT COUNT(*)
    FROM $wpdb->posts
    WHERE guid = %s AND post_parent = %d
    “,
    $guid,
    $post_id);

    $nrefs = $wpdb->get_var($q);
    if($nrefs > 0) {
    if($verbose) { echo “skip existing attachment: “.$guid.”\n”; flush(); }
    wp_reset_postdata(); //reset post info
    goto done;
    }
    }

    $attachment_data = array(
    ‘guid’ => $guid,
    ‘post_mime_type’ => ‘image/’.$smf_attachment_row->fileext,
    ‘post_title’ => $smf_attachment_row->filename,
    ‘post_status’ => null,
    ‘post_content’ => ”,
    );
    if($verbose) { echo “attachment_data = “.print_r($attachment_data).”\n”; flush(); }

    $attach_id = wp_insert_attachment($attachment_data, $new_full_filename, $post_id);

    //echo “attach_id = “.$attach_id.”\n”; flush();
    if($attach_id) {
    //update_post_meta($attach_id, ‘_bbp_attachment’, 1);
    if($attach_metadata = wp_generate_attachment_metadata($attach_id, $new_full_filename)) {
    //echo ‘attach_metadata = ‘.print_r($attach_metadata).”\n”; flush();
    wp_update_attachment_metadata( $attach_id, $attach_metadata );
    set_post_thumbnail( $post_id, $attach_id );
    } else {
    echo ‘wp_generate_attachment_metadata failed, fname = ‘.$new_full_filename.”\n”; flush();
    }
    }
    wp_reset_postdata();
    }
    }
    done:
    $count++;
    if($count%100 == 0)
    {
    echo $count.” attachments processed\r”;
    flush();
    }
    }
    echo “Done, processed “.$count.” records\n\n”;

    //clean up message body text
    //convert <tt> -> <br />
    mysql_query(“UPDATE wp_posts SET post_content = REPLACE (post_content, \'<tt>\’, \'<br />\’) WHERE post_content LIKE \’%<tt>%\'”);

    mysql_close($connection);
    exit;
    ?>

    #160786
    Robkk
    Moderator

    I did open Filezilla and I searched for “cache” — I found a cache.php file, but I didn’t even attempt to go mucking about in there!

    yep , dont edit files or delete any files you might cause another issue with your site.

    I’m a little glad to hear that you’ve possibly had a similar problem; maybe I can ask some other people on the site to try out different browsers and see if I need to go clean out my CPU cache.

    something like it , im sure its common too , like i said i dont remember 100%

    If you have a chance to add more classes to the CSS code, I would be extremely grateful. I really appreciate the time and effort you’ve spent on my issues.

    i tested with your theme and this seemed to work.

    .bbpress span#favorite-toggle a,
    .bbpress span#subscription-toggle a {
    	color: #000;
    }
    
    .bbpress span#favorite-toggle a:hover,
    .bbpress span#subscription-toggle a:hover {
    	color: #707070;
    }
    #160784
    DanaJoy2008
    Participant

    I could certainly contact the host and see if it’s something they did. I’m 100% positive I don’t have Wordfence, and I don’t *think* I have anything like it, but I will go double-check. I did open Filezilla and I searched for “cache” — I found a cache.php file, but I didn’t even attempt to go mucking about in there!

    I’m a little glad to hear that you’ve possibly had a similar problem; maybe I can ask some other people on the site to try out different browsers and see if I need to go clean out my CPU cache.

    If you have a chance to add more classes to the CSS code, I would be extremely grateful. I really appreciate the time and effort you’ve spent on my issues.

Viewing 25 results - 8,976 through 9,000 (of 32,505 total)
Skip to toolbar