Search Results for 'code'
-
AuthorSearch Results
-
February 11, 2014 at 10:44 am #142346
In reply to: White box covering Forum screen
Robin W
Moderatorit’s coming from bbpress stylesheet.
there may be a quicker way to remove this, but one that should work is as follows.
I don’t think you have a childtheme, and now may be the time to consider having one, see https://codex.bbpress.org/step-by-step-guide-to-setting-up-a-bbpress-forum-part-2/ for more details
once done you need to navigate to
wp-content/plugins/bbpress/templates/default/css/bbpress.css
copy this file into a folder called css within your theme, so you end up with
wp-content/themes/mychildtheme/css/bbpress.csswhere mychildtheme is the name of your childtheme
Then edit every line that has
background-color : xxxxxxx
change to
background: none repeat scroll 0 0 rgba(0, 0, 0, 0.4);
NOTE it goes from background-color to background
and it is only the background color that you’ll be changing, not lines which just have color: as that’ll be text!eg
#bbpress-forums div.bbp-forum-header, #bbpress-forums div.bbp-topic-header, #bbpress-forums div.bbp-reply-header { background-color: #f4f4f4; }becomes
#bbpress-forums div.bbp-forum-header, #bbpress-forums div.bbp-topic-header, #bbpress-forums div.bbp-reply-header { background: none repeat scroll 0 0 rgba(0, 0, 0, 0.4); }This will make the background transparent, but with a darker tint shading that you have in your sidebar (the amount of difference is on the 0.4 bit, 0.1 is the lightest, 1.0 the darkest).
Come back if that doesn’t fix it, or for further help
February 11, 2014 at 10:05 am #142345In reply to: widget context – are forum topics same as posts?
Robin W
Moderatorthe answer is probably yes – a forum post is a post
You might do better to install bbPress WP Tweaks Widget Logic plugin which gives you a forum specific sidebar
alternately (or additionally) use widget logic where you can use code like
is_bbpress()or the negative!is_bbpress()to control where widgets are shownFebruary 11, 2014 at 9:42 am #142342In reply to: How do you put the "My Profile" link on the menu?
Robin W
Moderatorok, that all looks fine.
The error as far as I can work out says that it has an unexpected ‘/ ‘ on the evaluated code on line 4 – so for the code in the profile page line 4 is
?>/edit/">However this may not be a line 4 error, but something that is missing or not evaluating correctly on an earlier line.
I’d try the following
Recheck that the code is pasted exactly as it should be, with no missing characters eg ‘;’s from ends of lines etc. The lines posted in my previous post go passed the visible, so did you scroll to the right – just checking the obvious first !
that your domain is spelled correctly etc.
Then I’d try removing the / from the start of line 4 – the edit bit, and the from the end of the edit bit – I don’t think that’s the problem, but try it anyway.
The just form my sanity copy the code from your page back into a post here, and I try it on my site to see if I get the error.
Then we’ll see where we go from there !
`February 11, 2014 at 7:17 am #142338In reply to: WP_Query post type topic help
Stephen Edgar
KeymasterAre you only to show the avatar? (i.e. Not their, role or title etc)
This should work to display only the current topic author user’s avatar without their display name or user role and with an avatar size 60px.
<?php bbp_topic_author_link( array( 'show_role' => false, 'type' => 'avatar', 'size' => 60 ) ); ?>February 11, 2014 at 4:40 am #142331In reply to: How do you put the "My Profile" link on the menu?
aravindbachu
Participant@robin-w , I am sorry for those remarks. I am actually more frustrated with myself for not being able to come up with a solution for that.
I have also seen that you have tried a lot to answer this particular question plaguing this board.
I have already tried Ronthai’s solution, but this is what pops up on my page :
Parse error: syntax error, unexpected ‘/’ in /home/knolzgig/public_html/wp-content/plugins/wp-exec-php/wp-exec-php.php(652) : eval()’d code on line 4I am unable to understand this now. there were / in many places… and I didn’t understand which one was causing the trouble, which unexpectedly shouldn’t have come in the first place.
February 11, 2014 at 4:39 am #142330In reply to: How do you put the "My Profile" link on the menu?
aravindbachu
Participant@robin-w , I am sorry for those remarks. I am actually more frustrated with myself for not being able to come up with a solution for that.
I have also seen that you have tried a lot to answer this particular question plaguing this board.
I have already tried Ronthai’s solution, but this is what pops up on my page :
Parse error: syntax error, unexpected ‘/’ in /home/knolzgig/public_html/wp-content/plugins/wp-exec-php/wp-exec-php.php(652) : eval()’d code on line 4I am unable to understand this now. there were / in many places… and I didn’t understand which one was causing the trouble, which unexpectedly shouldn’t have come in the first place.
February 11, 2014 at 4:15 am #142329koendb
ParticipantYou could just put it in your functions.php file.
If it’s empty put this on the first line:
<?phpGeneral information about adjusting your theme (and functions.php): Making a child theme
February 11, 2014 at 2:55 am #142328In reply to: remove rel=nofollow from bbpress posts
malkah
ParticipantHi
It didnt work. can you look at the code to see if something is not configured correctly?this is how the code looks like after I edited Theme Functions (functions.php) from within the WP dashboard>appearance>editor:
<?php
remove_filter( ‘bbp_get_reply_content’, ‘bbp_rel_nofollow’ );
remove_filter( ‘bbp_get_topic_content’, ‘bbp_rel_nofollow’ );
remove_filter( ‘bbp_get_reply_author_link’, ‘bbp_rel_nofollow’ );
remove_filter( ‘bbp_get_topic_author_link’, ‘bbp_rel_nofollow’ );require_once TEMPLATEPATH . ‘/lib/Themater.php’;
$theme = new Themater(‘HealthPress’);
$theme->options[‘includes’] = array(‘featuredposts’);$theme->options[‘plugins_options’][‘featuredposts’] = array(‘hook’ => ‘main_before’, ‘image_sizes’ => ‘930px. x 300px.’, ‘effect’ => ‘fade’);
if($theme->is_admin_user()) {
$theme->admin_options[‘Ads’][‘content’][‘header_banner’][‘content’][‘value’] = ‘‘;
}
…February 11, 2014 at 1:34 am #142327In reply to: WP_Query post type topic help
hitkid
ParticipantHey Stephen!
Thanks so much for the help! 😀 I should’ve mentioned that I tried those already and they didn’t appear. It works with other bbpress functions, but just not the author avatar as you shared with the codex. I updated the version of bbpress. buddypress and wordpress that I am using to try and see if that worked and still nothing. The avatar shows just fine in the mychildtheme/bbpress/loop-single-topic. It shows up with the topic index shortcode. Any ideas as to what the problem is? I’m pretty confused as to what’s going on!
Thanks again @netweb !
February 10, 2014 at 11:43 pm #142324Majijiboo
ParticipantWhich bbpress file should I add the below filter to to get that feature? Thanks.
function short_freshness_time( $output) { $output = preg_replace( '/, .*[^ago]/', ' ', $output ); return $output; } add_filter( 'bbp_get_time_since', 'short_freshness_time' ); add_filter('bp_core_time_since', 'short_freshness_time');February 10, 2014 at 3:05 pm #142317In reply to: How do you put the "My Profile" link on the menu?
Robin W
Moderatorthe best solution so far courtesy of Ronthai
In Dashboard>plugins>add new
Search for WP exec PHP, install and activateCreate a new page called “profile” or whatever name you want
In content of this page, add this code
<meta http-equiv="refresh" content="0;URL=http://mysite.com/forums/users/<?php global $current_user; get_currentuserinfo(); echo $current_user->user_login . ""; ?>/edit/">Where mysite.com is your site name
If using custom menus, add the page to the menu.
And it works !
February 10, 2014 at 3:03 pm #142316In reply to: Menu link to Profile
Robin W
ModeratorRonthai – have just tried it for profile, and it works well
Summary of what I did
In Dashboard>plugins>add new
Search for WP exec PHP, install and activateCreate a new page called “profile” or whatever name you want
In content of this page, add this code
<meta http-equiv="refresh" content="0;URL=http://mysite.com/forums/users/<?php global $current_user; get_currentuserinfo(); echo $current_user->user_login . ""; ?>/edit/">Where mysite.com is your site name
If using custom menus, add the page to the menu.
And it works !
February 10, 2014 at 12:13 pm #142309In reply to: How do you put the "My Profile" link on the menu?
Robin W
ModeratorI’m sorry that you feel that something for which you paid nothing isn’t for you.
But I don’t think that abusing the people on here who are trying to help you by saying it sucks is really the way forward.
I hope you are able to find some free software that works precisely as you want.
Whilst most people use sidebars and widgets to perform these functions, I shall continue to see if there is an easy way to get this into a menu and add it to the codex if I work it out.
Best wishes
Robin
February 10, 2014 at 11:45 am #142308Topic: Wrong search results for topics in Private forums
in forum TroubleshootingIlya
ParticipantFor participant user search results doesn’t not show topics from private forums.
If I add to default capabilities in
bbp_get_caps_for_role()at /wp-content/plugins/bbpress/includes/core/capabilities.php line 191 the follow line'read_hidden_forums' => true,then it works, but forum has visibility “Private” not “Hidden”.How can I override
bbp_get_caps_for_role()without modifying core files?February 10, 2014 at 10:58 am #142306In reply to: Changing "Forum" on Main Page
Darth
ParticipantSorry for the delayed response Robin.
Yes, I am talking about the “Forum” in the left of your pic.
I made the following change, as suggested:
<li class=”bbp-forum-info”><?php _e( ‘The Darth Side Forums’, ‘bbpress’ ); ?>
But, it didn’t take effect. The change is shown as listed above in the actual code, but When I go to “inspect element” on the page it still shows:
<li class=”bbp-forum-info”>Forum
February 10, 2014 at 9:52 am #142303Ilya
ParticipantI have the similar issue.
How I can add:// Forum caps 'read_hidden_forums' => true,Any idea?
February 10, 2014 at 4:58 am #142294In reply to: remove rel=nofollow from bbpress posts
Gautam Gupta
ParticipantThe next line after
<?phpFebruary 10, 2014 at 1:00 am #142288In reply to: WP_Query post type topic help
Stephen Edgar
KeymasterCheckout the docs here 🙂 https://codex.bbpress.org/bbp_topic_author_link/
February 10, 2014 at 12:21 am #142287In reply to: Edit topic reply, changes post order
Stephen Edgar
Keymaster@kris35 wrote… There are 68 replies to replies and 68 of them are locked this way
This shouldn’t be an issue unless
edit_lockhas incorrect timestamps.@kris35 wrote… I had to go into the backend and edit the “Reply To” box to zero.
We have just done some testing trying to reproduce “Incorrect Reply To’s” but couldn’t.
Setting them to
0will force the replies to be ‘Not Threaded’ and sorted by date (default)@shanebp wrote… …any edit to a reply pushes it to the bottom and destroys the threading. Any threaded replies become ‘flat’.
I can’t reproduce this, any edit I make to a ‘threaded reply’ in the frontend or backend keeps the correct ‘replyto’ value and works as expected.
February 9, 2014 at 8:27 pm #142283jalbaiges
ParticipantHello again.
I have been fighting for a while with the issue and I finally got a solution. I will write it down just in case it could be useful for somebody. Let me say I believe it might exist a smarter solution than mine, so, if you find it, live a comment here, thanks.
Two steps (bbPress 2.5.3):
1) In qtranslate/qtranslate_hooks.php, add the following filters:
add_filter( 'paginate_links', 'qtrans_convertURL' ); add_filter( 'bbp_get_topic_permalink', 'qtrans_convertURL' ); add_filter( 'bbp_get_reply_permalink', 'qtrans_convertURL' ); add_filter( 'bbp_get_forum_permalink', 'qtrans_convertURL' ); add_filter( 'bbp_get_favorites_permalink', 'qtrans_convertURL' ); add_filter( 'bbp_get_subscriptions_permalink', 'qtrans_convertURL' ); add_filter( 'bbp_get_user_profile_url', 'qtrans_convertURL' ); add_filter( 'bbp_get_user_edit_profile_url', 'qtrans_convertURL' ); add_filter( 'bbp_get_user_replies_created_url', 'qtrans_convertURL' ); add_filter( 'bbp_get_user_topics_created_url', 'qtrans_convertURL' );First four are for the standard navigation inside the forums. Last six are for the user profile menu.
2) In bbpress/includes/common/template.php, modify a couple of lines in
bbp_get_breadcrumb()function:In line 2250, replace:
$crumbs[] = '<a href="' . trailingslashit( home_url() ) . '" class="bbp-breadcrumb-home">' . $r['home_text'] . '</a>';with
$crumbs[] = '<a href="' . trailingslashit( qtrans_convertURL(home_url()) ) . '" class="bbp-breadcrumb-home">' . $r['home_text'] . '</a>';And in line 2267, replace:
$crumbs[] = '<a href="' . esc_url( $root_url ) . '" class="bbp-breadcrumb-root">' . $r['root_text'] . '</a>';with
$crumbs[] = '<a href="' . esc_url( qtrans_convertURL($root_url) ) . '" class="bbp-breadcrumb-root">' . $r['root_text'] . '</a>';That’s all! Hope it serves.
February 9, 2014 at 2:39 pm #142279In reply to: How do you put the "My Profile" link on the menu?
Robin W
Moderatoryour last question is easy, .org have customised, just as you are trying to do by adding it as a menu item – we all like it to look slightly differently to others.
I have tried from my little knowledge to get it to work but can’t. The best I can get is
// Filter wp_nav_menu() to add profile link add_filter( 'wp_nav_menu_items', 'my_nav_menu_profile_link' ); function my_nav_menu_profile_link($menu) { if (!is_user_logged_in()) return $menu; else $user = get_userdata( $user_id ); $name = esc_attr( $user_name ); $user_link = '<li><a href="http://www.mysite.com/forums/users/' . $user . '/edit">Amend profile</a></li>'; $menu = $menu . $user_link; return $menu; }But this just returns
http://www.mysite.com/forums/users//edit
Sorry, I have given up.
Can someone else get this working? – it is now annoying me !
February 9, 2014 at 11:48 am #142276In reply to: Menu link to Profile
aravindbachu
Participant@ronthai … your method seems good. can you please me more precise? where do we have to add that code and what should we change for other links?
February 9, 2014 at 6:28 am #142275In reply to: Edit topic reply, changes post order
Kris35
ParticipantMine has been fixed and this is what it was: I had to go into the backend and edit the “Reply To” box to zero. In the right hand column you have Forum, Topic, Reply To. I changed Reply To to zero.
My coder then went into my database and found 34 posts from over 15600 replies that were locked.
This is what he said:
There are 68 replies to replies and 68 of them are locked this way
For now I can’t tell exactly why this happening, but it surely does not happen too often.So generally users can reply to a post or to another reply, but sometimes a reply hangs to itself.
Not sure if this helps anyone?
February 9, 2014 at 4:51 am #142274In reply to: How do you put the "My Profile" link on the menu?
Robin W
ModeratorI am still playing with this, and it doesn’t currently work, but it’s something like adding the following to your functions file
// Filter wp_nav_menu() to add profile link add_filter( 'wp_nav_menu_items', 'my_nav_menu_profile_link' ); function my_nav_menu_profile_link($menu) { if (!is_user_logged_in()) return $menu; else $profilelink = '<li><a href="<?php bbp_user_profile_url( bbp_get_current_user_id() ); edit" >Amend Profile</a></li>'; $menu = $menu . $profilelink; return $menu; }Syntax needs sorting
I’m out most of today, but if you or someone else cracks this, then paste the solution here, and it’ll save me repeating the work.
Solution is based on
https://buddypress.org/support/topic/adding-dynamic-profile-link-to-main-menu-item/
which does the business for buddypress.
February 8, 2014 at 8:58 pm #142270In reply to: Edit topic reply, changes post order
Stephen Edgar
Keymaster@kris35 wroite...I changed them from being forums of a parent forum into being forums with no parent. I made them stand alone forums and those are the ones Im having trouble with.I just tried this.
From:
- Parent Forum -- Child ForumTo:
- Parent Forum - Child ForumEverything still works for me as expected. (i.e. It did not force the bug in this thread) 🙁
-
AuthorSearch Results