Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 20,726 through 20,750 (of 32,481 total)
  • Author
    Search Results
  • #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 :-)

    #90415
    Ben L.
    Member
    &lt;?php
    /*
    Plugin Name: My Profile Keys
    */

    function my_profile_keys( $a ) {
    $a['my_key_id'] = array(
    true, // Required
    'ID number', // Label
    'text', // Type
    '', // Value
    '' // Default when not set
    );
    return $a;
    }

    add_filter( 'get_profile_keys', 'my_profile_keys' );

    Untested, but should work. (Change the lt thing to a less than sign – the bbPress.org forums have some kind of glitch).

    #90075

    In reply to: Syntax error

    mmurasko
    Member

    I copied it from code editor if I copied it right from edit, it wouldn’t have numbers in it. I just wanted to see how far to go down when I copied it for you all to look at.

    I’m using WP 3

    #90072

    In reply to: Syntax error

    chrishajer
    Participant

    There should not be line numbers in that file. I wonder if someone on the WordPress side checked in code with line numbers?

    What version of WordPress are you using? And honestly, this looks like a WordPress not bbPress issue.

    Related to this recent report:

    https://bbpress.org/forums/topic/fatal-error-call-to-undefined-function-2

    #90071

    In reply to: Syntax error

    mmurasko
    Member

    Here is the code:

    1 &lt;?php

    2 /**

    3 * WordPress DB Class

    4 *

    5 * Original code from {@link http://php.justinvincent.com Justin Vincent (justin@visunet.ie)}

    6 *

    7 * @package WordPress

    8 * @subpackage Database

    9 * @since 0.71

    10 */

    11

    12 /**

    13 * @since 0.71

    14 */

    15 define( ‘EZSQL_VERSION’, ‘WP1.25’ );

    16

    17 /**

    18 * @since 0.71

    19 */

    20 define( ‘OBJECT’, ‘OBJECT’, true );

    #87853
    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

    #90166

    Ah sorry Chris, I wasn’t clear.

    What I meant was this:

    • We want/need people to test a year’s worth of code in 1.0.3
    • Why not download the latest version.
    • Apply the the patch to that downloded code.
    • Put in a zip file.
    • Rename Zip file “bbpress-1.0.3-alpha.zip”
    • Upload to website
    • Ask people to download and test.

    We know we can’t release 1.0.3 into the wild given that it’s whole implementation is questioned by the bugs in 1.1; but it’ll at least give us a heads up on a year’s worth of bugs.

    #90165
    Gautam Gupta
    Participant

    We can add the same code (the one I posted in the patch) in bbPress, but BackPress would be a better place for that. Anyone should contact westi as he can fix it.

    #90357
    Gautam Gupta
    Participant

    Easy way is deep integration but is highly not recommended as it adds unnecessary extra load on the server. Other way is to code a template yourself which looks similar to your WP theme or hire someone to do that.

    #90164
    chrishajer
    Participant

    BackPress is included as an external. I don’t have the ability to update the code here. I can just check in code to bbPress. Then, on some sort of cron schedule, the code that runs bbpress.org/forums is updated. It’s not nightly, as evidenced by the fact that this site is still running r2441 (actually, I think r2442: I tagged it wrong.) So, maybe it’s not automatically done, but the job fails and someone needs to do it manually.

    So, I can’t update the BackPress code that is running on this site. I could fix my local installation, and you could fix yours, but I can’t fix it here.

    If you want to see what’s included externally, you can download a trunk release from the bottom of a trac page and see that Akismet and BackPress are both missing. When I check out a copy with subversion, those externals are checked out. But I can’t check in to either of those projects.

    #87851
    chrishajer
    Participant

    I don’t think I have any ability to update the code that runs at the plugins site, so I can’t fix the plugins search. I believe the search is fixed here in the forums so if they update the code at plugins, it will be fixed.

    I don’t know if I can fix the &lt; &lt; thing locally (in an external?) but I would rather they just fix the BackPress bug properly. If we fix it here, then there’s no pressure to fix it in BackPress.

    #34601
    FMA
    Member

    Hello bbPressers! (:

    I’ve got some problems with integrating WordPress into my bbPress install.

    What am I doing wrong?

    15678gn.png

    http://i45.tinypic.com/15678gn.png

    There just simply no $table_prefix in wp-config.php :O

    I hope someone can help me with this.

    With Kind Regards,

    FMA

Viewing 25 results - 20,726 through 20,750 (of 32,481 total)
Skip to toolbar