Detective (@detective)

Forum Replies Created

Viewing 23 replies - 76 through 98 (of 98 total)
  • @citizenkeit:

    Honestly, i don’t know. Maybe it’s best to do a clean install.

    @Malfhok:

    I hope it works ok. I made some basic tests, but i don’t know how it works in a real environment.

    If you change the browser encoding to iso-8859-1 it works. Maybe it’s a encoding issue.

    pd = ¡qué bueno saber que no soy el único que habla castellano aquí :p !

    If you have a WP profile (like the author archive or some other profile) you can redirect the bbPress profile using this hook:

    //add_action('bb_init', 'profile_redirect');

    function profile_redirect() {
    if (is_bb_profile() && $_GET['tab'] != 'edit' && $_GET['tab'] != 'favorites') {
    $user = bb_get_user($_GET['id']);
    if ($user) wp_redirect("http://www.example.com/member/" . $user->user_nicename);
    }
    }

    I did this using this plugin for WordPress profiles, so even users who don’t have published posts have a profile. It works but you miss the profile edit messages (like “your profile has been updated”).

    Hi, i have a plugin that will support this soon :)

    The plugin is named Gaming Codes. It’s for WP, but i have a stripped down version for bbPress. I’ll post it here soon.

    Hi, this works for me:

    add_action('bb_init', 'pm_initialize');

    function pm_initialize() {
    load_plugin_textdomain('bb-pm', BB_PLUGIN_DIR . 'private-messages');
    }

    Inside the folder private-messages i have a file called bb-pm-es_ES.mo. As you can see, i use the locale es_ES.

    I finally made a custom “private forum” (note the single noun) plugin:

    define('FORO_STAFF', 22);

    add_filter('get_posts_where', 'ryuuko_staff_where_posts');
    function ryuuko_staff_where_posts($where) {
    if (!bb_is_user_logged_in() || !bb_current_user_can('moderate')) {
    //var_dump($where);
    $where .= " AND p.forum_id <> '" . FORO_STAFF . "' ";

    }
    return $where;
    }

    add_filter('get_topics_where', 'ryuuko_staff_where_topics');
    function ryuuko_staff_where_topics($where) {
    if (!bb_is_user_logged_in() || !bb_current_user_can('moderate')) {
    $where .= " AND t.forum_id <> '" . FORO_STAFF . "' ";
    }
    return $where;
    }

    add_filter('get_forums', 'ryuuko_staff_forums');
    function ryuuko_staff_forums($forums) {
    if (!bb_is_user_logged_in() || !bb_current_user_can('moderate')) {
    $where .= " AND t.forum_id <> '" . FORO_STAFF . "' ";
    $forum_key = -1;
    foreach ($forums as $key => $forum)
    if (intval($forum->forum_id) == FORO_STAFF) {
    $forum_key = $key;
    break;
    }
    unset($forums[$key]);
    }
    return $forums;
    }

    add_action('bb_forum.php_pre_db', 'ryuuko_forum_redirect');
    function ryuuko_forum_redirect($forum_id) {
    if (!bb_is_user_logged_in() || !bb_current_user_can('moderate')) {
    if ($forum_id == FORO_STAFF) bb_die("No puedes ver esto!");
    }
    }

    Maybe it’s useful for someone. The constant FORO STAFF is the id for the private forum. In this case, only users with the ‘moderate’ capability can see the forum.

    Other function names:

    * get_usermeta => bb_get_usermeta (the same applies to delete usermeta)

    * add_option doesn’t exists

    * update_option => bb_update_option

    * $current_user->has_cap => bb_current_user_has_cap (or something like that, check the files in bb-includes).

    * is_user_loggedin => bb_is_user_logged_in

    And others …

    It is really easy to add profile fields.

    First, you need to print the fields you need:

    add_action('extra_profile_fields', 'print_extra_fields');
    function print_extra_fields($user_ID) {
    /* get the current values for that user, and print your form items */
    }

    add_action('profile_edited', 'process_extra_fields');
    function process_extra_fields($user_ID){
    /* here, $_POST contains the new field values. so you can do things like bb_update_usermeta($user_ID, 'your_field', $_POST['your_field']); ... */
    }

    Please correct me if i’m wrong. I don’t remember the action names. But this works :) I use it in WP and BBP.


    Detective
    Member

    @detective

    I use this plugin ported from a Vanilla Extension:

    <?php
    /*
    Plugin Name: Video Tags
    Plugin URI: http://lussumo.com/addons/index.php?PostBackAction=AddOn&AddOnID=33
    Description: Ported from SirNot's HtmlFormatter for Vanilla
    Author URI:
    Version: 0.1
    */

    //allow youtube and google videos to be posted, tags are:
    //<video type="google">docid</video> (google video) -or-
    //<video type="youtube">video id</video> (youtube) -or-

    function video_embed($texto){
    $sReturn = preg_replace_callback(
    '/<video(?>s+)type=(["'

    ])((?>w+))1(?>s*)>([A-Za-z-_d]+?)</video>/is’,

    ‘VideoLink’,

    $texto

    );

    return $sReturn;

    }

    function VideoLink($Matches)

    {

    $Type = strtolower(trim($Matches[2]));

    $ID = $Matches[3];

    switch($Type)

    {

    case ‘google’ : return (‘<embed style=”width: 400px; height: 326px;” id=”VideoPlayback” ‘.

    ‘type=”application/x-shockwave-flash” src=”http://video.google.com/googleplayer.swf?docId=&#8217;.$ID.'”></embed>’);

    case ‘youtube’ : return (‘<object width=”425″ height=”350″><param name=”movie” value=”http://www.youtube.com/v/&#8217;.$ID.'”></param>’.

    ‘<embed src=”http://www.youtube.com/v/&#8217;.$ID.'” type=”application/x-shockwave-flash” width=”425″ height=”350″></embed>’.

    ‘</object>’);

    default : return $Matches[0];

    }

    }

    function allow_video_tags( $tags ) {

    $tags = array(‘type’ => array(‘maxlen’ => 10));

    return $tags;

    }

    add_filter( ‘bb_allowed_tags’, ‘allow_video_tags’ );

    add_filter( ‘post_text’, ‘video_embed’ );

    ?>

    `

    It allows you to embed video only from YT or Google Video.

    Also you could edit the .mo file. So you can translate “Member” and other titles.

    Check out the file loggedin.php in your template. The admin menu includes this file to display “welcome your_name….”. So if you have some img or lists or anything different from a span or p, that file is probably breaking the menu layout.

    Hi!

    I don’t use BBPress in that site, i’m installing it on another site, and there the code i posted works :)

    This is what i do in my sidebar (in WP and BB):

    <form action="<?php bloginfo('url') ?>/wp-login.php" method="post">
    <label for="log">Usuario<br /><input type="text" name="log" id="log" value="" size="22" /></label>
    <label for="pwd">Password<br /><input type="password" name="pwd" id="pwd" size="22" /></label>
    <input type="submit" name="submit" value="Ingresar" class="button" />
    <label for="rememberme"><small><input name="rememberme" id="rememberme" type="checkbox" checked="checked" value="forever" /> Recordarme</small></label><br />
    <input type="hidden" name="redirect_to" value="<?php echo $_SERVER['REQUEST_URI']; ?>"/>
    </form>

    You could take a look at the Simple Tagging plugin for WP. It has auto-complete and suggestion inside the Write Post form.

    Oh, amazing … i feel like Tom from Tom & Jerry :p

    I think it should not be hard to code such a plugin. It would have to create a new database table, like bb_read, with the following fields:

    – bb_user

    – bb_post

    – bb_last_comment_read

    This way you could modify the posts query, left joining it with this table. If the join is NULL (please correct me if i’m wrong, i haven’t done these things in a lot of time), then the user has never read the post. If bb_last_comment_read is less than the actual number of comments or replies, then he hasn’t read the last post.

    Another interesting alternative is what the folks at wordpress.org are doing … for non-visited links they have a font with a font-weight: bold style. So you can see which topics are new.

    In reply to: Plugin: Avatar Upload

    It appears just in the upload avatar template. Everything else works fine :)

    In reply to: Plugin: Avatar Upload

    Hi,

    I just upgraded to the last version and now my forum prints this message:

    Warning: call_user_func_array() [function.call-user-func-array]: First argumented is expected to be a valid callback, 'stdClass::has_cap' was given in /home/ficcion/public_html/wp-includes/capabilities.php on line 454

    Warning: call_user_func_array() [function.call-user-func-array]: First argumented is expected to be a valid callback, ‘stdClass::has_cap’ was given in /home/ficcion/public_html/wp-includes/capabilities.php on line 454

    Warning: call_user_func_array() [function.call-user-func-array]: First argumented is expected to be a valid callback, ‘stdClass::has_cap’ was given in /home/ficcion/public_html/wp-includes/capabilities.php on line 454

    Warning: call_user_func_array() [function.call-user-func-array]: First argumented is expected to be a valid callback, ‘stdClass::has_cap’ was given in /home/ficcion/public_html/wp-includes/capabilities.php on line 454

    Sadly i don’t know what it is. :(

    Hi!

    I run a vanilla board. I think Vanilla is a very complete, fast and stable forum software. The only problem i have is that none of the add-ons i programmed work the way i wanted. This is because the design of Vanilla is extremely object oriented so there are rules that you have to follow.

    BBPress doesn’t have that. Instead you have a lot more freedom to do things, and that’s what i wanted, so i’m moving to BBPress.

    Of course the object oriented structure of Vanilla is extremely well designed. I just don’t think extreme OO is completely adecuate on this kind of software.

    Another difference is that in Vanilla you just enable an add-on and it works. You don’t have to add code nor modify files (again, this is because of the structure of Vanilla. This is a very good feature, specially if you don’t have experience in PHP). In BBPress mostly all of the time you’ll have to modify files in your template to use some plugins (i like this, because i have more control over what’s happening).

    In short, Vanilla is excellent, but it’s not for me :D

    Maybe it could be something like “mark this topic as interesting”. And in your profile it would say “This user has interest in these topics: …”.

    This is what i do to solve the problem:

    function wpbb_add_user_role_rk($user_id) {

    $user = new WP_User($user_id);

    $user->set_role(get_option('default_role'));

    }

    add_action( ‘bb_new_user’, ‘wpbb_add_user_role_rk’);

    it is possible. Include the file wp-blog-header.php in the first line (after <?php) of your config.php. So, in every template file that calls bb_get_header() and bb_get_footer() you can replace them with get_header() and get_footer().

    In this way you’re loading the WP header and footer … and if you want to include some CSS specifically for bbpress you’ll have to do it by means of a WP plugin or editing wordpress’ header files.

    Hi!

    You can use WordPress Pages inside bbPress. I’m testing an integration between bb and wp and it works flawlessly. Look for some posts about including wp-config.php or wp-blog-header.php in your config.php.

Viewing 23 replies - 76 through 98 (of 98 total)