Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 20,751 through 20,775 (of 32,517 total)
  • Author
    Search Results
  • #86239
    zaerl
    Participant

    Hi Kevin. I found a “solution”. But I’m not proud of my code:

    add_action('bb_topic.php', 'the_function');
    add_action('bb_edit-post.php', 'the_function');
    add_action('bb_forum.php', 'the_function');
    add_action('bb_front-page.php', 'the_function');
    add_action('whatever_other_template_page.php', 'the_function');

    Basically speaking I hook those template pages that I need. The files in the root folder call:

    bb_load_template('template_file.php', some_stuff);

    in the very last line. That function calls the action bb_template_file.php, include() template_file.php and than calls the action bb_after_template_file.php

    Maybe there’s a better solution. I’m not a bbPress expert.

    #90551
    zaerl
    Participant

    Quoating and Posting reply: https://bbpress.org/plugins/topic/ajaxed-quote/

    Allowed quicktags: You mean the html tags that can be used in posts? bb_allowed_tags()

    Automatic tags: ?

    XU3E
    Member

    Hello to developers,

    I really love bbPress! Simple and fast! Integration options to WordPress is good way but I really love a idea about stand alone forum solution. Before that, there is few things that should be consideret to next release.

    Unread post/topics – Is it really hard to made this? This is main problem of all lightweight forums scripts – no marknig of unread post and parent topics. Just put that to the core and give options to admin. If they are interested about that fetahure they’ll enable it. Or just give us some up-to-date plugins that works and are supported by official dev team.

    Quoating and Posting reply – Light weight doesnt mean “no bbcode” or another nice code like !Texy. But please, no HTML or worst – XHTML STRONG tag as formating for messages! I really like simple way to add comments but i cant stay manual formatin of text with HTML. Its such waste of our time!

    And where is Quoting support like WP has?

    Allowed quicktags – Please, give me options set allowed tags from admin. Or just give better documentation! WordPress is the best because good documentation! I cant spend all day looking for right file just because its not at documentation and sometimes its impossible find some reasonable answers on google.

    Automatic tags – This is not serious problem. Just consider…

    Slug – Slug like WP. I miss this feathure. Its hard to fix slug problem if i cant directly acces to that from admin. Only way i can do it is mysql.

    Thats it! Nothing more. I am new here and i dont follow main goals of project but this is my opinion why is bbPress so uncomfortable to me and my friends.

    Its just my opinion and I hope you will consider make some serious progress on it.

    Sorry for my english.

    Thanks

    PS: I hope there will be more good ideas. Topics like this should be general, sticked.

    #90479
    Greg
    Participant

    _ck_, I would agree if it were just a matter of a clone theme. I operated our site like that for a couple of years. But when your customization goes beyond just a theme, then the costs of “cloning” get high in their own way.

    To repeat this thread, the duplication results in higher dev cost, more complexity to maintain and more bugs (to use a Rails-ism, the code isn’t very DRY).

    No question that it gets more performance and uses less resources though.

    #90478
    _ck_
    Participant

    I’ve been talking about this for years.

    The “performance” tag has a few gems in there I’ve written over time.

    bb-benchmark will also show you all the queries via the same method and a few other details, unfortunately the newest version is not in the plugin section right now because of how bbpress.org is broken.

    Part of the problem on the WP side is many times the plugins do not set their options to autoload (and have a whole bunch of options). I believe bbPress 1.x now has the same problem (it was avoided in 0.9 but re-introduced with backpress).

    I have a mini-plugin somewhere for 1.x to load all options with one query.

    Some setups can take hours to get the queries down, it’s exhausting

    Next you should notice that WP 3.0 + bbPress 1.x takes nearly 1 megabytes of code per instance and in some cases won’t even run on shared hosts because it goes over the PHP ini default setting of 32MB during runtime.

    If you are using a tag cloud, my “hot tags plus” will cache the complex query for the tag cloud and all rendering becomes static.

    ps. the real answer is not to do deep integration – just make a clone theme for bbpress, it’s worth the effort – the good thing about that is if WP is down, bbpress can still run

    Really helpful “Reboot Now”, thanks alot.

    Your first issue about the nonce value, I’ve never had it on any normal/shallow integration since I started specifying the all the keys in my config file. Yes it’s double handling but it’s made a huge difference.

    the bb-config file asks for this info:

    define( 'BB_AUTH_KEY', 'put your unique phrase here' );
    define( 'BB_SECURE_AUTH_KEY', 'put your unique phrase here' );
    define( 'BB_LOGGED_IN_KEY', 'put your unique phrase here' );
    define( 'BB_NONCE_KEY', 'put your unique phrase here' );

    The bb-config file tells you to get it form this location: https://api.wordpress.org/secret-key/1.1/bbpress/ . But really what you should have in the bbPress config file should be from the wordpress salt generator https://api.wordpress.org/secret-key/1.1/salt/

    I make sure I have an exact copy of my WordPress keys and a copy of my wordpress keys with “BB_” infront of them – and bam, that little issue went teh way of the dodo.

    define('AUTH_KEY',         '1');
    define('SECURE_AUTH_KEY', '2');
    define('LOGGED_IN_KEY', '3');
    define('NONCE_KEY', '4');
    define('AUTH_SALT', '5');
    define('SECURE_AUTH_SALT', '6');
    define('LOGGED_IN_SALT', '7');
    define('NONCE_SALT', '8');

    define('BB_AUTH_KEY', '1');
    define('BB_SECURE_AUTH_KEY', '2');
    define('BB_LOGGED_IN_KEY', '3');
    define('BB_NONCE_KEY', '4');
    define('BB_AUTH_SALT', '5');
    define('BB_SECURE_AUTH_SALT', '6');
    define('BB_LOGGED_IN_SALT', '7');
    define('BB_NONCE_SALT', '8');

    FYI incase anyone new to bbPress is reading this: If I do a clean bbPress install I strongly strongly advise using https://api.wordpress.org/secret-key/1.1/salt/bbpress/ instead which returns 8 lines (we get salts too) which WordPress has needed for 2 years.

    #86237

    Thank you Gautam!

    EDIT: Actually I’m looking for an action that gets called on every page after the options and database hits have been done, and before any info has been sent to a browser.

    I’ve tried:

    bb_options_loaded
    bb_plugins_loaded
    bb_send_headers

    EDIT 2: Actually, fingers crossed bb_index.php_pre_db will work.

    #90476
    Greg
    Participant

    I have now (1) figured out how to measure the number of queries correctly for both sides and (2) removed some very silly overhead that was immediately revealed after I achieved (1).

    The result is that both Kakumei and my custom theme do around 40 queries on the front page of the forum.

    Apologies for all the noise in the two posts before this one — a great illustration of more haste less speed.

    ps. One mod to Kevin’s extremely useful suggestion regarding the use of SAVEQUERIES to see where those queries are going… in bbPress you need to print the queries for BOTH the bbPress and WP databases. In other words, you need the following in your forum footer:

    global $wpdb, $bbdb;

    print_r($wpdb->queries);

    print_r($bbdb->queries);

    Or just to get the number of queries for both…

    global $wpdb, $bbdb;

    echo ‘WPDB Queries: ‘ . $wpdb->num_queries;

    echo ‘BBDB Queries ‘ . $bbdb->num_queries;

    Of course, the “>”s that appear in my code above should be greater than signs.

    #86236
    Gautam Gupta
    Participant

    Use bb_topic.php_pre_db action.

    Ryan’s plugin is nice, very nice indeed.

    It works in the same way as my hack/plugin for WP2.3 bbP0.8 in that it outputs a hardcoded file (obviously Ryan’s code it a heck of a lot better, and more up to date). Whats not great for me is that (the last time I checked) it attempts to output a hardcoded file once every hour, so any changes you make take 60 mins to appear on the bbpress site. You can lower that time ofcourse, but in that instance you’re going to struggle with things like SEO etc.

    #90474
    Greg
    Participant

    [EDIT] Scratch the below. It seems I was only counting the bbpress-related queries. I now see 51 queries (for a logged in user), which is a lot to pay for the convenience of calling wordpress functions. I look forward to hearing more about what you come up with during those two weeks.


    These stats are not consistent with my experience.

    I have a site with deep integration between bbPress 1.0.2 and WordPress MU 2.9 (BuddyPress). The number of queries for the front page is:

    18: logged out

    23: logged in

    I switched the theme back to Kakumei and this drops to:

    14: logged out

    19: logged in

    The deep integration here is requiring ‘wp-load.php’ from bb-config. How did you do the deep integration to get the results above?

    Or is WP3.0 doing something odd when integrated with bbP?

    Also, although 56 queries is really heavy for a standard deep integration, I wouldn’t be overly concerned about that number for a sophisticated site. And you really want to know what those queries are. Not all queries are created equal.

    #90497
    zaerl
    Participant
    bb_is_front()
    bb_is_forum()
    bb_is_tags()
    bb_is_tag()
    bb_is_topic_edit()
    bb_is_topic()
    bb_is_feed()
    bb_is_search()
    bb_is_profile()
    bb_is_favorites()
    bb_is_view()
    bb_is_statistics()

    that are all wrappers (a mojor part of them) of the bb_get_location() function which returns:

    front-page
    forum-page
    tag-page
    topic-edit-page
    topic-page
    feed-page
    search-page
    profile-page
    favorites-page
    view-page
    stats-page
    login-page
    register-page

    hpguru
    Member

    Just replace title in header.php in your theme:

    <title><?php bb_title() ?><?php if (bb_is_front()) { echo " - Your forum slogan";} ?><?php if ($page>1) { echo ' « Page '. $page; } ?></title>

    Unmangled: http://pastie.org/1028304

    Have a nice day and thanks to Zaerl to bb_is_front.

    I need function "if is home" to bbPress

    Example: Your topic title « Your forum name « Page 15

    If you are in topic’s page 15!

    #90494
    zaerl
    Participant

    bb_is_front()

    #90453

    Yeah, thats a bug with a system we’re dependant on.

    It was fixed yesterday, but hasn’t quite rolled out here yet.

    If you’re absolutely sure that this is no spaces whatsoever then here is a solution. delete bb-config.php and copy bb-config-sample.php and rename it bb-config.php.

    When you load your forum now, you should see it say “Cannot establish a database connection”.

    If it does, then edit the new bb-config.php with your database/username information :)

    It’s happened to me before, this seems to solve it.

    #90465

    In reply to: Installation question

    The isntallation process is no different to the WordPress process, there are just a few more steps. And the walkthrough I linked to is very very good and simple :)

    #90492
    Gautam Gupta
    Participant

    You can use the bb_is_front function (my previous comment went in spam).

    #90490
    Gautam Gupta
    Participant

    You can either put the code in front-page.php as Kevin told or use if ( bb_is_front() ) { /* Code Here */ }

    #34629

    I’ve spent the last week working with a client on a rather large WP/bbP setup. One of the real joys of this project is that it’s large enough for me to get some time in for more than asthetics and QA. Hence, a few more posts her this last week and some code, and some BackPress help.

    Anyway, one of my junior developers came up with an interesting stat the other day that I’ve been looking into, namely Deep Integration and it’s hit/performance. I’m sure almost all of this will be obvious to a great many of you, but I thought I’d throw out some figures.

    Single Loading of software after install

    WordPress2.9.2		16 database queries
    WordPress30 19 database queries
    bbPress0.9 09 database queries
    bbPress1.0.2 16 database quieres

    Single Loading of software after setup

    WordPress2.9.2		19 database queries
    WordPress30 23 database queries ***1
    bbPress0.9 10 database queries
    bbPress1.0.2 18 database quieres

    Now the first thing I noticed is that WP3.0 took a leap in queries. Once it takes you 20+ queries to load a simple homepage with no plugins my spider sense is tingling. Turns out that WP3.0 is somewhat sruggling with it’s new menu system. ***1 It takes 6 queries minimum, plus 1 query for each taxonomy type used in the new menu (apart from hardcoded links with don’t get an additional query). That’s a heck of a leap for something as simple as a menu. I mean, menu’s are rarely dynamic – they don’t change that often. For this particular website, as will probably be the way for the others I’ve moved to WP3.0, I’m looking at a minimum of 8 database queries simply to load the data needed to display the name and link in a menu. To be clear, that’s over 30% of database queries on a clean install of WordPress that are being called by this.

    As cool as the drag/drop facility is, make every menu item a custom link and you’ll save a minimum of 2 db calls per page load.

    Even better, hardcode the actual menu and save yourself 8 database calls per page load (you can hardcode an array for the walker class to iterate through and produce the same result)

    Single loading of software after basic/core plugins:

    Now, I believe that no WordPress (nor bbPress) install can run as expected these days without certain plugins. Your thoughts on this may vary ofcourse but I find that I need a minimum of WP-Super-cache, XML-sitemaps, WP-security-scan, wp-pagenavi, headspace/All-in-one, WP-stats, and probably a few others that I can’t remember off the top of my head. Oddly for bbPress I need more plugins.

    WordPress2.9.2		23 database queries
    WordPress30 27 database queries ***1
    bbPress0.9 18 database queries
    bbPress1.0.2 29 database quieres

    That’s quite a leap. But I’m confident that I could bring down the bbPress Queries with some time spent considerably, and I could enable caching from WordPress. I’m not posting this data in itself as definative stats for everyone, so there could be optomization made for sure.

    Deep Integration of WP3.0 and bbPress1.0.2:

    WP3 &amp; bbP1			56 database quieres

    56! With virtually no caching availible (as a plugin, for the average user with no .ini or shell access).

    56! On every page (+/- a few queries).

    Deep Integration of WP3.0 and bbPress1.0.2 – after first pass:

    WP3 &amp; bbP1			43 database quieres

    Ok some quick theme changes and delayed/circumvented loading of certain things and I’ve brought it down considerably.

    But the fact still remains that this is a truly crazy amount of database queries per page load.

    Anyway, after presenting this (in a better looking format) to the IT director of the client, I’ve managed to re-assign myself 2 weeks to come up with a planB. We want something that allows us the functionality of Deep Integration, but without the MASSIVE overhead. I have an idea down on paper, but right now I just wanted to post a few figures and give folks a heads up.

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

    Edit: If you want to see something fun, try this:

    Add to your bb-config.php and your wp-config.php

    In bb-config.php and wp-config.php add the following line:

    define('SAVEQUERIES', true);

    Then add the following code to your footer.php in your theme (right at the bottom)

    wordpress footer

    global $wpdb;
    echo &quot;[pre]&quot;;
    print_r($wpdb-&gt;queries);
    echo &quot;[/pre]&quot;;

    bbpress footer

    global $bbdb;
    echo &quot;[pre]&quot;;
    print_r($bbdb-&gt;queries);
    echo &quot;[/pre]&quot;;

    *** replace the square brackets [] html brackets (they’re not showing up correctly)

    #90420
    plinth
    Member

    Thanks for your help on this guys, and apologies for not searching the forum more thoroughly for similar topics already started!

    I’m not ignoring your advice, but just trying to make things work within my limited knowledge. What I’ve done is opened up the register.php file and commented out the following lines:

    unset($profile_info_keys['first_name']);
    unset($profile_info_keys['last_name']);

    …which has had the effect of making them appear on the register form. This is good for me because we need people to enter their full names to use the forum (requirement from client)

    Also, I’ve edited the functions.bb-core.php file and changed:

    'from' =&gt; array(0, __('Location')),

    …to read:

    'from' =&gt; array(1, __('ID Ref')),

    …which is pretty crude but makes it mandatory and changes the label to what I require. The obvious downside is that if any existing members have specified a location, it will appear with this new label.

    This is the quick n dirty solution, but I just want to check it’s not going to kill anything. Thanks

    #87860
    mr_pelle
    Participant

    I just noticed that download links at Download page should use a background image, but it cannot be found at the moment.

    Full background attribute: url(&quot;images/button-grad.png&quot;) repeat-x scroll left top #333333

    Wow, now background attribute is gone, so download links are nearly invisible… =P

    #90467

    In reply to: bbPress Security

    _ck_
    Participant

    Someone copied my plugin (they used ALL of my lines then added a few) but they defeated the entire purpose.

    Their code only runs if there is an active user, if someone is not logged in and there is a loophole, the code would run unchallenged.

    Plus they exclude admin, so if there is a hacked account, the code is also bypassed.

    Here is my improved version of my original code

    if (strlen($_SERVER['REQUEST_URI'])>255 ||
    preg_match('@(eval|base64|unescape)[^a-zA-Z0-9]@si',$_SERVER['REQUEST_URI']))
    {
    header('HTTP/1.1 414 Request-URI Too Long');
    header('Status: 414 Request-URI Too Long');
    header('Connection: Close');
    exit;
    }

    #90374
    chrishajer
    Participant

    If you don’t want a table prefix, I suppose you could go into the bbPress code and eliminate all the references to the WordPress table prefix in the installer (and possibly elsewhere.)

    It would be much easier to rename the WordPress tables and use a table prefix than hack the bbPress code. You tried once and did not have a good result. Maybe you need to try again and figure out where it went wrong if you really want integration between bbPress and WordPress. Either way, it’s going to require some work on your part due to a decision you made earlier to eliminate the WordPress table prefix.

    #90432

    In reply to: Theme not working!!!

    Don’t worry about Deep Integration. If you don’t know it, you’ve not got it, and that makes life easier :)

    If you can’t load the stylesheet of the theme you want to use in your browser (and therefore independant of both wordpress and bbpress – as you’re essentially just loading a text file from a server), then that’ll be the issue.

    Activating the theme you’re after would be great, as would telling us what folder it’s in and what it’s called :)

    #90418
    pagal
    Participant

    @chrishajer its not real a democracy…If you deleted my whole topic then you should also delete the whole topic of kevinjohngallagher which was against to me you just edit the kevin’s topic not delete it. You can also edit my topic but you did not. And I did not just give response to kevin, I also said something to zeal… can you please tell me why you delete the topic’s portion which was for zeal?

    Thanks :-)

Viewing 25 results - 20,751 through 20,775 (of 32,517 total)
Skip to toolbar