Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 21,001 through 21,025 (of 32,517 total)
  • Author
    Search Results
  • #89472

    do_action( ‘bb_update_topic’, $topic_id ); actually is fired after all the db stuff and not before. Given the code of bb_insert_topic we have:

    You’re a Legend.

    Once again, Thank You.

    I thought it might, but thats at least me down to 4 non-supported major features in my code:

    1) Update family tree upon adding/removing forums or changing forums order

    (the code is there, the trigger isn’t – right now I’ve just got a reminder in the readme and added it to the daily cron job on my servers)

    2) Gives accurate counting for parent child relationship in terms of “total” forums/topics/posts/voices.

    (Again, code is there and working, and runs on “recount”, but should also be activated upon adding/removing forums or changing forums order)

    3) Addition of “Groups” instead of categories. Again, this is written and working, but I’d need to come up with some form of changeover script.

    (Apparently to group forums together, you need to make it’s parent read only. But if you want to make a forum read only but not a ‘header/category/group’ you can’t. Don’t get me wrong it was a great hack by _ck_ when 0.8.3 came out, but man, why roll it into the core without any actual thought!! 0.8.3 was 3 years ago.)

    4) Rewrite hooks for moderation to comply with other plugins (specifically to play nice and read yours and Nightgunner5’s), as right now it only natively reads my own plugins, which is daft.

    #89434
    zaerl
    Participant

    Yes I know. Unfortunately I had to fight with that piece of code also in my plugin zaerl Visibility. bbPress doesn’t allow zero forums.

    #89471
    zaerl
    Participant

    I’m basically wanting to know when someone changes the name/title of a topic. Which seems very simple to me (in theory).

    do_action( 'bb_update_topic', $topic_id ); actually is fired after all the db stuff and not before. Given the code of bb_insert_topic we have:

    db update

    bb_update_topic

    bb_insert_topic

    in that order. If you intercept bb_update_topic the db must be already updated. At least if there isn’t something evil inside wp_cache_*

    If you want something that works before the database is updated. See this:

    add_filter('pre_topic_title', 'foo', 10, 2);

    function foo($topic_title, $topic_id)
    {
    global $bb_post;

    if($bb_post) echo "You changed me. How dare you.";

    return $topic_title;
    }

    but keep in mind that I’m not proud of this code nor I have run it. What actions do you want to take when a topic is renamed? You want to filter away the new title, changing the slug or what?

    I’m really not a fan of the colours and layout, but I love that you’ve done so much with it and have a thriving community. From what I can see, signatures and image posting are working really well for you as have Avatars etc.

    While my personal taste preffers your Kate Humble forums, its great to see you and your forums doing so well!

    Keep us notified of any changes you make too, and well done :)

    #89433

    oh for goodness sake, that code bug is really getting on my tits.

    Driz, the main thing to remember is this. these forums are aimed at making the WordPress support forums. Once you try and venture outside the functionality they have, you’re going ot hit issues which will need you to be able to read/write/investigate the source PHP files.

    #89432

    Ok, so you’re trying to do something that bbPress can’t natively do.

    You’re presuming, and we can all see why, that because this is forum software that it has native parent/child relationships; when it doesn’t really.

    I’ve always found the best thing to do is to write my own forum subroutine in a page.

    if ( bb_forums( $forum_id ) )

    {

    while ( bb_forum() )

    {

    global $forum;

    global $forum_id;

    print_r($forum);

    // I output my own code here using

    // $forum->forum_name

    // $forum->posts

    // To show children of forum

    if($forum->forum_parent == $forum_id || empty( $forum_id))

    {

    //Output code here, it’s a child or you’re on the front page

    }

    }

    }

    To re-iterate, I’m coding the above from memory, so if there are errors you’ll need to check them yourself :)

    #89470

    Wonderful Zaerl mate.

    Issue 1:

    bb_new_post and bb_new_topic actually cause me a world of issues, because they’re fired before all of the SQL/PHP is fired. It took me about 2 days to work out my copy and pasted SQL was producing different results in the PHP and the actual database.

    In the end, I had to move those functions to add_action('bb-post.php') and then test if a topic was passed or not.

    (I’m guessing a little that this might have something to do with the wp_cache functions, as in certain places we call wp_cache_flush and wp_cache_delete before the bb_new_post actions)

    bb_update_post though seems like its exactly what I want, though am a tad concerned that the same thing will happen – at least if I have access to $_POST I can hack it.

    I’m basically wanting to know when someone changes the name/title of a topic. Which seems very simple to me (in theory).

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

    The second one is a bit more tricky.

    I basically have a (half-baked) plugin that deals with the geneology of a forum, with true parent/child n-to-n relationships. For my non-flat websites, this (again half-hacked) plugin has really made my life easier.

    Before I release it, I want to make sure I’m covering as many bases as possible, and these have been outstanding bugs for about a year now.

    Whenever someone reorders their forums, or adds a new forum, or marks a forum as hidden; I’d like my plugin to know about it. Basically, I want my plugin to be fired AFTER the core has finished what it’s doing, and we’ve no action for that.

    But there’s no action or pluggable function that gets called after, thre is only bb_check_ajax_referer and thats called before any processing.

    I really apprecaite your help Zaerl mate, if you can think of anyhing else – please shout!

    #89431
    driz
    Member

    This only works for forums that have subforums. If I have a forum that is just top level and has no subforums when I view it it blows up saying Invalid argument supplied for foreach() in /nfs/c03/h05/mnt/52704/domains/paperviewmagazine.com/html/forums/bb-includes/functions.bb-forums.php on line 84

    If I switch the original if statement on instead it doesnt break, so it’s defo the new code. Any ideas? Thanks

    #89469
    zaerl
    Participant

    I have a plugin that needs to be fired when someone edits a post.

    bb_update_post, bb_new_post respectively. Post ID is passed.

    Now beware of the magic (?) hack. Given case 'order-forums' : you can use the the action fired by bb_check_ajax_referer:

    do_action('bb_check_ajax_referer', $action, $result);

    if $action == 'order-forums' then you are in that particular case.

    Now you can read $_POST or accessing other actions. What do you want to do?

    p.s. at least in this way God doesn’t kill a kitten.

    #89430
    zaerl
    Participant

    if(bb_forums(array(‘where’ =] “where forum_parent = $forum_id”)))

    Substitute the square bracket ] with the angular bracket. For great justice.

    #89429
    driz
    Member

    I tried the code zaerl posted, but it when viewing forums it requires the $forum_id within the function to display the correct stuff otherwise it will show the same as the front page and not the selected forums subforums. I need to use $forum_id with the array posted so I only get the top level forums within the chosen forum.

    I tried doing this to see if it would combine the two:

    if(bb_forums($forum_id, array(‘where’ => ‘where forum_parent = 0’)))

    but it just showed all the forums for that forum and not just the parents

    #89428

    What code did you try on the sub forum pages nad we can try and help :)

    #89446
    mr_pelle
    Participant

    Prepend this code to line 233 of functions.bb-template.php:

    if ( 'favorites' != $item[4] )

    #89479

    What I’m looking for is to have a simple forum integrated with my WP installation. It seems like bbPress is the perfect choice but now I’m not so sure

    If you want a “simple forum” then bbPress fits that need.

    If you want single sign on with your WordPress install, then bbPress is probably the best out there.

    as of yesterday I’ve heard of buddypress… and now I’m confused

    Yeah, we have to explain this every day to someone.

    Truly wish anyone with Documentation rights would maybe save this as a sticky or maybe in the documentation section or something…

    BuddyPress and bbPress are not connected.

    BuddyPress allows you to install a forked version of bbPress. It is not the same as this bbPress. We don’t know why they kept the name. We don’t know why they don’t publicise that they are different. If you use BuddyPress in any way, we can’t help you on this forum.

    It seems like the two products are made by the same people, are intended for similar purposes, but some people have both installed

    BuddyPress is ‘like’ a WordPress plugin, in the same vein of a fancy WooTheme or Thesis framework. Its like an additional layer onto which other plugins can be installed.

    About a year ago the BuddyPress team, under the great coding skills and direction of Andy Peatling (http://apeatling.wordpress.com/) forked and ported a version of bbPress to be run as a BuddyPress plugin.

    So bbPress and BuddyPress are two different products, with different aims and goals, and some people can have both installed – just not this version of bbPress.

    On top of that it seems like support for bbPress is waning

    Yes.

    But it will not go away or die. It runs the Automattic support forums, so its not going anywhere. It will be ported to a WrodPress plugin at some stage. Other than that sentance, we have no information on that.

    If what you need is a forum, use bbPress.

    If you need to build a social network (friends, groups, private messaging, activity) then use BuddyPress.

    Thats basically it :)

    #34472

    Hello folks,

    I was hoping that someone could point me in the direction of an ACTION that occurs on the following pages so that I can hook my plugin into them without hacking the core:

    bb-edit.php

    I have a plugin that needs to be fired when someone edits a post.

    Forum layout update

    In the backend we do it all through AJAX (how wonderful), except we call the following page bb-admin/admin-ajax.php and the following sections (via a switch statement): add-forums and order-forums.

    Except, no actions there to call either. And yes, to the best of my ability, I’ve stuck with the code the whole way through all the functions they call. I’ve yet to find a pluggable one.

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

    I realise that my phrasing is sometimes considered combative, and I apologise for that, but are we seriously suggesting that at no point is the ability to add/edit/control/order our forum pluggable in anyway; and the same for the editing of a forum post??

    I’m more than happy to be wrong here, because right now I’m having one of those “bbPress moments” where you’re not quite sure if you’re losing your marbles or if whoever decided to make these not pluggable is.

    Thanks for the help

    #89426
    driz
    Member

    Cool works great. How do I do the same for the sub forums page where the tag looks like this:

    <?php if ( bb_forums( $forum_id ) ) : ?>

    #89443
    gerikg
    Member

    you can start with:

    add to your style.css

    #favorite-toggle{display:none;}

    The three tabs will still show up but the option to add to favorites option won’t show up on the posts.

    open profile.php

    line #25 that starts with

    <?php if (bb_current_user_can( 'edit_favorites_of', $user->ID )) : ?>

    add BEFORE

    <!--

    line #27

    <?php endif; ?>

    add AFTER

    -->

    I don’t know how to edit the three tabs.. sorry

    #89440
    cv3t
    Member

    Do not prompt where?

    p.s I already everywhere searched find a code could not…

    #85809

    Hi Gideons,

    Mate, with respect, these aren’t really bbPress issues, it’s an issue with an independant theme given away some 2-3 months ago.

    It sounds to me like a basic web design CSS issue, thats outwith teh scope of this board, but if you’re still struggling, please contact the theme author at: http://www.jasonmorehouse.com/bbpress-vanilla-theme

    :)

    #85807

    Hi Gideons,

    I suggest you talk to the author directly at http://www.jasonmorehouse.com/bbpress-vanilla-theme

    :)

    #89424
    zaerl
    Participant

    Open front-page.php. Locate:

    if(bb_forums())

    (line 47 in kakumei) change it in:

    if(bb_forums(array('where' => 'where forum_parent = 0')))

    Have a nice day.

    #89422

    You’ll need to code a custom loop for that I’m afraid.

    #34467
    driz
    Member

    I want to show only the very top level forums on my front page. I have tried:

    <?php if ( bb_forums("depth=1") ) : ?>

    But that didn’t work and all the forums still show up. I only want to show the very top level, so for example if I have the following forums:

    Main
    - Sub Forum 1
    - Sub Forum 2
    --- Sub Forum 2.1
    --- Sub Forum 2.1
    - Sub Forum 3
    Community
    - Sub Forum 1
    - Sub Forum 2
    --- Sub Forum 2.1
    --- Sub Forum 2.1
    - Sub Forum 3

    Only Main and Community would appear on the home page.

    Thanks.

    #89409
    gerikg
    Member

    If you want it like this site…. An easy way to do it is…

    the front page of the default theme is broken into two parts.

    If you open front-page.php serach for these div codes, everything on the left is between “id=”hottags” role=”main””

    Everything on the right is between “div id=”discussions”” JUst move what you want in them.

    All you have to do is adjust the width/margin of both css styles.

    style.css (line 285) #front-page #hottags for the left side change the width

    style.css (line 293) #front-page #discussions change margin left to be 20px more than what you pick for the left column width and the width to fit.

    (Why doesn’t this site have a demo on bbpress! I hate changing my theme back to default to answer questions!)

    #89391
    mr_pelle
    Participant

    Solved. =)

Viewing 25 results - 21,001 through 21,025 (of 32,517 total)
Skip to toolbar