Search Results for 'code'
-
AuthorSearch Results
-
March 23, 2010 at 7:38 pm #77528
In 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!
March 22, 2010 at 5:15 am #86002In reply to: Lost All Users (Including ME!)
johnhiler
MemberThree quick questions to help scope out the situation.

1) Which versions of bbPress and WordPress did you have working together?
2) What version of WordPress did you upgrade to?
3) Where did your users disappear – just in bbPress, or also in WordPress?
Also – is this your forum?
March 22, 2010 at 1:28 am #33795Topic: BBPress Login Redirection
in forum InstallationK. Adam White
MemberI’ve gotten BBPress/Wordpress integration working, and now I want to use BBPress to handle all login duties—I would like to make it so that when a user accesses the login link from WordPress, it redirects them back to the page they came from after they log in to BBPress. So, the user will ideally travel:
A page [not logged in] -> BBPress bb_login.php -> Originating Page [logged in]
This is another thread relating to redirection but it seems very outdated, I can’t find the code they reference. Redirection works splendidly whenever you are internal to BBPress, is there any way to have it work when you’re coming from an external wordpress page?
This is kind of a re-post, my first post attempt is being held with an “Array: Voices” status, whatever that means…
March 21, 2010 at 6:23 pm #33800Topic: Write last post of user
in forum PluginsH
ParticipantI am working on an ajax function, and currently I write a plugin which gives the last post of the logged-in user.
The post should be displayed using the post.php template of the current theme.
I try to get the last post from the DB as an object, and give it to the bb_post_template() function, like written below, but that doesn’t work.
What should I do?
I have $user = 2 as an example.
$lastpost = $bbdb->get_results("SELECT * FROM bbpress_posts WHERE poster_id = ".$user." ORDER BY post_time desc LIMIT 0, 1");
foreach ($lastpost as $bb_post)
{
$id = $bb_post->post_id;
$post = bb_get_post($id);
if($post)
{
bb_post_template();
}
}March 21, 2010 at 4:17 pm #85837In reply to: username function
Ben L.
Member<?php
$user = bb_get_user( get_post_author_id() );
echo $user->user_login;
?>March 21, 2010 at 1:40 pm #85965In reply to: WP & BB Integration failed
leander8728
MemberThanks, it works
March 20, 2010 at 9:39 pm #85885In reply to: licence agreement
Kevin Ryman
ParticipantNo problem, Alex!
March 20, 2010 at 9:39 pm #85987In reply to: How to use bbvideo?
Kevin Ryman
ParticipantI haven’t use TinyMCE (for comments) with BBvideo. Why not try using BBcode Lite? https://bbpress.org/plugins/topic/bbcode-lite/ It works with BBvideo.
March 20, 2010 at 7:44 pm #85986In reply to: How to use bbvideo?
johnhiler
MemberWhen I just add a normal YouTube link, the video embed shows up for me when bbVideo is activated!
But I had to turn off bbVideo, because it didn’t work with TinyMCE enabled and the rich text editor turned on… I guess that extra a href code threw it off?
March 20, 2010 at 7:38 pm #85985In reply to: How to use bbvideo?
Kevin Ryman
ParticipantHello there! BBvideo supports 14 video streaming portals. They are listed below.
- Youtube
- Myvideo
- Funnyordie
- Gametrailers
- Collegehumor
- Dailymotion
- Glumbert
- Liveleak
- Redtube
- Googlevideo
- Sevenload
- Metacafe
- Clipfish
- Vimeo
Adult website links were removed for this post. However, they are still listed above.

Example
All you need to do is copy the video url and paste it in your post. No embed code needed!
Please read:
March 20, 2010 at 5:29 pm #74663In reply to: Testing Embeded Video
analytico
MemberHow to embed video using bbcode ? What syntax?
March 20, 2010 at 2:15 pm #85981Gautam Gupta
Participant1) Yes, you’ve heard correct that project is almost dead as no development is taking place for weeks. Also, more chances are that it will be converted into a WordPress plugin (but some methods might be made available to transfer your data from the bbPress install to the plugin).
2) bbPress 1.0 was almost a rewrite of 0.9, so a lot of code changed and the plugins became incompatible. _ck_, a major plugin developer and contributor to the project left because the project was not getting attention from months. You can check her website – http://bbshowcase.com
3) Can’t say anything about the timings….
4) That has been reported in #1181
March 20, 2010 at 4:35 am #68054In reply to: Here’s how to install Avatar Upload plugin
imcoach
MemberYeah, I’ve just spent the last 2 hours trying to figure this out… At first I thought I was just reading the instructions wrong. I’ve been trying to read into it and plop code randomly. I’ve gone over the instructions as to which file to put where about 5 times……..
…I’ll let you know if I figure it out, lol.. if I don’t give up shortly and go back to phpbb.
March 19, 2010 at 4:25 pm #85866In reply to: Problem upgrading from 0.904 to 1.0
inerxia
MemberThanks, here is the php:
And one final question , there is a way to reinstall using the same database and directory ?
<?php
/**
* The base configurations of bbPress.
*
* This file has the following configurations: MySQL settings, Table Prefix,
* Secret Keys and bbPress Language. You can get the MySQL settings from your
* web host.
*
* This file is used by the installer during installation.
*
* @package bbPress
*/
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for bbPress */
define( 'BBDB_NAME', 'organica_foro' );
/** MySQL database username */
define( 'BBDB_USER', 'organica_ineFORO' );
/** MySQL database password */
define( 'BBDB_PASSWORD', '********' );
/** MySQL hostname */
define( 'BBDB_HOST', '' );
/** Database Charset to use in creating database tables. */
define( 'BBDB_CHARSET', '' );
/** The Database Collate type. Don't change this if in doubt. */
define( 'BBDB_COLLATE', '' );
/**#@+
* Authentication Unique Keys.
*
* Change these to different unique phrases!
* You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/bbpress/ WordPress.org secret-key service}
*
* @since 1.0
*/
// edited keys chrishajer 19 March 2010
define('BB_AUTH_KEY', 'gUpvcuMfP+tDsXUus|(|9|/G4Owo@=;C697V[[ZPd+|W)BVK-[U,fi/H2r+VOj');
define('BB_SECURE_AUTH_KEY', 'sf8;HNH}7%N#_|=$d4(_(yV8Wt&R($kL+)JS@}Kno-Q2jfkOm|BUL-i**&f_Wg');
define('BB_LOGGED_IN_KEY', 'm}Xc?tvc 3;o)JUVdxDm%F[V96V<+zyka239SbV<^2)o[/tV>Q4&kW$B4ik(NA');
define('BB_NONCE_KEY', ';k,c^0G4nz9eZS#-cF7((.smjv.GtAz+.WZd<G544PzG.Mz*Cztr]|Gaw:-(!=');
/**#@-*/
/**
* bbPress Database Table prefix.
*
* You can have multiple installations in one database if you give each a unique
* prefix. Only numbers, letters, and underscores please!
*/
$bb_table_prefix = 'bb_';
/**
* bbPress Localized Language, defaults to English.
*
* Change this to localize bbPress. A corresponding MO file for the chosen
* language must be installed to a directory called "my-languages" in the root
* directory of bbPress. For example, install de.mo to "my-languages" and set
* BB_LANG to 'de' to enable German language support.
*/
define( 'BB_LANG', 'es_ES' );
?> -
AuthorSearch Results