Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 28,826 through 28,850 (of 32,505 total)
  • Author
    Search Results
  • #60948
    livibetter
    Member

    This is quick solution but not perfect. Find <?php while ( bb_forum() ) : ?> in front-page.php and replace it with

    <?php while ( bb_forum() ) : global $forum; if ($forum->forum_parent != 0) continue;?>

    It only hides the subforums, so visitors have to click on a top level forum to see if there is any subforum within the top level forum.

    #61252
    livibetter
    Member

    There are two if blocks in front-page.php, one for $super_stickies, another for $topics. Remove first one(about 8 lines) and replace second with

    <?php
    $stickyIdx = 0; $topicIdx = 0;
    while ($stickyIdx < count($super_stickies) && $topicIdx < count($topics)) {
    if ($super_stickies[$stickyIdx]->topic_time > $topics[$topicIdx]->topic_time)
    array_splice($topics, $topicIdx, 0, array($super_stickies[$stickyIdx++]));
    $topicIdx++;
    }
    if ($stickyIdx < count($super_stickies))
    array_splice($topics, count($topics), 0, array_slice($super_stickies, $stickyIdx));

    if ( $topics ) : foreach ( $topics as $topic ) : ?>
    <tr<?php topic_class(); ?>>
    <td><a href="<?php topic_link(); ?>"><?php topic_title(); ?></a></td>
    <td class="num"><?php topic_posts(); ?></td>
    <td class="num"><?php topic_last_poster(); ?></td>
    <td class="num"><small><?php topic_time(); ?></small></td>
    </tr>
    <?php endforeach; endif; // $topics ?>

    Actually, the replacement is equivalent to inserting 8 lines of code.

    #54731

    Bump :) A live ajax one would be amazingly brilliant, and would no doubt make it into the next official release, thus bring the developer of it untold fortunes.

    Well, I know I’d appreciate it. ;)

    #61291
    ericakadisco
    Member

    Thanks for the response.

    Okay, I tried to patch all the files with the changes in that ticket and I seem to get the same error.

    Here is my config.php:

    <?php

    // ** MySQL settings ** //
    define('BBDB_NAME', 'approachanxiety_com_bbpress'); // The name of the database
    define('BBDB_USER', 'disco'); // Your MySQL username
    define('BBDB_PASSWORD', 'xxxx'); // ...and password
    define('BBDB_HOST', 'localhost'); // 99% chance you won't need to change these last few

    define('BBDB_CHARSET', 'utf8'); // If you are *upgrading*, and your old config.php does
    define('BBDB_COLLATE', ''); // not have these two contstants in them, DO NOT define them
    // If you are installing for the first time, leave them here

    // Change the prefix if you want to have multiple forums in a single database.
    $bb_table_prefix = 'bb_'; // Only letters, numbers and underscores please!

    // The full URL of your bbPress install
    $bb->uri = 'http://approachanxiety.com/bbpress/';

    // What are you going to call me?
    $bb->name = 'New bbPress Site';

    // This must be set before you run the install script.
    $bb->admin_email = 'ericmonse@yahoo.com';

    // Set to true if you want pretty permalinks, set to 'slugs' if you want to use slug based pretty permalinks.
    $bb->mod_rewrite = false;

    // The number of topics that show on each page.
    $bb->page_topics = 30;

    // A user can edit a post for this many minutes after submitting.
    $bb->edit_lock = 60;

    // Your timezone offset. Example: -7 for Pacific Daylight Time.
    $bb->gmt_offset = 0;

    // Change this to localize bbPress. A corresponding MO file for the
    // chosen language must be installed to bb-includes/languages.
    // For example, install de.mo to bb-includes/languages and set BBLANG to 'de'
    // to enable German language support.
    define('BBLANG', '');

    // Your Akismet Key. You do not need a key to run bbPress, but if you want to take advantage
    // of Akismet's powerful spam blocking, you'll need one. You can get an Akismet key at
    // http://wordpress.com/api-keys/
    $bb->akismet_key = ''; // Example: '0123456789ab'

    // The rest is only useful if you are integrating bbPress with WordPress.
    // If you're not, just leave it as it is.

    $bb->wp_table_prefix = ''; // WordPress table prefix. Example: 'wp_';
    $bb->wp_home = ''; // WordPress - Options->General: Blog address (URL) // Example: 'http://example.com'
    $bb->wp_siteurl = ''; // WordPress - Options->General: WordPress address (URL) // Example: 'http://example.com'

    /* Stop editing */

    if ( !defined('BBPATH') )
    define('BBPATH', dirname(__FILE__) . '/' );
    require_once( BBPATH . 'bb-settings.php' );

    ?>

    When I run the testdb.php I get

    Connection Results

    Connection: Successful!

    Database Selection: Successful!

    Enter Your MySQL Information

    MySQL Hostname localhost

    MySQL Username disco

    MySQL Password xxxx

    MySQL Database approachanxiety_com_bbpress

    Here is the text php file that connects to the database and works:

    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>MySQL Test Script</title>
    <style>
    body { font-family: Verdana; font-size: 10pt; }
    td { font-size: 10pt; }
    th { font-size: 8pt; }
    </style>
    </head>
    <body>

    <?php

    if ( isset ( $_POST['submit'] ) ) {
    ?>
    <table border="1" summary="" cellpadding="2" cellspacing="0" style="border-collapse: collapse;">
    <tr>
    <th bgcolor="#F2F2F2" colspan="2"><center><b>Connection Results</b></center></td>
    </tr>
    <?

    if (!$link = @mysql_connect($_POST['mysql_hostname'], $_POST['mysql_username'], $_POST['mysql_password'])) {
    ?>
    <tr>
    <td>Connection:</td>
    <td bgcolor="red"><font color="white"><?php echo mysql_error(); ?></font></td>
    </tr>
    <?
    } else {
    ?>
    <tr>
    <td>Connection:</td>
    <td bgcolor="green"><font color="white">Successful!</font></td>
    </tr>
    <?
    }

    if (!$dblink = @mysql_select_db($_POST['mysql_database'], $link)) {
    ?>
    <tr>
    <td>Database Selection:</td>
    <td bgcolor="red"><font color="white"><?php echo mysql_error(); ?></font></td>
    </tr>
    <?
    } else {
    ?>
    <tr>
    <td>Database Selection:</td>
    <td bgcolor="green"><font color="white">Successful!</font></td>
    </tr>
    <?
    }

    @mysql_close($link);
    ?>
    </table>
    <?
    }

    ?>

    <form method="post">

    <table border="1" summary="" cellpadding="2" cellspacing="0" style="border-collapse: collapse;">
    <tr>
    <th bgcolor="#F2F2F2" colspan="2"><center><b>Enter Your MySQL Information</b></center></td>
    </tr>
    <tr>
    <td>MySQL Hostname</td>
    <td><input type="text" name="mysql_hostname" size="40" value="<?php echo $_POST['mysql_hostname']; ?>"></td>
    </tr>
    <tr>
    <td>MySQL Username</td>
    <td><input type="text" name="mysql_username" size="40" value="<?php echo $_POST['mysql_username']; ?>"></td>
    </tr>
    <tr>
    <td>MySQL Password</td>
    <td><input type="text" name="mysql_password" size="40" value="<?php echo $_POST['mysql_password']; ?>"></td>
    </tr>
    <tr>
    <td>MySQL Database</td>
    <td><input type="text" name="mysql_database" size="40" value="<?php echo $_POST['mysql_database']; ?>"></td>
    </tr>
    <tr>
    <td colspan="2"><center><input type="submit" name="submit" value="Submit"> <input type="reset" name="reset" value="Reset"></center></td>
    </tr>
    </table>
    </form>

    </body>
    </html>

    #2557
    ericakadisco
    Member

    I am installing bbPress to integrate with an existing WordPress. After the second step of install I get this error:

    Second Step

    Now we’re going to create the database tables and fill them with some
    default data.

    bbPress database error: [Access denied for user 'disco'@'localhost' to
    database 'approachanxiety_com_bbpress2']
    SHOW TABLES;

    bbPress database error: [Access denied for user 'disco'@'localhost' to
    database 'approachanxiety_com_bbpress2']
    CREATE TABLE bb_forums....

    It seems to be similar to this post,

    http://bbpress.org/forums/topic/step-two-database-error?replies=4

    And this one,

    http://bbpress.org/forums/topic/db-access-problem-in-the-first-installation-step?replies=19

    I tried to resolve it by replacing db-mysqli.php with db.php in the bb-includes folder and that didn’t work.

    The username and password are correct. They are the same as for my original wordpress blog. And the database is correct as well. When I change it to something else I can’t even get to the second step.

    Any help would be greatly appreciated!!!

    #61251
    Null
    Member

    Without the [ ] I presume. Thx going to try that!

    #61247
    livibetter
    Member

    I have no idea which file you meant. Please just paste the code about how you query for something from your database and how you process the data for the visitors.

    #61250
    livibetter
    Member

    You don’t have to check the existence of the table you need

    http://dev.mysql.com/doc/refman/4.1/en/create-table.html

    Just create a table with IF NOT EXISTS.

    #61245
    livibetter
    Member

    Could you paste your test.php?

    #61248
    livibetter
    Member

    Here is an example for deactivation hook

    //bb_register_deactivation_hook(__FILE__, 'GADeactivate'); // Bug in bbPress 0.8.3, do same thing using next line
    add_action('bb_deactivate_plugin_' . bb_plugin_basename(__FILE__), 'GADeactivate');

    just remove “de” from above, that should work. For example,

    bb_register_activation_hook(__FILE__, 'hook_fct');

    However, I haven’t used activation hook, therefore I don’t know is there a problem with it.

    #61287
    livibetter
    Member

    Sorry, my mistake

    <?php
    echo '(<a href="' . get_profile_tab_link(bb_get_current_user_info('id'), 'edit') . '">edit</a>)';
    ?>

    login_form() uses logged-in.php of current active theme if current user is logged in.

    #61284
    lookfab
    Member

    Thanks livibetter. I just realized that the profile field doesn’t show any fields that are not populated, so in my case there was no information to show until I added the website a few minutes ago.

    Not my brightest moment :-|

    #61285
    livibetter
    Member

    You can put this at proper place in your logged-in.php

    <?php
    echo '(<a href="' . get_profile_tab_link(0, 'edit') . '">edit</a>)';
    ?>

    #61269
    jazbek
    Member

    thanks man. :)

    #60314
    akhater
    Member

    fel64 WOW this is nice :) we learn every day don’t we :)

    I will add your link to my mod it will help ppl

    #60313
    fel64
    Member

    Nice, akhater. Just for simplicity and maintainability, you don’t actually have to copy and paste the member capabilities, you can simply duplicate them through code. (For example)

    #61194

    In reply to: Plugin: Gravatar

    livibetter
    Member

    New Version, 0.2. Download the zipped file.

    • Two Gravatar Email Source

      • Use registered email
      • Use additional Gravatar Email field

    • Email Verification – Users need to verify Gravatar Emails which they input
    • Options page (screenshot)
    • Default Image – Supports displaying Default Image

      • Also supports displaying different Default Image based on user’s role

    • Display Name – Shows Display Name instead of Login name if available
    • Customize Size, Rating of avatar
    • Complete Deactivation – Removes options and data in usermeta

    Plugin’s page

    #58181

    In reply to: bbSync

    jazbek
    Member

    hey fel et al.,

    found another issue which i just spent way too much time trying to figure out.. why is it that anywhere bb_get_option is called, it returns nothing? somehow the bb_get_option function doesn’t have access to the $bb object. I placed the following 2 lines of code in my bbpress functions.php, at the top of the bb_get_option function (after the line that reads global $bb;:

    print_r($bb);
    echo " $option ";

    and i got:

    akismet_key mod_rewrite use_cache active_plugins usercookie usercookie page_topics

    — notice, the requested option names are being echoed, but there’s no output from print_r($bb). why isn’t $bb set in the bb_get_option function?

    this issue is causing bbrepliestext() to output:

    Warning: Division by zero in /httpdocs/discuss/bb-includes/functions.php on line 1465

    if the “Do you want me to load bbPress whenever to make things like links nicer?” option is checked in Options > bbSync. To be specific, the error comes from line 500 in bbsync.php

    #60809
    livibetter
    Member

    Use this code as a plugin.

    function Hook_get_profile_info_keys($keys) {
    unset($keys['interest']);
    return $keys;
    }

    add_filter('get_profile_info_keys', 'Hook_get_profile_info_keys');

    #61271
    mrwonderr
    Member

    Thanks, it works. :D

    #2551
    lookfab
    Member

    Is there a simple way (i.e. not involving a plug-in) to change the title of a view? For example, if I wanted the view “Topics with no replies” to say “Threads with no replies”, how can I do this?

    I do see that the views are set up in default-filters.php, so I guess I’m asking whether there is an easy way to override these view definitions using code in the theme.

    Thanks.

    #61193

    In reply to: Plugin: Gravatar

    bigmumu
    Member

    Thanks guys, great job :)

    #61270
    fel64
    Member

    Include bb in wp-config.php like so:

    require_once('path/to/bb-load.php');

    #61268
    livibetter
    Member

    I checked 0.8 in svn. You can simply comment out or remove those capabilities in capabilities.php.

    #61267
    jazbek
    Member

    thanks, yeah, i am not using bbpress + wordpress on the installation i’m trying to disable posts and registration on.. that’s the old one that’s getting moved to the new site that has wordpress.

    0.8 doesn’t have plugin activation, i guess everything’s just enabled by default (someone correct me if i’m wrong). i’ll have to check out capabilities.php tomorrow (i’m off to a halloween party!). thanks for the help. :)

Viewing 25 results - 28,826 through 28,850 (of 32,505 total)
Skip to toolbar