Search Results for 'code'
-
AuthorSearch Results
-
October 21, 2007 at 8:58 pm #53604
In reply to: Add a “page” to my template
livibetter
MemberHi,
Here is a quick php for it(Use this method at your own risk), you need pretty permalink to use it.
Save the following code in bbPress root folder as
page.php<?php
require_once('./bb-load.php');
if (preg_match('/.*/page/(.*)/', $_SERVER['REQUEST_URI'], $matches)) {
$file = bb_slug_sanitize($matches[1]) . '.php';
if (file_exists(bb_get_active_theme_folder() . "/static/$file")) {
bb_load_template("static/" . $file);
exit(0);
}
}
wp_redirect(bb_get_option('uri'));
?>Put your static pages in a new
staticfolder under your template folder, they should looks like<?php bb_get_header(); ?>
The static content here.
<?php bb_get_footer(); ?>Then you can access a static file. For example, access
test.php(bb-templates/yourtemplate/static/test.php) at http://yoursite.com/bbpress/page/testRemember: Use this method at your own risk
October 21, 2007 at 8:14 pm #61197In reply to: Blank screen after installing bbPress
livibetter
Membermajea,
You used
require_oncein a wrong way. If you installed WordPress in /path/to/wordpress and bbPress in /path/to/bbpress, then you should userequire_once '../wordpress/wp-blog-header.php'.You normally use
require/includefor local .php.PS. I don’t use WordPress and bbPress together.
October 21, 2007 at 11:55 am #60752In reply to: Shares Roles with WordPress [Role Manager]
grosbouff
ParticipantI thinking to start developping a plugin.
I’m not a real coder but i’ll try.
Anyway, I think the problem is that bbpress uses names and not levels (like wordpress) for roles, so it will be hard to do, no ?
If you have ideas, if you want to help me, please feed this threat !
October 20, 2007 at 9:00 pm #61186In reply to: Plugin: Gravatar
livibetter
MemberAha… I just realized that I didn’t know users can change their registered email. (I use a Key Master to edit normal user’s profile…)
I should remove this Gravatar Email field to make code simpler and add another field
Use Gravatar?. Maybe add some other features as well.I am also waiting Gravatar to allow larger avatar. Once it allow, I will put a new version out.
vitovarducci
MemberAwesome. OK, so I removed the entry from the database and I was able to login like normal.
Then I went back and created a new post again to test if it would create a new topic in bbpress. No new topic. And it wouldn’t let me login to the backend again.
So I went back and removed the
capabilitesentry from the database.I can create topics no problem in bbpress. Just doesn’t create new topics when I write posts.
fel64
MemberMmmm. Bum.
Open phpmyadmin, browse wp_usermeta, look for a very recent record for your user_id, where meta_key =
capabilitiesand meta_value looks something likea:1:{s:6:"member";b:1;}. Then delete that and try again.October 20, 2007 at 12:11 am #2523Topic: Plugin: Gravatar
in forum Pluginslivibetter
MemberI wrote a simple plugin for Gravatar. I am planning to put files on Extend, but I am still waiting. You can download it from Google Code for now, please visit this plugin’s homepage. You can find a download link and know how to modify your theme in the page.
It is relatively simple:
- Gravatar Email field – This plugin doesn’t use user’s registered email.
- Email Verification – Users need to own the Gravatar Emails which they input.
- Support Default Image
- Size customized (1..80px)
I hope I can hear your thoughts about this plugin.
October 19, 2007 at 10:35 pm #61181In reply to: Error while posting
chrishajer
ParticipantWhat version of bbPress are you using and what type of host system is it on? It looks like the single quote in
Mail'sthrowing for a loop, but I haven’t seen that happen in any recent version of bbPress.October 19, 2007 at 7:02 pm #55812In reply to: Plugin: YouTube in bbPress
Trent Adams
MemberI managed to destroy this one and with a server crash and just haven’t rewrote it yet, but if you head over to https://bbpress.org/plugins/topic/55?replies=8 that plugin will do the same thing

Trent
fel64
MemberYo,
good good. Now instead of
global $bb_cache;tryglobal $bb_cache, $bb_roles;
October 19, 2007 at 5:58 pm #52877In reply to: Akismet 4 link limit in posts or whitelist
bobbyh
MemberThanks Sam!
vitovarducci
Memberhmm… I did it… but I get another error when creating new posts…
Warning: array_filter() [function.array-filter]: The second argument, 'Array', should be a valid callback in /homepages/28/d126493713/htdocs/cbusaffairs1/forum/bb-includes/capabilities.php on line 271
Warning: Invalid argument supplied for foreach() in /homepages/28/d126493713/htdocs/cbusaffairs1/forum/bb-includes/capabilities.php on line 275
Warning: array_filter() [function.array-filter]: The second argument, 'Array', should be a valid callback in /homepages/28/d126493713/htdocs/cbusaffairs1/forum/bb-includes/capabilities.php on line 271
Warning: Invalid argument supplied for foreach() in /homepages/28/d126493713/htdocs/cbusaffairs1/forum/bb-includes/capabilities.php on line 275
Warning: array_filter() [function.array-filter]: The second argument, 'Array', should be a valid callback in /homepages/28/d126493713/htdocs/cbusaffairs1/forum/bb-includes/capabilities.php on line 271
Warning: Invalid argument supplied for foreach() in /homepages/28/d126493713/htdocs/cbusaffairs1/forum/bb-includes/capabilities.php on line 275
Warning: array_filter() [function.array-filter]: The second argument, 'Array', should be a valid callback in /homepages/28/d126493713/htdocs/cbusaffairs1/forum/bb-includes/capabilities.php on line 271
Warning: Invalid argument supplied for foreach() in /homepages/28/d126493713/htdocs/cbusaffairs1/forum/bb-includes/capabilities.php on line 275
Warning: Cannot modify header information - headers already sent by (output started at /homepages/28/d126493713/htdocs/cbusaffairs1/forum/bb-includes/capabilities.php:271) in /homepages/28/d126493713/htdocs/cbusaffairs1/wp-includes/pluggable.php on line 341Sorry, I just don’t understand the code well enough to figure it out myself…
fel64
MemberSlex, you didn’t, it’s cool, and for the last week I have barely posted here without being rather drunk (since I usually see posts late at night when I come home). I did not know about you and I somewhat hope that you did not know about me. It is cool.
Jazbek, have you tried it? It has been a good half-year since I came up with the
globals solution, but even from a purely theoretical standpoint I don’t see why it would work. The key issue is that bb-include files cannot access the globals, and declaring globals in some function in wp shouldn’t change that. The only thing that seems like it could is the main code, ie. config.php.Of course, perhaps I’m making something of a fool of myself and it would totally work. If you’ve tried it and it worked for you (meaning also that without the
globals code in bbsync.php you had fatal errors) then I’ll check it out again. Cheers.jazbek
Memberfel, do you think maybe you should add
global $bb_cache;to the bbsync.php file instead of telling everyone to add it to their config? wouldn’t it work out of the box that way?October 19, 2007 at 6:31 am #52876In reply to: Akismet 4 link limit in posts or whitelist
Sam Bauers
ParticipantPut this in a plugin file named ‘_addSuperuser.php’ in the my-plugins directory:
function addSuperuserToArray($array)
{
$array[] = 'Superuser';
return $array;
}
add_filter('bb_trusted_roles', 'addSuperuserToArray');.
If there is no my-plugins directory in the bbPress root, just create it. The underscore at the start of the file name should make the file autoload, so it is available without activation in the admin area.
October 19, 2007 at 6:17 am #52875In reply to: Akismet 4 link limit in posts or whitelist
bobbyh
MemberI ran into a similar problem. Specifically, I created a new Role called ‘Superuser’ that has capabilities between Member and Moderator. I don’t want these users ever to be spam-filtered.
I solved this by replacing this function in /bb-includes/functions.php:
function bb_trusted_roles() {return apply_filters( 'bb_trusted_roles', array('moderator', 'administrator', 'keymaster') );}with this:
function bb_trusted_roles() {return apply_filters( 'bb_trusted_roles', array('moderator', 'administrator', 'keymaster', 'Superuser') );}This works, but I hate hacking the core. Is there a way to do this with a plugin? I tried and tried, but I couldn’t figure out how to array_push a new Role on that array. Can somebody help me, perhaps with their superior understanding of how add_filter works?

Thanks!
-Bob
fel64
MemberSlex, indeed there’s some issue there. It probably needs further thinking about. However, like I said if you want to modify it to stop wp saving comments, or even to make bb add replies to wp comments, implement the change and I would definitely like to make a branch of bbsync.
Vito, can you please open bb’s config.php file and add this line to it somewhere?
global $bb_cache;That should fix that error (assuming you’re using the latest stable, .8.3!).
No good news on making backdated topics I’m afraid, because there’s no way to use the API to create the topic and set the time of it to be in the past. You’d have to copy and modify some large blocks of code, which is exactly what I want to avoid with bbsync (regarding the problem that became with bbpress post, for example).
However, if you edit an old post in wp and press save, it will create a new topic in bb for you (but with today’s date, rather than the appropriate one). It’s an unfortunate limitation of bbsync.
vitovarducci
Memberfel,
Thank you so much. I never even had bbpress post, I thought that this migration would create new topics for each already existing blog post.
But every time I try to create a new post, I receive this error:
Fatal error: Call to a member function on a non-object in /homepages/28/d126493713/htdocs/cbusaffairs1/forum/bb-includes/functions.php on line 997The post is still created on the blog, but nothing happens in bbpress.
Is this an error on my part?
Also, is there any way to create the new topics for each already existing blog post?
Thank you so much for all your help.
October 19, 2007 at 1:30 am #60750In reply to: Shares Roles with WordPress [Role Manager]
Lars-Christian
MemberI’ve looked through the (two) plugins that allows us to restrict forums, and sadly, it seems your guesses are correct. The first one which allows you to allow users in to a forum based on member names is hardly compatible with the latest version of bbPress (and seems dead). I almost got it working right, except for the fact that it messed up my forum hierarchy, and some other bugs, which meant that threads couldn’t be posted to a certain forum without being in that forum, which was enough for me to rule it out.
The other option, private forum as you tried out yourself, doesn’t allow us to do anything but restrict it to either members, mods or admins, which is the most viable solution to me at this point. It does mean however that I will need to give all my members who need access to the restricted forum moderator capabilities. Hardly ideal, but I’ll have to go with it for now.
I’ll be looking at it this weekend though, and hopefully I can find a sort of solution to it. Right now I’m thinking of finding a way to strip moderators of actual moderating powers, but I really don’t know. Adding another usergroup (pretty simple) should work too, but it has to be reflected in the plugin as well, but I don’t have the coding skills (I don’t have any coding skills) to do that.
Hopefully a gifted plugin developer will step in and solve this for us
October 18, 2007 at 11:47 pm #61119In reply to: Key Master Doesn’t Have Permission to Add Forum
Lars-Christian
MemberWell, this is just plain weird. Still haven’t been able to fix it for my original WP admin account (the dummy one holds up however), but I experienced something even weirder today.
Was logged in, adding some tags to a thread, and whoops, after being able to add one just fine, it gave me the “No permission” message when I tried to add a second.
Go figure.
Hope someone is able to work out a fix for this. Haven’t added any code to the config.php file.
October 18, 2007 at 10:00 pm #61166In reply to: Fatal Error Prior to Installation
iamfyrestorm
MemberWell, I don’t know, but since there’s a deregister view following the register view function maybe it’s not necessary.
function bb_register_view( $view, $title, $query_args = '' ) {
global $bb_views;
$view = bb_slug_sanitize( $view );
$title = wp_specialchars( $title );
if ( !$view || !$title )
return false;
$query_args = wp_parse_args( $query_args );
if ( !$sticky_set = isset($query_args['sticky']) )
$query_args['sticky'] = 'no';
$bb_views[$view]['title'] = $title;
$bb_views[$view]['query'] = $query_args;
$bb_views[$view]['sticky'] = !$sticky_set; // No sticky set => split into stickies and not
return $bb_views[$view];
}
function bb_deregister_view( $view ) {
global $bb_views;
$view = bb_slug_sanitize( $view );
if ( !isset($bb_views[$view]) )
return false;
unset($GLOBALS['bb_views'][$view]);
return true;
}I’m in trouble if I ever need to create my own views or if the views that are being created in the default-filters.php page are ever used. But until I get a response from someone that knows what’s going on, I’m running bbPress without it register views.
October 18, 2007 at 9:54 pm #61156In reply to: Internal Server Error
livibetter
MemberThat’s weird…
Did you modify the code by your hands?
[17-Oct-2007 20:53:46] PHP Warning: mysql_get_server_info() [function.mysql-get-server-info]: Access denied for user ‘unrprus1’@’localhost’ (using password: NO) in /home/unrprus1/public_html/wp02/forums/bb-includes/db-mysqli.php on line 80
According your log, that’s
mysql_get_server_infonotmysqli_get_server_info.The patch changed the function from
mysql_get_server_infotomysqli_get_server_info(there is an additional letter i). Could you read thedb-mysqli.phpagain?I have this error before on my hosting server, once I modified that code. It totally fixed I only modified line 80.
October 18, 2007 at 9:40 pm #61154In reply to: Internal Server Error
livibetter
MemberHave you tried this this
to modify line 80 in
db-mysqli.php?October 18, 2007 at 9:04 pm #53043In reply to: Change the default ‘Member’ role title?
livibetter
MemberI made another approach to fit this need and used it on my forum.
function ChangeRoleDisplayName() {
global $bb_roles;
$bb_roles->role_names['keymaster'] = "Toilet Cleaner";
[...]
}
add_action('bb_got_roles', 'ChangeRoleDisplayName', 10, 0);
?>The complete code is in role-display-name.php.
October 18, 2007 at 8:58 pm #61138In reply to: Showing HTML tags on post
andrew79
MemberI do have allow image plugin . That was the thing that wasn’t allowing me to post
<img>tags. I’ve installed the plugin that you have pointed me to . The comment-quick-tags but it returns a script error for me on my firebug (firefox addon) making me think it’s not loading properly. -
AuthorSearch Results