Search Results for 'code'
-
AuthorSearch Results
-
June 28, 2009 at 11:13 pm #75152
In reply to: navigation bar in BuddyPress in BBPress
allenweiss
MemberHmm..it looks like they say to use the functions.php file (for the theme) to add the code, but I don’t see such a functions file…am I missing something obvious?
June 28, 2009 at 9:53 pm #75143In reply to: How can I disable HTML in posts?
chrishajer
ParticipantThe allowable HTML tags are in an array called
bb_allowed_tags. I think you could create a plugin that just empties that array.https://bbpress.org/forums/topic/hooks-038-filters-docu#post-6740
I’ve only seen people requesting the opposite, allowing additional HTML markup, so I’m not sure exactly how to do this.
June 28, 2009 at 9:05 pm #75146In reply to: Authentication check on non-WP page
michael3185
MemberI use this to stop people accessing the profile page unless logged-in;
<?php if ( !bb_is_user_logged_in() ) {
show_error_page('log-in to access profiles');
exit;
} ?>Something along those line should work with a link to somewhere else, assuming they’re in a bbPress page to begin with.
June 28, 2009 at 8:21 pm #15116Topic: How can I disable HTML in posts?
in forum TroubleshootingBurakhan
MemberHi everyone,
I want to disable HTML codes in posts. I am using “BBcode Lite for bbPress” and I dont need html codes to edit my post. When my member want to add a HTML code that is useful to forums the code works and havent seen properly. How can I disable?
June 28, 2009 at 7:59 pm #73609In reply to: bbPress Integration plugin for WPMU
Detective
MemberNow I get an odd behavior:
– if the user logs in inside WP, he appears logged in in both WP and BB, but he can’t post in BB. If he has admin rights, he can’t see bb-admin.
– if the user logs in inside BB, everything works ok in both WP and BB.
So I redirected all logins to BB.
In mu-plugins I added the following:
function rk_login_redirect() {
if (strpos($_SERVER['REQUEST_URI'], 'wp-login.php') !== false && $_GET['action'] != 'logout' ) {
$url = 'http://foros.ryuuko.cl/bb-login.php';
$redirect = urlencode(wp_get_referer());
$url = add_query_arg('redirect_to', $redirect, $url);
wp_redirect($url);
}
}
add_action('init', 'rk_login_redirect');In a plugin in my-plugins I added:
add_filter('wp_redirect', 'rk_redirect_location');
function rk_redirect_location($location, $status = 302) {
$arr = array();
$ref = wp_get_referer();
$url_array = parse_url($ref);
parse_str($url_array['query'], $arr);
if (isset($arr['redirect_to']) && !empty($arr['redirect_to'])) {
$url = urldecode($arr['redirect_to']);
$url_array = parse_url($url);
if (strpos($url_array['host'], 'ryuuko.cl') !== false)
$location = $url;
}
return $location;
}June 28, 2009 at 6:52 pm #75140In reply to: Would this be the right thing for me?
johnhiler
MemberYes, you can integrate your user databases and then cookie integrate.

Two questions:
* Do you want to combine your two user account systems? If so, how will you handle it when two accounts have the same name in each system?
* What version of WordPress are you using?
June 28, 2009 at 4:58 pm #75137In reply to: support forum plugin error
bobbyh
MemberI think maybe it’s a bug? The code at line 657 is:
return sprintf('<img src="$1%ssupport-forum-$2%s.png" alt="[$3%s]" title="[$3%s]" style="vertical-align:top; margin-right:0.3em; width:14px; height:14px; border-width:0;" />$4%s', $this->iconURI, 'sticky', __('sticky', 'support-forum'),$label);Instead of
$ 1 %(added spaces so it’d render on bbpress) shouldn’t it be%1$? c.f. http://us3.php.net/manual/en/function.sprintf.phpLikewise, replace all the other integers, e.g. it should be %2$.
Oddly, this function was changed in 3.0.2.
You can reverse the $ and % signs here and in the other function at line 680.
June 28, 2009 at 4:08 pm #74728In reply to: Just one more… release candidate 1.0-RC-3
the_Wish
MemberThis, however, is still true. Has anyone else encountered this trouble?
Trying to determine if it’s a plugin in need of update, or if it’s an error on my part, or an actual issue in RC3.
Ok, so I’ve just revisited the additional code issue for my forum and it is indeed the “Allow Images” Plugin that triggers this behaviour. Not only does it scramble your IMG codes, but all other codes as well. It didn’t do this up to RC1 though.
It’s working now for me and I used the chance to also upgrade my custom theme to Kakumei RC3 Standards which, yes, involved the deactivation of the external Page Links plugin.
Works good now.
June 28, 2009 at 3:24 pm #73775In reply to: How to list tags on forum.php
bobbyh
Membertopic_tags() will invoke the topic-tags.php file in your template (or if that file doesn’t exist in your template, in the default template).
At the bottom of the code in that template, there is a tag_form(); invocation. To not have the form appear, you could try invoking the rest of the code on that page (without that tag_form invocation).
The “delete tag” link will appear as long as you are logged in as an admin. It won’t appear to most users when you’re not logged in. So you shouldn’t worry about that appearing.
June 28, 2009 at 1:07 pm #75132Rhys Wynne
ParticipantThat was it!
Thanks
June 28, 2009 at 9:20 am #15112Topic: I can’t work out what’s wrong? Producing a fatal error.
in forum PluginsRhys Wynne
ParticipantHi all!
I’m upgrading a plugin to use the administration menus, rather than editing within the plugin itself. I have used admin functions before (such as add_action), but for the life of me I can’t figure out why I’m having problems adding it this time around.
Basically, on activation of the following plugin I get a “this plugin has caused a fatal error” (but it is activated), and on deactivation I get “Warning: Cannot modify header information – headers already sent by (output started at /home/britain/public_html/forum/bb-plugins/top-posters-code.php:32) in /home/britain/public_html/forum/bb-includes/pluggable.php on line 232”.
Here is the code
<?php
/*
Plugin Name: Show Top Posters (backup)
Plugin URI: http://www.gospelrhys.co.uk/bbpress-plugin-show-top-posters
Description: Readers with the most postes are displayed on your bbpress forum, with their names (linked to their website if they provided one). Based on the <a href="http://www.pfadvice.com/wordpress-plugins/show-top-commentators/" target="_blank">Show Top Commenters</a> plugin for WordPress by <a href="http://www.savingadvice.com" target="_blank">Nate Sanden</a>
Version: 1.2
Author: Rhys Wynne
Author URI: http://www.gospelrhys.co.uk
*/
add_action('bb_admin-header.php', 'show_top_posters_admin_page_default');
add_action('bb_admin_menu_generator', 'show_top_posters_add_admin_page');
function show_top_posters_add_admin_page() {
bb_admin_add_submenu(__('Show Top Posters'), 'use_keys', 'show_top_posters_admin_page');
}
function show_top_posters_admin_page_default() {
echo "test";
}
function show_top_posters_admin_page() {
echo "test";
}
function show_top_poster_text() {
echo "test";
}
?>Any suggestions?
June 28, 2009 at 5:18 am #75128In reply to: How to print all user profiles
Sam Bauers
ParticipantYou aren’t inside a function so there’s no need to globalise
$bbdb.This will get you every user (including all meta) into the array
$users:$user_ids = $bbdb->get_col( "SELECT ID FROM $bbdb->users WHERE user_status = 0 ORDER BY id;", 0 );
$users = bb_get_user( $user_ids );
print_r( $users );June 28, 2009 at 2:49 am #75127In reply to: How to print all user profiles
chrishajer
ParticipantHopefully this is only a typo here, not in your actual code:
global $bddb;Should be $bbdb.
June 28, 2009 at 2:44 am #75118In reply to: Topic slugs & numeric IDs
chrishajer
ParticipantI am guessing you need to change your
RewriteBasefrom
RewriteBase /to
RewriteBase /forum/where forum is the name of your subfolder.
June 28, 2009 at 2:37 am #15111Topic: How to print all user profiles
in forum Troubleshootingiang
MemberI want to display a list of all the users on my blog (wbs80.com) and their profile information.
I have been looking at the bbpress code and trying several tests…but unfortunately without success.
My approach is to get the list of profile keys, get the list of users and for each user display the username and profile information. The code segment that I have is:
<?php
require_once (‘../../bb-load.php’);
global $bddb;
$profile_keys = get_profile_info_keys();
//print_r($profile_keys);
$userinfo = $bbdb->get_results(“SELECT * FROM $bbdb->users WHERE user_status = 0 ORDER BY ‘ID'”);
//print_r($userinfo);
foreach ($userinfo as $key) {
$metainfo = $bbdb->get_results(“SELECT * FROM $bbdb->usermeta WHERE user_id = $key->ID”);
// ???
}
?>
I don’t know how to use the “profile_keys” value(s) to access the “metainfo” data structure and extract the data.
Any help would be greatly appreciated!
June 28, 2009 at 1:11 am #75113In reply to: Logging Out Error?
johnhiler
MemberThis plugin should do something similar, and hopefully won’t give you any errors.
June 27, 2009 at 8:25 pm #75088In reply to: Best way to prevent SPAM registration?
Detective
MemberThe .htaccess code redirects all POST requests to register.php to another url if the request doesn’t have a referer from my own forum.
The code is originally from here: http://wpmututorials.com/how-to/spam-blogs-and-buddypress/
June 27, 2009 at 8:06 pm #75117In reply to: Topic slugs & numeric IDs
michael3185
MemberAh, that I haven’t. I copied it into the folder. Mind you, it doesn’t seem to have anything defined in it which points to the old path. Here’s the content;
Options -MultiViews
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^pm/?(.*)$ /my-plugins/bbpm/index.php?$1 [L]
RewriteRule ^page/([0-9]+)/?$ /index.php?page=$1 [L,QSA]
RewriteRule ^forum/([^/]+)/page/([0-9]+)/?$ /forum.php?id=$1&page=$2 [L,QSA]
RewriteRule ^forum/([^/]+)/?$ /forum.php?id=$1 [L,QSA]
RewriteRule ^forum/?$ / [R=302,L,QSA]
RewriteRule ^topic/([^/]+)/page/([0-9]+)/?$ /topic.php?id=$1&page=$2 [L,QSA]
RewriteRule ^topic/([^/]+)/?$ /topic.php?id=$1 [L,QSA]
RewriteRule ^topic/?$ / [R=302,L,QSA]
RewriteRule ^tags/([^/]+)/page/([0-9]+)/?$ /tags.php?tag=$1&page=$2 [L,QSA]
RewriteRule ^tags/([^/]+)/?$ /tags.php?tag=$1 [L,QSA]
RewriteRule ^tags/?$ /tags.php [L,QSA]
RewriteRule ^profile/([^/]+)/page/([0-9]+)/?$ /profile.php?id=$1&page=$2 [L,QSA]
RewriteRule ^profile/([^/]+)/([^/]+)/?$ /profile.php?id=$1&tab=$2 [L,QSA]
RewriteRule ^profile/([^/]+)/([^/]+)/page/([0-9]+)/?$ /profile.php?id=$1&tab=$2&page=$3 [L,QSA]
RewriteRule ^profile/([^/]+)/?$ /profile.php?id=$1 [L,QSA]
RewriteRule ^profile/?$ /profile.php [L,QSA]
RewriteRule ^view/([^/]+)/page/([0-9]+)/?$ /view.php?view=$1&page=$2 [L,QSA]
RewriteRule ^view/([^/]+)/?$ /view.php?view=$1 [L,QSA]
RewriteRule ^rss/?$ /rss.php [L,QSA]
RewriteRule ^rss/topics/?$ /rss.php?topics=1 [L,QSA]
RewriteRule ^rss/forum/([^/]+)/?$ /rss.php?forum=$1 [L,QSA]
RewriteRule ^rss/forum/([^/]+)/topics/?$ /rss.php?forum=$1&topics=1 [L,QSA]
RewriteRule ^rss/topic/([^/]+)/?$ /rss.php?topic=$1 [L,QSA]
RewriteRule ^rss/tags/([^/]+)/?$ /rss.php?tag=$1 [L,QSA]
RewriteRule ^rss/tags/([^/]+)/topics/?$ /rss.php?tag=$1&topics=1 [L,QSA]
RewriteRule ^rss/profile/([^/]+)/?$ /rss.php?profile=$1 [L,QSA]
RewriteRule ^rss/view/([^/]+)/?$ /rss.php?view=$1 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ /index.php [L]
</IfModule>I have no idea what any of it does!
June 27, 2009 at 7:39 pm #75124In reply to: I have avatars showing but i get a error msg?
chrishajer
ParticipantThat table name looks wrong (based on the table name from the Simple Online List you posted in the other topic). What version of bbPress are you using and how are you getting the avatars to show? Plugin?
monstet5_bbp01.bb_online
Looks like monstet5_bbp01 is the database name, and bb_ is the table prefix, and online is the table name created by the Simple Online List?
If that’s the case there, how do you have an options table here with no table prefix, just a database name?
Unless you used
bbp01.as your table prefix instead ofbbp01_?June 27, 2009 at 7:17 pm #75059chrishajer
ParticipantAlso, can you get phpinfo() for your server? Just put this into a file and call it up in a browser:
<?php
phpinfo();
?>If you save that as a file called info.php, you can load in your browser at http://www.example.com/info.php or http://www.example.com/bbpress/info.php depending on where you installed it.
June 27, 2009 at 5:11 pm #75114In reply to: Topic slugs & numeric IDs
johnhiler
MemberWhen you run this query, does your old URI show up anywhere?
SELECT * FROM bb_topicmeta WHERE meta_key=’uri’
As for the word “slugs”, I’m pretty sure it comes from typesetting.
June 27, 2009 at 4:45 pm #75033In reply to: Error messages with bbPress and WP’s WP_CACHE
r-a-y
ParticipantHi Sam,
Did the var_dump.
Here’s the result:
array(2) {
[0]=>
string(1) "2"
[1]=>
string(1) "1"
}
string(0) ""[EDIT]
I should state that I forgot to clear the memcached service. How do I go about doing that?
June 27, 2009 at 7:49 am #75109In reply to: Super Search plugin failing
_ck_
ParticipantIt sends all the invisible code before the webpage that your browser requires to understand the language, etc.
In theory commenting it out is very bad but for some reason with bb-gzip it’s being triggered twice which should not happen and is bad. The fix I gave you is a lazy workaround for now until I have time to address it properly one day (and might need a completely different fix with bbPress 1.0.1 etc)
June 27, 2009 at 7:38 am #75121Sam Bauers
ParticipantThe favourites RSS feed was always public, for some reason the page was made private in the past. We decided (me and mdawaffe) to just make it public from now on instead of getting rid of the RSS feed.
If you don’t want it to be public then you’ll need to write some plugin code to make that happen, just remember to kill the RSS feed as well.
June 27, 2009 at 7:03 am #51708In reply to: Plugin: Post Notification
lemonade-joe
MemberHi, I am trying to use this plugin on a site running in Slovak language, that means, I need to use special characters. I am not good with php, so forgive me, if am not technical enough

The system e-mails (like registration) are working fine. However, when sending mail through Post Notification, the special characters are messed up.
When I was checking the source code of the mails, I have discovered, that the registration mails contain the line “Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=”UTF-8″”.
The Post Notification mails (also the Report Post plugin mails) do not contain any charset specification (the source code contains this: X-Amavis-Alert: BAD HEADER SECTION, Non-encoded 8-bit data (char C3 hex).
Can that be the source of my problem, if yes, how can I solve it?
-
AuthorSearch Results