Search Results for 'code'
-
Search Results
-
Topic: PHP Help (Compressing code)
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!
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?
Topic: Hiding Sub-Forums
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!
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];

. I have these versions: WPMU 2.8.4a, Buddypress 1.0.3, bbpress 1.0.2. Any more ideas please?
//))(?!([^>]+'.$domain.'))(.+)>|iU', '<a rel="nofollow" target="_blank">', $text); // add back in when needed
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.