Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 9,601 through 9,625 (of 32,519 total)
  • Author
    Search Results
  • #157653

    Topic: PLEASE HELP!

    in forum Troubleshooting
    Seo45
    Participant

    Okay, I’m officially freaking out now. After hearing about it quite a bit, I finally learned how to create a child theme. I did so, and I began adding css related to bbpress with “!important” to change things. After changing a few things, I realized the text color wasn’t going to work, so I went into my theme options, and there is a way to change colors without having to go into code. Luckily, there is a default button, so I can just press that to go back to default. Basically, I changed each one and then refreshed the forum to see if that was it. I finally found it, but I didn’t like what it did to the rest of the site, so I went back to default. Now nothing is changing on the forum, even though everything else is going back to normal in the theme.

    So I then started deleting the changes I made in my child theme .css, and it isn’t changing anything. I even went as far as to go back to my parent theme. This made the forum disappear, so I deactivated it and re-activated it. Well, now it is right back to the one after it was changed. How could it still be changed? I tried deleting it and re installing it, but it still won’t change. How could this have happened?

    Sorry for panicking, but I simply don’t understand how this happened. Thank you for any answers.

    #157652
    cjchamberland
    Participant

    I’m working on a site that HAS to have a “custom” button on TinyMCE to insert a custom string for users through the visual editor on BBPress. It works fine through the wp-admin, but it has to work on the actual forum pages. I located where the failure happens – does anyone know how or what I need to replace this with in order for it to work with BBpress? Or any other hacks I can try?? (It’s basically selecting all the text, then I do a search for a specific item and add their custom string to that item):

    var content = tinyMCE.get(‘content’).getContent();

    Looking at the code, I though maybe it should be:

    var content = tinyMCE.get(‘bb_topic_content’).getContent();

    but that didn’t work either….

    #157637
    Robin W
    Moderator

    ok the title comes form your theme, so I can’t help precisely with what to do but you should look in the page.php file or similar and find

    <h1 class=”entry-title”><?php the_title(); ?></h1>

    or something similar.

    Come back with the lines and a few before and after and I’ll try and help further, but many themes are very complicated!

    on the second issue, put the following in your functions file

    Function hide_topic_display ($retstr){
    	$retstr = '' ;
    	return $retstr ;
    }
    	
    add_filter( 'bbp_get_forum_pagination_count', 'hide_topic_display' );
    

    Functions files and child themes – explained !

    #157632
    Maidul
    Participant

    I write a short code for that

    http://dynamicweblab.com/2015/02/bbpress-topic-info-short-code/

    Hope this will help somebody

    #157630
    Nicolas Korobochkin
    Participant

    I’m also stopped recive the notifications by email after update… to 2.5.4 (not sure about version). This happens because new bbPress send one email to all subscribed people. I publish the solutions for another issue few weeks ago https://bbpress.org/forums/topic/hook-to-bbpress-notifications/#post-156426 but it also the solution for your issue.

    In few words about my code:

    1. Disable default bbPress notifications (one email per all users).
    2. Add similar notifications but it sends one email per user and WordPress send it by using cron (not immediately).

    P. S. I’m also using WP SMTP plugin to send email throw external SMTP server.

    #157627
    peter-hamilton
    Participant

    I agree, plugins tend to break WordPress every now and then, but I did hardcode certain plugins directly into my child theme, these can not update unless I update them myself.

    In my first 12 months of WordPress studies/experiments there were a lot ofplugins binned due to conflicts or outright fails.

    #157626

    In reply to: bbPress on Github

    Nicolas Korobochkin
    Participant

    Thank you 🙂 I’m just trying to use this repository like bower_component. I can’t find SVN URL endpoint to using it in bower. Few examples from Bower API (bower. io/docs/api/#install):

    svn+ssh://package. googlecode. com/svn/
    svn+https://package. googlecode. com/svn/
    svn+http://package. googlecode. com/svn/

    I try use svn+h t t p s : / / bbpress. svn. wordpress. org/ but it doesn’t work.

    P. S. I use a lot of spaces because bbpress. org doesn’t allow publish replies with external links.

    #157624
    Ryan
    Participant

    It looks like there are possibly 2 issues being reported here.

    One issue reported by the OP is that emails are not working properly. Another being that people aren’t being notified due to the subscribe checkboxes not actually being checked by default causing people to become unsubscribed when they post replies to topics they were previously subscribed to.

    The first issue with emails sounds like it could be conflicts with themes or plugins. However if it is actually an email issue it could also be that the emails from the server aren’t being properly sent or received which could be for a number of reasons such as bad DNS records or improper mail server configuration.

    The second issue is that when posting topics or replies the subscription checkboxes are not checked by default. This is described above by Killerrabbit2 here in this post: https://bbpress.org/forums/topic/email-notifications-not-working-looking-for-help/#post-153189

    I think if bbpress added an option to set the default state of the checkboxes to allow the subscription checkboxes to be checked or unchecked with the default being checked would be part of the solution for the second issue.

    You can set the default setting to be checked by editing the bbpress template files /wp-content/plugins/bbpress/templates/default/bbpress/form-topic.php and /wp-content/plugins/bbpress/templates/default/bbpress/form-reply.php and finding the subscription input checkboxes and adding checked to them seems to fix part of it.

    <input name="bbp_topic_subscription" id="bbp_topic_subscription" type="checkbox" value="bbp_subscribe" checked tabindex="<?php bbp_tab_index(); ?>" />

    Another issue seems to be that it doesn’t subscribe to topics within a forum when subscribing to an entire forum. So for example if you subscribe to a forum and a topic isn’t checked within that forum (which is how bbpress is currently set by default since it doesn’t subscribe to things by default) then it won’t notify you of new replies. Kind of defeats the purpose of subscribing to an entire forum I think. So if you subscribe or unsubscribe to an entire forum it should subscribe or unsubscribe all posts within that forum at that time. I haven’t tried adding code to fix this yet.

    I suspect some bbpress templates could actually do this stuff for the second issue properly. Not sure if people even release new ones ever or not. It’s also possible that some themes could potentially already have their own bbpress templates which potentially could be broken or outdated causing issues.

    #157604
    theatereleven
    Participant

    Okay, I found these three bad boys:

    
    <?php bbp_topic_tag_list(); ?>
    <?php bbp_topic_subscription_link(); ?>
    <?php bbp_user_favorites_link(); ?>
    

    Now I’m just on the hunt for the others. Any hints appreciated!

    #157572
    Stagger Lee
    Participant

    This seems to work, just tested. Adjust after need.
    Limit user upload by KB size:

    add_filter('wp_handle_upload_prefilter', 'f711_image_size_prevent');
    function f711_image_size_prevent($file) {
    
        // get filesize of upload
        $size = $file['size'];
        $size = $size / 1024; // Calculate down to KB
    
        // get imagetype of upload
        $type = $file['type'];
        $is_image = strpos($type, 'image');
    
        // set sizelimit
        $limit = 700; // Your Filesize in KB
    
        // set imagelimit
        $imagelimit = 7;
    
        // set allowed imagetype
        $imagetype = 'image/jpeg';
    
        // query how many images the current user already uploaded
        global $current_user;
        $args = array(
            'orderby'         => 'post_date',
            'order'           => 'DESC',
            'numberposts'     => -1,
            'post_type'       => 'attachment',
            'author'          => $current_user->ID,
        );
        $attachmentsbyuser = get_posts( $args );
    
        if ( ( $size > $limit ) && ($is_image !== false) ) { // check if the image is small enough
            $file['error'] = 'Image files must be smaller than '.$limit.'KB';
        } elseif ( $type != $imagetype ) { // check if image type is allowed
            $file['error'] = 'Image must be ' . $imagetype . '.';
        } elseif ( count( $attachmentsbyuser ) >= $imagelimit ) { // check if the user has exceeded the image limit
            $file['error'] = 'Image limit of ' . $imagelimit . ' is exceeded for this user.';
        }
        return $file;
    
    }
    #157571
    Stagger Lee
    Participant

    Set a maximum upload count for users on a specific user role

    add_filter( 'wp_handle_upload_prefilter', 'limit_uploads_for_user_roles' );
     
    function limit_uploads_for_user_roles( $file ) {
      $user = wp_get_current_user();
      // add the role you want to limit in the array
      $limit_roles = array('contributor');
      $filtered = apply_filters( 'limit_uploads_for_roles', $limit_roles, $user );
      if ( array_intersect( $limit_roles, $user->roles ) ) {
        $upload_count = get_user_meta( $user->ID, 'upload_count', true ) ? : 0;
        $limit = apply_filters( 'limit_uploads_for_user_roles_limit', 10, $user,$upload_count, $file );
        if ( ( $upload_count + 1 ) > $limit ) {
          $file['error'] = __('Upload limit has been reached for this account!','yourtxtdomain');
        } else {
          update_user_meta( $user->ID, 'upload_count', $upload_count + 1 );
        }
      }
      return $file;
    }

    This action will fire when user delete attachment

    add_action('delete_attachment', 'decrease_limit_uploads_for_user');
    function decrease_limit_uploads_for_user( $id ) {
       $user = wp_get_current_user();
       // add the role you want to limit in the array
       $limit_roles = array('contributor');
       $filtered = apply_filters( 'limit_uploads_for_roles', $limit_roles, $user );
       if ( array_intersect( $limit_roles, $user->roles ) ) {
         $post = get_post( $id);
         if ( $post->post_author != $user->ID ) return;
         $count = get_user_meta( $user->ID, 'upload_count', true ) ? : 0;
         if ( $count ) update_user_meta( $user->ID, 'upload_count', $count - 1 );
       }
    }
    #157569
    Stagger Lee
    Participant

    I just write this on trac. Needs to be restricted for users to see other attachments, they did not uploaded.

    function filter_my_attachments( $wp_query ) {
        if (is_admin() && ($wp_query->query_vars['post_type'] == 'attachment')) {
            if ( !current_user_can( 'activate_plugins' ) ) {
                global $current_user;
                $wp_query->set( 'author', $current_user->id );
            }
        }
    }
    add_filter('parse_query', 'filter_my_attachments' );
    
    add_filter( 'bbp_after_get_the_content_parse_args', 'tp_bbpress_upload_media' );
     
    function tp_bbpress_upload_media( $args ) {
    $args['media_buttons'] = true;
     
    return $args;
    }
    #157563
    Robin W
    Moderator

    ok, sorry for delay – putting in ‘bumps’ tends to not get you help as many of us work on ‘topics with no replies’ and you have replies 🙂

    Put the following in your functions file

    function rew_role_show () {
    $displayed_user = bbp_get_reply_author_id() ;
    $role = bbp_get_user_role( $displayed_user);
    if ( bbp_is_user_keymaster($displayed_user) ||$role == 'bbp_moderator')  {
    echo '<li>' ; 
    echo 'I im in supporting group';
    echo '</li>' ;
    }
    }
    
    add_action ('bbp_theme_after_reply_author_details', 'rew_role_show') ;
    	
    

    Functions files and child themes – explained !

    #157562
    Robin W
    Moderator

    just tested and

    add_filter( 'bbp_get_author_link', 'remove_author_links', 10, 2);
    add_filter( 'bbp_get_reply_author_link', 'remove_author_links', 10, 2);
    add_filter( 'bbp_get_topic_author_link', 'remove_author_links', 10, 2);
    function remove_author_links($author_link, $args) {
    	$author_link = preg_replace(array('{<a[^>]*>}','{}'), array(" "), $author_link);
    	return $author_link;
     }
     
    
    add_filter ('bbp_before_get_author_link_parse_args' , 'rew_remove_avatar' ) ;
    add_filter ('bbp_before_get_reply_author_link_parse_args' , 'rew_remove_avatar' ) ;
    add_filter ('bbp_before_get_topic_author_link_parse_args' , 'rew_remove_avatar' ) ;
    function rew_remove_avatar ($args) {
    	$args['type'] = 'name' ;
    	return $args ;
    }
    
    

    seems to do what is required

    #157559
    melanie bund
    Participant

    Hi ok am reactivating source code – i managed to hide the url, but i dont actually want to do that i want to make it so it doesnt link otherwise you have “started by “. Another idea can i link it to their profile page which is not part of bbpress “http://photohunters.org/photohunters/my-profile/&#8221;

    site page
    http://photohunters.org/photohunters/forum/2nd-hand-market/

    i really do appreciate your help – am just trying to strip the forum down to the bare minimum
    thank you
    Melanie

    #157535
    Robin W
    Moderator

    Can you give us a screen shot of IE and one of safari – just saves me loading this code (so I can help others as well as you) , so I can quickly see the difference

    #157534
    Robin W
    Moderator

    sorry this support forum is manned by volunteers so we do this in our spare time and for free.

    I presume you got this code from

    http://www.digitspeak.com/blogging/wordpress/remove-bbpress-forum-profile-url-link/

    when you say

    the avatar reappears which i managed to get rid of – is there another workaround?

    can you explain a bit more about

    i managed to get rid of

    what did you do?

    #157532
    melanie bund
    Participant

    Hi am posting this again as have had no response
    Hi Have tried to remove the link from username with below code but when i use it, the avatar reappears which i managed to get rid of – is there another workaround?

    add_filter(‘bbp_before_get_breadcrumb_parse_args’, ‘mycustom_breadcrumb_options’);
    add_filter( ‘bbp_get_author_link’, ‘remove_author_links’, 10, 2);
    add_filter( ‘bbp_get_reply_author_link’, ‘remove_author_links’, 10, 2);
    add_filter( ‘bbp_get_topic_author_link’, ‘remove_author_links’, 10, 2);
    function remove_author_links($author_link, $args) {
    $author_link = preg_replace(array(‘{<a[^>]*>}’,'{}’), array(” “), $author_link);
    return $author_link;
    }

    thanks in advance
    Melanie

    #157527
    raytronx
    Participant

    It looks like my issue with the BCCs is being caused by the wpMandrill plugin I use to send emails through the Mandrill service

    The Mandrill API previously couldn’t deal with BCC emails, it has been updated but it’s WP plugin hasn’t.
    I tried this code offered by a user but it ended up sending two emails. One with no BCCs showing and one with the same BCCs showing problem. https://wordpress.org/support/topic/how-to-contribute-fixed-bcc

    #157519
    sajjad
    Participant

    Any reply yet!!!
    I have request to help me to correct this code. I am not expert in php.
    Thank you to all …

    #157501
    laddi
    Participant

    @Robin, 😯 Woooooooow, Amazing, Man its working, :mrgreen:
    Thanks a Billion Trillion Robin, My dear…
    Oh I am so happy to see its gone… 😀 😀

    Hey, Robin, check it out man, we just got it. You are super. If we could meet, I must arrange a Beer Party.

    Oh this is the lovely piece of art: 💡

    remove_filter( 'bbp_get_reply_content', 'bbp_make_clickable', 4);
    remove_filter( 'bbp_get_topic_content', 'bbp_make_clickable', 4); 

    So everybody just use this above code to stay better in Google, and Don’t Forget to Thanks dear Robin W. All Credit Goes to Him. Hats Off!

    Please make this topic Resolved.

    #157495
    netposer
    Participant

    The main forum page (created during the install process using Method 1 or Method 2 shows no forum info.

    If I create a new topic (admin) and go directly there I can see the post, reply and see other forums

    I created a forum called “t-forums” and added “For Sale” and “General” under that. Everything works just great except the parent (Forums).
    Home › Forums › t-forums › For Sale

    So the parent (Forums) seems broke and doesn’t show the forum items on it’s page.

    I’ve removed the plugin and added it back with the same results.

    #157490
    YardenSade
    Participant

    Hello guys,
    I tried to search for this topic for some time, and I found a lot of answers but non of them was on the point for my simple yet maybe difficult task.
    My client needs the forum to be visible only for users/some users.
    Basically only the users should be able to see the forums while others won’t even know it exist.

    Can someone please help me with on the point solution, and if non exist I would have to use some bypass, maybe even make my own php code – which I rather avoid.

    Thanks for reading and helping!
    Techical: using 4.1 WP and latest bbpress.

    #157489
    Robin W
    Moderator

    if you get the remove filter working in the other post you could have it ‘removed’ as default and then add a conditional filter

    e.g. if users has posted xx topics then {
    add_filter( ‘bbp_get_reply_content’, ‘bbp_make_clickable’, 10 );
    add_filter( ‘bbp_get_topic_content’, ‘bbp_make_clickable’, 10 );
    }

    but you’d need to code that yourself as I’m time strapped at the moment

    #157488
    Robin W
    Moderator

    ok, you got me interested enough to look it up.

    bbPress now uses its own version of make_clickable, so the two filters are :

    add_filter( 'bbp_get_reply_content', 'bbp_make_clickable', 4    );
    add_filter( 'bbp_get_topic_content', 'bbp_make_clickable', 4    );
    

    so you need

    remove_filter( 'bbp_get_reply_content', 'bbp_make_clickable', 4);
    remove_filter( 'bbp_get_topic_content', 'bbp_make_clickable', 4);
Viewing 25 results - 9,601 through 9,625 (of 32,519 total)
Skip to toolbar