Search Results for 'code'
-
AuthorSearch Results
-
Stagger Lee
Participantfunction my_bbp_change_avatar_size($author_avatar, $topic_id, $size) { $author_avatar = ''; if ($size == 14) { $size = 50; } if ($size == 80) { $size = 190; } $topic_id = bbp_get_topic_id( $topic_id ); if ( !empty( $topic_id ) ) { if ( !bbp_is_topic_anonymous( $topic_id ) ) { $author_avatar = get_avatar( bbp_get_topic_author_id( $topic_id ), $size ); } else { $author_avatar = get_avatar( get_post_meta( $topic_id, '_bbp_anonymous_email', true ), $size ); } } return $author_avatar; } /* Add priority (default=10) and number of arguments */ add_filter('bbp_get_topic_author_avatar', 'my_bbp_change_avatar_size', 20, 3); add_filter('bbp_get_reply_author_avatar', 'my_bbp_change_avatar_size', 20, 3); add_filter('bbp_get_current_user_avatar', 'my_bbp_change_avatar_size', 20, 3);/* We increased the tiny avatar size, so adjust the position */ #bbpress-forums p.bbp-topic-meta img.avatar, #bbpress-forums ul.bbp-reply-revision-log img.avatar, #bbpress-forums ul.bbp-topic-revision-log img.avatar, #bbpress-forums div.bbp-template-notice img.avatar, #bbpress-forums .widget_display_topics img.avatar, #bbpress-forums .widget_display_replies img.avatar { margin-bottom: -2px; } /* Increase max-width for the big avatars */ #bbpress-forums div.bbp-forum-author img.avatar, #bbpress-forums div.bbp-topic-author img.avatar, #bbpress-forums div.bbp-reply-author img.avatar { /*margin: 12px auto 0;*/ max-width: 110px; }January 25, 2015 at 2:55 pm #157304In reply to: Few words about bbPress from my perspective
Stagger Lee
ParticipantProblems with other forum scripts are (if we forget about WP integration for a moment) like this, and i have seen it more than often.
People come to forum, relax, discussing, forget about time. But they forget about main portal too. It doesnt exist for them. I have seen many popular and crowded forums and people behind main portal lose money, time, energy to write editorials and news. Nobody is reading this, nobody “knows” about portal when they are on forum. And all try to make other forum scripts look a like something near CMS are madness, better not to go this way.
Here you have old brother WordPress, so popular in the world. You discuss in the forum, suddenly sidebar widget display new article from portal, as it says “did you forget to read news”. Just one example of many of them.
All is here, all exist to make bbPress (or BuddyPress) most popular forum script. To follow steps of WordPress.
Smart core coders, wish exist, older brother WordPress is there to push bbPress in the front of other forum scripts.January 25, 2015 at 2:37 pm #157303In reply to: Few words about bbPress from my perspective
Stagger Lee
ParticipantI am not saying all this because of me. I have now so many (tested) snippets and tweaks i can make bbPress more advanced than phpBB3 forum. I am thankfull to core guys, and I am not complaining.
Integration (affinity better to say) with WP core is so amazing it just blow minds.
I am saying this because of core coders guys. It is pitty lose hours, days, weeks and last nobody or very few people use bbPress.
January 25, 2015 at 2:29 pm #157302In reply to: directly land on forum page no index
Robin W
Moderatorok,
firstly if you just create a page for your forum and use the shortcode
[bbp-single-forum id=$forum_id] – Display a single forums topics. eg. [bbp-single-forum id=32]
then just that forum will be displayed.
to change the breadcrumb display – see
January 25, 2015 at 1:34 pm #157297In reply to: Few words about bbPress from my perspective
Robin W
Moderatorno problem in your post – and followed it right up until
I am talking about plain old CSS2/CSS3. No database queries, and you “sell” your product/code.
I didn’t understand that part – can you explain further !
January 25, 2015 at 12:24 pm #157294In reply to: Separating Forums into Groups
Robin W
ModeratorIs there something that I’m missing?
possibly.
but the rest of the codes don’t work.
This again isn’t really helpful. What do you mean by ‘don’t work’ – nothing shows? something shows but it is not what you want? a picture would be useful.
I cannot help unless I get detailed problems 🙂
January 25, 2015 at 11:30 am #157293In reply to: Separating Forums into Groups
DevilWoIf
ParticipantSorry. I mean, I tried the shortcodes in my page but the forums aren’t separating the way I need them to like in my picture. The codes dont seem to work… I added the stat code that shows how many users and that works but the rest of the codes don’t work.
I put the correct forum ID and everything and they weren’t showing. Is there something that I’m missing?
January 25, 2015 at 8:28 am #157284Topic: Few words about bbPress from my perspective
in forum Requests & FeedbackStagger Lee
ParticipantFirst, for a whole week now I am collecting, testing, verifiyng snippets around the web, most from this forum, and make my own collection. To have it all on one place on localhost. Stop making it, it never ends. 🙂 bbPress is so, so, so manageable and easy to add all functions other forum software have.
Second, you won hearts of coders and developers. What about WP/bbPress beginners ?
As you already lose your time coding make some new theme for this support forum. To make it as demo for bbPress, to make it shine and stick out.There is a reason why WP holds so much of web, and bbPress is not in this league.
Dont get me wrong, I read your topic about complicating things and rised support with new functions/options. I am talking about plain old CSS2/CSS3. No database queries, and you “sell” your product/code.So, thanks and apologies if I offended someone.
January 25, 2015 at 5:14 am #157280In reply to: first post
Matthias
ParticipantI put the whole code in the editor. But I get the same error…
January 25, 2015 at 4:41 am #157277In reply to: Sidebar not Showing
January 25, 2015 at 4:40 am #157276Robin W
ModeratorI know nothing about visual composer, but a quick google produces
http://codecanyon.net/item/bbpress-shortcodes-for-visual-composer/9073637
which suggests that standard shortcodes don’t work?
January 25, 2015 at 4:33 am #157273In reply to: Separating Forums into Groups
Robin W
Moderatormy plugin
has a code
[display-forum-index forum= ‘2932, 2921′ breadcrumb=’no’ search=’no’] Displays the selected forum indexes
which lets you organise the order of forums
January 25, 2015 at 4:15 am #157269In reply to: first post
Matthias
ParticipantI think we are close, but it gives me an error in this line
echo “Replies only viewable for logged in users”;Parse error: syntax error, unexpected ‘only‘ (T_STRING), expecting ‘,’ or ‘;’
Seems like it uses the message as code?January 25, 2015 at 1:15 am #157266Topic: bbpress shortcode in visual composer tab takes over page.
in forum Pluginswebplayer
ParticipantI am creating a page using visual composer and making it have tabs. One of those tabs is forum, and when I embed a bbpress shortcode in that tab and publish the page. bbpress breaks our of visual composer and takes over the whole page. Any idea for why this is happening?
January 25, 2015 at 12:51 am #157265In reply to: bbPress Moderation
cyclesha
ParticipantProbably the same problem, however, I have the code.
January 24, 2015 at 8:52 pm #157257In reply to: solved: disable saving of ip address
Stagger Lee
ParticipantOld topic but if it can help someone. Code is tested and still works, just formatting of code on this forum is wrong.
add_filter('bbp_current_author_ip', 'my_anonymize_ip'); function my_anonymize_ip($retval) { $retval = '0.0.0.0'; return $retval; }January 24, 2015 at 7:21 pm #157254In reply to: My new social forum | please review
peter-hamilton
ParticipantI had no knowledge of PHP when I started a few months ago and made it by cutting and pasting, copying and changing plugin codes, lot of topicsand tutorials read and many sleepless nights.
Deffo a lot of work but I hope it is paying off.
I have a dummy account for people who want to see members only functions like a “like” system and lots of profile functions
username : demo
password : demoNow working on @media queries so it is easier to use on mobiles
January 24, 2015 at 5:47 pm #157251In reply to: My new social forum | please review
Stagger Lee
ParticipantA lot of work ? Looks very nice. I had to check source code to see if you are cheating. 🙂
January 24, 2015 at 5:35 pm #157250In reply to: Modifying Username Colors Based on Role
Stagger Lee
ParticipantThis seem to works. Or seems to work, I never know difference.
add_filter('bbp_before_get_reply_author_role_parse_args', 'ntwb_bbpress_reply_css_role' ); function ntwb_bbpress_reply_css_role() { $role = strtolower( bbp_get_user_display_role( bbp_get_reply_author_id( $reply_id ) ) ); $args['class'] = 'bbp-author-role bbp-author-role-' . $role; $args['before'] = ''; $args['after'] = ''; return $args; } add_filter('bbp_before_get_topic_author_role_parse_args', 'ntwb_bbpress_topic_css_role' ); function ntwb_bbpress_topic_css_role() { $role = strtolower( bbp_get_user_display_role( bbp_get_topic_author_id( $topic_id ) ) ); $args['class'] = 'bbp-author-role bbp-author-role-' . $role; $args['before'] = ''; $args['after'] = ''; return $args; }January 24, 2015 at 5:34 pm #157249In reply to: Showing breadcrumb at bottom of post?
Robin W
Moderatoryou could try something like the following in your function file (not tested)
add_action ('bbp_template_after_replies_loop', 'bbp_breadcrumb' );January 24, 2015 at 3:42 pm #157247In reply to: first post
Matthias
ParticipantHm, it shows this error…
Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'bb_auth_reply_view' not found or invalid function name in ..../blog/wp-includes/plugin.php on line 213January 24, 2015 at 3:20 pm #157245In reply to: first post
Robin W
ModeratorI thought I can do it with a filter in functions.php.
unfortunately not that easy if you don’t want to show the replies, as the loop-replies file has no easy filter to hook to !
yes you can put this in your main theme, just be aware itr will get overwritten by any theme update, so keep a good note of what you did, so you can do it again if needed.
create a directory on your theme called ‘bbpress’
ie wp-content/%your-theme-name%/bbpress
find
wp-content/plugins/bbpress/templates/default/bbpress/loop-replies.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/%your-theme-name%/bbpress/loop-replies.php
bbPress will now use this template instead of the originalso that gets the right file
I wish I had time to write a solution for you for free, but I’m tied up in other work.
but basically you want to look at lines
<?php while ( bbp_replies() ) : bbp_the_reply(); ?> <?php bbp_get_template_part( 'loop', 'single-reply' ); ?>You want to stop it getting the template loop-single-reply if it is after pos 1, so something like
<?php while ( bbp_replies() ) : bbp_the_reply(); ?> <?php // if user is not logged in and is the first reply if( !is_user_logged_in() && $rep_position =2 ) { echo "Replies only viewable for logged in users"; } // if user is not logged in and is after the forst reply, then don't do naything elseif( !is_user_logged_in() && $rep_position >2 ) { } //otherwise carry on as usual else bbp_get_template_part( 'loop', 'single-reply' ); ?>January 24, 2015 at 3:01 pm #157243In reply to: first post
Matthias
ParticipantI thought I can do it with a filter in functions.php.
Don’t want to setup a child theme for this.
Is it possible to do it with just adding a additonal bbpress file to my theme?My php-code knowledge is just search, copy and paste 😉
Thanks
MatthiasJanuary 24, 2015 at 2:54 pm #157242In reply to: first post
Robin W
Moderatorthe filter is just applying to the reply content.
You probably want to amend a template – How php code/wordpress knowledgable are you?
January 24, 2015 at 2:38 pm #157239In reply to: first post
Matthias
ParticipantI found a nice code, that shows the first message in a thread for everyone.
Answer are shown only to logged in users.Perfekt so far.
BUT the code shows in every answer the same message for non logged users
“Replies only viewable for logged in users”Does anyone know, how to change the code, to show only one template-notice
“Replies only viewable for logged in users” instead?function bb_auth_reply_view( $reply_id ) { $reply_id = bbp_get_reply_id( $reply_id ); // Check if password is required if ( post_password_required( $reply_id ) ) return get_the_password_form(); $content = get_post_field( 'post_content', $reply_id ); // first topic reply shouldn't be hiding $rep_position = bbp_get_reply_position($reply_id); // if user is not logged in and not the first post topic if( !is_user_logged_in() && $rep_position > 1 ) { return "Replies only viewable for logged in users"; } else { // return normal return $content; } } add_filter( 'bbp_get_reply_content', 'bb_auth_reply_view' );Thanks
Matthias -
AuthorSearch Results