Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 6,251 through 6,275 (of 32,519 total)
  • Author
    Search Results
  • #175902
    Robin W
    Moderator

    This should do what you want

    //add profile link to forums
    add_action ( 'bbp_template_before_single_forum', 'rew_profile_link' ) ;
    add_action ( 'bbp_template_before_forums_index', 'rew_profile_link' ) ;
    
    function rew_profile_link () {
    	if (!is_user_logged_in())
    		return ;
    	$current_user = wp_get_current_user();
    		$user=$current_user->user_nicename  ;
    		$user_slug =  get_option( '_bbp_user_slug' ) ;
    			if (get_option( '_bbp_include_root' ) == true  ) {	
    			$forum_slug = get_option( '_bbp_root_slug' ) ;
    			$slug = $forum_slug.'/'.$user_slug.'/' ;
    			}
    			else {
    			$slug=$user_slug . '/' ;
    			}
    			$edit_profile = __('Edit Profile', 'bbp-style-pack') ;
    			//get url
    			$url = get_site_url(); 
    			$profilelink = '<a href="'. $url .'/' .$slug. $user . '/edit">'.$edit_profile.'</a>';
    			echo '<div style="text-align: center;">'.$profilelink ;
    }

    add it to your functions file

    https://codex.bbpress.org/functions-files-and-child-themes-explained/

    #175899
    Robin W
    Moderator

    not tested but this code should allow editing at all times. Add it to your functions file

    add filter ('bbp_past_edit_lock' , 'rew_allow_editing' )
    
    function rew_allow_editing () {
    	$retval = false ;
    	Return $retval ;
    }

    on other posts, I’d wonder if the bbp_reply_id(); might be returning a null or the wrong id.

    As a test the easiest way would be to replace your Edit </a> with

    <?php echo esc_url( home_url( '/' ) ).'conversations/reply/'.bbp_reply_id().'/edit/' ?></a>
    

    That way you’ll see where it is going to send you and can find out what the problem is

    #175894
    EliFerreira
    Participant

    Thanks for your help, Robin W. It worked. I just delete the code of lines 60 and 68 and saved the file.

    #175893
    Robin W
    Moderator

    You will need to change a template, so if you can edit a file and know FTP then you can amend this

    create a directory on your theme called ‘bbpress’
    ie wp-content/themes/%your-theme-name%/bbpress

    where %your-theme-name% is the name of your theme

    find
    wp-content/plugins/bbpress/templates/default/bbpress/loop-single-topic.php
    Make a copy of this file, and put in in the directory called bbpress that you created above, so you end up with
    wp-content/themes/%your-theme-name%/bbpress/loop-single-topic.phpbbPress will now use this template instead of the original and you can amend this.

    Now go to line 68, which says

    <span class="bbp-topic-started-in"><?php printf( __( 'in: <a href="%1$s">%2$s</a>', 'bbpress' ), bbp_get_forum_permalink( bbp_get_topic_forum_id() ), bbp_get_forum_title( bbp_get_topic_forum_id() ) ); ?></span>
    

    and delete this and save the file

    shablon
    Participant

    Since there is a time limit to editing post and no way to set it to unlimited (I wonder why, but that’s a question for another day), I’ve set the limit to maximum. There also was an issue, where original “edit” button wouldn’t show up. I did a little research, and turned out that most of the time, it was theme conflict. Changing theme was not an option. So, I’ve just added a custom “edit” link to template. It looks like this
    <a href="<?php echo esc_url( home_url( '/' ) ); ?>conversations/reply/<?php bbp_reply_id(); ?>/edit/" class="editbtn"> Edit</a>

    It works fine with newer posts. But when I tried editing one of older posts, I got following error:
    The mydomain.com page isn’t working
    mydomain.com redirected you too many times.

    Robkk
    Moderator

    I don’t think there is a character limit when you post a reply or topic with more than 300 characters.

    Check to see if it could be some spam plugin with a feature for this, or a custom theme feature by doing the listed plugin and theme troubleshooting.

    https://codex.bbpress.org/getting-started/troubleshooting/

    #175880
    Robkk
    Moderator

    @stevecl

    The issue also does happen in TwentyFifteen.

    The issue is because in the bbPress default theme package, there is a template called content-search.php. In some newer themes there is also a template of the same name. And since the bbPress templates don’t necessarily need to be in a bbPress folder, the bbPress plugin is choosing the template from your theme before the template that is actually in bbPress.

    Copy content-search.php from the bbPress plugin templates and place it in a child theme in a folder called bbpress. This fixed the issue you are getting in a free version of your currently active theme.

    https://codex.bbpress.org/themes/theme-compatibility/

    Also just created a trac ticket for this issue.

    https://bbpress.trac.wordpress.org/ticket/2966

    #175879
    scootsafe
    Participant

    Heyy hi, it is working as it is now when i insert this code in! Thanks!

    #175870
    Robkk
    Moderator

    @scootsafe

    Since you enabled threaded replies, which has an issue with some mobile responsive styles because how they are by default. Try this custom CSS, or disable threaded replies and see if your forums have a better layout, though I am not sure how the mycred badges will react.

    #bbpress-forums div.bbp-reply-author a.bbp-author-name {
      display: block !important;
    }
    #175862

    Topic: What does Robkk do?

    in forum Showcase
    peter-hamilton
    Participant

    besides all the wonderful and appreciated help here on the bbpress forums, what do you do with bbpress?

    I would love to see more websites showcased and since you @robkk are leading the herd now I am in need to see the best bbpress forums online from you, I bet you made a few by now.

    I personally get a lot of inspiration looking at other forums and see how people make the code their own but can not find a descent showcase anywhere.

    Looking forward to be amazed
    Peter

    #175856
    Stephen Edgar
    Keymaster

    @jon-fergus I suggest you do not add edit_others_topics to user roles so they can add inline images, it *WILL* allow them to *edit others topics** for whatever reason users cannot edit other topics as you suggest might be a bug, it might not be and maybe a conflict with your *adminimize hide dashboard* plugin and is obfuscated and easily bypassed.

    #175854

    In reply to: logout page issue

    Robkk
    Moderator

    My bad it is called the (bbPress) login widget.

    I got confused of this custom widget I created that is a fork of the same code.

    #175853
    Robkk
    Moderator

    Something like this might work. In the post views plugin you will need to edit how it displays so it does not show “views” at the end of the number. If you do not want to mess with anymore files, or change the template view, just use the function in this post I created in this kind of similar topic.

    https://bbpress.org/forums/topic/new-feature-viewhit-counts/#post-161937
    loop-topics.php snippet

    <ul class="forum-titles">
    	<li class="bbp-topic-title"><?php _e( 'Topic', 'bbpress' ); ?></li>
    	<li class="bbp-topic-voice-count"><?php _e( 'Voices', 'bbpress' ); ?></li>
    	<li class="bbp-topic-views-count"><?php _e( 'Views', 'bbpress' ); ?></li>
    	<li class="bbp-topic-reply-count"><?php bbp_show_lead_topic() ? _e( 'Replies', 'bbpress' ) : _e( 'Posts', 'bbpress' ); ?></li>
    	<li class="bbp-topic-freshness"><?php _e( 'Freshness', 'bbpress' ); ?></li>
    </ul>

    loop-single-topic.php

    <li class="bbp-topic-voice-count"><?php bbp_topic_voice_count(); ?></li>
    
    <li class="bbp-topic-views-count"><?php if(function_exists('the_views')) { the_views(); } ?></li>
    
    <li class="bbp-topic-reply-count"><?php bbp_show_lead_topic() ? bbp_topic_reply_count() : bbp_topic_post_count(); ?></li>

    CSS

    #bbpress-forums li.bbp-topic-views-count {
      float: left;
      width: 15%;
      text-align: center;
    }
    
    #bbpress-forums li.bbp-topic-title {
      float: left;
      text-align: left;
      width: 43%;
    }

    Also make sure to surround your code with the backticks from the code button in the toolbar.

    These-> '' <-these

    #175851
    peter-hamilton
    Participant

    And I wish this forum did a bit more to sell BBPress, where are the showcases, the paid for professionals and why is this theme still sooooo boring.

    Why not integrate more with Buddypress forums, as I can not believe people only using BBPress on its own, I want a better profile.

    Why not have the option to test plugins on this site with live demos.

    Why not have a clear donation button on your site, or do anything to receive funds to spend time improving the BB line.

    Perhaps charge people 1 euro to download BBPress first time then free for life through account, perhaps the free model gives more awareness but BBPress is good enough to compete with expensive forum software.

    Why not compete with codecanyon and offer premium plugins that work without conflicts.

    Why not hire me as vice president of BBCorp and pay me lots, I accept jellybeans as currency.

    Anyway, as mentioned before loving BBPress.

    P.H.

    #175850
    peter-hamilton
    Participant

    Will look at that plugin, sounds good if it does not create conflicts with my custom theme.

    Had to google Bootstrap

    I am almost ready with mobile version of my theme, actually not too bad to do with minimal css coding.
    Will have a look at that bootstrap thingy, perhaps I can copy and paste my way to integration, give me a few years and it will be done…lol

    I guess Php and Java should become easier over time for most, I get how some hooks work and understand the logic of a certain line of code, but do not know to write a line of Php or Java if my live depended on it, start to panic when databases are mentioned..lol
    More like a blind guy trying to finish a puzzle, keep banging pieces together until they stuck.

    But I must say that peoples reaction give me a warm gooey feeling inside, and should show everyone here that BBPress can be whatever you want it to be, if I can do it so can you…

    P.H.

    #175847
    peter-hamilton
    Participant

    And the WordPress/BBPress combo is actually quite easy to play with, took me a while (2 years almost) to understand the code but now like a puzzle that is relatively easy to manipulate.

    Only big issue I always find is the massive amounts of javascript and css queries, trying soon to combine a bit more.

    #175840

    In reply to: logout page issue

    ajising84
    Participant

    Hi,

    Thanks for your reply, the short code was used for one “logout” plugin and it was later removed due to compatibility issue with my theme.

    Can you please tell me, where I get this “bbPress profile widget ” ?

    Await your reply.

    Regards,
    Ajit

    #175838
    Blaze Miskulin
    Participant

    I’m working with the WP SpamShield team, but I’ll also post the error here just in case it helps.

    
    [19-Jun-2016 05:28:41 UTC] PHP Notice:  bbp_setup_current_user was called <strong>incorrectly</strong>. The current user is being initialized without using $wp->init(). Please see <a href="https://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more information. (This message was added in version 2.3.) in /home/XXX/public_html/wp-includes/functions.php on line 3897
    
    #175836
    Jon Fergus
    Participant

    For those who have added the code from palmdoc’s instructions here, you’ll also likely need to change user role permissions so that they can upload inline images to all topics. Solution is here: https://bbpress.org/forums/topic/cant-upload-media-in-bbpress/#post-175834

    #175831
    Robin W
    Moderator
    #175829
    peter-hamilton
    Participant

    So after updates with BBPress and Buddypress my site is currently broken but will have it up and running soon again with a much improved code.

    jhayghost
    Participant

    Hello,

    I implemented a basic BBPress to our secured site. all members are registered and automatically assign them to participants. But after a week when I visited some topics went to trash, spam and closed. I checked bbpress code and I can not find any cron task and I`m not using Akismet at all.

    I hope you can help me.

    Many Thanks 🙂

    #175812
    quikfixed
    Participant

    Hi there,

    In my list of the topics, there isn’t any pagination link beside each topic even if I’ve set to display only 15 post per page. The pagination within the individual topic is shown but not beside the topics for those with more than 15 post in the main page listing. Any ideas?

    Is this a setting or must I change anything?

    I’m assuming I need to change the content-single-forum.php ?

                             <div class="td-topics-title">
                                    <a href="<?php bbp_topic_permalink(); ?>"><?php bbp_topic_title();?></a>
                                </div>
    #175809
    Robin W
    Moderator

    you can achieve this with forum roles eg

    https://codex.bbpress.org/custom-capabilities/

    if you want it across all forums

    or if you just want one of several to be restricted, then I’ve recently added this to my private groups plugin

    https://wordpress.org/plugins/bbp-private-groups/

    see topic permissions tab

    #175807
    Robkk
    Moderator

    @rda5009

    Or how would I go about adding the reference lookup to obtain the user’s bp group(s), the forum tied to that bp group(s), and then display the recent 5-10 topics?

    If you are really not that good with code, try to hire a developer to create this for you.

    Here is a couple of links that might be helpful though.

    http://hookr.io/plugins/buddypress/#index=g&search=bp_get_group

    http://hookr.io/plugins/buddypress/#index=i&search=bp_is

    https://developer.wordpress.org/reference/functions/is_user_logged_in/

    https://github.com/ntwb/bbPress/blob/master/src/includes/common/widgets.php#L674

Viewing 25 results - 6,251 through 6,275 (of 32,519 total)
Skip to toolbar