Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 2,276 through 2,300 (of 32,467 total)
  • Author
    Search Results
  • #215093
    Robin W
    Moderator

    The $subs = explode(',' , $subs); turns the string in the database to an array.

    Can you confirm for the user selected that they have active subs?

    #215092
    athep
    Participant

    I have included $subs = explode(',' , $subs); and it’s returning nothing, it has no error or any output..

    The other error was Warning: in_array() expects parameter 2 to be array, bool given in ..../content-main.php on line 21

    Line 21 is <?php if (in_array($forum_id, $subs)) { ?>

    #215091
    Robin W
    Moderator
    <?php global $current_user; get_currentuserinfo(); $uid = bbp_get_current_user_id(); ?>
    <?php if ( bbp_get_user_forum_subscriptions( $uid ) ) : ?>
    <?php $subs = bbp_get_user_forum_subscriptions( $uid ) ; ?>
    <?php $subs = explode(',', $subs);
      <?php while ( bbp_forums() ) : bbp_the_forum(); ?>
      <?php $forum_id = $bbp->forum_query->post->ID; ?>
    	<?php if (in_array($forum_id, $subs)) { ?>
        <p><?php bbp_forum_title(); ?></p>
    	<?php } ?>
      <?php endwhile; ?>
    <?php endif; ?>
    #215090
    Robin W
    Moderator

    hold on you haven’t got the line

    <?php $subs = explode(',', $subs);

    #215088
    athep
    Participant

    Same error indicating this line <?php if (in_array($forum_id, $subs)) { ?>

    #215087
    Robin W
    Moderator

    try

    <?php global $current_user; get_currentuserinfo(); $uid = bbp_get_current_user_id(); ?>
    <?php if ( bbp_get_user_forum_subscriptions( $uid ) ) : ?>
    <?php $subs = bbp_get_user_forum_subscriptions( $uid ) ; ?>
      <?php while ( bbp_forums() ) : bbp_the_forum(); ?>
      <?php $forum_id = $bbp->forum_query->post->ID; ?>
    	<?php if (in_array($forum_id, $subs)) { ?>
        <p><?php bbp_forum_title(); ?></p>
    	<?php } ?>
      <?php endwhile; ?>
    <?php endif; ?>
    #215086
    athep
    Participant
    <?php global $current_user; get_currentuserinfo(); $uid = bbp_get_current_user_id(); ?>
    <?php if ( bbp_get_user_forum_subscriptions( $uid ) ) : ?>
    <?php $subs = bbp_get_user_forum_subscriptions( $uid ) ; ?>
      <?php while ( bbp_forums() ) : bbp_the_forum(); ?>
      <?php $forum_id = bbp_get_forum_id( $forum_id ); ?>
    	<?php if (in_array($forum_id, $subs)) { ?>
        <p><?php bbp_forum_title(); ?></p>
    	<?php } ?>
      <?php endwhile; ?>
    <?php endif; ?>
    #215085
    Robin W
    Moderator

    can you post your corrected code

    #215084
    athep
    Participant

    There were a few syntax errors I fixed with your code, and the error message ends with the files location stating that the error comes from the line ‘<?php if (in_array($forum_id, $subs)) { ?>’

    Your second snippet returns null, nothing, maybe bbp_forum_title() won’t work in this context?

    #215081
    athep
    Participant

    Hello Robin, thank you for your reply. I got this error Warning: in_array() expects parameter 2 to be array, bool given in... I’d appreciate helping me figure it out if possible

    #215079
    Robin W
    Moderator

    untested but something like

    <?php global $current_user; get_currentuserinfo(); $uid = bbp_get_current_user_id(); ?>
    <?php if ( bbp_get_user_forum_subscriptions( $uid ) ) : ?>
    <?php $subs = bbp_get_user_forum_subscriptions( $uid ) ; ?>
      <?php while ( bbp_forums() ) : bbp_the_forum(); ?>
      <?php $forum_id = bbp_get_forum_id( $forum_id ); ?>
    	<?php if (in_array($forum_id, $subs)) { ?>
        <p><?php bbp_forum_title(); ?></p>
    	etc.
    	<php } ?>
      <?php endwhile; ?>
    <?php endif; ?>
    #215072
    athep
    Participant

    Hello everyone,

    I have this loop in my custom theme that lists the forums a user is subscribed to

    <?php global $current_user; get_currentuserinfo(); $uid = bbp_get_current_user_id(); ?>
    <?php if ( bbp_get_user_forum_subscriptions( $uid ) ) : ?>
      <?php while ( bbp_forums() ) : bbp_the_forum(); ?>
        <p><?php bbp_forum_title(); ?></p>
      <?php endwhile; ?>
    <?php endif; ?>

    I’m not sure if it is the most efficient technique but it is working fine.

    Now I’m trying to retrieve the topics under those forums, if I’m subscribed to forum a and not b, how can I retrieve all the topics of only forum a?

    #215071
    xavierissac94
    Participant

    Hi is there is any way to show success message like. “New topic submission succesfully”, once topic is submited. I am using ‘[bbp-topic-form]‘ shortcode to display topic form. But i want to display message once topic is submitted suceesfully.

    Is there is any way to acheive this

    #215059
    purityboy83
    Participant

    Hi

    I have a lot of plugins installed on my site.

    Let me know if you have anything to check more

    Best Regards,
    Hyunho

    ================

    301 Redirects

    Activity Log

    Advanced Access Manager

    Advanced Editor Tools (previously TinyMCE Advanced)

    Advanced TinyMCE Configuration

    All In One SEO Pack

    Automatic Copyright Year

    Awesome Weather Widget

    bbp style pack

    bbp User Ranking

    bbPress

    bbPress – Private Replies

    bbPress forum utility pack

    bbPress Permalinks with ID

    bbPress Profile Link Shortcode

    bbpress Simple View Counts

    bbPress Toolkit

    Classic Editor

    Favicon by RealFaviconGenerator

    GD bbPress Attachments

    GD bbPress Tools

    Hide Admin Bar From Front End

    Hide My WP Ghost Lite

    Image Upload for BBPress

    Link Widget Title

    Log Out Shortcode

    MangBoard WP

    Members

    Nav Menu Roles

    Pages In Widgets

    Post/Page specific custom CSS

    Search & Replace

    Shortcode in Menus

    Shortcode Widget

    SiteOrigin CSS

    Smush

    Stylist

    Timeline Express

    User Registration

    Wordfence Security

    WP 2FA – Two-factor authentication for WordPress

    WP OPcache

    WP RSS Aggregator

    WP Statistics

    WP-Optimize – Clean, Compress, Cache

    WPForce Logout

    broken link check

    buddyPress

    ================

    #215058
    Robin W
    Moderator

    and then same shortcode on every topic page, and above or below the reply form ?

    #215047
    sflwa
    Participant

    I’m referring to what is referenced this – https://codex.bbpress.org/getting-started/forum-moderation/common-tasks/

    In the frontend

    Log into your site and go to your forums on your site
    If you need to delete a topic, go into the topic and hit the Trash Admin Link to put the topic into the trash.
    Now you will see that the trash link has turned to the Delete Admin Link , and from there you can click Delete to delete the topic permanently.

    So once you click trash it turns red and then the link changes to delete which is “empty trash” for that one item

    #215044
    kriskl
    Participant

    I use “bbPress Do Short Codes” plugin

    maybe it will help

    #215023

    In reply to: Sort topics in a Forum

    Robin W
    Moderator

    I’ve taken a look, and yes lots of code changes to get replies in reverse order, and currently too much of a challenge to try and do !

    Sorry !

    #215003
    Daniel J. Lewis
    Participant

    Don’t you hate it when people post questions and forget to share the answers they found?

    It’s been a few years now, but I think I remember what I did. I copied the template into my theme so I could override it. There, I modified it so it would add the post tags (like spoilers as CSS classes to those posts. Then, I modified my CSS and JS to black-out the title until clicked.

    I’m sorry I can’t provide the exact code, but maybe that helps point you in the right direction.

    #215000

    In reply to: Log In page

    Robin W
    Moderator

    ok, so I’ve created a shortcode that should do this

    I’ve added this to my bbp-style-pack plugin

    bbp style pack

    once activated go to

    dashboard>settings>bbp style pack>shortcodes

    and you’ll see how to add the shortcode there

    #214996
    laetee
    Participant

    @robin-w I just installed and activated and it works. Thanks for your help.

    I also didn’t realize you were the author of the style pack plugin, which I also have activated. This is the first real fix that has actually worked for me, so adding it to the trac ticket and your styling plugin would be most helpful to others, I would imagine.

    Thanks again for your help on a rainy day.

    Side note, how would I go about keeping this updated if for some reason you can’t? I’m guessing it has something to do with keeping the code updated, yes?

    #214986
    Robin W
    Moderator

    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

    Code Snippets

    #214970
    truth4vahid
    Participant

    How can I insert short codes under topic pages?

    englishteam.ir

    #214969
    Robin W
    Moderator

    so rainy afternoon, so I have wrapped wpup’s code into a plugin, and fixed a couple of things that were different.

    This plugin technically works, but without creating multiple threads I can’t really test !

    so if anyone fancies trying it out, feel free and let me know if it does what it is supposed to.

    and sorry @xprojectsx – I am just putting it out there, I don’t promise to fix it if it doesn’t work, but am happy to take a look, and I don’t promise to maintain it – you download and use on this basis !

    If it does work, I’ll add it to the trac ticket for this thread, and maybe add it to my style pack plugin bug fix page.

    bbp threaded replies

    #214967
    Chineseand
    Participant

    For other for future reference, it turned out to be a CSS issue, but could be overridden with this small fix:

    .bbp-admin-links {
    Bottom : 0px !important ;
    }
Viewing 25 results - 2,276 through 2,300 (of 32,467 total)
Skip to toolbar