Search Results for 'code'
-
AuthorSearch Results
-
October 20, 2014 at 3:22 pm #153586
In reply to: How to remove (0,0) in sub forum listings?
Robin W
Moderatornot sure why
I’ve read https://codex.bbpress.org/layout-and-functionality-examples-you-can-use/ among other tips.
isn’t working for you?
October 20, 2014 at 1:53 pm #153580Topic: How to remove (0,0) in sub forum listings?
in forum Troubleshootingkendorama
ParticipantI’ve googled and searched the support forums and it seems the answers are outdated and don’t currently work on this version of bbPress.
I’ve read https://codex.bbpress.org/layout-and-functionality-examples-you-can-use/ among other tips.
Any help?
October 19, 2014 at 2:12 pm #153553In reply to: Disabling topic creation-box
jessy
Participant@cubeacid: You want this: Do not allow users to publish new topics, just replies on your topics. Correct?
1, Install plugin: WPFront User Role Editor
2, Go to Roles => All roles => and choose Participant, it has 8 capabilities
3, You need uncheck publish_topics and edit_topics and assign_topic_tags and delete_topic_tags
4, with this plugin you can do it because it is built in role from plugin bbPress
5, But, we can customize it with filter function pasted below
6, Jast paste it into function.php and refresh the page in admin plugin WPFront User Role Editor in Participate role how magicaly capabilities are removed 🙂
7, If the participant or regular registered user will go on topics, they will be message “You cannot create new topics.” and if user click on your own created topic, he can reply 🙂Paste it into functions.php
function my_custom_get_caps_for_role_filter($caps, $role) { /* Only filter for roles we are interested in! */ if ($role == 'bbp_participant' ) $caps = my_custom_get_caps_for_role($role); return $caps; } add_filter('bbp_get_caps_for_role', 'my_custom_get_caps_for_role_filter', 10, 2); function my_custom_get_caps_for_role($role) { switch ($role) { case 'bbp_participant': return array( // Primary caps 'spectate' => true, 'participate' => true, 'moderate' => false, 'throttle' => false, 'view_trash' => false, // Forum caps 'publish_forums' => false, 'edit_forums' => false, 'edit_others_forums' => false, 'delete_forums' => false, 'delete_others_forums' => false, 'read_private_forums' => false, 'read_hidden_forums' => false, // Topic caps 'publish_topics' => false, 'edit_topics' => false, 'edit_others_topics' => false, 'delete_topics' => false, 'delete_others_topics' => false, 'read_private_topics' => false, // Reply caps 'publish_replies' => true, 'edit_replies' => true, 'edit_others_replies' => false, 'delete_replies' => false, 'delete_others_replies' => false, 'read_private_replies' => false, // Topic tag caps 'manage_topic_tags' => false, 'edit_topic_tags' => false, 'delete_topic_tags' => false, 'assign_topic_tags' => false ); break; default: return $role; } }I have try that ad for me it works.
October 19, 2014 at 12:49 pm #153550In reply to: Remove box around the author name
jessy
ParticipantRewrite your theme styles with this, paste this on very bottom on style.css or into <head> tag section and wrap t with <style text/css></style>:
#bbpress-forums p.bbp-topic-meta span { white-space: nowrap; background: none; border: none; }October 19, 2014 at 11:54 am #153547In reply to: Issues inserting/embedding videos
jessy
ParticipantDo you really need this shortcode? I am sorry about this, but for many reasons it is enough to use just video from youtube, because, if you will use the video than you will need CDN also. And this shortcode in my opition do not have nice css stylesheet.
October 19, 2014 at 11:23 am #153544In reply to: Issues inserting/embedding videos
jessy
ParticipantInstall plugin bbPress2 shortcode whitelist.
just write string: video into that small text area
October 19, 2014 at 11:11 am #153542In reply to: Issues inserting/embedding videos
jessy
ParticipantInstall plugin bbPress2 shortcode whitelist
And to settings write video
October 19, 2014 at 10:47 am #153539In reply to: Set featured image for bbpress forum posts
jessy
ParticipantInto your function.php paste this code, you will allow to Custom Post Type forum – bbPress have featured images in admin.
add_theme_support( 'post-thumbnails', array( 'forum' ) ); add_post_type_support('forum', 'thumbnail');October 19, 2014 at 10:29 am #153538In reply to: Issues inserting/embedding videos
mannmithund
ParticipantThank you.
The theme supports videos, i.e. no issues to add them to regular blog posts.
Added the code, this results in
Fatal error: Call to undefined function video().October 19, 2014 at 10:28 am #153537In reply to: Size font bbpress
jessy
Participant1, Go to Appearance => Editor => Style.css edit this file section Reset from mayer, and find there “font-size: 100%; font: inherit;” change it into font-size: 16px; remove font: inherit
Reset section would look like this:
/* ------------------------------------------------------------------------- * * Reset - http://meyerweb.com/eric/tools/css/reset/ v2.0 | 20110126 * ------------------------------------------------------------------------- */ html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video { margin: 0; padding: 0; border: 0; font-size: 16px; vertical-align: baseline; } article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { display: block; } ol, ul { list-style: none; } blockquote, q { quotes: none; } blockquote:before, blockquote:after, q:before, q:after { content: ''; content: none; } table { border-collapse: collapse; border-spacing: 0; }Let me know if you need help.
October 19, 2014 at 9:55 am #153536In reply to: Issues inserting/embedding videos
jessy
ParticipantIf your theme support this shortcode on posts and pages we can assume your shortcode is working fine, but bbPress is for security reasons blocking.
Place this code into functions.php
function jm_bbp_shortcodes( $content, $reply_id ) { return video( $content ); } add_filter('bbp_get_reply_content', 'jm_bbp_shortcodes', 10, 2); add_filter('bbp_get_topic_content', 'jm_bbp_shortcodes', 10, 2);Let me know if you need help.
October 19, 2014 at 9:35 am #153535Topic: broken
in forum TroubleshootingLazylonewolf
ParticipantUsing the li(list) HTML tag causes the reply to be broken. Any idea how to fix this?
<img src="http://fc05.deviantart.net/fs70/f/2014/292/8/3/broken_li_by_radstylix-d83ea8x.png" alt="<li> html breaks reply" />Top part of the black line shows a reply without li, while below it shows what happens if li is used.
October 19, 2014 at 9:18 am #153534In reply to: Restricting bbpress to a single forum
jessy
ParticipantTwo solutions:
1, Go to Settings => Forums it is settins for bbPress and just find Forum root should show and choose Topics by Freshness
2, You need to use shortcode [bbp-single-forum id=2766]
It is simple, create one forum and use your single forum ID, you can find it if you hover over the forum in the admin, check the bottom the link and there is the ID, replace it to your shortcode in custom page.
If you need help, let me know.
October 19, 2014 at 8:40 am #153533Topic: Issues inserting/embedding videos
in forum Troubleshootingmannmithund
ParticipantHello there
I fail in inserting / embedding an m4v video into a forum posts. Posts show text and images as intended, but for videos, just the smart tag is shown:
[video width="640" height="640" m4v="video.m4v"][/video]What am I doing wrong?
I run wordpress 4 and bbpress 2.5.4Help is much appreciated.
– MannMitHund
October 19, 2014 at 4:23 am #153522In reply to: How do i customize user roles?
Robin W
ModeratorGreat – presume you’re fixed if not
October 18, 2014 at 11:01 pm #153519In reply to: How do i customize user roles?
esportsstream
ParticipantOk do to fix it i had to write that code in the actual funtions.php file of my main theme
October 18, 2014 at 10:20 pm #153517In reply to: How do i customize user roles?
esportsstream
ParticipantSo i made a new file called bbpress-functions.php and put this into it
<?php //code to add tutor role function add_apply_role( $bbp_roles ) { /* Add a role called apply */ $bbp_roles['bbp_apply'] = array( 'name' => 'apply', 'capabilities' => custom_capabilities( 'bbp_apply' ) ); return $bbp_roles; } add_filter( 'bbp_get_dynamic_roles', 'add_apply_role', 1 ); function apply_role_caps_filter( $caps, $role ) { /* Only filter for roles we are interested in! */ if( $role == 'bbp_apply' ) $caps = custom_capabilities( $role ); return $caps; } add_filter( 'bbp_get_caps_for_role', 'apply_role_caps_filter', 10, 2 ); function custom_capabilities( $role ) { switch ( $role ) { /* Capabilities for 'apply' role */ case 'bbp_apply': return array( // Primary caps 'spectate' => true, 'participate' => true, 'moderate' => false, 'throttle' => false, 'view_trash' => false, // Forum caps 'publish_forums' => false, 'edit_forums' => false, 'edit_others_forums' => false, 'delete_forums' => false, 'delete_others_forums' => false, 'read_private_forums' => false, 'read_hidden_forums' => false, // Topic caps 'publish_topics' => true, 'edit_topics' => true, 'edit_others_topics' => false, 'delete_topics' => false, 'delete_others_topics' => false, 'read_private_topics' => false, // Reply caps 'publish_replies' => true, 'edit_replies' => true, 'edit_others_replies' => false, 'delete_replies' => false, 'delete_others_replies' => false, 'read_private_replies' => false, // Topic tag caps 'manage_topic_tags' => false, 'edit_topic_tags' => false, 'delete_topic_tags' => false, 'assign_topic_tags' => true, ); break; default : return $role; } }I have no idea where i put this file in my site directory……
October 18, 2014 at 4:18 pm #153508In reply to: bbPress 2.0.2 and 1.6MM posts = painfully slow
Daniel J. Lewis
ParticipantAny update to this? I, too, have a large bbPress forum and I see the following in my error log:
SlowTimer [6357ms] at runtime/ext_mysql: slow query: SELECT SQL_CALC_FOUND_ROWS wp_13_posts.ID FROM wp_13_posts INNER JOIN wp_13_postmeta ON (wp_13_posts.ID = wp_13_postmeta.post_id)\nINNER JOIN wp_13_postmeta AS mt1 ON (wp_13_posts.ID = mt1.post_id) WHERE 1=1 AND wp_13_posts.post_type = 'topic' AND (wp_13_posts.post_status = 'publish' OR wp_13_posts.post_status = 'closed') AND (wp_13_postmeta.meta_key = '_bbp_last_active_time'\nAND (mt1.meta_key = '_bbp_forum_id' AND CAST(mt1.meta_value AS SIGNED) != '133643') ) GROUP BY wp_13_posts.ID ORDER BY wp_13_postmeta.meta_value DESC LIMIT 0, 25October 18, 2014 at 4:05 pm #153507In reply to: Topics not appearing in forum
Robin W
ModeratorThe issue is related to how wp4.0 looks at search and in particular at the ‘s’ parameter submitted to wp-query. wp4.0 does it differently and what didn’t look like a search to previous wp versions now does when sent from bbpress functions.
Hence why your
$query->is_searchwas affectedOctober 18, 2014 at 3:42 pm #153506In reply to: Topics not appearing in forum
mkoenen
ParticipantI had the same problem. After upgrading to WP 4.0 only sticky topics were visible. I tried the patch/plugin “bbpress wp4 fix”. I could now see all topics, but when I clicked on any one of them only the first forum topic would open. The URL was correct, but the wrong topic appeared in the page. I deactivated the plugin and after some more research, found that I had a piece of code in my functions file that interfered with the topics showing. Here is the code that caused the problem:
//exclude from search results function fb_search_filter($query) { if ( !$query->is_admin && $query->is_search) { $query->set('post_type', array('course_unit') ); // id of page or post } return $query; } add_filter( 'pre_get_posts', 'fb_search_filter' );I don’t know why this code is a problem, but I no longer needed it. I deleted it and now my forums are working just fine.
October 18, 2014 at 1:18 pm #153500In reply to: Forum not showing up
Robin W
Moderatorok, pasting urls into a page won’t really do it
you can either enter
[bbp-forum-index]or if you are using custom menu’s you can enter the url as a menu item
October 18, 2014 at 1:14 pm #153499In reply to: Size font bbpress
Robin W
Moderator@ricsca2
bbpress does have a css of its own as yiou found earlier, but tries to use much of the one from the host themeI am trying to write a bbpress css plugin where you can set areas simply
eg
Header : Colour? size? etc.
but progress I slow whilst I work out what bits of the bbpress.css code do and when
Tell me which parts you are still having trouble with eg breadcrumb and I’ll try and help further
October 18, 2014 at 8:18 am #153495In reply to: Size font bbpress
Ricsca2
Participant@robin-w With the code you’ve written now the various parts of the forum is bigger.
The problem is that I can not change manualente all parts of the theme.
The theme for bbPress does not have a css because it goes to get the css of wordpress theme right?As ever with the theme HUEman this does not happen?
Very thanks
October 17, 2014 at 12:10 pm #153468In reply to: Size font bbpress
Robin W
ModeratorWithout a url or screenshot I can’t really help further – there are several places where bbpress has font sizes eg
#bbpress-forums ul.bbp-lead-topic, #bbpress-forums ul.bbp-topics, #bbpress-forums ul.bbp-forums, #bbpress-forums ul.bbp-replies, #bbpress-forums ul.bbp-search-results { font-size: 12px; } #bbpress-forums .bbp-forums-list li { font-size: 11px; } #bbpress-forums div.bbp-forum-title h3, #bbpress-forums div.bbp-topic-title h3, #bbpress-forums div.bbp-reply-title h3 { font-size: 16px; } #bbpress-forums .bbp-forum-info .bbp-forum-content, #bbpress-forums p.bbp-topic-meta { font-size: 11px; }and lots more
I can only suggest you try some of the above in your custom css BUT put ‘!important’ after the px part to ensure that it is not overwritten eg
#bbpress-forums ul.bbp-lead-topic, #bbpress-forums ul.bbp-topics, #bbpress-forums ul.bbp-forums, #bbpress-forums ul.bbp-replies, #bbpress-forums ul.bbp-search-results { font-size: 12px !important; }October 17, 2014 at 10:02 am #153460Topic: BuddyPress – error displaying closed topic title
in forum TroubleshootingTullariS
ParticipantHello everyone!
Just spotted an issue with bbp_filter_modify_page_title(). It tried to fetch the current topic to add its title to <title> but uses post_status = ‘publish’. This fails if the topic is set to closed.
My suggestion is to change line 127 from:
'post_status' => 'publish',
to
'post_status' => 'any',
Best regards -
AuthorSearch Results