Search Results for 'code'
-
AuthorSearch Results
-
February 18, 2009 at 12:05 am #71923
In reply to: Custom User Groups
farly
MemberOkay I had to change it a bit:
<?php
/*
Plugin Name: Add custom usergroups
Description: Adds custom usergroups
Author: fel64, farly
*/
add_filter('get_roles', 'add_custom_usergroups');
function add_custom_usergroups( $roles ) {
//define custom groups
//$groups['GROUPNAME'] = array('CAPABILITIES LIKE','HUMAN GROUPNAME', array(EXTRA CAPABILITY, EXTRA CAPABILITY));
$groups['probemitglied'] = array('member','Mitglied auf Probe', array());
$groups['mitglied'] = array('member','Mitglied', array());
$groups['kernmitglied'] = array('member','Kernmitglied', array());
$groups['koordinator'] = array('moderator','Koordinator', array());
$groups['leiter'] = array('administrator','Leiter', array());
foreach ($groups as $key => $g) {
$roles[$key] = $roles[$g[0]]; //duplicate member capabilities
$roles[$key]['name'] = __($g[1]); // change name
foreach( $g[2] as $capability ) {
$roles[$key]['capabilities'][$capability] = true; // add extra capabilities
}
}
return $roles;
}
?>February 17, 2009 at 11:03 pm #71922In reply to: Custom User Groups
farly
MemberThanks!
I modified this approach slightly and ended up with this:
<?php
/*
Plugin Name: Add custom usergroups
Description: Adds custom usergroups
Author: fel64, farly
*/
add_filter('get_roles', 'add_custom_usergroups');
function add_custom_usergroups( $roles ) {
//define custom groups
$groups['mitglied_probe'] = array('Mitglied auf Probe', array('rulord_level1'));
$groups['mitglied'] = array('Mitglied', array('rulord_level1', 'rulord_level2'));
$groups['kernmitglied'] = array('Kernmitglied', array('rulord_level1', 'rulord_level2', 'rulord_level3'));
$groups['koordinator'] = array('Koordinator', array('rulord_level1', 'rulord_level2', 'rulord_level3', 'rulord_level4'));
$groups['leiter'] = array('Leiter', array('rulord_level1', 'rulord_level2', 'rulord_level3', 'rulord_level4', 'rulord_level5'));
foreach ($groups as $key => $g) {
$roles[$key] = $roles['member']; //duplicate member capabilities
$roles[$key] =& $user[$key]; //convenience
$user[$key]['name'] = __($g[0]);
foreach( $g[1] as $capability ) {
$user[$key]['capabilities'][$capability] = true;
}
}
return $roles;
}
?>It works for me so far
February 17, 2009 at 7:23 pm #71942In reply to: Can’t delete or modify users as admin
Ipstenu (Mika Epstein)
ModeratorFlip back to the default themes and see if the problem persists. If no, it’s the theme. If it persists, collect the following:
1) bbPress version
2) Plugins
3) WP version (if integrated)
and report back!
February 17, 2009 at 5:09 pm #71921In reply to: Custom User Groups
johnhiler
MemberYou can use fel64’s unofficial plugin to add a new Role:
https://bbpress.org/forums/topic/adding-a-new-user-type?replies=6#post-9210
I’ve used this together with Hidden Forums, and it works really nicely!
February 17, 2009 at 12:46 pm #69481In reply to: del Sol Owners Club
Shagalaga
MemberNice
but some usernames are missing(or hidden?)
February 17, 2009 at 6:59 am #71917In reply to: WordPress Permalinks in BBpress
coolsaggu
MemberHi chrishajer,
Thanks for the suggestion…….
but they are bound to change sometime in future.
I also read your article. Thanks I was bit struggling with this thing also(getting WP info in BBpress). But even if I get the information, how would i construct the Permalink structure of the WP.
I have been following the WP code to write my own functions, but they seem to go pretty deep and I dont know whether creating a copy of these functions in BBpress would be safe or not.
February 17, 2009 at 1:45 am #71885In reply to: “pretty” permalinks in bbPress
chrishajer
ParticipantThere is no restart required for modifying an .htaccess file: Apache reads that for every access.
The permalinks are not related to PHP4 vs PHP5.
The permalink stuff is definitely 100% right now, at least for the 0.9.x series.
I’m assuming you made the change in the admin to turn on the permalinks, in conjunction with adding the .htaccess rewrite rules?
I had to insert this into my .htaccess to turn OFF the multiviews before the rewrite rules would work:
Options -MultiViews
February 16, 2009 at 2:08 pm #71916In reply to: WordPress Permalinks in BBpress
chrishajer
ParticipantIt would be easiest to hard code them if they don’t change very often.
_ck_ described how to get bbPress information inside WordPress. Maybe something similar would work in an opposite fashion to get WordPress information inside bbPress:
February 15, 2009 at 11:51 pm #71255lookfab
MemberWill there be a version of 0.9 that supports php4, or is 1.0 the next time we’ll see php4 support in an official (beta) release?
February 15, 2009 at 6:19 pm #71214In reply to: List all Tags?
circuit
Membermy line 2529 was blank so i replaced the nearest thing i could see that was similar to
return "<small> - <a href="/forum/profile.php?id=$tag->user_id">$poster</a></small> [<a href='$url' class='delete:$list_id:tag-{$tag->tag_id}_{$tag->user_id}' title='$title'>×</a>]";
now, either as a result of this or as a result of the updates described in this page:
https://bbpress.org/forums/topic/theme-template-files-to-change-for-10#post-23794
…my tag area no longer automatically reloads when a tag is added, even though the tag is committed to the db and can be seen if you reload the page. i am a bit worried that users are going to be confused by this. i bet i have replaced the wrong line, but i am not sure…
February 15, 2009 at 4:58 pm #71678Asbjørn Ulsberg
MemberI’m having the same problem and it seems that the WP integration for whatever mysterious reason forces the MySQL connection into “localhost” mode. I’ve configured both WP and bbPress to connect to another MySQL host, but still it seems like bbPress is trying to connect to “localhost”.
I added a print_r($args) inside the db_connect_host() function and found that the function is called twice and the first time the credentials, host, etc., are correct and the second time they aren’t. The second time the function is called, the credentials are for some reason set to the ones of the logged in user. So somewhere in the bbPress code, authentication is done not with the values stored in bb-config.php, but with the username and password of what’s stored in the session cookie and the host is then set to “localhost”.
I don’t know how to investigate this problem any further.
February 15, 2009 at 3:33 pm #71666anandsrinivasan
MemberWorks like magic..You are a rockstar, Chris!!
Thanks again..
February 15, 2009 at 3:17 pm #71664chrishajer
ParticipantYes, probably. You can see if that’s the problem by logging in as keymaster and going to the Admin section, then Settings > General (sometimes this is the URL http://wat2.com/bb-admin/options-general.php). Once there, change “Pretty Permalink Type” to “None” and then try your forum. If your forum is usable after that, then yes, it’s because bbPress is trying to use permalinks, but you have not set up the .htaccess file with rewrite rules.
You can create the rewrite rules by accessing this URL in your forum:
http://wat2.com/bb-admin/rewrite-rules.php
Now, take the output from that browser window and paste it into a .htaccess file in the forum root (
/home/web/htdocs/whatever/wat2/.htaccess
) on your server. Once that’s done, change the permalink setting back to one of the other two options (Numeric or Name based) and then try accessing topics and the profile page in your forum.https://bbpress.org/documentation/faq/#pretty-permalinks
(I don’t recommend the
Options +MultiViews
line, but that does work for some people instead of creating the rewrite rules in the browser). Be sure you’re logged in as keymaster before you try to access http://wat2.com/bb-admin/rewrite-rules.php or it won’t work.salemw
MemberWell my friend found a solution for me and in case I wasn’t the only one asking for excerpt RSS
here it is:
Add this function to functions.bb-template:
// excerpt for rss
function post_text_excerpt( $post_id = 0 ) {
echo apply_filters( 'post_text', get_post_text_excerpt( $post_id ), get_post_id( $post_id ) );
}
function get_post_text_excerpt( $post_id = 0 ) {
$bb_post = bb_get_post( get_post_id( $post_id ) );
// Number max of characters
$max_rss=250;
$excerpt_rss = $bb_post->post_text;
if (strlen($excerpt_rss)>$max_rss) {
$excerpt_rss = substr(ltrim($excerpt_rss), 0, $max_rss);
preg_match('<code>.+(?=[,;.])</code>s', $excerpt_rss, $out1);
preg_match('<code>.+(?=[ ])</code>s', $excerpt_rss, $out2);
if ( ( strlen($out2[0]) - strlen($out1[0]) ) < $tronque_maxi) {
$excerpt_rss = $out1[0];
} else {
$excerpt_rss = $out2[0];
}
if (preg_match('<code>.+(?=(de|du|dans|le|la|a|à)$)</code>s', $excerpt_rss, $out3)) {$excerpt_rss = $out3[0];};
return $excerpt_rss."...";
} else {
return $excerpt_rss;
}
return apply_filters( 'get_post_text', $excerpt_rss, $bb_post->post_id );
}
// end excerpt for rssAnd replace post_text() par post_text_excerpt() in my-templates/your_template/rss2.php
The author website:
February 15, 2009 at 5:00 am #71902In reply to: Why isnt…..
John James Jacoby
KeymasterJust because you’re brother and sister doesn’t mean you wear the same clothes.
You have a totally valid point, and I think once the development process is mostly *over* that making things pretty will be addressed, but right now I think the consensus is that making it all pretty is wasted effort because of how quickly each platform changes.
February 15, 2009 at 2:43 am #4861Topic: BuddyPress Group Forums for bbPress
in forum PluginsBurt Adsit
MemberI’ve got this plugin up to something testable and releaseable. v0.21
Description
Enable BuddyPress group forum features in bbPress.
BuddyPress has three types of groups. Public, Private and Hidden. In all three cases users must be members of a group to participate in group forum conversations.
These two plugins modify a standard bbPress forum installation to allow BuddyPress group members to carry on discussions in bbPress.
BuddyPress public groups will be read only in bbPress. Anyone wishing to participate in a public group discussion must be a member of that group in bp.
BuddyPress private and hidden groups will be hidden in bbPress. Only members of these groups will see the forums and be able to participate.
BuddyPress group admins and mods have moderator privileges in bbPress. The moderator role is restricted to their group forum.
Read more and download:
http://code.ourcommoninterest.org/2009/02/14/buddypress-group-forums-for-bbpress/
February 14, 2009 at 9:28 pm #71901In reply to: How to create a message for non-logged in users
chrishajer
ParticipantUse
<?php if ( !bb_is_user_logged_in() ) : ?>
then if that comes back true (they’re not logged in) display your message.Examples of this can be found in the front-page.php template file.
February 14, 2009 at 10:06 am #68476In reply to: WordPress 2.7 and bbPress?
C Bog
Memberi have spent some time now analyzing the code of bbpress and wordpress.
it seems to me that an update of the old bbpress code (version 0.9.0.4) is unfeasable, because sam already managed to succesfully integrate version 1.0 with wordpress 2.7.1
all you have to do in order to use bbpress alpha with the recent versions of wordpress is to follow the bbpress installation instructions and it will work out of the box.
there is still some work to be done. as far as i can tell, bbpress and wordpess use multiple cookies for multiple paths. the one they share is the one for the root path. so… if you login into wordpress, you won’t be logged in into bbpress admin section. this does not happen the other way arround.
it is not recomended though to use the alpha version in production sites. for now, it seems that a downgrade of wordpress would be the best solution.
February 13, 2009 at 3:51 pm #68474In reply to: WordPress 2.7 and bbPress?
C Bog
Memberas far as i can see, by studying the code, wordpress has introduced a salt for hashing the passwords since 2.5
bbpress (my version is 0.9.0.4) has not updated it’s functions to include this salt.
the alpha release of bbpress 1.0 seems to take care of this problem, but the file structure, as far as i can see is completely different from the older versions, so a simple copy & paste wouldn’t do.
maybe the stable 1.0 release will take care of this issue, but since then (i don’t recommend using the alpha version on production web sites) i will try to modify the pluggable.php file of bbpress 0.9.0.4 in order to allow the usage of salts.
i’ll be back these days with further details.
February 13, 2009 at 7:59 am #71883In reply to: “pretty” permalinks in bbPress
pro101
MemberOK — I stumbled upon the FAQ and saw the htaccess code to add. I LOVE the URLs, could never get to this in phpBB. If this thing is secure, I’m going to love bbPress. Kudos to the dev team, very cool forum software!
And thanks Angie!
February 12, 2009 at 9:47 pm #4849Topic: bbPress beta coming soon?
in forum Installationpro101
MemberHi all: I’m a WP2.7 user and find the idea of running our forum on bbPress very interesting. Only issue is the Alpha level of 1.0 code and inability to use the 0.9 GA with WP2.7.
– any idea when we can expect a stable enough beta?
– if I decide to install the Alpha release on a separate DB (just to insulate our live WP site), will there be an easy path later on to consolidate for single login when bbPress 1.0 goes GA?
February 12, 2009 at 2:13 pm #71775In reply to: Posts added to all MU blogs showing on one forum???
Ipstenu (Mika Epstein)
ModeratorI think it’s less chicken/egg and more apples/oranges.
Different people like blogs than like forums, and topics in blogs rarely are formatted in the way you would for a forum. Your mileage may vary, of course, but a beautifully crafted blog post, in my experience, is a tl;dr post on a forum. Not to mention the SEO implications
February 12, 2009 at 9:45 am #71866In reply to: Using bbpress functions from the wordpress theme
tfab69fr
MemberUnfortunately this causes an error:
Fatal error: Cannot redeclare _http_build_query() (previously declared in E:wampwwwrs_prod_nextforumbb-includesbackpressfunctions.compat.php:21) in E:wampwwwrs_prod_nextwp-includescompat.php on line 45
February 12, 2009 at 8:25 am #71867In reply to: Paypal or Premium Subscriber Mode
johnhiler
MemberYou could use create a new Role, and then restrict access to a specific forum only to people in that role or higher using Hidden Forums:
https://bbpress.org/plugins/topic/hidden-forums/
You’d still need a hook into Paypal, if you wanted to automate purchasing of access to your premium forum… but you could take that code from some of the existing WordPress or WordPress MU programs out there?
February 11, 2009 at 5:28 pm #59105In reply to: WordPress/BBPress Single Sign On
Ipstenu (Mika Epstein)
ModeratorIn your bb-config:
$bb->wp_table_prefix = 'wp_econome'; // WordPress table prefix. Example: 'wp_';
In your wp-config:
$table_prefix = 'wp_econome_'; // Only numbers, letters, and underscores please!
Looks like you’re missing an underscore in bb-config.
Also try changing this on your bbconfig:
$bb->sitecookiepath = '/starteconome/blog/';
-
AuthorSearch Results