Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 1 through 25 (of 32,395 total)
  • Author
    Search Results
  • #244524
    Robin W
    Moderator

    it’s not really anyone’s ‘fault’ but bbpress would need to make the change to their code, so yes bbpress is ‘causing it’.

    #244499
    kampot888
    Participant

    I have the same problem.

    Buddyboss is slow to update and has old code, so I want to switch back to BBPRESS.

    Buddyboss doesn’t want to export, so they don’t provide a migration tool. For that reason, I don’t recommend it.

    #244427
    downybirch
    Participant

    I’d need to make a login for you, since only logged in users can see the private forums…

    Can you make up a dummy email (or pm me a working email) and I’ll set that up?

    For the record, this is the page giving the problem:

    https://scottishpolicy.org/forums/forum/constitution/

    It’s all in the process of development just now, so there’s not content as yet…

    I’d send a screenshot, but I don’t actually think that’d be a great deal of help.

    #244426
    downybirch
    Participant

    I’d need to make a login for you, since only logged in users can see the private forums…

    Can you make up a dummy email (or pm me a working email) and I’ll set that up?

    For the record, this is the page giving the problem:

    https://scottishpolicy.org/forums/forum/constitution/

    It’s all in the process of development just now, so there’s not content as yet…

    #244420
    downybirch
    Participant

    I’m running WP 6.8.1 wih bbp 2.6.13 and bbp style pack 6.3.0 on the Twenty Twenty-Four theme.

    When I view my forum as a logged in user, I get this at the head of the page:

    Private: Private: Constitution

    Is there a way to suppress this?

    It’s probably me… 🙂

    #244419
    downybirch
    Participant

    I’m running WP 6.8.1 wih bbp 2.6.13 and bbp style pack 6.3.0 on the Twenty Twenty-Four theme.

    When I view my forum as a logged in user, I see this under the Last Activity section:

    Last Activity: <a href="https://scottishpolicy.org/forums/topic/right-to-privacy/" title="Right to privacy">1 day, 9 hours ago</a>

    I’ve used Inspector to look at the code in the browser (Firefox and Brave – both are affected) and I can’t spot anything obvious.

    Is this a known issue?

    Is there a fix?

    #244353
    Robin W
    Moderator

    Changing this is not within the current plugins capability.

    I suspect that with the right code it could be done, but I have no idea how to do it.

    I’d suggest you hire a programmer

    #244349
    elsoar
    Participant

    Thank you for your help, sir.

    Unfortunately, people don’t look, but search engines do.

    Link structuring is extremely important.

    I removed the word “Forums” from the link
    Prefix all forum content with the Forum Root slug (Recommended)

    , but I don’t know how to add the forum name instead of the word “Topic.”

    #244347
    elsoar
    Participant

    Hello..

    Yes, I want Change my bbPress permalinks in my forum,

    from:

    Error

    to:
    https://bbpress.org/troubleshooting/error-5/

    So, I want:
    Delete: forums
    Delete: topic
    Add: ForumName “not forums btw”

    Can I do that plz?

    E.T.A.
    Why?
    Because my forum will be about cars, I’ll want to include the car brand in the permanent link.

    For example:

    https://cars.com/bmw/why-my-bmw-app-is-not-working

    Robin W
    Moderator

    You can add it to the menu

    Install

    bbp style pack

    once activated go to

    dashboard>settings>bbp style pack>login

    or you can use the
    [bbp-login]
    shortcode which will display a clickable link

    #244316

    Topic: Error

    in forum Installation
    Preeti Razdan
    Participant

    I just installed bbpress plug in. Why does my forum page show this :

    \

         

    Sculley
    Participant

    Hi there,

    We’re using bbPress with the Simple Membership plugin, and the site is built with the GeneratePress theme. Here’s the staging site for reference: https://iu9d4mv2wm-staging.onrocket.site/forums/

    Login is handled through Simple Membership, but profile behavior is different than the typical bbPress/WordPress setup.

    When a member creates a topic or reply, they can click on their avatar or name to access their forum profile — which includes favorites, subscriptions, activity, etc. However, if a user hasn’t posted yet, there’s no way for them to access their profile, because their avatar/name doesn’t appear anywhere.

    Is there a shortcode, function, or recommended method to add a “View My Profile” link at the top of the forums (or anywhere else), even if the user hasn’t posted?

    Thanks in advance for any guidance!

    #244266
    Chefranov
    Participant

    I tried, I installed bbPress, Block everywhere and Gutenberg 20.6.0 but it doesn’t work. If I don’t install Gutenberg plugin I get critical error on the site. If I install 20.6.0 then I don’t see reply window and see js errors:

    Store "core/interface" is already registered.
    
    Uncaught Error: You tried to opt-in to unstable APIs without confirming you know the consequences. This feature is only for JavaScript modules shipped with WordPress core. Please do not use it in plugins and themes as the unstable APIs will removed without a warning. If you ignore this error and depend on unstable features, your product will inevitably break on the next WordPress release.
    at t (implementation.ts:101:9)
    at 772 (index.min.js?ver=1.0.0:13:2251)
    at o (index.min.js?ver=1.0.0:34:44729)
    at index.min.js?ver=1.0.0:34:45918
    at o.O (index.min.js?ver=1.0.0:34:44999)
    at index.min.js?ver=1.0.0:34:45931
    at index.min.js?ver=1.0.0:34:45937

    #244247
    DragoWeb
    Participant

    Same notice here, with v2.6.13. So I patched includes/extend/buddypress/loader.php

    line 42 : esc_html__( 'Forums', 'bbpress' ),
    to : function_exists('esc_html__') && did_action('init') ? esc_html__( 'Forums', 'bbpress' ) : 'Forums',

    and line 119 : 'search_string' => esc_html__( 'Search Forums...', 'bbpress' ),
    to : 'search_string' => did_action('init') ? esc_html__( 'Search Forums...', 'bbpress' ) : 'Search Forums...',

    and it’s gone.

    I had several similar notices from different plugins, and I suspect WPML to cause this issue. I can’t deavtivate it because last time I did it was a complete mess 😅

    I don’t have much time to go further this now, but I saw this topic so I guess Bbpress is not causing it.

    #244200

    In reply to: Memory Leak?

    Chefranov
    Participant

    I tried this hack

    add_action('all', function($tag) {
        static $count = 0;
        if (strpos($tag, 'acf') !== false && $count++ > 300) {
            error_log('ACF hook overflow: ' . $tag);
            exit;
        }
    });

    and it response:

    [17-Apr-2025 10:10:24 UTC] ACF hook overflow: gettext_acf

    #244160

    Topic: Memory Leak?

    in forum Troubleshooting
    Chefranov
    Participant

    When I open Dashboard → Replies → Add new reply I get 500 error and this in php logs:

    [16-Apr-2025 13:27:10 UTC] PHP Fatal error:  Allowed memory size of 1073741824 bytes exhausted (tried to allocate 262144 bytes) in /Users/chefranov/Sites/mysite.loc/wp-includes/class-wp-object-cache.php on line 363
    [16-Apr-2025 13:27:10 UTC] PHP Fatal error:  Allowed memory size of 1073741824 bytes exhausted (tried to allocate 262144 bytes) in /Users/chefranov/Sites/mysite.loc/wp-includes/class-wp-fatal-error-handler.php on line 37
    #244114
    Robin W
    Moderator

    On the users, bbpress hooks to user_id’s, so in the database you would have a topic/reply author just held in the database as for instance 27, and then bbpress looks up the nicename for that in the user table, so no user in the table, then no name to display.

    On import with no ‘import users’ if the username does not exist it puts it as 0, and then it is displayed as ‘anonymous’

    So whist everything is possible if you can write code or know someone who can, there is no easy way to import usernames, as you would need to amend both the import code and the username display code.

    I have no experience of phpBB, so cannot comment on the other aspects. The importer was written some time ago by someone who no longer is actively involved in bbpress.

    #244084
    yosmc
    Participant

    Hi all,

    I’ve been doing a test run today to import my old phpBB board to bbpress, and it worked surprisingly well (as in: the whole process finished without hanging).

    In the end, though, I do have a number of problems, and I was wondering if anyone doing a similar import was able to solve them.

    – The old board has thousands of registered users (many of them spammers :/ ), and I didn’t want to clutter my WordPress install with all those accounts, especially since it’s a multisite install and I’m mainly migrating the board for archiving purposes. So I didn’t check the “import user accounts” box, but now all user names are just “Anonymous”. Any way to migrate the user names without the accounts?

    – It seems like quoted posts are broken, as the “bbcode_quote” tag isn’t applied where it should be.

    – Smilies aren’t imported properly. The relative path to the smilies is lost, and when there’s more than one smiley in a row, only the first one has an image tag.

    – [img] tags aren’t being properly converted either. Or rather the conversion seems to work ok, but after the actual link, the [img] code, which bbpress can’t read, is retained for some reason.

    – Like I said, overall conversion seemed to work well, but cluttered the error log with hundreds of these messages:

    PHP Warning: Trying to access array offset on value of type bool in /wp-content/plugins/bbpress/includes/admin/parser.php on line 1289

    Anything to worry about?

    – I understand that no attachments are imported by default, but maybe someone found a workaround?

    Thanks!

    #244067
    Robin W
    Moderator

    thanks for that – I think I understand 🙂

    so the function that is used to display replies is is held in

    \bbpress\includes\replies\template.php line 576`

    function bbp_get_reply_content( $reply_id = 0 ) {
    		$reply_id = bbp_get_reply_id( $reply_id );
    
    		// Check if password is required
    		if ( post_password_required( $reply_id ) ) {
    			return get_the_password_form();
    		}
    
    		$content = get_post_field( 'post_content', $reply_id );
    
    		// Filter & return
    		return apply_filters( 'bbp_get_reply_content', $content, $reply_id );
    	}

    so

    add_filter( 'bbp_get_reply_content', 'my_function', 10 , 2) ;
    
    function my_function ($content, $reply_id ){
    	//your code here 
    
    }
    #244065
    annually2523
    Participant

    A user posts a topic. That topic now has a couple of replies. We have implemented a standard of referencing other replies without quoting by simply using a hashtag and a number. Like ‘#5’ would be a reply to reply number 5 in the topic.

    We currently have a plugin (that I did not write but have access to) that upon ‘commit’ or save will analyse the content of the reply and convert all #[NUMBER] strings into anchor references to other replies before content is saved to db.

    This is just not very practical because when that same reply is edited the #[NUMBER] has now been wrapped in a tag to make it a link making editing the # part very annoying if that’s what users want to do.

    Instead we would like to make the analyses and the conversion of the reply when the readout from db happens. Or at least before any text/replies are shown. That means the code has to run on every reply every time it needs to be shown, but the content save is as the user saved it.

    Does that make any sense?

    #244064
    Robin W
    Moderator

    can you explain a bit more about what you are wishing to achieve.

    eg user posts a topic/reply/either? and then before being published
    automatic text is added – then same text each time
    Someone looks at the posts and does a manual edit
    some code looks for x and changes it to y
    nothing in the database is changed, but before any display soemthing happens?

    etc.

    #244033
    izzi8181
    Participant

    Thanks for the reply! Hmm I wonder if I’m misidentifying what’s a title… I took a quick look at one of the pages and the title that’s showing (for example on that shop page) is the title I’ve typed in when creating the page (as an H1). So I’m thinking that means “title” in this case means that actual page title that’s auto-generated, and that’s what’s being hidden everywhere including on the forum pages.

    I looked in the section you suggested and the “forum title area” toggle was on for both single pages and archives.

    I also checked all the other areas in “custom post types” and the “title area” was on for all of them.

    Is there a code snippet I could put in that would override whatever it is and show the titles on my forum pages? (it seems that I don’t want the title auto-populated on my other site pages).

    Thanks so much for the help!

    neon67
    Participant

    Perhaps someone will find it useful. This code does not load the system and saves the result in temporary storage.

    // Function to fetch the latest image from a topic
    async function fetchLatestImageFromTopic(topicUrl) {
        // Check if there is cached data and if it is fresh
        let cachedData = localStorage.getItem('latestImageData');
        let cachedTimestamp = localStorage.getItem('latestImageTimestamp');
        const cacheLifetime = 24 * 60 * 60 * 1000; // 24 hours
    
        // If there is cached data and it's fresh, display it
        if (cachedData && cachedTimestamp && (Date.now() - cachedTimestamp < cacheLifetime)) {
            document.getElementById('latest-image-container').innerHTML = cachedData;
            return;
        }
    
        // Request to the server to get the topic data
        try {
            const response = await fetch(topicUrl);
            if (!response.ok) throw new Error('Page load error');
    
            const text = await response.text();
            const parser = new DOMParser();
            const doc = parser.parseFromString(text, 'text/html');
    
            // Extract all replies in the topic
            const replies = Array.from(doc.querySelectorAll('.bbp-reply'));
    
            let latestImage = null;
            let latestDate = 0;
            let heading = '';
            let description = '';
    
            // Loop through all replies and find the freshest image
            for (let reply of replies) {
                const postDate = new Date(reply.querySelector('.bbp-post-meta .bbp-post-date').textContent).getTime();
                const img = reply.querySelector('img');
                
                if (img && postDate > latestDate) {
                    latestImage = img;
                    latestDate = postDate;
                    heading = reply.querySelector('h3') ? reply.querySelector('h3').innerText : '';
                    description = reply.textContent.trim().replace(heading, '').trim();
                }
            }
    
            // If an image is found, create HTML content
            if (latestImage) {
                const imgSrc = latestImage.getAttribute('src');
                const imgAlt = latestImage.getAttribute('alt') || '';
    
                const outputHtml = 
    
                    <div style="text-align: center;">
                        ${heading ? <code><h3>${heading}</h3></code> : ''}
                        <img src="${imgSrc}" alt="${imgAlt}" />
                        ${description ? <code><p>${description}</p></code> : ''}
                    </div>
                ;
    
                // Save the data in local storage
                localStorage.setItem('latestImageData', outputHtml);
                localStorage.setItem('latestImageTimestamp', Date.now());
    
                // Display the result on the page
                document.getElementById('latest-image-container').innerHTML = outputHtml;
            } else {
                document.getElementById('latest-image-container').innerHTML = '<p>No images found.</p>';
            }
        } catch (error) {
            console.error('Error:', error);
        }
    }
    
    // Call the function with the topic URL
    fetchLatestImageFromTopic('https://www - yours - topic');

    How This Code Works:
    Cache Check:

    First, we check if there is any cached data in localStorage.

    If the data exists and is still fresh (within the last 24 hours), we display it on the page.

    Server Request:

    If there is no cache or it’s outdated, we send an AJAX request to the server to retrieve the topic data.

    We only need to parse the HTML content to extract images and publication dates.

    Finding the Freshest Image:

    We loop through all the replies and extract the image and publication date.

    If the date of the current reply is more recent than the previous one, we update the image and data.

    Caching the Result:

    After finding the freshest image and associated content, we save the result in localStorage so we don’t need to make repeated requests.

    Displaying the Result:

    We display the result on the page, including the image, heading (if available), and description.

    Where to Place This Code?
    HTML: Insert this code within a <script> block on the page where you want to display the image.

    #243747

    In reply to: Close topic label

    uksentinel
    Participant

    This is what I ended up using and seems to work well. If others are looking for CSS code that adds a “CLOSED” visual reference to the beginning of TOPICS Titles that have been closed, then try this and tweak to suit if needed.

    /* Add a “Closed” label to closed topics in bbPress */
    .status-closed .bsp-preview::before {
    content: “Closed”;
    background-color: #ff0000; /* Red background for visibility */
    color: #ffffff; /* White text color */
    padding: 2px 6px;
    margin-right: 10px;
    border-radius: 3px;
    font-size: 0.9em;
    font-weight: bold;
    }

    Example;
    https://uktechhub.com/wp/wp-content/uploads/2025/03/UKTH-Closed-Topic-icon.png

    #243738
    grem2016
    Participant

    Hi Robin,
    No, it was myself, some 8-years ago, when I added the forum. Since then we’ve added WP page content, images etc, and I’ve just kept it updated. The addition of the single BBpress forum on one page was very simple using the shortcode “bbp-single-forum”, with no other changes that I recall. Eventually I hope to remove all visible log-in possibilities, relying only on c-panel admin access for update/maintenance purposes.
    Maybe I’m missing something here, and removal of the site log-in widget will also remove the login option on the forum page. Did you already take a look to see what I mean? Under the “memories shared” tab, you will see further tabs, one of which is Forum, and that is where the other Login/register section is, below the forum topics. It is this part I would like to see removed so that the page is cleaner.
    Is that possible?
    Thanks in advance,
    Graham.

Viewing 25 results - 1 through 25 (of 32,395 total)
Skip to toolbar