Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 26,076 through 26,100 (of 32,481 total)
  • Author
    Search Results
  • _ck_
    Participant

    One possible way to benchmark the performance is to run these two queries in phpmyadmin (via SQL tab)

    SELECT SQL_NO_CACHE t.* FROM bb_topics AS t   USE INDEX(topic_time)  WHERE t.topic_status = '0' AND t.topic_sticky != '2'   ORDER BY t.topic_time DESC LIMIT 25

    vs.

    SELECT SQL_NO_CACHE t.* FROM bb_topics AS t  WHERE t.topic_status = '0' AND t.topic_sticky != '2'   ORDER BY t.topic_time DESC LIMIT 25

    On my setup the one with the forced index takes half the time of the one without, however we are talking 0.0026 sec vs 0.0013 sec so that is almost meaningless. What we need is someone with 10,000 topics and then you’ll know for certain.

    _ck_
    Participant

    Not extensively tested but this will do it without a core hack

    (once ALTER TABLE bb_topics ADD INDEX (topic_time) is done)

    <?php
    /*
    Plugin Name: Topic Time Index
    */
    add_filter('get_latest_topics_join','topic_time_index',99999);
    function topic_time_index($join) {return " $join USE INDEX(topic_time) ";}
    ?>

    _ck_
    Participant

    This is the SQL query to use if others want to add such an index:

    ALTER TABLE bb_topics ADD INDEX (topic_time)

    But that in itself is not enough, bbPress has to be forced to use the index.

    I am trying to figure out a way to do this without hacking the core, via a mini-plugin instead.

    anotherdan
    Member

    I have just re-launched a site containing about 43000 topics and over 300000 posts…

    I had severe performance issues on all sites using the get_latest_topics functionality (the frontpage was severe because it is using more than once in my custom theme).

    Because of the “index” design it file-sorting because it’s sorting on topic_time and is mysql is hitting the stickies index.

    The solution was to create a new index only with the topic_time field in it. However I was unable to force this index in the query without touching the core files.

    This is what i did:

    Could there be a filter there so I could move this out into a plugin?

    BB_Query::generate_topic_sql function:

    $index_append = '';
    switch ($this->query_id) {
    case 'get_latest_topics':
    $index_append = ' FORCE INDEX (topics_time_order) ';
    break;
    }

    $this->request = $this->_filter_sql( $bits, "$bbdb->topics AS t $index_append" );

    I guess I will find more places where I could do some index optimization that fit’s my install… I can’t be the first running into this issue?

    #67459
    walkerevans
    Member

    Thanks for the links, Chris. As bad as the search is in BBPress, it’s still better than phpBB2 (which I’m migrating from). ;)

    And John, I saw the Super Search, but didn’t want to use it since it’s in super-alpha mode and I need something that will also search WP posts, and it doesn’t seem like that plugin does that. At least not yet. So for now I’m using the WP search plugin: https://bbpress.org/plugins/topic/wp-search/

    Just wondered if there was any way to get Tags/Titles in the existing forum search. Hrm.

    #4544
    JesperA
    Member

    Hi!

    I want to use a couple of WordPress function so i tried to include wp_blog_header in bb_config like this:

    “require_once(‘../wp-blog-header.php’);”

    This works well if i am in the forum section but as soon as i go into bb-admin i get the terrible feared:

    Warning: require_once(/wp-blog-header.php) [function.require-once]: failed to open stream: No such file or directory in C:wampspeedrevisionforumbb-config.php on line 49

    Fatal error: require_once() [function.require]: Failed opening required ‘/wp-blog-header.php’ (include_path=’.;C:php5pear’) in C:wampspeedrevisionforumbb-config.php on line 49

    This worked great in 0.9.0.3 but in the latest unstable version 1 A4 it does this, why?

    And why does it say that a forum is locked when i am trying to make a post?

    Would really appreciate some help ;)

    #68510

    In reply to: Mass user delete

    dkulchenko
    Member

    A kind of hackish, but simple way:

    Log into your MySQL database with php_myadmin, go to the <db-prefix>_users table, go to Browse view, and simply select each user you want to delete with a checkbox, then press the X at the bottom of the screen. phpmyadmin lists the username, real name, id, and so on of the user, so that you can quickly delete by names.

    NOTE: Of course, only do this if you know what you’re doing. Using phpmyadmin, you can do anything from change one letter of someone’s username to trash your entire installation. Do not use this tool if you’re a noob. :)

    Also, this only works if the user accounts do not have any posts associated with them. If they do, this may cause very unpredictable behavior. Before doing this, delete all the posts associated with the user accounts from bbPress, or by deleting posts from the bb_posts table. Then, you can safely delete the users using the steps above.

    #4540
    dcole07
    Member

    I used: add_filter('get_profile_info_keys', 'get_profile_info_keys_personal'); to add more fields to the registration. But I don’t know how or can’t seam to find a way to get this data.

    I thought I could use $user = new BB_User($user_id); and then use $user["new_field"], but after I did var_dump($user), I couldn’t find it in there. But it does appear in that user’s profile!

    How can I access the new values in get_profile_info_keys for a particular user?

    #70667
    marcoapaulo
    Member

    Thank you. Will try that ;)

    #70663
    Ganzuelo
    Participant

    Tried to reinstall, deleted config first, no luck., deleted entire bbpress install., no luck.. I will try and fix tomorrow. =(

    #70299
    chrishajer
    Participant

    I just watched the basic integration screencast and tried integration again. I ran into some of the same problems mentioned above so I did a little testing.

    1. Sam, thanks for the screencast.

    2. Using a subdirectory of forums, and then making a WordPress Page called “Forums” with a slug of “forums” works just fine. The page will show up in your WordPress page menu like any other Page, but the real ‘forums’ subdirectory you installed bbPress into is what is displayed to visitors, NOT the content of the WordPress Page called “Forums.” I used to install a redirect plugin at WordPress to redirect the “Forums” Page to the http://example.com/forums/ real subdirectory, but I guess this works just fine like this. Good to know.

    3. When using PHP4 (4.4.9) I encountered the “Forum could not be created!” error mentioned above. I thought it was possibly the MySQL version (which was 4.0.27 I believe) but it turned out that by using PHP5 (5.2.6) it installed fine, into the same database. I added this to my .htaccess file in the site root (for WordPress and bbPress):

    AddType x-mapp-php5 .php

    That forced .php files to be processed as PHP5. I did that before installing WordPress. I confirmed with phpinfo that PHP5 was being used for both the blog and the forum. The 2nd time through (actually, the 3rd time, but that’s a different story), using PHP5, the forum was created properly.

    After that, following the screencast pretty closely resulted in an installation where I can log in as Admin (key master) at either bbPress or WordPress, and I am logged in on the other side, as expected. Logging out of one logs me out of both. It’s what I expect user integration to be.

    Waiting for the next screencast, Sam. Thanks.

    p.s. Did I miss it, or is the NONCE key for bbPress never set in the video? I have one in wp-config.php, since the keys were generated by the WordPress.org API, but did I miss setting that in bbPress? Should I just make it the same as it is in bbPress? Will not having it prevent me from administering the forum or something? I didn’t test any functionality of the forum, just the logins.

    #70662
    chrishajer
    Participant

    Warning: mysql_connect() [function.mysql-connect]: Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2) in /nfs/c03/h04/mnt/57391/domains/willclan4food.net/html/bbpress/bb-includes/backpress/class.bpdb.php on line 123

    I just got this same error on installation of Alpha 4 with WordPress 2.7 integration. I caused it by being logged out of WordPress when I clicked the link to my wp-admin/options.php that was displayed by bbPress (the one where bbPress tells you to look for the salts in the WP admin area.) In Sam’s screencast, he was logged in, so clicking the link just brought up the options page straight away.

    Anyway, I was logged out of WordPress at that step, and when I clicked the link, I got the WordPress admin login, with a redirect URL that looked like this:

    http://example.com/wp-login.php?redirect_to=http%3A%2F%2Fexample.com%2Fforums%2Fbb-admin%2Finstall.php%3Fstep%3D2

    So, when I logged in, instead of redirecting me upon login to http://example.com/wp-admin/options.php, it redirected me to step 2 in the bbPress install. After that, I got the same exact error as you did. In fact, there were a couple more too.

    Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/tmp/mysqld.sock' (2) in /home/example/forums/bb-includes/backpress/class.bpdb.php on line 123

    Warning: mysql_error(): supplied argument is not a valid MySQL-Link resource in /home/example/forums/bb-includes/backpress/class.bpdb.php on line 377

    Warning: Cannot modify header information - headers already sent by (output started at /home/example/forums/bb-includes/backpress/class.bpdb.php:123) in /home/example/forums/bb-includes/functions.bb-core.php on line 842

    I ended up reinstalling since I was not confident in the installation at that point and didn’t want to take any chances at something not being set properly.

    #70659
    Ganzuelo
    Participant

    I got alpha to work,. I then installed both bbpress plugins for wordpress. I went back to change user options in the bbpress admin panel and error messages came up.. goto http://willclan4food.net for details.. The error codes are popping up there

    #69565

    In reply to: Using Sticky Post

    Malice
    Member

    Yea I have a similar problem. A sticky in a subforum (not sticky to front) makes the topic disappear from the subforum. It does still show up in the latest discussion on the frontpage. Can’t sticky posts in individual subforums though.

    Forum

    I use several plugins, all activated:

    BBcode Buttons Toolbar 0.0.8

    BBcode Lite 1.0.3

    BBPress Private Messaging 0.80

    bbPress signatures 0.1.9

    bbPress Smilies 0.0.5

    bb Topic Views 1.6.3

    Bozo Users 1.0

    Google Analitycs 0.1

    Human Test for bbPress 0.8.2

    Instant Password 0.0.4

    New User Notification Email 0.0.2

    Post Count Plus – Dynamic.Titles & More! 1.1.6

    Quote 0.2

    Subscribe to Topic 0.0.1

    Unread Posts 0.9.3

    #70646

    In reply to: Deactivate New Users

    Trent Adams
    Member

    Generally what I do is just edit your template to change the code on register.php to just have the registration page either redirect to your wordpress registration or have a link on it. If you use the default theme, just copy it into /my-templates/ and edit the register.php file of your theme. That seems to be the easiest as it then never shows the bbPress registration form.

    #67456
    walkerevans
    Member

    I was just thinking the same thing. I’ve run a few tests and it doesn’t appear to search tags or headlines.

    If anyone knows a fix it would be great to hear one! ;)

    #65649
    anotherdan
    Member

    Lighttpd “pro” – thanks but im not, hehe… Anyways it was me on irc the other day, I have bbPress running now, and have made a few changes to the the rewrite rules, I found exactly some errors regarding some urls needing more parameters…

    This is how it looks now:

    http://lab.anotherdan.com/conf/bbpress-rewrite.conf.txt

    I havent been through it all but at least some it works :) (Note this also contains some of the custom rewriting im doing for this install)

    #70593

    In reply to: Codex linking?

    _ck_
    Participant

    There’s no way your version works because the str_replace is executed immediately and the $2 isn’t available at that time. The regex would either have to use a callback or be expanded to catch words (or look on php.net for the /e modifer)

    #70592

    In reply to: Codex linking?

    The destination URL would be http://wiki.mydomain.com/wiki/PAGE And it cleverly sees the spaces (like ‘Main Page’) and turns that into underscores (Main_Page).

    <?php
    /*
    Plugin Name: Wiki Link
    */
    add_action('post_text','wiki_link',200);
    function wiki_link($text) {
    $url="http://example.com/path_to_wiki/";
    $wiki= str_replace(" ", "_", "$ 2");
    $text=preg_replace("/([[(.+?)]])/si","<a class='wiki_link' href='$url$wiki'>$ 2</a>",$text);
    return $text;
    }
    ?>

    It does eat that $2 doesn’t it…

    #70591

    In reply to: Codex linking?

    _ck_
    Participant

    Untested. Actually the forum is deleting some of the code so use it from here:

    http://pastebin.com/f54a958de

    <?php
    /*
    Plugin Name: Wiki Link
    */
    add_action('post_text','wiki_link',200);
    function wiki_link($text) {
    $url="http://example.com/path_to_wiki?terms=";
    $text=preg_replace("/([[(.+?)]])/si","<a class='wiki_link' href='$url$2'>$2</a>",$text);
    return $text;
    }
    ?>

    the above is missing two $2, should look like

    <a class='wiki_link' href='$url$2'>$2</a>

    #70590

    In reply to: Codex linking?

    _ck_
    Participant

    It’s probably a 5 line plugin to do that.

    Give me an example of what the destination URL looks like.

    #70606
    walkerevans
    Member

    Commented out the following code in template-functions.php got it to work again… testing to see if this is going to cause any security problems.

    //if ( ‘user_email’ == $key && $bb_current_id != $user->ID )

    // continue;

    #68337
    Malice
    Member

    great work guys! Can’t believe this exists just 2 years. Excellent software!

    Thanks for all the plugins as well =)

    #4484
    sbouazza
    Member

    Replace :

    $uri = preg_replace('!?page=[0-9]+!', '%_%', $uri );

    By :

    $uri = preg_replace('!?page=[0-9]+!', '%_%', $uri );

    That’s all .

    #70625
    chrishajer
    Participant

    I was able to get the forum ID on a topic page by using this (and nothing else) in header.php:

    <?php echo (get_forum_id()); ?>

    Works on forum pages too.

Viewing 25 results - 26,076 through 26,100 (of 32,481 total)
Skip to toolbar