Search Results for 'code'
-
AuthorSearch Results
-
February 17, 2017 at 3:57 am #181797
In reply to: Is there an API for bbPress
mapofemergence
ParticipantHi everybody,
I was actually starting a topic about this, a few days ago, but my post contains a bunch of links (more than 3) to help contextualize the discussion and it’s still pending approval.
If moderators can help with that, the link to the topic is:
https://bbpress.org/?post_type=topic&p=181440
(I hope it’s not a problem to link it here; in case, feel free to delete or edit this reply)I was trying to start writing a first version of a REST API too, as I missed the latest posts by Pascal. Also, I looked for existing code here:
https://github.com/ePascalC/bbp-API
but found only empty files. Am I missing something?Anyway, I downladed the plugin and checked the code there.
Mine differs a bit as I was using BP-REST as a starter: I saw they had an extensive discussion about how to frame the whole work and structure it for the longer term, so I thought it was a good idea to take that into consideration.If you think we might join efforts on this, let me know; I have limited time to invest on this but I’d be pleased to give my contribution whenever I can.
Cheers,
s t eFebruary 17, 2017 at 2:51 am #181796In reply to: Last activity link name wrong
Fuskeduske
ParticipantHi RotiSoft,
The code that i supplied in a pastebin, should hopefully solve the issue.
If not, the problem could rely in another plugin, and i may therefore ask you to disable them all, and enable them one after one. 🙂
-Fuske
February 16, 2017 at 6:42 pm #181786In reply to: Editing text above forum list
Robin W
Moderatorok, it could be several places
lets start with
ie wp-content/themes/%your-theme-name%/functions.php
where %your-theme-name% is the name of your theme
can you look in that file for lines of code that start with
add_actionand list any that you see here
February 16, 2017 at 3:02 pm #181780In reply to: bbPress sidebar not working
Robin W
Moderatorsorry, missed that you were using wp tweaks which adds this sidebar. This plugin has no support, and doesn’t work with several themes by the look of it.
suggest you try
https://en-gb.wordpress.org/plugins/widget-logic/
the logic for forum pages is
is_bbpress()for a widget to only show on forum pages
and to exclude from forum pages is
!is_bbpress()February 16, 2017 at 9:28 am #181772In reply to: bbPress breadcrumb forum root link issue
dropshot
ParticipantThe problem is if you create a page with the same slug as your forum index and insert the forum index shortcode, this page will just be a page that happens to contain bbpress content. It isn’t a real bbpress page.
If you would like your index page (mysite.com) as your forum index how can you make that a real forum page? NOT just a page that contains bbpress content.
You can’t set your forum root index to nothing cause this will make default value (forums) to reappear. Of course you can 301 redirect /forums to index page. But as mentioned, this will display a page with forum content. NOT a real forum page.
Appreciate any kind of suggestions.
February 16, 2017 at 7:20 am #181766In reply to: Is there an API for bbPress
jpvanmuijen
ParticipantHi, this topic has been very helpful in getting the latest replies, thanks Barry & Robin!
I’m trying to get the topic of the last five replies and later on construct the URL using the topic URL and reply # (kinda like Robin’s shortcode plugin does), but I can’t figure out how to do this.
I changed $author_id = get_post( $single_item[‘id’] )->post_author to $topic_id = get_post( $single_item[‘id’] )->topic hoping it would return the topic ID, but no luck. Is there a way to retrieve how to target this field?
Thanks again!February 16, 2017 at 4:21 am #181755phil49
ParticipantHello Robin,
Thanks for the reply again.
I pasted the code in the additional Custom CSS section in WordPress, indeed I immediately noticed that page width was wider by about 1/5.
However, the “bbpress.php” template was… not affected ! 🙁
I tried copying the code in the style.css in the child theme previously created, but same thing no wide page again !
As I noticed since the beginning, ALL the site pages, I mean the one managed by this epoymous section in WordPress ARE affected by any additional CSS code, BUT NO page in the forum section with the “bbpress.page” Template are concerned by any modification !
It’s as if so long as there’s no modification on the bbpress.php code or it’s CSS, nothing could happen !
Yet, as mentioned earlier, in the child theme I’ve created, I added as explained in this forum : http://www.designbombs.com/master-twenty-seventeen-wordpress-theme/ , the following files :
1 style.css file
1 page-full-width.php
1 function.phpWas there any other operation I should have done ?
For instance, should I try something with the Bbpress-style-pack I’ve installed a few weeks ago for another purpose but that includes a CSS section ?
I don’t really understand what I’m supposed to do, the explanation is not quite clear to me !
It’s explained that it will create a “bspstyle.css” file but what will be the impact on the whole site as I just want to alter page width ONLY on the forum pages, the other pages have the adequate width !
Kind regards,
Philippe
February 15, 2017 at 6:38 pm #181748Robin W
Moderatorok, put this in the custom css
.single-post:not(.has-sidebar) #primary, .page.page-one-column:not(.twentyseventeen-front-page) #primary, .archive.page-one-column:not(.has-sidebar) .page-header, .archive.page-one-column:not(.has-sidebar) #primary { max-width: 100% !important; }you may need to play with it if it affects other parts of your site.
if you don’t know how to do this – come back
February 15, 2017 at 2:21 am #181703In reply to: Last activity link name wrong
Fuskeduske
ParticipantHi RotiSoft,
You can change bbp_get_forum_last_reply_title to bbp_get_forum_last_topic_title, to get rid of the reply-to tag. However this will still make problems, while for example deleting or trashing a topic.
Robin gave me the following code, it should show the latest title without “reply-to” tag: http://pastebin.com/raw/jY5hSPPp
This should be used together with:
<?php do_action( 'bbp_theme_before_forum_freshness_link' ); ?> <?php bbp_forum_freshness_link(); ?> <?php do_action( 'bbp_theme_after_forum_freshness_link' ); ?>However you might need to adjust a little due to the way of your theme setup.
-Fuske
February 14, 2017 at 8:21 pm #181699In reply to: Last activity link name wrong
Tamas Rottenbacher
ParticipantHi @fuskeren!
I don’t use bbPress style pack plugin.
The theme use that code for call the last active topic display:
<a rel="internal" href="<?php bbp_forum_last_reply_url(); ?>" title="Legutóbbi aktív téma: <?php bbp_forum_last_topic_title(); ?>"><?php bbp_forum_last_topic_title(); ?></a>
and under that: (the second line, the time and user)<?php do_action( 'bbp_theme_before_forum_freshness_link' ); ?> <?php bbp_forum_freshness_link(); ?> <?php do_action( 'bbp_theme_after_forum_freshness_link' ); ?>I’m tried add that code:
<?php $forum_id = bbp_get_forum_id( $forum_id ); $active_id = bbp_get_forum_last_active_id( $forum_id ); ?> <?php echo bbp_get_forum_last_reply_url( $forum_id ); ?><br /> <?php echo bbp_get_forum_last_reply_title( $forum_id ); ?>But that add “Comment:” or “Reply:” because that is the reply title, not the last active topic.
February 14, 2017 at 10:11 am #181668In reply to: disable email Email (required) config ?
Fuskeduske
ParticipantHi Crew,
I have just tried running the code on my own test invironment, and i can see, that the code, does not seems to work.
I do however not have enough knowhow to help you further.
I am glad to see, that you got your functions file to work atleast.
February 14, 2017 at 9:48 am #181658In reply to: disable email Email (required) config ?
Fuskeduske
ParticipantHi Crewockeez,
1. Line of Robins code appears to be broken, can you try replacing it with:
add_filter ('bbp_filter_anonymous_post_data' , 'rew_filter_anonymous_post_data' 10, 2);February 14, 2017 at 8:54 am #181648In reply to: Last activity link name wrong
Fuskeduske
ParticipantHi RotiSoft,
Could you provide me with a description of how you’re displaying the titles?
I’ve just recently had a longer correspondence with RobW, about what i think is the same issue.
He told me as follows:
Basically a category holds the last active ID of its sub forums, and each sub forum also holds its last active ID. But deleting a sub forum topic seems to get the category last active ID wrong.
I see that he just updated he’s bbpress style pack plugin, with a hotfix for this issue,
while he gave me the snippet of the code used for the fix, it does not work if your tweak is done if you’re using code as in this: https://bbpress.org/forums/topic/freshness-link/I don’t think Robin would mind me sharing the code snippet, as he implemented it in he’s free plugin, but as requested i would like to know how you’re displaying it.
-Fuske
February 14, 2017 at 8:51 am #181647In reply to: Can I add a forum under a page or post?
Robin W
Moderatorlots of shortcodes available for putting into pages and posts
and I have additional shortcodes in my style pack plugin
February 14, 2017 at 8:12 am #181637In reply to: disable email Email (required) config ?
crewockeez
Participanti try insert new code. not work.
February 14, 2017 at 7:17 am #181623In reply to: disable email Email (required) config ?
Robin W
Moderatorthis – it has some parts changed !!
add_filter ('bbp_filter_anonymous_post_data' , 'rew__filter_anonymous_post_data' 10, 2) ; function rew_filter_anonymous_post_data( $retval, $r ) { // Filter variables and add errors if necessary $r['bbp_anonymous_name'] = apply_filters( 'bbp_pre_anonymous_post_author_name', $r['bbp_anonymous_name'] ); if ( empty( $r['bbp_anonymous_name'] ) ) bbp_add_error( 'bbp_anonymous_name', __( '<strong>ERROR</strong>: Invalid author name submitted!', 'bbpress' ) ); // Website is optional $r['bbp_anonymous_website'] = apply_filters( 'bbp_pre_anonymous_post_author_website', $r['bbp_anonymous_website'] ); // Return false if we have any errors $retval = bbp_has_errors() ? false : $r; // Finally, return sanitized data or false return apply_filters( 'rew_filter_anonymous_post_data', $retval, $r ); }February 14, 2017 at 5:13 am #181613In reply to: disable email Email (required) config ?
crewockeez
Participanti insert code on functions.php on my team
add_filter ('bbp_filter_anonymous_post_data' , 'rew__filter_anonymous_post_data' 10, 2) ; function rew_filter_anonymous_post_data( $retval, $r ) { // Filter variables and add errors if necessary $r['bbp_anonymous_name'] = apply_filters( 'bbp_pre_anonymous_post_author_name', $r['bbp_anonymous_name'] ); if ( empty( $r['bbp_anonymous_name'] ) ) bbp_add_error( 'bbp_anonymous_name', __( '<strong>ERROR</strong>: Invalid author name submitted!', 'bbpress' ) ); // Website is optional $r['bbp_anonymous_website'] = apply_filters( 'bbp_pre_anonymous_post_author_website', $r['bbp_anonymous_website'] ); // Return false if we have any errors $retval = bbp_has_errors() ? false : $r; // Finally, return sanitized data or false return apply_filters( 'bbp_filter_anonymous_post_data', $retval, $r );upload file functions.php on server. open site error.
February 14, 2017 at 5:01 am #181612In reply to: disable email Email (required) config ?
Robin W
Moderatornot sure what you mean, but corrected code here
add_filter ('bbp_filter_anonymous_post_data' , 'rew__filter_anonymous_post_data' 10, 2) ; function rew_filter_anonymous_post_data( $retval, $r ) { // Filter variables and add errors if necessary $r['bbp_anonymous_name'] = apply_filters( 'bbp_pre_anonymous_post_author_name', $r['bbp_anonymous_name'] ); if ( empty( $r['bbp_anonymous_name'] ) ) bbp_add_error( 'bbp_anonymous_name', __( '<strong>ERROR</strong>: Invalid author name submitted!', 'bbpress' ) ); // Website is optional $r['bbp_anonymous_website'] = apply_filters( 'bbp_pre_anonymous_post_author_website', $r['bbp_anonymous_website'] ); // Return false if we have any errors $retval = bbp_has_errors() ? false : $r; // Finally, return sanitized data or false return apply_filters( 'rew_filter_anonymous_post_data', $retval, $r ); }February 13, 2017 at 10:17 pm #181603In reply to: disable email Email (required) config ?
crewockeez
Participantno insert code on fuctions file. on site error
add_filter ('bbp_filter_anonymous_post_data' , 'rew__filter_anonymous_post_data' 10, 2) ; function rew_filter_anonymous_post_data( $retval, $r ) { // Filter variables and add errors if necessary $r['bbp_anonymous_name'] = apply_filters( 'bbp_pre_anonymous_post_author_name', $r['bbp_anonymous_name'] ); if ( empty( $r['bbp_anonymous_name'] ) ) bbp_add_error( 'bbp_anonymous_name', __( '<strong>ERROR</strong>: Invalid author name submitted!', 'bbpress' ) ); // Website is optional $r['bbp_anonymous_website'] = apply_filters( 'bbp_pre_anonymous_post_author_website', $r['bbp_anonymous_website'] ); // Return false if we have any errors $retval = bbp_has_errors() ? false : $r; // Finally, return sanitized data or false return apply_filters( 'bbp_filter_anonymous_post_data', $retval, $r ); }February 13, 2017 at 5:28 pm #181598In reply to: disable email Email (required) config ?
Robin W
Moderatoruntested, but try adding this to your functions file
add_filter ('bbp_filter_anonymous_post_data' , 'rew__filter_anonymous_post_data' 10, 2) ; function rew_filter_anonymous_post_data( $retval, $r ) { // Filter variables and add errors if necessary $r['bbp_anonymous_name'] = apply_filters( 'bbp_pre_anonymous_post_author_name', $r['bbp_anonymous_name'] ); if ( empty( $r['bbp_anonymous_name'] ) ) bbp_add_error( 'bbp_anonymous_name', __( '<strong>ERROR</strong>: Invalid author name submitted!', 'bbpress' ) ); // Website is optional $r['bbp_anonymous_website'] = apply_filters( 'bbp_pre_anonymous_post_author_website', $r['bbp_anonymous_website'] ); // Return false if we have any errors $retval = bbp_has_errors() ? false : $r; // Finally, return sanitized data or false return apply_filters( 'bbp_filter_anonymous_post_data', $retval, $r ); }February 13, 2017 at 1:53 pm #181591In reply to: disable email Email (required) config ?
Robin W
ModeratorThis is in a file called form-anonymous.php :
create a directory on your theme called ‘bbpress’
ie wp-content/themes/%your-theme-name%/bbpresswhere %your-theme-name% is the name of your theme
find
wp-content/plugins/bbpress/templates/default/bbpress/form-anonymous.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/form-anonymous.php
bbPress will now use this template instead of the original
and you can amend thisyou will see that lines 26-29 contain
<p> <label for="bbp_anonymous_email"><?php _e( 'Mail (will not be published) (required):', 'bbpress' ); ?></label><br /> <input type="text" id="bbp_anonymous_email" value="<?php bbp_author_email(); ?>" tabindex="<?php bbp_tab_index(); ?>" size="40" name="bbp_anonymous_email" /> </p>Just delete this and save, and this field will not be shown
February 12, 2017 at 5:23 am #181501phil49
ParticipantHi,
Just a question: how can I know which page model is being used by the forum pages ?
Is there a way to know it through the dashboard or inspecting the source code ?
Regards
Philippe
February 11, 2017 at 3:11 pm #181492Robin W
Moderatorhave you been through no. 8 in this link
February 11, 2017 at 2:23 pm #181489Md Sadiqur Rahman
Participantbbp additional shortcodes plugin solved the problem 🙂
February 11, 2017 at 1:50 pm #181488Md Sadiqur Rahman
ParticipantHi,
I’m using [bbp-single-forum id=#] shortcode to show forum under a certain category. Above it, there is a status bar (counts topics and replies). It is not fitting with my homepage. Is there a way to delete it?Screenshot:https://www.dropbox.com/s/52kip18610x7iu7/forum-1.png?dl=0
-
AuthorSearch Results