Search Results for 'code'
-
AuthorSearch Results
-
September 30, 2009 at 8:14 pm #79962
In reply to: removing tags
Mark
MemberLooks like it’s bb_repermalink that’s choking and causing us to get that blank page.
Submit to trac? You can modify the following in functions.bb-core.php, starting on line 737;
$_original_id = $id;
if ( !$id )
$permalink = bb_get_tag_page_link();
else {
global $tag, $tag_name;
$tag_name = $id;
$tag = bb_get_tag( (string) $tag_name );
$permalink = bb_get_tag_link( 0, $page ); // 0 => grabs $tag from global.
}To;
$_original_id = $id;
$tag = bb_get_tag( (string) $id );
if ( !$tag )
$permalink = bb_get_tag_page_link();
else {
global $tag, $tag_name;
$tag_name = $id;
$permalink = bb_get_tag_link( 0, $page ); // 0 => grabs $tag from global.
}And instead of returning that blank page, it will return the global tags page. Possibly not the most eloquent solution, but works nonetheless.
September 30, 2009 at 8:04 pm #79998In reply to: MU or WP for BB Integration
Mark
MemberHonestly when it comes to basic integration there’s absolutely no difference. WP and WPMU are the same codebase after all. The only real difference is whether or not you want your blog owners to be automatically added to your primary blog and by proxy as members of the forum.
Deep integration is accomplished exactly the same on either platform too. Just stick with µ, eventually (as in anywhere from tomorrow to 2017) the two will merge anyways and if you install a second copy of standalone WP.org for your forums, you’re just going to wind up with two µ’s down the road.

I noticed you tagged this convo bbmu, just so you know (you probably do) but when you integrate bbPress with µ you don’t get bbPress µ as a result. When /bbpress is accessed, no matter the blog, the viewer will get the exact same forum.
September 30, 2009 at 7:30 pm #64937In reply to: Make BBPress a Page in WordPress???
kaz1844
Memberhere’s what I did to get a page in wordpress in my navigation bar that redirects to the bbpress part of my site: set up a page template and made sure it was selected when I set up the forum page in wordpress – the template simply included redirection code:
<?php
/*
Template Name: Forum Section
*/
?>
<?php
header( ‘Location: http://www.yourdomain.com/your-forum-name-directory’ ) ;
?>
September 30, 2009 at 6:53 pm #79961In reply to: removing tags
chrishajer
ParticipantI didn’t actually check the code, if it was 200 or 500. I just assumed the blank page was due to a 500 error. It would be nice to see “sorry that tag does not exist” or something on an error page.
Try to browse a non-existent tag here and see what happens.
Just checked here and it’s a 200 response with a blank page. My information about 500 error earlier was incorrect.
September 30, 2009 at 6:44 pm #79960In reply to: removing tags
Mark
MemberYou might want to explore where that 500 is coming from, that probably shouldn’t happen. I did the same thing just to see if it was inherent to bbPress or maybe just bbPress.org, and it seems it might be just you.
I got a blank page (would be nice to see that redirect somewhere else for non-existent tags) but it was showing a 200 ok, and not a 500.I just realized bbPress doesn’t have anywhere to view/edit tags in the administration panel. Is that coming down the road?
September 30, 2009 at 2:35 pm #79951In reply to: Unhide Profile Email Adresses
Adam Harley (Kawauso)
Member<?php
function add_email_spec_meta( $arr ) {
if( !bb_is_user_logged_in() || bb_current_user_can( 'edit_users' ) )
return $arr;
if( bb_get_location() != 'profile-page' || stripos( $_SERVER[ 'QUERY_STRING' ], 'tab=edit' ) !== false )
return $arr;
$arr['email_spec'] = $arr['user_email'];
global $wp_users_object;
$id = bb_get_current_user_info( 'id' );
$meta_key = 'email_spec';
$meta_value = bb_get_usermeta( $id, 'user_email' );
$wp_users_object->update_meta( compact( 'id', 'meta_key', 'meta_value' ) );
return $arr;
}
add_filter( 'get_profile_info_keys', 'add_email_spec_meta' );
?>September 30, 2009 at 2:31 pm #79995In reply to: integration into a portal
Ashish Kumar (Ashfame)
ParticipantTechnically its all feasible.
a) you can override bbPress login functions with the ones matching with your portal
b) that’s again feasible (I think CK was working on a plugin for this, try some searching)
c) its feasible but I don’t have any idea of going about it
d) which credentials? login credentials through GET?
u gotta be kidding meSeptember 30, 2009 at 12:38 pm #79948In reply to: Unhide Profile Email Adresses
chrishajer
ParticipantMaybe you could add that capability to the
memberrole?September 30, 2009 at 12:31 pm #79993In reply to: Page Not Found error after changing url
chrishajer
ParticipantIf you want to reinstall, you also need to remove the database tables, in addition to bb-config.php.
You can also edit your bb-config.php and add a line like this to override the configuration:
$bb->uri = 'http://klikerlab.pl/forum/';You have to rename the folder where you installed bbPress as well, from bbpress to forums. You can’t just make the configuration changes.
September 30, 2009 at 11:52 am #79992In reply to: Page Not Found error after changing url
ailusia
MemberUpdate – now both urls show 404 error
September 30, 2009 at 7:12 am #79945In reply to: Unhide Profile Email Adresses
Ashish Kumar (Ashfame)
ParticipantWith what I understand, the thing is only functions in
functions.bb-pluggable.phpcan be masked (plugged) as its the last file to look for undefined functions. Defining any function which is there overrides the definition in that file. But what if we need to change the behaviour of a function which is somewhere else?I would love to see someone prove me wrong.
September 30, 2009 at 6:34 am #79944In reply to: Unhide Profile Email Adresses
Ashish Kumar (Ashfame)
ParticipantOn line 2368 of
functions.bb-templateunderbb-includesdir of your bbPress resides the code you want to change.bb_current_user_can( 'edit_users' )Editing a core file is not recommended but I am unsure of how to mask it to call a custom function instead of the core function.
If its unmaskable for now (architectural) and you want a fix, then either you can change that
bb_current_user_can( 'edit_users' )withbb_is_user_logged_in()but you will have to do it again when you upgrade (or till someone posts a recommended fix) or you can append this line in your profile.php after the call to the bb_profile_data()<?php
if ( bb_is_user_logged_in() ) {
echo $user->user_email;
}?>[untested but should work]
September 30, 2009 at 5:37 am #79862In reply to: add text to home page of forum
hpguru
MemberEdit a themes front-page.php.
Replace
<h2><?php _e('Hot Tags'); ?></h2>
<p class="frontpageheatmap"><?php bb_tag_heat_map(); ?></p>with…
<h2><?php _e('Some Text'); ?></h2>
<p>Text text text.</p>September 29, 2009 at 9:19 pm #79955In reply to: Aligning text in Topics.
chrishajer
ParticipantI think you could probably add it an allowed tags, but I don’t think I’ve ever seen it.
https://bbpress.org/plugins/topic/admin-can-post-anything/
https://bbpress.org/forums/topic/plugin-using-the-strike-tag#post-3709
https://bbpress.org/forums/topic/allowing-html#post-5279
To align the text, you’re going to need to allow a div or span I think, with a limited number of attributes.
There was some recent discussion too, with someone posting a lot of code, but I can’t find that reply right now.
September 29, 2009 at 6:54 pm #79887In reply to: Link Cloaking
aiitee
Memberhey kawauso, thanks for that code i will try it!
i was thinking to cloak almost all links inside a post or thread.
mostly links to download sites like megaupload or rapidshare, etc. but also links to anything inside a post.
the code from kawauso is exactly what i’m talking about.
cya and thanks!
September 29, 2009 at 6:14 pm #79923In reply to: Some PHP help please
Adam Harley (Kawauso)
MemberThe cleanest way of doing this hasn’t been mentioned. Instead of using echo commands, it’s a lot easier to just wrap HTML.
<?php if ( bb_is_user_logged_in() ) : ?>
this
<?php elseif : ?>
not this
<?php endif; ?>September 29, 2009 at 4:58 pm #79920In reply to: Forums excerpt and description?
Mark
Member@olaf, muchos appreciado senor, but I’ve already written my own workaround.
Just more of a suggestion based on situations I’ve ran into, something to consider as a future feature to make it easier for those who aren’t at home with PHP.The problem with simply truncating such a thing is you could wind up with a front page description of something like “The following forum is a good place to…” or something of the sort. I’ve looked at a lot of other bbPress sites in the last couple of months, and they all seem to be fairly out of the box setups, so I’m not so sure this is really widely being sought out, just something that would be fairly easy to implement and might aid in future scalability of bbPress installations.
September 29, 2009 at 4:48 pm #79929In reply to: Registration/Log In Link in homepage?
gerikg
Memberpart 1. This will work in BBpress only:
<?php if ( !in_array( bb_get_location(), array( 'login-page', 'register-page' ) ) ) login_form(); ?>put that in the header.php I’m not sure how to do it in WP to make it work.part 2. edit the logged-in.php in your bb theme
September 29, 2009 at 3:09 pm #79921In reply to: Some PHP help please
gerikg
Memberme either..
try this..
<?php if ( bb_is_user_logged_in() ) echo "";
else
echo "PUT_YOUR_LINK_IN_HERE"; ?>see if that works, hopefully someone who can write php will chime in.
September 29, 2009 at 2:28 pm #31916Topic: How to prevent bb_repermalink from calling a 404
in forum TroubleshootingAphelionZ
ParticipantI need to create a few urls from my forum root at /community like so:
/community/forums/ – shows just a simple list of all forums
/community/leaderboards/ -custom functionality
/community/achievements/ – more custom functionality
It’s easy enough to achieve this with a query string and if statements in front-page.php, but I’m trying to use .htaccess to achieve this like so:
RewriteRule ^forums/$ index.php?view=forums [L,QSA]I was getting the bbpress 404 page until I drilled down into bb-admin/functions.bb-core.php and changed line 667 from
$issue_404 = true;to
$issue_404 = falseIt worked fine but I’m not comfortable changing the core code like that, as it’s indicitave that I’m doing something wrong – but what exactly? What should I change about my approach to get the page to serve correctly?
September 29, 2009 at 1:13 pm #79859In reply to: add text to home page of forum
amylmc
MemberI’m not code savvy. Can you please advise the specifics of what and where within the file to add it?
Thank you!
September 29, 2009 at 9:40 am #79919In reply to: Forums excerpt and description?
Olaf Lederer
ParticipantMaybe you can shorten the desription using this custom php function?
if (!function_exists('substring_words')) {
function substring_words($str, $txt_len, $prefix = ' [...]') {
$words = explode(' ', $str);
$count = 0;
$new_str = '';
$abbr = '';
foreach ($words as $val) {
if ($count < $txt_len) {
$new_str .= $val.' ';
$count = $count + strlen($val);
}
}
$new_str = rtrim($new_str, ' ,.;:');
$new_str .= (strlen($str) > $txt_len) ? $prefix : '';
return $new_str;
}
}September 29, 2009 at 2:10 am #79844In reply to: Need poll for version 1.02 now!
Mark
MemberDowngrading is not an option.
If I could use signatures here, that would be my new one.
September 28, 2009 at 7:49 pm #79909In reply to: Probably Easy Answers for This…
01020230302
MemberI have it integrated with WPMU and it works fine in that respect – linking user/pass from WPMU and so on. However, when I login as admin I am able to create post,reply. When I login as a member I am not able to create a new topic and I see the words ‘REPLY’ but no option to
September 28, 2009 at 7:01 pm #75591gerikg
MemberJosef, take out in wp-config
/**bbpress integration **/
define('USER_COOKIE', 'wordpressuser');
define('PASS_COOKIE', 'wordpresspass');
define('COOKIEPATH', $base);
define('SITECOOKIEPATH', '/');
define('COOKIE_DOMAIN', '.thisissite2.com'); // same as bbPressand bb-config
$bb->wp_home = 'http://thisissite2.com/';
$bb->wp_siteurl = 'http://thisissite2.com/';
// Integrating with mu
$bb->cookiepath = '/';
$bb->cookiedomain = '.thisissite2.com'; // leading . allows subdomain sharing
$bb->usercookie = 'wordpressuser'; // WPMU doesn't hash cookies
$bb->passcookie = 'wordpresspass'; // WPMU doesn't hash cookiesUse this plugin https://wordpress.org/extend/plugins/bbpress-integration/
If you’re using MU you will get 4 lines, cookiehash, cookie_domain, sitecookiepath, and cookiepath.
get the information from there and put it right AFTER this line in wp-config
* @package WordPress
*/then paste only cookie_domain, sitecookiepath, and cookiepath in bb-config file. leave out cookiehash right after
* @package bbPress
*/Then get new keys, use this link https://api.wordpress.org/secret-key/1.1/salt it has 8 keys put it in both like you did before. Don’t forget the BB_ prefix in bb-config.
Clear your cache and cookies. Give it a try. if that doesn’t work then look in your BB dashboard and check your settings on wordpress integration. make sure if you left out “www” in wordpressd to leave it out on bbpress.
-
AuthorSearch Results