Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 23,801 through 23,825 (of 32,481 total)
  • Author
    Search Results
  • #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.

    #78375
    Rohan Kapoor
    Member

    Go to your theme folder, find the theme. Edit front-page.php:

    Remove the following:

    <?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 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; ?>
    <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 endwhile; ?>
    </table>
    <?php endif; // bb_forums() ?>

    #78456
    gerikg
    Member

    take out

    define( 'WP_AUTH_COOKIE_VERSION', 1 );

    if you’re using 2.8.4a and make sure the other “defines” are right after <?

    #78374
    phaniraj01
    Member

    please give me the code to edit..

    I have no programing experience.

    thanks,

    phani

    Texiwill
    Participant

    Hello,

    There is a bug in bb-includes/functions.bb-forums.php, at line 101 in bbpress v1.0.2. The code assumes that the forum_id is the sames the array_id when the array is flattened. This is not always the case if you apply_filters to the forum list such as private forums does.

    The code ccurrently reads:

    _forums[$_id] = $forums[$_id]

    Which may not be true if the forum id is not the same as the array id.

    This code does fixed the problem…. The key is to convert forum_id into an array enumerator so that when you look at $_ids you compare to the proper array which is no longer the full array but one with missing topics/forums.

    $forums = (array) apply_filters( ‘get_forums’, $forums );

    + foreach($forums as $f) {

    + $fids[$f->forum_id] = $f;

    + }

    if ( $child_of || $hierarchical || $depth ) {

    $_forums = bb_get_forums_hierarchical( $child_of, $depth, $forums );

    if ( !is_array( $_forums ) )

    return false;

    $_forums = (array) bb_flatten_array( $_forums, $cut_branch );

    foreach ( array_keys($_forums) as $_id )

    + $_forums[$_id] = $fids[$_id];

    #78443

    In reply to: / in usernames?

    jeffhiggins
    Member

    Suppose I was to use .9, is there any way to actually get my 1.0 database over to a .9 install?

    See, this is the major problem that has been plaguing me all this time. To begin with, I only switched to bbPress because my phpBB3 (modded) broke and the database was partially messed up (no matter what I tried, I could not get that database onto a clean install).

    Luckily I was able to get that db over to bbPress, but now that I am here I feel like A) I’m stuck (no backup/restore feature scares me half to death, and B) that I might have made a mistake. To hear that I should be downgrading to an older version is pretty frightening too, because this is for a client, and I wasn’t planning on sticking around for years to fix all the potential things that might happen from using a year old version of something (especially when support for the .9 version gets dropped altogether.

    I really don’t like phpBB3. It does not offer me to the modification/ease of use that I need as a dev. On the other hand, it seems like the more I try to do with bbPress, the less it delivers. Almost none of the useful plugins work with 1.0.2, so I’m stuck deciding whether I should spend the time creating my own theme (based off of the WP theme for the client), or whether I should be trying to figure out how to get this db (which has changed since I left phpBB3) and move it to a platform that is more mature.

    This is all very frustrating – and basically illustrates why I hate forum software in general. Any suggestions? I’m desperate/almost at my wits end…

    All I really want is:

    1. avatars (not just gravatars) [that users can upload for themselves]
    2. private messages
    3. attachments
    4. smilies

    And yet, it seems like even these things cannot be had with 1.0 – at least not from what I can find by searching this site (which by the way really needs to organize plugins based on bbPress version compatibility). So in a round about way, I guess I’m stuck with bbPress (and hopefully things will improve – don’t get me wrong it’s great software, but it’s just too simple [without plugins] for what I need). That being said, if the only way for me to enjoy those features lised above is via plugins, then how do I downgrade my install to .9? Alternatively, can I [and if so how do I] install .9 and then point it to my pre-existing 1.0 database (so that all the users, posts, etc, are not lost, and so they resolve in the new .9 install)?

    Thanks in advance for any help that you – or anyone else – can give me…

Viewing 25 results - 23,801 through 23,825 (of 32,481 total)
Skip to toolbar