Search Results for 'code'
-
AuthorSearch Results
-
March 26, 2010 at 11:23 am #85766
In reply to: Display name restriction
zaerl
ParticipantHi Tom, thank for your answer. Unfortunately I cannot took out the display name feature because my mother language isn’t english and in my idiom it’s impossible to write significant portion of text without using characters outside the ASCII base and as far as I know unicode characters can’t be used in login names.
Anyway I think that I will hack the core even if I know that this isn’t a good thing. I think that I will add an extra check in
$wp_users_object->update_user()which in turn call_put_user.March 26, 2010 at 7:02 am #85765In reply to: Display name restriction
deadlyhifi
ParticipantI was having this problem on my forum so I took out the display name feature.
See https://bbpress.org/forums/topic/help-with-basic-command-to-add-new-profile-fields#post-65468
And delete
'display_name' => array(1, __('Display name as')),March 26, 2010 at 4:26 am #86187In reply to: Can't get it to work :Could not establish a database
absolutex
Memberok i get it to work

find in meta database and change this table
meta key
user_bbdb_name
and
user_bbdb_user
March 25, 2010 at 9:38 pm #86084In reply to: Umlaut in member name
Dailytalker
MemberI solved the problem by adding the following additional code to the plugin:
add_filter( 'get_user_display_name', 'rk_display_name' );function rk_display_name($name, $ID = 0) {
if ( !seems_utf8( $name ) )
return utf8_encode( $name );
return $name;
}
March 25, 2010 at 8:07 pm #86168In reply to: problem with users upgrade 1.2
radovanx
Member0.9 yes i use template where i can put le code for this ? thanks
March 25, 2010 at 5:55 pm #54441In reply to: Add nofollow to links
Process of Illumination
ParticipantHi,
since i have the forum in a different frame of my page, i’d have to add the attribute “target_top” to every link.
The code below is only for target_blank, or would it be possible to replace every “blank” with “top” and have it working?
https://bbpress.org/forums/topic/add-nofollow-to-links#post-17523″
And how do you make the code into a plugin? you copy and paste into a text file, save it as *.php and upload the file in the bbpress plugins folder?
Thank you very much, every help is very appreciated!
The Process
March 25, 2010 at 4:57 pm #86128In reply to: integrating BBpress as a WP page
gerikg
Member“manage the bbpress forum via the same admin login as the primary WP install.”
https://wordpress.org/extend/plugins/bbpress-admin/
“…main wp widgetized sidebar”
If you did the deep integration you just have to stick
<?php getsidebar() ?;>somewhere in you bbpress theme file then mess with you bbpress css to make it fit.“..same sort of functionality with editing php and css templates, etc. in bbpress as with WP”
no such thing
March 25, 2010 at 4:34 am #86120In reply to: hundreds of spam users…
fifthhouse
MemberThanks everyone! I should be able to work this out with these plugins and guidelines. Cheers
March 25, 2010 at 12:38 am #85909In reply to: bbPress Deep Integration / Installation Tutorial
Kevin Ryman
ParticipantOnce again, nice video tutorial. Keep them coming!
March 24, 2010 at 8:33 pm #86118In reply to: hundreds of spam users…
johnhiler
MemberThere’s a nice Mass Delete Users plugin that lets you batch delete members:
https://bbpress.org/plugins/topic/mass-delete-users/
I’ve used it before, and it’s great!
Just make sure to backup your data first, just to be on the safe side.

I think there are also plugins you can install to disable registration. Let me know if you are interested, and I can try to track one down!
March 24, 2010 at 5:44 pm #85778Kevin Ryman
ParticipantEven though you changed your mind, this question of yours may come in handy to someone else. Thank you for asking.
March 24, 2010 at 8:20 am #85880In reply to: Ping Gautam: Revisiting bb-attachments
Gautam Gupta
ParticipantIn the bb Attachments FAQ, it is written:
if you get
error: denied mimeon every upload,mime_content_type functionorshell accessmust exist to verify mime types – otherwise you can force all types to be allowed by editingbb-attachments.phpand adding'application/octet-stream'to each of the$bb_attachments['allowed']['mime_types']And as I can see in the dump you pasted, neither
mime_content_typeis enabled, norshell access, so you would need to add'application/octet-stream'to each of the$bb_attachments['allowed']['mime_types']inbb-attachments.php.March 23, 2010 at 11:15 pm #86080In reply to: Umlaut in member name
Dailytalker
MemberI looked a bit around and found a peace of code with which I was able to create a plugin.
<?php/*
Plugin Name: UTF-8 usernames
Description: This plugin enables utf-8 characters in usernames. Mbstring must be enabled in the php.ini.
*/
function sanitize_user_mbstring( $raw_username, $username, $strict = false ) {
$raw_username = $username;
$username = strip_tags($username);
// Kill octets
$username = preg_replace(‘|%([a-fA-F0-9][a-fA-F0-9])|’, ”, $username);
$username = preg_replace(‘/&.+?;/’, ”, $username); // Kill entities
// Usage of ‘mb_ereg_replace’ instead of ‘preg_replace’ to preserve accents.
if ( $strict )
$username = mb_ereg_replace(‘|[^a-z0-9 _.-@]|i’, ”, $username);
return apply_filters(‘sanitize_user_mbstring’, $username, $raw_username, $strict);
}
add_action(‘sanitize_user’, ‘sanitize_user_mbstring’, 0, 3);
?>
Unfortunately it doesn’t work properly. When it displays correctly in bbpress it doesn’t in wordpress and reverse. I don’t have access to the php.ini. Could it be, that the thing with “mbstring” is the problem?
March 23, 2010 at 7:38 pm #77528In reply to: All RSS Feeds Broken?
Dailytalker
MemberI solved the problem!
I removed all “
»” in the rss.phpReplace the code of your rss.php with the following code and it should work:
<?php<br />
require('./bb-load.php');</p>
<p>// Determine the type of feed and the id of the object<br />
if ( isset($_GET['view']) || bb_get_path() == 'view' ) {</p>
<p> // View<br />
$feed = 'view';<br />
$feed_id = isset($_GET['view']) ? $_GET['view'] : bb_get_path(2);</p>
<p>} elseif ( isset($_GET['topic']) || bb_get_path() == 'topic' ) {</p>
<p> // Topic<br />
$feed = 'topic';<br />
$topic = get_topic(isset($_GET['topic']) ? $_GET['topic'] : bb_get_path(2));<br />
$feed_id = $topic->topic_id;</p>
<p>} elseif ( isset($_GET['profile']) || bb_get_path() == 'profile' ) {</p>
<p> // Profile<br />
$feed = 'profile';<br />
$feed_id = isset($_GET['profile']) ? $_GET['profile'] : bb_get_path(2);</p>
<p>} elseif ( isset($_GET['tag']) || bb_get_path() == 'tags' ) {</p>
<p> if ( isset($_GET['topics']) || bb_get_path(3) == 'topics' ) {<br />
// Tag recent topics<br />
$feed = 'tag-topics';<br />
} else {<br />
// Tag recent posts<br />
$feed = 'tag-posts';<br />
}<br />
$feed_id = isset($_GET['tag']) ? $_GET['tag'] : bb_get_path(2);</p>
<p>} elseif ( isset($_GET['forum']) || bb_get_path() == 'forum' ) {</p>
<p> if ( isset($_GET['topics']) || bb_get_path(3) == 'topics' ) {<br />
// Forum recent topics<br />
$feed = 'forum-topics';<br />
} else {<br />
// Forum recent posts<br />
$feed = 'forum-posts';<br />
}<br />
$forum = bb_get_forum(isset($_GET['forum']) ? $_GET['forum'] : bb_get_path(2));<br />
$feed_id = $forum->forum_id;</p>
<p>} elseif ( isset($_GET['topics']) || bb_get_path() == 'topics' ) {</p>
<p> // Recent topics<br />
$feed = 'all-topics';</p>
<p>} else {</p>
<p> // Recent posts<br />
$feed = 'all-posts';</p>
<p>}</p>
<p>// Initialise the override variable<br />
$bb_db_override = false;<br />
do_action( 'bb_rss.php_pre_db' );</p>
<p>if ( !$bb_db_override ) {</p>
<p> // Get the posts and the title for the given feed<br />
switch ($feed) {<br />
case 'view':<br />
if ( !isset($bb_views[$feed_id]) )<br />
die();<br />
if ( !$bb_views[$feed_id]['feed'] )<br />
die();<br />
if ( !$topics_object = new BB_Query( 'topic', $bb_views[$feed_id]['query'], "bb_view_$feed_id" ) )<br />
die();</p>
<p> $topics = $topics_object->results;<br />
if ( !$topics || !is_array($topics) )<br />
die();</p>
<p> $posts = array();<br />
foreach ($topics as $topic) {<br />
$posts[] = bb_get_first_post($topic->topic_id);<br />
}</p>
<p> $title = esc_html( sprintf( __( '%1$s View: %2$s' ), bb_get_option( 'name' ), $bb_views[$feed_id]['title'] ) );<br />
$link = get_view_link($feed_id);<br />
$link_self = bb_get_view_rss_link($feed_id);<br />
break;</p>
<p> case 'topic':<br />
if ( !$topic = get_topic ( $feed_id ) )<br />
die();<br />
if ( !$posts = get_thread( $feed_id, 0, 1 ) )<br />
die();<br />
$title = esc_html( sprintf( __( '%1$s Topic: %2$s' ), bb_get_option( 'name' ), get_topic_title() ) );<br />
$link = get_topic_link($feed_id);<br />
$link_self = get_topic_rss_link($feed_id);<br />
break;</p>
<p> case 'profile':<br />
if ( bb_get_option( 'mod_rewrite' ) === 'slugs' ) {<br />
$user = bb_get_user_by_nicename( $feed_id );<br />
} else {<br />
$user = bb_get_user( $feed_id );<br />
}<br />
if ( !$user ) {<br />
die();<br />
}<br />
if ( !$posts = get_user_favorites( $user->ID ) ) {<br />
die();<br />
}<br />
$title = esc_html( sprintf( __( '%1$s User Favorites: %2$s' ), bb_get_option( 'name' ), $user->user_login ) );<br />
$link = bb_get_profile_link($feed_id);<br />
$link_self = get_favorites_rss_link($feed_id);<br />
break;</p>
<p> case 'tag-topics':<br />
if ( !$tag = bb_get_tag( $feed_id ) )<br />
die();<br />
if ( !$topics = get_tagged_topics( array( 'tag_id' => $tag->tag_id, 'page' => 0 ) ) )<br />
die();</p>
<p> $posts = array();<br />
foreach ($topics as $topic) {<br />
$posts[] = bb_get_first_post($topic->topic_id);<br />
}</p>
<p> $title = esc_html( sprintf( __( '%1$s Tag: %2$s - Recent Topics' ), bb_get_option( 'name' ), bb_get_tag_name() ) );<br />
$link = bb_get_tag_link($feed_id);<br />
$link_self = bb_get_tag_topics_rss_link($feed_id);<br />
break;</p>
<p> case 'tag-posts':<br />
if ( !$tag = bb_get_tag( $feed_id ) )<br />
die();<br />
if ( !$posts = get_tagged_topic_posts( array( 'tag_id' => $tag->tag_id, 'page' => 0 ) ) )<br />
die();<br />
$title = esc_html( sprintf( __( '%1$s Tag: %2$s - Recent Posts' ), bb_get_option( 'name' ), bb_get_tag_name() ) );<br />
$link = bb_get_tag_link($feed_id);<br />
$link_self = bb_get_tag_posts_rss_link($feed_id);<br />
break;</p>
<p> case 'forum-topics':<br />
if ( !$topics = get_latest_topics( $feed_id ) )<br />
die();</p>
<p> $posts = array();<br />
foreach ($topics as $topic) {<br />
$posts[] = bb_get_first_post($topic->topic_id);<br />
}</p>
<p> $title = esc_html( sprintf( __( '%1$s Forum: %2$s - Recent Topics' ), bb_get_option( 'name' ), get_forum_name( $feed_id ) ) );<br />
$link = get_forum_link($feed_id);<br />
$link_self = bb_get_forum_topics_rss_link($feed_id);<br />
break;</p>
<p> case 'forum-posts':<br />
if ( !$posts = bb_get_latest_forum_posts( $feed_id ) )<br />
die();<br />
$title = esc_html( sprintf( __( '%1$s Forum: %2$s - Recent Posts' ), bb_get_option( 'name' ), get_forum_name( $feed_id ) ) );<br />
$link = get_forum_link($feed_id);<br />
$link_self = bb_get_forum_posts_rss_link($feed_id);<br />
break;</p>
<p> // Get just the first post from the latest topics<br />
case 'all-topics':<br />
if ( !$topics = get_latest_topics() )<br />
die();</p>
<p> $posts = array();<br />
foreach ($topics as $topic) {<br />
$posts[] = bb_get_first_post($topic->topic_id);<br />
}</p>
<p> $title = esc_html( sprintf( __( '%1$s Recent Topics' ), bb_get_option( 'name' ) ) );<br />
$link = bb_get_uri();<br />
$link_self = bb_get_topics_rss_link();<br />
break;</p>
<p> // Get latest posts by default<br />
case 'all-posts':<br />
default:<br />
if ( !$posts = bb_get_latest_posts( 35 ) )<br />
die();<br />
$title = esc_html( sprintf( __( '%1$s Recent Posts' ), bb_get_option( 'name' ) ) );<br />
$link = bb_get_uri();<br />
$link_self = bb_get_posts_rss_link();<br />
break;<br />
}<br />
}</p>
<p>bb_send_304( $posts[0]->post_time );</p>
<p>if (!$description = esc_html( bb_get_option('description') )) {<br />
$description = $title;<br />
}<br />
$title = apply_filters( 'bb_title_rss', $title, $feed );<br />
$description = apply_filters( 'bb_description_rss', $description, $feed );<br />
$posts = apply_filters( 'bb_posts_rss', $posts, $feed );<br />
$link_self = apply_filters( 'bb_link_self_rss', $link_self, $feed );</p>
<p>bb_load_template( 'rss2.php', array('bb_db_override', 'title', 'description', 'link', 'link_self'), $feed );</p>
<p>?>March 23, 2010 at 7:38 pm #86025In reply to: Lost All Users (Including ME!)
chrishajer
ParticipantLooks like that information is stored in the
bb_metatable in the bbPress database, with the following values:meta_id: autoincrement
object type: bb_option
object_id: 0 (always zero in my case)
meta_key: these 4
user_bbdb_name
user_bbdb_user
user_bbdb_password
user_bbdb_hostmeta_value: your database name, user, password and host.
Screenshot: http://chrishajer.com/bbpress/cloner-userdatabase.png
HTH
March 23, 2010 at 4:40 pm #85906In reply to: bbPress Deep Integration / Installation Tutorial
arpowers
Memberhere’s a second one for ‘deep integrating’ with WP ( our customers struggle with that

http://www.pagelines.com/posts/deep-integration-with-bbpress/
Wait, is this just an installation procedure or integration procedure?
First is installing bbPress, second is deep integrating..
March 23, 2010 at 3:56 pm #86023In reply to: Lost All Users (Including ME!)
cloner
ParticipantChris,
The forum was set up and functoned for years with the split databases. Posts are saved in the bbPress db, whilst users are saved in the WordPress db. Now, for some reason, bbPress cannot read the user info from the WordPress db. I’ve tried to reinstall, but once I’ve completed “Step 1” and click the button to move to “Step 2”, the page is redirected to the forum homepage and I never get an opportunity to get to “Step 2”. I assume the installation script realized that there is already an installation of bbPress present and refuses to go further.
My questions is, how (in the code) are bbPress and WordPress tied together? What could be fouled up that makes it impossible for bbPress to read the existing user data from WordPress?
March 23, 2010 at 9:01 am #86068In reply to: BBCODE not working
johnhiler
MemberbbPress markup sounds suspiciously like hyper text markup.
March 23, 2010 at 8:36 am #86067In reply to: BBCODE not working
benbt-japan
Memberbbpress markup requires < > not [ ] around the tags.
March 23, 2010 at 8:10 am #33812Topic: BBCODE not working
in forum Troubleshootingbenbt-japan
MemberThis new forum has just been installed, but I have noticed – as I write a guide for non-English users of the forums in Japanese – that bbcode does not seem to be working. The url is http://www.language-global.com/language/forums/ but it might be quicker just to tell me if the following bbcode ‘tags’ work on bbpress :
[ul][li][/li][/ul] & [strong][/strong]The message beneath the posting box includes all of those in the list of allowed markup, but none of them are working at the moment. Have also searched the admin area for some control over bbcode but couldn’t find any.
Very happy with the look and feel of bbpress after wrestling with a certain WP plugin for almost two days without achieving what I have achieved with this forum in one afternoon.
March 23, 2010 at 5:10 am #86021In reply to: Lost All Users (Including ME!)
johnhiler
MemberWhat do you mean about the bbPress querying the WordPress database for user data? I thought most posts are showing up as Anonymous?
If they are different database, then that explains the problem. You want to install both WordPress and bbPress inside of a single database, if they are going to share users. This guide to integration might be useful.
https://bbpress.org/forums/topic/wordpress-and-bbpress-integration-101
It’s a bit outdated, but I’m guessing it will give you a nice lay of the land.
March 23, 2010 at 12:12 am #86011In reply to: Lost All Users (Including ME!)
cloner
ParticipantOK…..in bb-config.php, there is a line that reads:
// of the “SECRET_KEY” in the WordPress file wp-config.php
define(‘BB_SECRET_KEY’, ‘6koHWRD9d{XOEQ-S5+T[Or|TK[at.G8Qo~s,Z$]n:Yt:Ts%+uVpO.]MI3$’); // Change this to a unique phrase.
Then, in wp-config.php, there’s a line that reads:
define(‘LOGGED_IN_KEY’, ‘6koHWRD9d{XOEQ-S5+T[Or|TK[at.G8Qo~s,Z$]n:Yt:Ts%+uVpO.]MI3$’|P]tL’);
Notice the line in bbpress is missing the characters: ‘|P]tL’
I don’t know if the ‘ between and | is the end of the phrase and the P[tl is code, or if the whole ‘|P]tL should be added, but it seems odd that they don’t match EXACTLY.
Reckon this is an issue? I don’t know why it would have changed, but something’s askew.
March 22, 2010 at 6:34 pm #86057In reply to: Hidden posts
guarda-faro
MemberI already know that plugin. In fact I found the operative version of the same and I proved it. It has some deficiencies that I did not like. I rejected to use it. I do not understand the reason bbPress does not include the use of static pages. He is not so complicated. On the other hand, I prefer not to use plugins, if I can avoid it. For that reason I prefer to find another form through some function that I can incorporate to the code of my template.
Thank you
March 22, 2010 at 1:01 pm #77524In reply to: All RSS Feeds Broken?
yoyopop
Member@ kawauso
I applied the patches suggested via the trac and your comments but my rss feed is still returning invalid in Chrome, Opera and Firefox (in Safari it works fine)
it does seem to be something wrong with the markup via an extra space in front of the xml declaration somewhere…
Anyone have any ideas??
Chrome:
error on line 1 at column 6: XML declaration allowed only at the start of the document
Opera:
XML parsing failed: syntax error (Line: 1, Character: 1)
Error:XML declaration not at beginning of document
and it shows a space in front of the initial
<? xmlFirefox:
XML Parsing Error: XML or text declaration not at start of entity
Location: /rss.php?topic=2074
Line Number 1, Column 2: <?xml version=”1.0″ encoding=”UTF-8″?>
-^
March 22, 2010 at 5:44 am #85996In reply to: BBPress Login Redirection
K. Adam White
MemberUpdate: I seem to have gotten it working, by inserting the following code directly to function
bb_safe_redirectwithinfunctions.bb-pluggable.php, right before the line checking against $allowed_hosts:$allowed_redirects = array();$allowed_redirects[] = 'offsite-feedback-forum.com';
$allowed_redirects[] = 'base-blog-url.com';
$allowed_redirects[] = 'base-blog-url.com/wordpress-installed-directory';
add_filter('allowed_redirect_hosts', 'add_allowed_redirect_hosts');
I originally tried to do this from a plugin, as the code above is copied from a handy WordPress plugin, but I was not able to get it to work without sticking it right within the pluggable.php file. If anybody has a better suggestion, I’d love to avoid editing the core files if possible!
-
AuthorSearch Results