Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 26,401 through 26,425 (of 32,481 total)
  • Author
    Search Results
  • #68986

    Yeah, found the bb_mail function and will use a couple spam protection functions from WP-Mail to hardcode it for my site but won’t be able to make a plugin out of it :-(

    #68984

    Oh, that’s a little too complex :-) I don’t think I can get my head around this one lest it was stripped down to the core functionality. The best part of my PHP days is unfortunately numbered but I’ll try to look for something easier.

    #49661

    In reply to: Emoticons For bbPress?

    _ck_
    Participant

    See this part of the plugin, you need to change the bb_add_filter and bb_add_actionto justadd_filterandadd_action`

    /******************************************************************************
    * - Define for bbPress interface
    *****************************************************************************/

    $bbemoticons = & new bbEmoticons();

    bb_add_filter('post_text', array(&$bbemoticons, 'convert_smilies'));
    //bb_head is not called always. :-)
    //bb_add_action('bb_head', array(&$bbemoticons, 'bb_grins_head'));
    bb_add_action('bb_feed_head', array(&$bbemoticons, 'bb_grins_head'));
    bb_add_action('bb_grins', array(&$bbemoticons, 'bb_grins'));

    #49660

    In reply to: Emoticons For bbPress?

    _ck_
    Participant

    See this part of the plugin, you need to change the bb_add_filter and bb_add_actionto justadd_filterandadd_action`

    /******************************************************************************
    * - Define for bbPress interface
    *****************************************************************************/

    $bbemoticons = & new bbEmoticons();

    bb_add_filter('post_text', array(&$bbemoticons, 'convert_smilies'));
    //bb_head is not called always. :-)
    //bb_add_action('bb_head', array(&$bbemoticons, 'bb_grins_head'));
    bb_add_action('bb_feed_head', array(&$bbemoticons, 'bb_grins_head'));
    bb_add_action('bb_grins', array(&$bbemoticons, 'bb_grins'));

    #68982

    I can see there’s no plugin like that yet, however can anybody just hint as to what backpress functions I can use in order to hardcode this myself? I’m learning the php + bbpress stuff quite fast so I’d give it a whirl with a little help.

    Think it may come useful for others as well.

    #57729
    chrissydunno
    Member

    where in the code do you add your redirect hook exactly?

    #69416
    _ck_
    Participant

    There is no bb_do_action, only do_action.

    bb_do_action has been removed.

    Are you talking about the plugin created in this thread:

    https://bbpress.org/forums/topic/emoticons-for-bbpress

    Why not post your question there, where it will actually be relevant?

    #69411
    _ck_
    Participant

    bbPress Plugin Index, A – M

    A

    B

    C

    D

    E

    F

    G

    H

    I

    L

    M

    #69315

    In reply to: Locked Out of Forum!

    _ck_
    Participant

    Change the bbpress tables prefixs to bb_ via phpmyadmin and then fix the prefix setting in bb-config.php

    I tried to understand the new database structure by checking the upgrade-schema.php. I found one thing could cause problem:

    $bb_queries = “CREATE TABLE IF NOT EXISTS $bbdb->users (

    ID bigint(20) unsigned NOT NULL auto_increment,

    user_login varchar(60) NOT NULL default ”,

    user_pass varchar(64) NOT NULL default ”,

    user_nicename varchar(50) NOT NULL default ”,

    user_email varchar(100) NOT NULL default ”,

    user_url varchar(100) NOT NULL default ”,

    user_registered datetime NOT NULL default ‘0000-00-00 00:00:00’,

    user_status int(11) NOT NULL default 0,

    display_name varchar(250) NOT NULL default ”,

    PRIMARY KEY (ID),

    UNIQUE KEY user_login (user_login),

    UNIQUE KEY user_nicename (user_nicename)

    );”;

    my old database table bb_users the user_nicename does not have unique key on it, but now upgrade try to setup as unique key. will it be the reason for the upgrade timeout?

    Unfortunately for my cpanel host I could not access the mysql log, but please help me solve this. any inputs are welcome.

    thanks.

    I follow the steps. After extract the new bbpress files and rename the config.php (v0.8) to bb-config.php, I could see all my previous posts.

    However, when I login to the Admin, it displays:

    It looks like your database is out-of-date.

    You can update it here.

    After click the Upgrade Database button, after a few seconds, the http://www.travelsuperlink.com/forum/bb-admin/upgrade.php page just display a blank webpage (timeout?)

    I am stuck here, please help.

    _ck_
    Participant

    Since bbPress-Live also does a list of forums, here’s how to do that too:

    <h2>Forum List</h2>
    <ul>
    <?php
    global $wpdb;
    $query="SELECT * FROM bb_forums WHERE topics!=0 ORDER BY forum_order ASC LIMIT 10";
    $results=$wpdb->get_results($query);
    foreach ($results as $result) {
    echo "<li><a href='/forums/forum.php?id=".$result->forum_id."'>".$result->forum_name."</a></li>";
    }
    ?>
    </ul>

    of course this example doesn’t take into account nested forums and will just display them flat.

    _ck_
    Participant

    And you can just keep making it fancier and fancier.

    Let’s say you want to also show how many posts each topic has.

    echo "<li><a href='/forums/topic.php?id=".$result->topic_id."'>".$result->topic_title."</a> (".$result->topic_posts." posts)</li>";

    or how old the last reply is

    echo "<li><a href='/forums/topic.php?id=".$result->topic_id."'>".$result->topic_title."</a> (".human_time_diff(strtotime($result->topic_time." GMT"))." ago)</li>";

    _ck_
    Participant

    Let’s put that all together – this should work right inside any wordpress template:

    <h2>Latest Forum Discussions</h2>
    <ul>
    <?php
    global $wpdb;
    $query="SELECT * FROM bb_topics WHERE topic_status=0 ORDER BY topic_time DESC LIMIT 10";
    $results=$wpdb->get_results($query);
    foreach ($results as $result) {
    echo "<li><a href='/forums/topic.php?id=".$result->topic_id."'>".$result->topic_title."</a></li>";
    }
    ?>
    </ul>

    _ck_
    Participant

    So we have the $results, how do we make a pretty list of them, say inside of our sidebar?

    We have to loop through them and print them out. This is where that list of fields inside of bb_topics comes in handy.

    Here’s just a list of titles to start with:

    foreach ($results as $result) {
    echo "<li>".$result->topic_title."</li>";
    }

    Of course that’s not very useful, because they aren’t clickable. To make them clickable will take a little bit more work:

    foreach ($results as $result) {
    echo "<li><a href='/forums/topic.php?id=".$result->topic_id."'>".$result->topic_title."</a></li>";
    }

    That example uses quite a few shortcuts to get the job done, it hardcoded the path to your forums (change /forums/ if needed) and even if your bbPress uses pretty permalinks, it simply uses the topic id number to get there – bbPress will redirect back to permalinks. If you absolutely know you have permalinks and want to use them, you could have done something like this instead:

    <a href='/forums/topic/".$result->topic_slug."'>"

    _ck_
    Participant

    Now we need to put together a correct mysql query.

    Let’s try something simple.

    SELECT * FROM bb_topics WHERE topic_status=0 ORDER BY topic_time DESC LIMIT 10

    SELECT means “grab the following”

    the asterisk means “all the fields in the table”

    FROM bb_topics is kinda obvious, it’s the table we want

    topic_status=0 means it’s topics not deleted

    ORDER BY topic_time DESC means put the newest topics on top

    LIMIT 10 means we want only the first 10

    Let’s say we also wanted to exclude topics that were closed, since people can’t reply, we don’t want to tease them. In that case you would change the

    WHERE topic_status=0

    to

    WHERE topic_status=0 AND topic_open=1

    or let’s say you only wanted “stickies”

    WHERE topic_status=0 AND topic_sticky!=0

    Okay now to use that in WordPress we do the following:

    global $wpdb;
    $query="SELECT * FROM bb_topics WHERE topic_status=0 ORDER BY topic_time DESC LIMIT 10";
    $results=$wpdb->get_results($query);

    If all goes well, WordPress will then execute the query and then fill $results with the answers.

    Now comes the output part.

    _ck_
    Participant

    Both bbPress and WordPress have a very simple way of fetching data.

    WordPress uses $wpdb

    bbPress uses $bbdb

    (the db part means database, very simple)

    Then there’s the good old “get_results”. They both use that.

    bbpress:

    $results=$bbdb->get_results("mysql query goes here");

    wordpress:

    $results=$wpdb->get_results("mysql query goes here");

    Many times you can use the same query in either bbpress or wordpress by just changing $bbdb to $wpdb or visa-versa.

    Then you have to figure out what you are asking for.

    Let’s use the really simple bbPress Topics table as an example. Unless you’ve customized your install, the Topics table is probably called bb_topics

    Here are all the fields available inside of bb_topics.

    topic_id
    topic_title
    topic_slug
    topic_poster
    topic_poster_name
    topic_last_poster
    topic_last_poster_name
    topic_start_time
    topic_time
    forum_id
    topic_status
    topic_open
    topic_last_post_id
    topic_sticky
    topic_posts
    tag_count

    _ck_
    Participant

    I’m not sure if this has been addressed elsewhere already or a plugin already exists but for novices that have even just a beginner’s knowledge of how php+mysql works I want to show you how easy it is to show bbPress info inside of WordPress and vise-versa.

    You should NOT be using overly complex plugins like bbPress-Live or parsing RSS feeds if you have WordPress and bbPress sharing the same database but different tables. Instead, it’s a piece-of-cake to grab info from each other directly and display it. You don’t even need a plugin, you can code it right into your templates (as long as you know they will remain working together).

    So I’ll give some examples here and then if anyone has questions feel free to ask.

    #69103
    _ck_
    Participant

    You shouldn’t need a RewriteCond in that case, the RewriteRule can work without it if it’s simple enough.

    If you are using the .htaccess inside of the /forum/ directory though, the above examples need to be trimmed without the forum/ part.

    ie.

    RewriteRule ^forum/faq

    should actually be

    RewriteRule ^faq

    Only leave the forum/ part in there if you are using the .htaccess in the parent (webroot) folder.

    #69311

    In reply to: Locked Out of Forum!

    _ck_
    Participant

    To get bbPress you work you might be able to go into bb_config.php and edit this line

    $bb_table_prefix = 'bb_';

    and make it say

    $bb_table_prefix = '';

    (that’s just two single quotes together with no space)

    Not sure if it would work and it’s bad idea to keep running like that.

    Using phpMyAdmin, you could try to rename all the tables to bb_users, bb_usermeta, etc.

    But do you see your WordPress tables? You have a bigger problem is there’s wp_users and wp_usermeta and then you don’t see topics forums posts tables.

    You may have installed bbpress into a new database instead of the old wp database?

    Copy all the names of the tables in the left hand site of phpmyadmin here so we can see better what’s wrong.

    #69310

    In reply to: Locked Out of Forum!

    chrishajer
    Participant

    It looks like you have an extra db in there. So if your database is database, your tables are actually named database.dbusers, for example?

    The default would be database.bb_users.

    To change the table prefix your bbPress installation uses, there is a value in bb-config.php called $bb_table_prefix which is normally set to “bb_”. What is the value in your file?

    To recover, you might want to rename all your tables using a prefix, then add that prefix to bb-config.php for $bb_table_prefix. I think that would work.

    I think leaving the tables with no prefixes is a bad idea, because if you install other software in the same database, you might have a conflict with similarly named tables. Not every application behaves well and allows a table prefix. oscommerce used to do that (no table prefix, just tables with normal names that would step all over any existing similarly named tables.)

    #69340
    chrishajer
    Participant

    I just thought to check the address bar to see if the proper reply number is being appended, and it is. So, the URL looks like:

    https://bbpress.org/forums/topic/column-widths-topic-posts-last-poster-freshness?replies=2#post-21105

    But there is no #post-21105 (my reply) on the page. It’s just not there yet. Odd.

    #69329
    chrishajer
    Participant

    You didn’t mention the version you’re using, but in Alpha 2, they’re not set. They are just table cells with no width. The will resize the fit the data. If you want to set them, for the front page anyway, the tables are generated in front-page.php. Just look for all the <td> with no widths and adjust yours there.

    #67985
    mvds
    Member

    Just a question:

    do you include your wp functions in bbpress? I see calls to wp functions in several bb functions (also in bb_insert_topic and bb_insert_post) and I can imagine that if you dont include wp functions in bbpress, that these statements fail.

    I cannot include wp functions with the

    $bb->WP_BB = true;
    if (file_exists('../wp-blog-header.php'))
    require_once('../wp-blog-header.php');
    else
    if (file_exists('../../wp-blog-header.php'))
    require_once('../../wp-blog-header.php');

    part because then my forums don’t work. I can’t access my bb-admin pages and bbpress doesn’t recognize my users.

    What breaks it is the inclusion of the wordpress functions in the bb-config.php file. If you delete that code and visit the admin, it will work just fine.

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