Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 27,101 through 27,125 (of 32,481 total)
  • Author
    Search Results
  • Well, I was having issues with my WordPress admin, so, like a clever person I created a new admin name and deleted the old. Well. Turns out that in doing so I’ve deleted my keymaster in BBPress.

    I’ve seen some posts that suggest editing the tables. I’ve tried adding the code

    $bb->new_keymaster = ‘AdminTwo’;

    to my bb-config.php and then running install.php. But, nothing happens. So, if I must edit my database, can someone please let me know in more deatail how? (Ie: Which tables, which values, etc.)

    Thank You so Much!

    #3791
    #66040
    csseur3
    Member

    hi,

    for the wp-config.php file in wordpress, it is:

    define(‘COOKIE_DOMAIN’, ‘.website.org’);

    or

    define(‘COOKIE_DOMAIN’, ‘website.org’);

    ?

    thanks ;)

    Fred

    chrishajer
    Participant

    You take all that code that howtogeek pasted and put it into a file called “replacebbmail.php” or something. To make php code into a bbPress plugin, it needs to have a header. The header needs to look something like this (change the values to something meaningful to you):

    <?php
    /*
    Plugin Name: Swift Mailer
    Plugin URI: http://www.example.com/ (doesn't really matter)
    Description: Replace bb_mail with Swift Mailer
    Author: You
    Author URI: http://www.example.com/
    Version: 0.1
    */

     

    Then, paste the code that howtogeek showed at the end of that file. In the end, it will look something like this.

    <?php
    /*
    Plugin Name: Swift Mailer
    Plugin URI: http://www.example.com/ (doesn't really matter)
    Description: Replace bb_mail with Swift Mailer
    Author: You
    Author URI: http://www.example.com/
    Version: 0.1
    */

    if ( !function_exists('bb_mail') ) {
    function bb_mail($to, $subject, $content, $headers=''){

    require_once('PATH_TO/Swift/lib/Swift.php');
    require_once('PATH_TO/Swift/lib/Swift/Connection/Sendmail.php');

    $swift =& new Swift(new Swift_Connection_Sendmail("/usr/sbin/sendmail -bs"));
    $from = new Swift_Address("noreply@mysite.com","My bbPress Forums");

    $message =& new Swift_Message($subject, $content);
    if ($swift->send($message, $to, $from)) {return true;}
    else{ echo "Message failed to send to ".$to." from ".$from;}
    $swift->disconnect();
    }
    }
    ?>

     

    The name of the file does not matter really. Save that new file in bb-plugins. Now activate your new plugin in the admin section of your bbPress site.

    You will need to configure it before activating it to make sure it works (setting up the path to swift mailer and setting the auth stuff if you need to.)

    chrissydunno
    Member

    thanks guys .. but how do you ‘make howtogeek’s code into a plugin’

    where does his code go? registration-settings.php? how?

    i can install swiftmailer of course, just not sure what else needs to change in current bbpress configurations

    #3790
    #66821
    _ck_
    Participant

    bb-ratings has this problem:

    https://plugins-svn.bbpress.org/bb-ratings/tags/0.8.5/bb-ratings.php

    as you can see on/around line 205

    #66323
    csseur3
    Member

    And I think you are missing the people who will say “oh, we need a plugin for just that! I can’t imagine the others! “

    I have already twenty plugins activated, some of which, as memberlist, which does not change of code (or very little) and they can be integrated safely by default.

    In place of a plugin, a checkbox in the options natives would be better, no?

    As WordPress 2.7 perhaps we should integrate the most simple and the most popular plugins by default, no?

    I thought about it to ensure the development of bbPress and enable it to compete with others. And if there is more interested users = more visitors for the sites of the plugins creators on their “donate” link lol: p

    Please, think at the question^ ^ or create a “plugin integration poll” :p

    Bug fixes are good. New features, too. :)

    _ck_
    Participant

    It really is that simple – just make HowToGeek’s code into a plugin and install swiftmailer:

    https://bbpress.org/forums/topic/trick-to-fix-some-email-problems-with-08x-plugins-on-09x#post-15776

    That reminds me to fix some of my plugins so they use bb_mail() instead of mail() directly.

    #64024

    Thanks chrishajer – that’s just what I need it. I had tried the other hidden field, expecting that to work…

    :D

    #64023
    chrishajer
    Participant

    Instead of this WordPress function:

    <?php wp_register(); ?> 

    You would have a link to bb-login.php. Then bb-login handles the whole thing. In the login form, you would add that hidden form field to redirect then after login, as explained here.

    https://bbpress.org/forums/topic/heres-a-trick-to-redirect-user-back-to-topic-after-login#post-14268

    #64022
    mattbaehr
    Member

    How do I change the reg links? In my theme, here is the reg code:

    <li id="meta" class="widget">

    <h2><?php _e('Members') ?></h2>

    <ul>

    <?php wp_register(); ?>

    <li><?php wp_loginout(); ?></li>

    <?php wp_meta(); ?>

    </ul>

    </li>

    What would I do to get it to redirect to the bbpress registration page?

    #66792

    In reply to: Theme directory

    thion
    Member

    http://bbshowcase.org/ ;)

    Besides – there’s no point to make a theme directory if there are no themes. Not many people are doing layouts for bbPress and if they’re doing, then it’s really hard work – I know something about it as I’m making “Halloween Evening” theme for bbPress right now…

    #3779

    Topic: Theme directory

    in forum Themes
    csseur3
    Member

    Hello,

    like the theme directory of wordpress.org, it is possible to have a theme directory in bbpress.org ? :)

    Bye,

    Fred

    #66285
    _ck_
    Participant

    There are radical internal changes in 1.0 with the switch to the BackPress core, not to mention the cookie changes and some major db function changes which consolidated all the meta tables into bb_meta. The code is untested against most plugins. It’s a much bigger change IMHO from 0.9 to 1.0 vs the older 0.8.3 to 0.9.0 change.

    However I don’t think it will take much to get it the final stamp of approval, maybe even late this month or early next, depending how many more features Sam wants to put into it. There’s still a whole bunch of open tickets:

    https://trac.bbpress.org/report/3

    I just don’t want it to be rushed to an official release like 0.9 was, which was followed shortly by 0.9.0.1 and 0.9.0.2 and then 0.9.0.2 sp1 – that’s embarrassing and makes bbPress look amateur.

    Let’s get it right this time – report those bugs at http://trac.bbpress.org

    #64020

    You can just change the register links in the wordpress template to point to the bbpress login and registration forms… that’s easy enough (you can even copy the login form code into the template directly and it seems to work).

    The problem is, how to get users back to the URL they came from after they login (by default they seem to get bounced to the forum home page instead)… any ideas?

    #66784
    chrishajer
    Participant

    If it’s this site http://famousbeats.net/ it’s 2.5.1:

    <meta name="generator" content="WordPress 2.5.1" />

    #66737

    In reply to: Sitemap generator

    chrishajer
    Participant

    I have not seen the author around in a while. I would say if it’s not your work, you should not upload it to the extend section. I didn’t see it there already. Of course, someone could look at this plugin and extend it. It’s GPL2 licensed.

    There was a problem with the plugin creating a site map when there are lots of posts; it slowed down posting. Maybe it could be fixed to allow creation of the sitemap via cron or via a GET request, rather than randomly when a post is marked favorite. There was also a problem with certain characters not being encoded in the URL if you’re not using permalinks.

    Lots of work could be done to extend and improve the plugin, then it could be released and posted to the bbPress extend/plugins section.

    #66680
    thion
    Member

    I’ve already found the problem – I guess I’ve lost myself when trying to develop a plugin for both 0.9.0.2 and 1.0 ;). It’s working now and will be released today (I hope)…

    #66679
    _ck_
    Participant

    The user_id of the user on the profile page might be in $user->ID

    try global $user; $user_id=$user->ID;

    ($user is only available on the profile page)

    #65980
    _ck_
    Participant

    This plugin is meant as a temporarily workaround until the bug can be fixed in WordPress – it will replace “anonymous” with the user login.

    Install it on the WordPress side:

    <?php
    /*
    Plugin Name: changes anonymous to member's login if display name missing (plugin for WordPress)
    */
    function no_anonymous_members($author) { // this is a WORDPRESS plugin, not bbPress
    global $comment;
    if (empty($comment->comment_author) && !empty($comment->user_id)) {$user=get_userdata($comment->user_id); $author=$user->user_login;}
    return $author;
    } add_filter('get_comment_author', 'no_anonymous_members');

    if ( !function_exists('get_userdata') ) :
    function get_userdata( $user_id ) {
    global $wpdb;

    $user_id = absint($user_id);
    if ( $user_id == 0 )
    return false;

    $user = wp_cache_get($user_id, 'users');

    if ( $user ) {
    if (empty($user->display_name)) {$user->display_name=$user->user_login;}
    return $user;
    }
    if ( !$user = $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->users WHERE ID = %d LIMIT 1", $user_id)) ) {
    return false;
    }
    _fill_user($user);
    if (empty($user->display_name)) {$user->display_name=$user->user_login;}
    return $user;
    }
    endif;
    ?>

    (The real answer of course is to insert the user_login when the comment is posted, however I cannot find a suitable hook in WordPress’s comment-template.php so I am doing it by completely replacing the get_userdata function in pluggable.php)

    #65979
    _ck_
    Participant

    I guess I can create some code to fix the display name issue in existing databases. Give me a few minutes.

    update: actually it’s as simple as this in phpMyAdmin:

    UPDATE wp_users SET display_name=user_login WHERE display_name=''

    or via a mini-plugin:

    <?php
    /*
    Plugin Name: Fix Anonymous Members
    */
    function fix_anonymous() {global $bbdb;
    $bbdb->query("UPDATE $bbdb->users SET display_name=user_login WHERE display_name='' ");
    } add_action('bb_init','fix_anonymous');
    ?>

    save as _fix-anonymous.php (with leading underscore)

    you only need to upload and run bbpress once with it loaded (no activation required) and then delete the plugin or it will slow down bbPress.

    I am now writing a WordPress plugin to fix this without having to duplicate all the names in the table which is a horrendous waste of space.

    #65978
    _ck_
    Participant

    Well we know what causes “anonymous” to show up, it’s because bbPress is not creating the display name for the user when the user registers on the bbPress side and then goes to use WordPress.

    The question is, why is this suddenly happening when bbPress is supposed to create it already. This might be a question for Sam – but I hope he can reproduce the problem.

    Did you add the above code to insert the display name?

    I hope I didn’t lead you wrong by implying you should try 2.6 because that will be incompatible with bbPress 0.9

    2.6 has compatibility with bbPress 1.0 alpha but a few plugins won’t work with the alpha yet (like bb-topic-views)

    Oh and the display name persists in 1.0 alpha and is on line 487 in pluggable. I’ve filed a trac report:

    https://trac.bbpress.org/ticket/922

    #66731
    chrishajer
    Participant

    I don’t think iframes work very will with bbPress. Are you trying to put the forum in an iframe?

    <frameset rows="100%,*" border="0" frameborder="no" framespacing="0">
    <frame name="site" src="http://hlvdubs.iamanerd.org.uk/forum" marginwidth="0" marginheight="0" noresize scrolling="auto">
    <noframes>
    <body bgcolor="#ffffff">

    </body>
    </noframes>
    </frameset>

     

    I think this is part or all of the problem. Don’t try to access bbPress from an iframe. You’ve got two different domains going on there.

    #66729
    jifop
    Member

    hmm, i’ve thrown it back up and its still dead :(

    checking the source it seems ok

    <link rel=”stylesheet” href=”http://www.hlvdubs.co.uk/forum/bb-templates/kakumei/style.css&#8221; type=”text/css”>

Viewing 25 results - 27,101 through 27,125 (of 32,481 total)
Skip to toolbar