Search Results for 'code'
-
AuthorSearch Results
-
June 14, 2015 at 10:01 am #163149
In reply to: bbPress and custom fields
PinkishHue
ParticipantI was able to do this by adding this to my functions.php / custom plugin:
// Add custom fields to bbpress topics on front end add_action ( 'bbp_theme_before_topic_form_content', 'bbp_extra_fields'); function bbp_extra_fields() { $value = get_post_meta( bbp_get_topic_id(), 'YOUR-FIELD-NAME', true); echo '<label for="bbp_extra_field">My Extra Field:</label><br>'; echo "<input type='text' name='YOUR-FIELD-NAME' value='".$value."'>"; } //Save and update the values from the front end add_action ( 'bbp_new_topic', 'bbp_save_extra_fields', 10, 1 ); add_action ( 'bbp_edit_topic', 'bbp_save_extra_fields', 10, 1 ); function bbp_save_extra_fields($topic_id=0) { if (isset($_POST) && $_POST['YOUR-FIELD-NAME']!='') update_post_meta( $topic_id, 'YOUR-FIELD-NAME', $_POST['YOUR-FIELD-NAME'] ); }I think that’s correct but am in a bit of a code-haze at the moment! Hopefully it puts you on the right track at least. (And I can’t remember where I got the original code so apologies for not crediting original author)
June 14, 2015 at 9:03 am #163148Topic: Remove avatar and navigation from user pages
in forum Showcaseproject_subdomain
ParticipantHi!
When clicking through bbpress user pages (profile, edit profil, subscriptions etc..) the avatar and the user navigation will be displayed on the left side on all those pages by default.How can I remove avatar’s and user navigation’s div from all pages except the user’s profile home page to get more space?
Tried this in user-details.php, did not work (blank screen):
<?php if ( bbp_is_user_home() ){ ?> <div id="bbp-user-avatar"> [...] </div> <div id="bbp-user-navigation"> </div> }Thanks in advance!
June 13, 2015 at 10:18 am #163140Topic: Change meta/page title for user pages
in forum Troubleshootingproject_subdomain
ParticipantHi!
I ‘d like to change the meta titles (browser’s page title) for bbpress’ profile/user pages as it was not catched by the translation in my language.
So far I tried this which does not work:function amend_title () { elseif ( bbp_is_single_user() ) { if ( bbp_is_user_home() ) { $new_title['text'] = esc_attr_x( 'Translation of Your Profile', 'User viewing his/her own profile', 'bbpress' ); } } else { $new_title['text'] = sprintf( esc_attr_x( "%s's", 'User viewing another users profile', 'bbpress' ), get_userdata( bbp_get_user_id() )->display_name ); } if ( bbp_is_single_user_topics() ) { $new_title['format'] = esc_attr__( "%s Translation of topics", 'bbpress' ); } elseif ( bbp_is_single_user_replies() ) { $new_title['format'] = esc_attr__( "%s Translation of replies", 'bbpress' ); } elseif ( bbp_is_favorites() ) { $new_title['format'] = esc_attr__( "%s Translation of favorites", 'bbpress' ); } elseif ( bbp_is_subscriptions() ) { $new_title['format'] = esc_attr__( "%s Translation of subscriptions", 'bbpress' ); } else { $new_title['format'] = esc_attr__( "%s Translation of profile", 'bbpress' ); } } elseif ( bbp_is_single_user_edit() ) { if ( bbp_is_user_home_edit() ) { $new_title['text'] = esc_attr__( 'Translation of edit profile', 'bbpress' ); } else { $new_title['text'] = get_userdata( bbp_get_user_id() )->display_name; $new_title['format'] = esc_attr__( "Translation of edit %s's profile", 'bbpress' ); } return $new_title; } add_filter('bbp_before_title_parse_args', 'amend_title' );Any help is much appreciated!
Thanks!June 13, 2015 at 2:13 am #163136Doctor Psyringe
ParticipantI’ve provided negativity without solution to my silly issue;
Unchecking “Prefix all forum content with the Forum Root slug (Recommended)” will remove that slug entirely from the forums listing. That will get the average user most of the way.
Users with the issue I have running MultiSite – a feature with documentation – I changed the Forum Root to “forumroot” (instead of “Forums”). I then created a new Page called “Forums” and in the content placed “[bbp-forum-index]” – the forum index shortcode.
Finally, go to Settings/Reading and change “Front page displays” to “A Static Page”. Select the “Forums” Page as the Front Page.
You should now have “www.website.com/forum/forum/etc.” – although I changed my Single Forum Slug to “content”. So I have “www.website.com/forum/content/etc.”. Had I not made any changes it would have been “www.website.com/forum/forums/forum/etc.”. How redundant for trying to be advanced.
In the end – “Forums” and “forumroot” are identical. Again suggesting it’s useless.
*high five*
June 12, 2015 at 5:23 pm #163130In reply to: bbpress forums alignment issue
Robkk
ModeratorNo you were trying to find this code as if it was already in your theme , I just showed you the original code so you could understand why it was causing the issue.
But just place this CSS code where you would put custom CSS like what I already listed.
You do not have to replace any code just add it as custom css
#bbpress-forums .single_post a { font-size: 12px !important; margin-left: 0 !Important; }Since your bbPress forums look custom I can’t tell which is custom and what could be your theme so you would have to edit this code and replace the original code in the bbpress.css file if you want or just place it in some other custom css areas with !important after the width to help out.
You can place the code in the bbpress.css file where you want , it is your site
the two places i said would be better for beginners so that the code doesn’t conflict with the media queries.li.bbp-forum-topic-count, li.bbp-topic-voice-count, li.bbp-forum-reply-count, li.bbp-topic-reply-count { border: 0px none; width: 10% !important; margin-right: 20px !important; margin-top: 0px !important; }June 12, 2015 at 5:01 pm #163129In reply to: bbpress forums alignment issue
stiffmeister12
ParticipantOkay so if I am understanding this correct (sorry im still learning this stuff)
for my themes style.css files you want me to find the code.single_post a {
font-size: 14px ;
margin-left: 0 ;
}
and replace it with#bbpress-forums .single_post a {
font-size: 12px !important;
margin-left: 0 !Important;
}And for this code
li.bbp-forum-topic-count,
li.bbp-topic-voice-count,
li.bbp-forum-reply-count,
li.bbp-topic-reply-count {
border: 0px none;
width: 10% !important;
margin-right: 20px !important;
margin-top: 0px !important;
}
you want me to open up the bbpress.css and add it above the media queries or just at the top above the other css rules?June 12, 2015 at 4:49 pm #163127In reply to: bbpress forums alignment issue
Robkk
ModeratorYour theme had something similar to this CSS
.single_post a { font-size: 14px ; margin-left: 0 ; }So the new CSS I gave you would overwrite it only on bbPress forums.
you can add it
to your child themes style.css
in a custom css plugin
and you could add it to the bbpress.css file if you put it in your child theme in a folder called css somewhere above the media queries or just at the top above the other css rules.
June 12, 2015 at 3:56 pm #163124In reply to: bbpress forums alignment issue
stiffmeister12
ParticipantI just checked my themes style.css and there is nothing with bbpress forums in it right now for some reason there is however css code in my responsive.css for bbpress forums
#bbpress-forums .status-category li.bbp-in-forum-freshness {
margin-left: 1px;
width: 33.494% !important;#bbpress-forums .bbp-topics li.bbp-body ul.topic {
border-bottom: medium none !important;
border-left: 0 none !important;
border-top: 2px solid #aaa !important;
box-shadow: 1px 1px 0.5px 0 rgb(221, 221, 221);June 12, 2015 at 3:44 pm #163123In reply to: bbpress forums alignment issue
stiffmeister12
Participantthank you for the reply now where would this code go in the bbpress style.css? can it go directly at the end? Or am i editing the code? same goes for the themes style.css. thanks
June 12, 2015 at 3:28 pm #163118Robkk
ModeratorAlso, small second question. It happens often that I’m on a site that I *think* I’ve registered on, but haven’t. If someone enters a login that is not correct AND that username doesn’t currently exist, is there a way to redirect to the registration page WITH that username?
So, for example, I type in username: MyFaveUser pw: 1234, and it doesn’t exist in my user table, so the user is redirected to “Hey, MyFaveUser doesn’t exist, but you can register with it! It’s available!” and then autofill the username field with MyFaveUser and leave the pw field blank?
This is some custom development , I suggest you hire a developer if you need help.
As for the login shortcode issue , it might be best for you to link to the default WordPress login page if you are experiencing issue with it. Or just use a better front-end authentication plugin.
June 12, 2015 at 3:03 pm #163112In reply to: bbpress forums alignment issue
Robkk
ModeratorThis seems very custom , looks pretty good though
The bbPress forum header labels have certain widths to them. So this is the CSS you might want to adjust.
li.bbp-forum-topic-count, li.bbp-topic-voice-count, li.bbp-forum-reply-count, li.bbp-topic-reply-count { border: 0px none; width: 10% !important; margin-right: 20px !important; margin-top: 0px !important; }It might look shifted because you are trying to make your forums look more table like.
The username being shifted is because of some CSS from your theme being added into bbPress.
This custom css might help.
#bbpress-forums .single_post a { font-size: 12px !important; margin-left: 0 !Important; }June 12, 2015 at 1:30 pm #163110Topic: bbpress forums alignment issue
in forum Troubleshootingstiffmeister12
ParticipantSo I am using a custom theme for my site and when I integrated bbpress into my theme the alignment is just off for some reason. On the home page the top bar is a little miss aligned where it says “topics” and “posts” Link – http://dailymut.com/dailymut-forums/
When I go into a topic the alignment is really off under “topic” and a part of background is missing under “voices” “posts” and “freshness”. And There is a random circle over the “voices” text for some reason. Link – http://dailymut.com/forums/forum/madden/mut-player-reviews/
Finally when I go into the Topic The picture is not aligned with the username and the text box looks off as well.
I have tried to change the style.css and I have tried to change the bbpress CSS and nothing has worked maybe im imputing the wrong code or maybe im not in putting it correctly. Either way if anyone can check it out and see what the problem is and could tell me what code to input and where specifically to put it that would be greatly appreciated.
June 12, 2015 at 1:16 pm #163109In reply to: exclude forum from shortcode?
Robkk
ModeratorI don’t think that you can exclude forums with the shortcode.
You could allow your group forums to have a parent forum so that they do not all show up on the forum arhive.
- go setting > forums
- scroll all the way down to BuddyPress Integration
- Now select the group forums to have a parent forum from the drop down list.
June 11, 2015 at 5:40 pm #163094In reply to: Sidebar as you seen on bbPress.org
Luis Fatorbinario
ParticipantCan someone please post the link here. I only opted by bbPress over other options because I saw this nice sidebar in this forum.
And if you guys implement the code as a plugin or something bbPress would have many more installs.
June 11, 2015 at 3:19 pm #163088In reply to: userpro bbpress avatar display
Robkk
ModeratorI think what you are looking for is in the
loop-single-topic.phptemplate and the other one is maybeloop-single-forum.php.June 11, 2015 at 7:50 am #163081Topic: exclude forum from shortcode?
in forum Installationchristianslater
ParticipantHello I am using bbpress in conjunction with buddypress. I also activated the function to allow forum creation with creation of a buddypress group.
Additionally I want to have forum page. When I place the shortcode on a page all forums are displayed also the ones that are created with buddypress group. Is it possible to exclude these forums form the page?
June 11, 2015 at 5:26 am #163079Stephen Edgar
KeymasterAnother potential idea would be to modify the code to “limit” the repair tool amount of replies it’s trying to do each time.
I’m not sure how many forums your site has, but maybe restricting that by forum ID may drop you down from 3 million to something more reasonable to process in under 30 seconds?
June 11, 2015 at 5:24 am #163078Stephen Edgar
KeymasterThe reply position is stored in
wp_postsinmenu_order, the first reply of a topic should be0, then each reply after that increments by1, that is what the end goal should be.June 11, 2015 at 5:16 am #163074Stephen Edgar
KeymasterYou could also try running that same query you did above where it returned
3,763,193total replies, then run the repair reply menu order repair tool and run the query again then subtract that new total from the original3,763,193to see how many replies are getting there menu order updated before PHP times out, then divide3,763,193by that number and you’d have a theoretical value of how many times you would need to run that tool before all replies are actually repaired 😉June 11, 2015 at 5:13 am #163073Stephen Edgar
KeymasterTwo functions
bbp_update_reply_position()andbbp_get_reply_position_raw()are what you need to look at:
https://bbpress.trac.wordpress.org/browser/branches/2.5/includes/replies/functions.php#L2113
https://bbpress.trac.wordpress.org/browser/branches/2.5/includes/replies/functions.php#L2149The two functions above are what calculates the reply position in the database as it doesn’t actually exist in the database until either a) a new reply is added to a topic or b) the repair tool is ran to calculate the reply order.
June 11, 2015 at 5:05 am #163071mmice
ParticipantWell, i ran:
SELECT a.ID FROM bb_posts AS a INNER JOIN ( SELECT menu_order, post_parent FROM bb_posts GROUP BY menu_order, post_parent HAVING COUNT( * ) >1 )b ON a.menu_order = b.menu_order AND a.post_parent = b.post_parent WHERE post_type = 'reply';3,763,193 total, Query took 11.5215 sec
I guess it’s only SELECT and yep, it returns what is have to be fixed?
Script seems to make “bbp_update_reply_position” with that information. Where can i find the reply position in DB?June 11, 2015 at 5:03 am #163069In reply to: SMF Import to bbPress
Stephen Edgar
KeymasterYou would want to do a search and replace in your database to change it from a
BBCodelink to a compatible link e.g.http://youtube.com/video_url.I’m not familiar with “Aeva media” so can’t really help in that regard.
Using a search and replace plugin like the following might be what you need:
https://wordpress.org/plugins/search-and-replace/You would search for the “Aeva media” BBCode, eg.
[aver_video]video_url[/aver_video]and replace it withhttp://aver-vidio-domain.com/video_urlJune 11, 2015 at 4:51 am #163068Stephen Edgar
KeymasterFound the patch, it needs lots of testing and I haven’t had the time to take even a cursory look at it yet https://bbpress.trac.wordpress.org/ticket/2731, so lets leave that aside for now.
The code is here, I’m not sure your level of PHP knowledge but I’ll just add the link to it for now and will follow up after you’ve had a look at the code:
https://bbpress.trac.wordpress.org/browser/branches/2.5/includes/admin/tools.php#L1134June 11, 2015 at 4:47 am #163067mmice
ParticipantI really appreciate!
Yep, it’s likely php script code limitation. I already asked for admin’s to encrease php_time_limit, but it’s still to small ))
June 11, 2015 at 4:44 am #163066Stephen Edgar
KeymasterI’ll go grab that code for you now, I’ve also got a patch that I’m trying to find that fixes this per the details below.
The thing is, the tool works as you noted that it works for when you’ve only got 2 replies, it fails on millions because the PHP code times out after 30 seconds, theoretically if you keep running that tool, click back after each white screen and hit go again you will eventually achieve said goal, with millions I would not advise this though.
-
AuthorSearch Results