Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 12,826 through 12,850 (of 32,506 total)
  • Author
    Search Results
  • #141766
    Shmoo
    Participant

    Just curious as I’m not a PHP-er and learning each day.

    What I’m trying to make is a front-end tab-system that shows three tabs
    Tab [1] = Topics
    Tab [2] = Replies
    Tab [3] = Refresh, just a reload of the page

    bbPress list latests - Topics and Replies

    Topics,
    This should be a very easy query-/loop in general, it’s just a list of all new topics that have been added to my forum. There’s only one little thing, it should order at the date of creation so that when an older topic gets a reply it doesn’t bounce to the top of the list.

    Replies,
    This should be a query for latests updated topics of any age, if a topic of 5 years old receives an update or bounce it should jump to the top of this list. + newly or older created topics without replies shouldn’t get listed inside this second ‘Replies’ tab.

    I came up with this idea:

    
    <?php if ( bbp_has_topics( array( 'show_stickies' => false, 'order' => 'DESC', 'posts_per_page' => 120, 'max_num_pages' => 1 ) ) ): ?>
    <?php while ( bbp_topics() ) : bbp_the_topic(); ?>
    	<?php if ( bbp_get_topic_reply_count() ) {
    	 bbp_get_template_part( 'last-topic-activity/last-replies-loop' );
    	} ?>
    <?php endwhile; ?>
    <?php endif; ?>
    

    posts_per_page => 120 is a little bold but it’s just for testing right now.
    Just curious if this is okay to work with, I found the bbp_get_topic_reply_count() function and it has a True or False statement so I thought lets just check if the topics have a reply_count … if it’s true than list a bunch of stuff through the custom-loop template I made.

    Hope somebody can verify if this is okay, it looks like it’s working.

    #141764
    sarau
    Participant

    I’m using WordPress version 3.8.1 (the latest as of this writing) and bbPress version 2.5.3 The url wouldn’t show the problem since the forum is private and you would only see “Oh bother! No forums were found here!” on the page as a non-logged in non-member of the site. This question also relates to the WordPress dashboard rather than the site itself. I’ve given a user on the site the bbPress role of Moderator with the expectation that he should be able to set up new forums, however, when he logs in, he can only see/access topics, replies and profile in the WordPress dashboard. There is no link to “Forums” where he can add new ones. Why is this the case when according to the roles information on this page: http://codex.bbpress.org/bbpress-user-roles-and-capabilities/ a Moderator “can create and edit forums. Can create, edit and delete other users’ topics and replies. Can manage Tags, and moderate a forum with the moderation tools”?

    #141760
    #141759

    In reply to: Thousands of revisions

    inspirationally
    Participant

    Fugettaboutit – some more hours passed by and they still are there. So that wasn’t the reason.

    CUrious is, that, at least for me, the URLs (guid) of the revisions are like
    http://deppheads.com/general/2014/01/24/303815-revision-v1/

    with post parent being this
    http://deppheads.com/forums/reply/303815/

    while even those spam replies have an url like this
    http://deppheads.com/forums/reply/711501/

    so they are getting normal posts in the general category (my default one)

    #141758
    Matthew
    Participant

    This is what I have so far

    add_action( 'wp_before_admin_bar_render', 'my_tweaked_admin_bar' ); 
    
    function my_tweaked_admin_bar() {
        global $wp_admin_bar;
    
        $wp_admin_bar->remove_menu('edit-profile');
    
        $wp_admin_bar->add_menu( array(
                'id'    => 'edit-profile',
                'title' => 'Edit My Profile',
                'href'  => site_url(''),
                'parent'=>'user-actions'
            ));
    }
    
    #141757
    avgmatt
    Participant

    Thanks. I was hoping it was that easy. Is there a list of bbpress shortcodes somewhere?

    #141754

    The easiest way to do this is to make a WordPress page with the same slug as your forum root. bbPress will see that page and yield to it, letting it render instead of your forums.

    In that page’s content, use the bbp-forum-index shortcode, along with any other HTML, shortcodes, or whatever else you want there. You can get really fancy with your forum index using modifications in a child theme, custom template parts, page templates, forum archives, etc…

    #141752
    avgmatt
    Participant

    I have my forum all set up about how I want it and I am using the stock root /forums as the forum front page. How do I go about adding to the main area above and below the forum? I would like to add items such as banners or use shortcodes for topic info. Where would this root page file be located?

    Thank You
    Matt

    http://averageoutdoorsman.com/forums/

    #141750

    bbPress comes with widgets and a shortcodes to help with rerouting logins and sign-ups (which are what we use here on bbpress.org), but you’ll likely want to look into other third party plugins for actually taking over and controlling the stock experience.

    • bbp-login
    • bbp-register
    • bbl-lost-pass
    #141744
    Stephen Edgar
    Keymaster

    At a quick glance I’m quite sure bbPress could do everything that you mention above, just not out of the box will it do those things.

    You would need to make these customizations yourself or hire a programmer to do them for you.

    The ‘threaded “hierarchal tree-style” would just be a matter of making some custom templates and would be quite quick. To setup the different theme for different users I think there are a few WordPress plugins that let your users choose what theme they want to use, so have two themes, one with the default bbPress theme (with or without customizations, and the other theme with your customized “hierarchal tree-style” templates.

    There are some docs on getting started with custom templates https://codex.bbpress.org/theme-compatibility/

    #141705
    beaulahsmithzeiler
    Participant

    Hi guys. New at this. How do I make use of the lost password shortcode without creating a new page on the menu? I am using the express widget that allows users to register,log in and lost password. I have a page for register,so it redirect the user to that page to register. But I don’t want a page in my menu for lost password although I want to offer it to the user.

    #141696
    Stephen Edgar
    Keymaster

    Is your SMF database on the same database server that your WordPress instalation is setup with?

    If not your webhost should have some docs on how to export/backup your database.

    Then follow the similar docs on your new webhost to import the database if needed.

    Then follow the basic steps outlined here https://codex.bbpress.org/import-forums/

    There are also a couple of topics here on bbPress.org relating to SMF that you should be able to find pretty quickly.

    #141682
    Stephen Edgar
    Keymaster

    Not a solution but go to Admin > Tools > Export and export your replies.

    These files will be in XML format, open each one up in your favorite text editor and check what is or isn’t there.

    Now, are you actually missing content that should actually be there or are is it just the replies are not being shown on the site?

    #141680
    PCTP
    Participant

    Are there any other options … plugins, for example, that will change the look of the forum, but not the theme? I would have no idea where to place the filter codes and not even sure how that would change the forum look.

    #141676

    Pretty strange. You could try recounting the replies in Admin > Tools > Forums though there’s no reason they would all disappear without some outside intervention.

    #141672
    Robin W
    Moderator

    Markic,

    Thanks for posting these – I’ve added them to the codex documentation at

    Layout and functionality – Examples you can use

    as items 6 & 7

    Regards

    Robin W

    #141649

    In reply to: Help with error

    Roitduck
    Participant

    Hi again,
    It worked before, but stopped after i made some changes in the code. But i can’t find the error or where in the code the problem is. I’ve also updated to the new version of bbpress, do you think it has any effect?

    #141648
    koendb
    Participant

    Ah, sorry @shmoo or @macpress: forgot to add the filters:

    add_filter( 'bbp_get_time_since', 'short_freshness_time' );
    add_filter('bp_core_time_since', 'short_freshness_time');
    #141647
    Markic
    Participant

    First of all, I’m not asking any questions, I’m offering solutions for people who, like me, had these specific problems, are googling for a solutions and can’t find any. Some of you think this is pure amateur stuff, but there are people out there who will spend hours trying different things and this can save them so much time. If you want to delete this topic, I don’t care, I’m here to help…

    How to load bbpress.css before your yoursheet.css?
    Intro: When WordPress is loading stylesheets, they’ll load all the theme .css files first and then they’ll load plugin css. That way plugin css has higher priority than your css and only way you can override it is with !important. As we all know, that is a bad practice.

    Also, you can create your own bbpress.css in your theme but that means more files to keep up with (although, that’s the cleanest solution). Here’s another way to do this:

    paste this code into functions.php…

    if (class_exists('bbPress')) {
    add_action( 'wp_print_styles', 'deregister_bbpress_styles', 15 );
    function deregister_bbpress_styles() {
    wp_deregister_style( 'bbp-default' );
    }
    wp_enqueue_style( 'bbpress_css', plugins_url().'/bbpress/templates/default/css/bbpress.min.css');
    }

    So, let’s get into details:
    – first, if you have active plugin ‘bbPress’ it will exicute the following code which removes all the .css files from it
    – second, it loads bbpress.min.css again, but this time where you want it…
    – be sure that you enqeue your stylesheet after this code

    Note: there are two problems that might arise from this techique
    -if bbPress developers decide to rename, remove or split bbpress.min.css, you’ll have to change the code again
    -there’s other .css file named “bbpress-rtl(.min).css”. Well, some cultures (Arabic), read and write from right to left. And what this file aligns everything to the right. bbPress has some system of deciding whether it should load this file or not, but by doing this technique, you’re disabling that system.

    How can I remove all the breadcrumbs from the templates and set them at the top of the page?
    Intro: Many of us are creating our own themes with existing breadcrumbs systems which are in the header. But bbPress has it’s own idea where to display breadcrumbs, and sometimes that’s at the top of the page, sometimes that’s below search form and sometimes it’s below title. Here’s how you can change that quickly.

    1. If you haven’t, create “bbpress.php” in the root folder of your theme. (You can copy-paste page.php)
    2. Add
    <div class="truebreadcrumbs"><?php bbp_breadcrumb(); ?></div>
    where you wan’t to show your breadcrumbs
    3. Add this CSS:

    div.bbp-breadcrumb {
    display: none; /*this will hide all breadcrumbs*/
    }

    .truebreadcrumbs div.bbp-breadcrumb {
    display: block; /*this will display breadcrumbs you've created*/
    }

    Sure, HTML will still generate all the breadcrumbs and css will hide the unwanted ones, but this is the easiest way to do this without going into templates…

    #141644
    koendb
    Participant

    You could change your forum lay-out with a template and let your other pages stay the same. It’s going to be though to achieve this result without ANY coding languages. Even when you use other’s code you’ll need to change the .css to change the colors etc.

    If you however decide to try it yourself, you should start reading here.

    #141639
    Shmoo
    Participant

    Try this.

    Your HTML and CSS isn’t very pretty but this will do the trick I believe.

    
    .type-reply.user-id-1 {
         background: #91CDEA;
         border-top: 1px solid #BEC3C7;
         border-bottom: 1px solid #BEC3C7;
         overflow: hidden;
    }
    

    Btw, if you have copied the default bbpress.css stylsheet from the plugins folder to your own theme ( wp-content/themes/your-theme-name/css/ ) folder you can edit and customize that new bbpress.css file. You don’t have to place all your custom CSS inside the style.css – just customize the bbpress.css inside your theme folder.

    Right now you’re working too much with the !important; attribute just trying to overwrite default stylings while it’s not needed if you simply customize the bbpress.css stylesheet.

    #141624
    koendb
    Participant

    Thanks Shmoo!
    I added this filter, don’t remember where I found it:

    function short_freshness_time( $output) {
    $output = preg_replace( '/, .*[^ago]/', ' ', $output );
    return $output;
    }
    
    add_filter( 'bbp_get_time_since', 'short_freshness_time' );
    add_filter('bp_core_time_since', 'short_freshness_time');

    Shall we leave this thread to Mycelus now? Feel free to PM me or open your own.

    #141623
    Shmoo
    Participant

    Well try using your browsers Web inspector that will guide you through your code and gives you a visual image of where and what you can change because every site can be different.

    This is an old video but I think every browser today has an Inspector inside it by default. It gives you an idea of how you can spot some HTML classes and what you should target to change.

    #141621
    Shmoo
    Participant

    Try adding this to your CSS.

    
    .type-reply.user-id-1 { background: #ff000; }
    

    Change the number 1 in the line above with the user_ID number of your admin-/moderator user-id-1

    #141619
    Shmoo
    Participant
Viewing 25 results - 12,826 through 12,850 (of 32,506 total)
Skip to toolbar