Search Results for 'test'
-
AuthorSearch Results
-
September 21, 2021 at 4:32 am #223289
bobdobbs
ParticipantHi Robin. I looked at this a while ago and did some experimentation with it.
I’m sure it does what I need, but it requires too much configuration and mental overhead for my simple requirements.That’s not a criticism of the plugin itself! It looks great!
But its flexibility requires me to learn its complex model.
And my needs are dead simple: simply make all forum content inaccessible to everyone who isn’t signed in as a forum member.Afaict, the function I’ve created above does a good enough job toward that end.
The main issue is that it allows access to anyone who isn’t a member, as long as they have a login to the website.For me this isn’t a problem yet: the only members of the site will be forum members.
At this point I’m not sure how to test for that. I’ll get around to figuring that out at some point.September 20, 2021 at 9:19 pm #223269bobdobbs
ParticipantI have a solution.
It relies on a couple of assumptions: one being that the structure of URL’s is like this:
‘http://mysite.com/forums/…’Assumption 2: all users with an account on the website are allowed to access the forum.
This function does the following:
If the user requests a resource under ‘/forums/’ then we test to see if the user has a wordpress account and is logged in. If the user isn’t logged into the wordpress account, then they get denied.In production I’ve replaced ‘wp_die’ with a wp_redirect to another page.
/**
* If a user is not a forum member, and requests the forum index page then redirect them
*/add_action('init', 'as_protect_forums'); function as_protect_forums() { // get the path of the requested URI $current_url = home_url($_SERVER['REQUEST_URI']); $path = parse_url($current_url, PHP_URL_PATH) ; $parts = explode('/', $path) ; $first_part = $parts[1] ; if ( $first_part === 'forums' ) { if ( 0 === get_current_user_id() ) { wp_die('nope'); } } }September 20, 2021 at 7:03 am #223248In reply to: Different displays for method 1 and method 2
Ludovic S. Clain
ParticipantHi @robin-w,
thanks for your reply!I managed to reproduce my problem:
I created a WordPress instance on wptaste.com, reinstalled the essential bbpress plugins as well as Elementor Pro and Astra Pro, trying to redo my settings by hand, the error did not reproduce , I then exported my settings from the original site to re-import them into the test site and there I got the error.So I set out to reset my settings in Astra Pro and then redo them by hand, and now everything is back to normal.
I didn’t understand what it was, but I was able to isolate it and find a solution that didn’t take your time.
Thanks for putting me on the trail!
Best regards,
Ludovic from Reunion island 🇷🇪September 12, 2021 at 2:03 pm #223137In reply to: bbPress Thread Content Displays Lower than Avatar
Robin W
ModeratorI took a look at this, but cannot see what is causing the issue
it could be a theme or plugin issue
Themes
As a test switch to a default theme such as twentytwenty, and see if this fixes.
Plugins
If that doesn’t work, also deactivate all plugins apart from bbpress and see if this fixes. if it does, re-enable one at a time to see which is causing the error.
If you cannot do this to your site (say because it is live) then use the ‘troubleshooting’ features of this plugin to let you test without affecting other users
Then come back
September 11, 2021 at 3:51 am #223121In reply to: Forums index vs custom page shorturl
Robin W
ModeratorAs a test can you try not having the underscore eg customforum as a single word and see if that makes a difference.
Also are you running buddypress as well ? (question not suggesting you should or shouldn’t !)
September 9, 2021 at 1:14 pm #223084In reply to: Way to prevent duplicate post blocking?
Robin W
Moderatorthe easiest way to do this is to allow participant to ‘throttle’ – this then lets them bypass this check
so the code (untested) should be :
add_filter( 'bbp_get_caps_for_role', 'rew_throttle_bypass', 10, 2); function rew_throttle_bypass ($caps, $role) { if ($role == bbp_get_participant_role() ) { $caps['throttle'] = true ; } return $caps ; }ut this in your child theme’s function file –
ie wp-content/themes/%your-theme-name%/functions.php
where %your-theme-name% is the name of your theme
or use
September 9, 2021 at 12:12 pm #223082Topic: Way to prevent duplicate post blocking?
in forum Troubleshootingbhkh
ParticipantIs there a way to disable the “Duplicate reply detected” error checking? My forum will mostly be people uploading audio attachments and they may very well just say the same thing each time they post. But in the short term it’s a bother to my testers since they can’t just write “test” each time.
I know that the error code is in \wp-content\plugins\bbpress\includes\common\functions.php
I’m guessing there is some way to filter the bbp_check_for_duplicate function, but I don’t know enough php to do that.
I’ve seen some others post this question in the past but didn’t see answers.
(BTW, I posted this question a few hours ago but it got marked as spam. Not sure why. I included some code in it but have removed it in this one. Hope it’s ok to repost.)
September 8, 2021 at 10:23 am #223063In reply to: How to respond with a quote
pandex
Participanttest
September 7, 2021 at 9:59 am #223042In reply to: Filtering text in replies
bhkh
ParticipantThanks again for such a quick reply!
1. since this relates to bbpress attachments plugin specifically, it would be better to ask there – Milan should be able to help
So I just now tested putting the code (in this case a link) I’m trying to filter in the body of a reply in addition to having it be in the attachment (hadn’t thought about trying that before) but before I posted I saw
<div class="bbp-attachments">in the page source and so figured that attachments were something in core bbP, not just the GD bbPress Attachments plugin.And the result of that test now is that the link in the body of the reply is also not filtered. So I think I’m back to this being a bbP thing and not a GD bbPress Attachments.
I notice that you also asked about empty replies in that forum as well as this forum where I gave you a fix – it is very frustrating for plugin authors and helpers when they spend time on an issue only to find that the original poster has already fixed it
I totally get that! At the time, I had no idea what the response rate was going to be. Sometimes communities/companies reply within the hour (as you did, thanks!!) or if they will take weeks. So not being sure which was causing the problem, I did post in both places. Please forgive me. I was surprised that both places replied so quickly.
It would be polite to do this
I did! Within minutes of seeing his response. Wasn’t it visible to you? Should I have linked back to the forum as well? I’m happy to, I just thought the code was enough. I totally know the frustration of support posts that end with “Oh, never mind, I fixed it.” and no solution.
Anyway, since I now know that my filter also doesn’t catch things in the body of the reply either (and I would like it to) are we back to this being a bbP thing? Are there other troubleshooting things I’m missing? I have disabled all other plugins and tried a default theme.
September 6, 2021 at 4:55 am #222980In reply to: Allow empty replies
Robin W
Moderatorthere should be an error message at the top saying
Your reply cannot be empty.but the other plugin may be affecting this.
the quickest way to correct this is to create some content if it is blank.
This filter (untested) will deal with empty content and add a space character.
add_filter ('bbp_new_reply_pre_content' , 'rew_allow_blank_content') ; function rew_allow_blank_content ($reply_content) { if ( empty( $reply_content ) ) { $reply_content = ' ' ; } return $reply_content ; }Put this in your child theme’s function file –
ie wp-content/themes/%your-theme-name%/functions.php
where %your-theme-name% is the name of your theme
or use
I have initially set it to change empty content to a single space character ie
$reply_content = ' ' ;however later checking by WordPress may delete this, so it may need some actual text – maybe like
$reply_content = 'this reply is has no text' ;September 5, 2021 at 6:41 am #222946Topic: Images Upload
in forum Installationhardikchosla
ParticipantSeptember 4, 2021 at 9:59 am #222930Robin W
Moderatoryou need to wrap the url into an image tag as in
https://www.w3schools.com/tags/tag_img.asp
so (untested so may need fixing) and image sizing but try
add_action('bbp_template_before_replies_loop', 'bbp_show_extra_fields'); function bbp_show_extra_fields() { $topic_id = bbp_get_topic_id(); $value1 = get_post_meta( $topic_id, 'bbp_extra_field1', true); $value2 = get_post_meta( $topic_id, 'bbp_extra_field2', true); $img1 = '<img src="'.$value1.'">' ; echo "Field 1: ".$img1."<br>"; echo "Field 2: ".$value2."<br>"; }August 31, 2021 at 1:54 pm #222847Robin W
Moderatorjust tested it on my site, and it seems to work.
where did you put the code?
August 31, 2021 at 12:26 pm #222845Robin W
Moderatoruntested but try this
add_filter ('bbp_new_reply_redirect_to', 'rew_redirect_to_topic', 10 , 3) ; function rew_redirect_to_topic ($reply_url, $redirect_to, $reply_id ) { $topic_id = bbp_get_reply_topic_id ($reply_id) ; $redirect_url = bbp_get_topic_permalink( $topic_id, $redirect_to ); return $redirect_url ; }Put this in your child theme’s function file –
ie wp-content/themes/%your-theme-name%/functions.php
where %your-theme-name% is the name of your theme
or use
August 27, 2021 at 11:08 am #222789In reply to: Background colour different on Safari and Firefox
Robin W
Moderatorit will be caching on your browser.
you need to clear cache on the browsers to let them download the latest version of css.
They look the same on my PC in all browsers, as I am looking at the site for the first time.
August 24, 2021 at 1:20 pm #222741In reply to: No Forum subscriptions (update to 2.5)
Robin W
Moderator2.6 is that latest version – did you mean that ?
August 23, 2021 at 10:14 pm #222730Topic: Pagination – How to remove last page numbers?
in forum TroubleshootingROSEMILAN
ParticipantHi,
I would like to remove the last page numbers in pagination,
is there any function code to do this?at the moment, on latest topics on a big forum.. it shows like this..
August 21, 2021 at 4:43 pm #222696Topic: Styling Issue
in forum Themesjeremy
ParticipantHi. Testing bbPress using Penci Soledad. Installed Robin’s Style Pack, but none of the changes are being registered. I cleared caches and all. I should note that I have a dark theme on my site and the styling needs help. Any advice?
August 19, 2021 at 1:17 pm #222667In reply to: Catering for when users simply reply to emails
Robin W
ModeratorAtleast one that says it officially supports the latest wordpress version that is out.I thought it now did – certainly here
August 19, 2021 at 1:04 pm #222666In reply to: Catering for when users simply reply to emails
Chuckie
ParticipantI appreciate that you took the time to look.
Maybe sometime soon we will get an updated bbPress? Who knows …. Atleast one that says it officially supports the latest wordpress version that is out.
August 7, 2021 at 2:56 am #222494In reply to: Forum url changes
Robin W
Moderatorok you could also use a PHP variable rather than a wordpress function
so
$current_url = $_SERVER['REQUEST_URI'];should give you the displayed URL in all cases.
you can then do an ‘if’ test to see if you are in forums using say
if (strpos($_SERVER['REQUEST_URI'], '/qaforums/') == true )…then you are in the forumsAugust 7, 2021 at 2:02 am #222486In reply to: Bbpress – caching mobile pages plugin
uksentinel
Participant@robin-w on the other topic is very knowledgeable, turn off all cache plugin and see if problem is still there.
Are you using any cookies plugin, as this I have had issue with ?
have you always had this problem, as maybe a theme issues, any chance of you trying a different theme, just for testing ?
August 6, 2021 at 3:51 pm #222466In reply to: Forum url changes
pawanahluwalia
ParticipantI haven’t tried adding an extra forum to test it. I am just assuming it defaults to the highest forum ID, which is what it is currently doing.
August 6, 2021 at 12:21 pm #222459In reply to: Forum url changes
Robin W
Moderatorif get_page link returns :
mywebsite.com/forum_name3/forum_name3/
then you could just test for this eg
if (get_page_link() == 'mywebsite.com/forum_name3/forum_name3/') { get_permalink etc. } else { get_page_link() }August 6, 2021 at 12:06 pm #222458In reply to: Forum url changes
pawanahluwalia
ParticipantThanks!
However, is_bbpress() only seems to be true if you are on the root forum page.
How can I test for any forum page?
I tried
echo get_permalink();
on a forum page, but it does not display anything. It does display it on the root forum page, but it does not match the root forum page permalink. It again shows the highest Forum ID permalink instead.
Presumably the page is being created in code and is overwriting the content of the current forum page.
Any further suggestions?
-
AuthorSearch Results