Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 23,876 through 23,900 (of 32,570 total)
  • Author
    Search Results
  • #78473

    In reply to: Hiding Sub-Forums

    Jimmy B.
    Participant

    Hey hentdan! Thanks for your code snippet, that seemed to do the trick. I tweaked a couple things, namely <?php if (bb_forum_depth() <= 1 ) : ?>.

    Thank you very much!

    Here’s the complete code that’s working for me:

    <?php function bb_forum_depth( ) {
    global $bb_forums_loop;
    if ( !is_object($bb_forums_loop) || !is_a($bb_forums_loop, 'BB_Loop') )
    return false;

    return $bb_forums_loop->walker->depth;
    } ?>

    <?php while ( bb_forum() ) : ?>
    <?php if (bb_get_forum_is_category()) : ?>
    <tr<?php bb_forum_class('bb-category'); ?>>
    <td colspan="3"><?php bb_forum_pad( '<div class="nest">' ); ?><a href="<?php forum_link(); ?>"><?php forum_name(); ?></a><?php forum_description( array( 'before' => '<small> – ', 'after' => '</small>' ) ); ?><?php bb_forum_pad( '</div>' ); ?></td>
    </tr>
    <?php continue; endif; ?>
    <?php if (bb_forum_depth() <= 1 ) : ?> <!-- ******* -->
    <tr<?php bb_forum_class(); ?>>
    <td><?php bb_forum_pad( '<div class="nest">' ); ?><a href="<?php forum_link(); ?>"><?php forum_name(); ?></a><?php forum_description( array( 'before' => '<small> – ', 'after' => '</small>' ) ); ?><?php bb_forum_pad( '</div>' ); ?></td>
    <td class="num"><?php forum_topics(); ?></td>
    <td class="num"><?php forum_posts(); ?></td>
    </tr>
    <?php endif; ?><!-- ******* -->
    <?php endwhile; ?>

    #78030
    hpguru
    Member

    Thank you for fast help. This works good now. :)

    #78507
    kickerman360
    Member

    NightGunner5: I’ll test that when I get a chance, thanks!

    FinalWebsites: The plugin calls the image a certain name. If the user is “admin” the admin’s avatar will be “avatar.jpg” but could also be “avatar.gif” etc. This code hopefully will reduce the code.

    Thanks again!

    #78506
    Ben L.
    Member

    <?php echo('<img src="/forums/avatars/' . basename( current( glob( BB_PATH . 'avatars/' . $current_user->user_login . '.*' ) ) ) . '" />'); ?> (Untested, but it should work.)

    #78029
    Olaf Lederer
    Participant

    Hi,

    locate in the plugin file the function

    function create_seo_meta_txt($content) {
    $raw = str_replace(PHP_EOL, ' ', strip_tags($content));
    $raw = str_replace(' ', ' ', $raw);
    $snippet = substring_words($raw, 120, '');
    return htmlentities($snippet, ENT_QUOTES);
    }

    and replace “htmlentities” with “wp_specialchars”.

    Let me know if this works for you. This plugin is a little quick and dirty for these functions :)

    The seo plugin for wordpress has for internationalization huge blocks of code :)

    #78505
    Olaf Lederer
    Participant

    You don’t need to use all the php tags and how do you test if the image exists?

    #31608
    kickerman360
    Member

    Hi,

    I not that good at php so I was wondering if some wouldn’t mind shortening this bit of code:

    <?php  echo('<img src="/forums/avatars/' . $current_user->user_login . '.jpg" />'); ?>
    <?php echo('<img src="/forums/avatars/' . $current_user->user_login . '.png" />'); ?>
    <?php echo('<img src="/forums/avatars/' . $current_user->user_login . '.gif" />'); ?>
    <?php echo('<img src="/forums/avatars/' . $current_user->user_login . '.jpeg" />'); ?>

    Basically it is supposed to go through every file extension allowed by the avatar plugin and display the image with the actual extension, there can be only one.

    It is used to display Avatars in WordPress by the way without loading bbPress.

    Any help would be great!

    #78028
    hpguru
    Member

    Utf-8

    My forum is bbPress 1.0.2 and url is http://keskustelu.hpguru.net/

    Thank you. :)

    PS: There is http://keskustelu.hpguru.net/topic/kayta-googlea ä and ö. And in many others topics.

    #78472

    In reply to: Hiding Sub-Forums

    hentdan
    Member

    This works for me…

    function bb_forum_depth( ) {

    global $bb_forums_loop;

    if ( !is_object($bb_forums_loop) || !is_a($bb_forums_loop, 'BB_Loop') )

    return false;

    return $bb_forums_loop->walker->depth;

    }

    <?php while ( bb_forum() ) : ?>

    <?php if (bb_get_forum_is_category()) : ?>

    <tr<?php bb_forum_class('bb-category'); ?>>

    <td colspan="3"><?php bb_forum_pad( '<div class="nest">' ); ?>"><?php forum_name(); ?><?php forum_description( array( 'before' => '<small> – ', 'after' => '</small>' ) ); ?><?php bb_forum_pad( '</div>' ); ?></td>

    </tr>

    <?php continue; endif; ?>

    <?php if (bb_forum_depth() <= 2 ) : ?> <!-- ******* -->

    <tr<?php bb_forum_class(); ?>>

    <td><?php bb_forum_pad( '<div class="nest">' ); ?>"><?php forum_name(); ?><?php forum_description( array( 'before' => '<small> – ', 'after' => '</small>' ) ); ?><?php bb_forum_pad( '</div>' ); ?></td>

    <td class="num"><?php forum_topics(); ?></td>

    <td class="num"><?php forum_posts(); ?></td>

    </tr>

    <?php endif; ?><!-- ******* -->

    <?php endwhile; ?>

    #75069
    Duke
    Member

    I only know how to do it in the forum view, for the latest post author (in every topic)… but I dont know how to make it work for single posts inside the topics…

    Latest poster in a topic, points to profile:

    <a href="<?php user_profile_link($topic->topic_last_poster) ?>"><?php topic_last_poster(); ?></a>

    Come on, there must be a way to link each post author name (inside a topic) to their profile….

    #78025
    Olaf Lederer
    Participant

    The new version is fine, it’s just the old version :) if you update you’re fine

    #78482
    thekmen
    Member

    Thanks for the help, I managed to fix the issue by using

    define('BB_HASH', md5('my key here'));

    in bb-config.php

    #63073
    _ck_
    Participant

    Try this simpler version:

    function bb_target_blank( $text ) {
    $text = preg_replace('|<a (.+?)>|i', '<a $1 target="_blank">', $text);
    return $text;
    }
    add_filter('pre_post', 'bb_target_blank');

    EDIT 22 December 2009. bbPress is stripping the $1 out of the code above. It goes between the ‘a’ and the ‘target’ where you can see two spaces. See here:

    http://pastie.org/753419

    #78283
    yangers101
    Member

    I tried that but it still does not work =(. I have these versions: WPMU 2.8.4a, Buddypress 1.0.3, bbpress 1.0.2. Any more ideas please?

    #78481
    gerikg
    Member
    #78480
    thekmen
    Member

    I wish I didn’t, but I do…bbPress is setting a cookiehash & I need to change it, I thought this would be possible by using

    define('BB_COOKIEHASH', md5('my key here'));

    or

    define('COOKIEHASH', md5('my key here'));

    in my bb-config.php, but whatever I use as ‘my key here’ makes no difference to the cookies created by bbPress, any other ideas?

    #31601
    thekmen
    Member

    Hi all,

    I am trying to integrate BBPress with a few WordPress installs that all share the same user table database.

    All is working fine except for adding:

    define('COOKIEHASH', md5('my key here'));

    in the bb-config.php file, no matter what I add here, the cookiehash is never changed using BBPress 1.0.2, is this a bug have I missed something?

    #68593
    Fernando Tellado
    Participant

    I’m translating and modifying the theme, you can see it in my forum: http://ayudawordpress.com/foro/

    I’ve made some changes to adecuate it to bbPress 1.x (core code adaptations to new functions). I’ve changed some css too, reordered the front page, added the description to the style.css and a screenshot and a lot more. When it is finished I’ll publish it.

    #63072
    tahoekid
    Member

    I can’t seem to get _ck_’s plugin to work, everytime I use it takes away the a href…

    <?php
    /*
    Plugin Name: Target Nofollow External Only
    Description: append target="_blank" and rel="nofollow" only on external links
    Plugin URI:
    Author: _ck_
    Version: 0.0.1
    */

    add_filter('post_text', 'target_nofollow_external_only',999); // unfortunately we have to do this on every page load and not in pre_post

    function target_nofollow_external_only( $text ) {
    $domain="easyloungin-forum.com"; // domain to exclude from target and nofollow
    $text = preg_replace('|<a (.*)rel=['"]nofollow['"](.+)?>|iU','<a >', $text); // strip ALL nofollow
    $text = preg_replace('|<a (?=([^>]+http://))(?!([^>]+'.$domain.'))(.+)>|iU', '<a rel="nofollow" target="_blank">', $text); // add back in when needed
    return $text;
    }
    ?>

    #78470

    In reply to: Hiding Sub-Forums

    EmileGoss
    Member

    I’d try cutting out this block of code in forum.php:

    <?php if ( bb_forums( $forum_id ) ) : ?>
    <h2><?php _e('Subforums'); ?></h2>
    <table id="forumlist">

    <tr>
    <th><?php _e('Main Theme'); ?></th>
    <th><?php _e('Topics'); ?></th>
    <th><?php _e('Posts'); ?></th>
    </tr>

    <?php while ( bb_forum() ) : ?>
    <tr<?php bb_forum_class(); ?>>
    <td><?php bb_forum_pad( '<div class="nest">' ); ?><a href="<?php forum_link(); ?>"><?php forum_name(); ?></a><small><?php forum_description(); ?></small><?php bb_forum_pad( '</div>' ); ?></td>
    <td class="num"><?php forum_topics(); ?></td>
    <td class="num"><?php forum_posts(); ?></td>
    </tr>
    <?php endwhile; ?>
    </table>
    <?php endif; ?>

    #78469

    In reply to: Hiding Sub-Forums

    Jimmy B.
    Participant

    I already have, they’re very very old and so any links with code in them (via Postbin) is gone.

    #78467

    In reply to: Hiding Sub-Forums

    Jimmy B.
    Participant

    Hrmm, that didn’t seem to do the trick for me. That code appears to have some stray “> as well.

    #78466

    In reply to: Hiding Sub-Forums

    EmileGoss
    Member
    <?php if ( bb_forums() ) : ?>
    <h2><?php _e('Forums'); ?></h2>
    <table id="forumlist">

    <tr>
    <th><?php _e('Main Theme'); ?></th>
    <th><?php _e('Topics'); ?></th>
    <th><?php _e('Posts'); ?></th>
    </tr>
    <?php while ( bb_forum() ) : ?>
    <?php if (bb_get_forum_is_category()) : ?>
    <tr<?php bb_forum_class('bb-category'); ?>>
    <td colspan="3"><?php bb_forum_pad( '<div class="nest">' ); ?><a>"><?php forum_name(); ?></a><?php forum_description( array( 'before' => '<small> – ', 'after' => '</small>' ) ); ?><?php bb_forum_pad( '</div>' ); ?></td>
    </tr>
    <?php continue; endif; ?>
    <tr<?php bb_forum_class(); ?>>
    <td><?php bb_forum_pad( '<div class="nest">' ); ?><a>"><?php forum_name(); ?></a><?php forum_description( array( 'before' => '<small> – ', 'after' => '</small>' ) ); ?><?php bb_forum_pad( '</div>' ); ?></td>
    <td class="num"><?php forum_topics(); ?></td>
    <td class="num"><?php forum_posts(); ?></td>
    </tr>
    <?php endwhile; ?>
    </table>
    <?php endif; // bb_forums() ?>

    #31598
    Jimmy B.
    Participant

    Greetings,

    After searching and reading around a bit, I still cannot resolve this “issue”. Basically I’d like to hide the sub-forums from my homepage So that only the category or parent forum shows up.

    I came across this post:

    http://bbpress.org/forums/topic/hide-subforums-on-main-page

    which seemed to offer a quick fix of replacing one line of code:

    <?php if ( bb_forums() ) : ?>

    to

    <?php if ( bb_forums("depth=1") ) : ?>

    Unfortunately this does not seem to work.

    If any further information is needed, please let me know! Thanks very much!

    #78451

    In reply to: bbPress MU

    Rohan Kapoor
    Member

    They will be releasing the code soon but not yet.

Viewing 25 results - 23,876 through 23,900 (of 32,570 total)
Skip to toolbar