I’d like my sticky threads to act exactly like regular threads on the front page “Latest Discussions” section, instead of always being at the top of the list. That is, they’d still appear on the list, but in the order of last posting – the same as all the usual threads.
Is there any easy fix?
Thanks for the response.
Okay, I tried to patch all the files with the changes in that ticket and I seem to get the same error.
Here is my config.php:
<?php
// ** MySQL settings ** //
define('BBDB_NAME', 'approachanxiety_com_bbpress'); // The name of the database
define('BBDB_USER', 'disco'); // Your MySQL username
define('BBDB_PASSWORD', 'xxxx'); // ...and password
define('BBDB_HOST', 'localhost'); // 99% chance you won't need to change these last few
define('BBDB_CHARSET', 'utf8'); // If you are *upgrading*, and your old config.php does
define('BBDB_COLLATE', ''); // not have these two contstants in them, DO NOT define them
// If you are installing for the first time, leave them here
// Change the prefix if you want to have multiple forums in a single database.
$bb_table_prefix = 'bb_'; // Only letters, numbers and underscores please!
// The full URL of your bbPress install
$bb->uri = 'http://approachanxiety.com/bbpress/';
// What are you going to call me?
$bb->name = 'New bbPress Site';
// This must be set before you run the install script.
$bb->admin_email = 'ericmonse@yahoo.com';
// Set to true if you want pretty permalinks, set to 'slugs' if you want to use slug based pretty permalinks.
$bb->mod_rewrite = false;
// The number of topics that show on each page.
$bb->page_topics = 30;
// A user can edit a post for this many minutes after submitting.
$bb->edit_lock = 60;
// Your timezone offset. Example: -7 for Pacific Daylight Time.
$bb->gmt_offset = 0;
// Change this to localize bbPress. A corresponding MO file for the
// chosen language must be installed to bb-includes/languages.
// For example, install de.mo to bb-includes/languages and set BBLANG to 'de'
// to enable German language support.
define('BBLANG', '');
// Your Akismet Key. You do not need a key to run bbPress, but if you want to take advantage
// of Akismet's powerful spam blocking, you'll need one. You can get an Akismet key at
// http://wordpress.com/api-keys/
$bb->akismet_key = ''; // Example: '0123456789ab'
// The rest is only useful if you are integrating bbPress with WordPress.
// If you're not, just leave it as it is.
$bb->wp_table_prefix = ''; // WordPress table prefix. Example: 'wp_';
$bb->wp_home = ''; // WordPress - Options->General: Blog address (URL) // Example: 'http://example.com'
$bb->wp_siteurl = ''; // WordPress - Options->General: WordPress address (URL) // Example: 'http://example.com'
/* Stop editing */
if ( !defined('BBPATH') )
define('BBPATH', dirname(__FILE__) . '/' );
require_once( BBPATH . 'bb-settings.php' );
?>
When I run the testdb.php I get
Connection Results
Connection: Successful!
Database Selection: Successful!
Enter Your MySQL Information
MySQL Hostname localhost
MySQL Username disco
MySQL Password xxxx
MySQL Database approachanxiety_com_bbpress
Here is the text php file that connects to the database and works:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>MySQL Test Script</title>
<style>
body { font-family: Verdana; font-size: 10pt; }
td { font-size: 10pt; }
th { font-size: 8pt; }
</style>
</head>
<body>
<?php
if ( isset ( $_POST['submit'] ) ) {
?>
<table border="1" summary="" cellpadding="2" cellspacing="0" style="border-collapse: collapse;">
<tr>
<th bgcolor="#F2F2F2" colspan="2"><center><b>Connection Results</b></center></td>
</tr>
<?
if (!$link = @mysql_connect($_POST['mysql_hostname'], $_POST['mysql_username'], $_POST['mysql_password'])) {
?>
<tr>
<td>Connection:</td>
<td bgcolor="red"><font color="white"><?php echo mysql_error(); ?></font></td>
</tr>
<?
} else {
?>
<tr>
<td>Connection:</td>
<td bgcolor="green"><font color="white">Successful!</font></td>
</tr>
<?
}
if (!$dblink = @mysql_select_db($_POST['mysql_database'], $link)) {
?>
<tr>
<td>Database Selection:</td>
<td bgcolor="red"><font color="white"><?php echo mysql_error(); ?></font></td>
</tr>
<?
} else {
?>
<tr>
<td>Database Selection:</td>
<td bgcolor="green"><font color="white">Successful!</font></td>
</tr>
<?
}
@mysql_close($link);
?>
</table>
<?
}
?>
<form method="post">
<table border="1" summary="" cellpadding="2" cellspacing="0" style="border-collapse: collapse;">
<tr>
<th bgcolor="#F2F2F2" colspan="2"><center><b>Enter Your MySQL Information</b></center></td>
</tr>
<tr>
<td>MySQL Hostname</td>
<td><input type="text" name="mysql_hostname" size="40" value="<?php echo $_POST['mysql_hostname']; ?>"></td>
</tr>
<tr>
<td>MySQL Username</td>
<td><input type="text" name="mysql_username" size="40" value="<?php echo $_POST['mysql_username']; ?>"></td>
</tr>
<tr>
<td>MySQL Password</td>
<td><input type="text" name="mysql_password" size="40" value="<?php echo $_POST['mysql_password']; ?>"></td>
</tr>
<tr>
<td>MySQL Database</td>
<td><input type="text" name="mysql_database" size="40" value="<?php echo $_POST['mysql_database']; ?>"></td>
</tr>
<tr>
<td colspan="2"><center><input type="submit" name="submit" value="Submit"> <input type="reset" name="reset" value="Reset"></center></td>
</tr>
</table>
</form>
</body>
</html>
I think if you post the config.php and the test script with connection details, someone will be able to help. Seems like a simple connection issue, assuming you followed the instructions in the other post you found.
Rather than replacing db-mysqli.php with db.php, did you try to apply the patch attached to this ticket?
https://trac.bbpress.org/ticket/745
I’ve been searching, every file in my kakumei theme and cannot find the file that is messing up how the add new page is displaying. I know its a div issue but can’t seem to find that extra div.
What file displays the add new option in the latest discussion section?
Does it display within another file? Which one?
Also, using a test script, I entered the same database information that’s in my bbpress config.php file and I can successfully connect to my database. The user, Disco, is the default user and is database administrator so there’s no reason why I should get access denied.
Euuh ok, still not sure how to use this.
Let’s say I want to ad a tabel in the db called ‘test’, but only if it doesn’t excist.
So on plugin activation:
1- check if the table ‘test’ excists
2- if not, insert the tabel ‘test’
3- else die
Could you paste your test.php
?
Thanks livibetter. I just realized that the profile field doesn’t show any fields that are not populated, so in my case there was no information to show until I added the website a few minutes ago.
Not my brightest moment
Plugin: YouTube in bbPress
test!
If you have the latest version of bbpress (.8.3), you need to activate the plugin that allows images.
Hi,
I’m trying to add a new custom page to my forum. It’s very simple, this is what I have so far:
– 1 custom page called test.php
– the page includes the forum header and footer
– The content (middle) part is pulled from the db aswell
All works fine except hyperlinks! Links like http://www.test.com will NOT appear as a hyperlink, but just as plain text. How to fix this? I want this to behave just like this textfield I am typing in right now (auto hyperlink converting).
bbcodes like bold do work.
_Null
I only tested one case, the dollar sign ‘$’ on my testing forum with commenting out the entire function bb_user_sanitize
except last line. I can register with ‘$’ in username, post with that account and the username is showed correctly.
Hi,
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 static
folder 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/test
Remember: Use this method at your own risk
I am trying to integrate bbPress with WordPress. I installed it on my local test environment first, in order to work out any kinks. bbPress is in the same database as WordPress. The installation went fine, it seemed, and I ended up with a basic version of bbPress — left-aligned black font on a plain white background. Is this what I am supposed to see?
However, when I tried to point it to WordPress, using “require_once(‘http://localhost:8888/wordpress/wp-blog-header.php’);” in the config.php file, I only got a blank screen. Any idea what I’m doing wrong?
I sort of fumble my way through all this web design stuff, so there is a good chance the answer is painfully easy, but I can’t seem to find it. Thanks.
The previous version of this plugin. That’s version μ instead of the latest, ν.
Awesome. 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 capabilites
entry from the database.
I can create topics no problem in bbpress. Just doesn’t create new topics when I write posts.
Gostallion, got the latest bb?
I’m using the latest version of bbsync.
Now I can’t login to the bbpress backend. It’s like it doesn’t recognize the roles anymore. I can login and view my profile and such, but can’t get into the backend.
I am using 0.8.3 I upgraded the same day it came out and everything works great, I am very happy with everything, but this is so weird. Like you said their is something bad about this post.
I am running the forum in bluehost.com as far as I know they are pretty good at keeping up to date with their upgrades so I am sure they have all their software up to date.
I was installing PM to the forum when I notice the error so I deleted all the changes and deactivate the plugin to check if that was the problem but it turn out that even without the plugin the error keep coming up.
Maybe I just found a bug on the latest version but I don’t know anything about coding so this is up to you guys.
Slex, 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.
I’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
Tested. Works. Good job Jaz… now I dont have to wonder how many months from now my hack would have caused a nuclear war in china.
And just for the sake of completeness. I did not test the case where a user is a blog writer (can write new posts), but is not some sort of administrator on the forum. I can’t foresee needing this functionality, but if it doesnt work, dont get mad at me.
Database redundancy time?
Yeah, I think that did it. I just tested a post as a regular user and it worked without any errors. I am short on time right now so if anyone else has a chance to try it out, that’d be cool. Here’s all I did (all in felsyncpost()):
1) added $bb_current_user
to the globals
2) commented out line 36
3) added $bb_current_user = $current_user;
in its place.
Try it out.
Strange that it’s not catching if it’s a BB_User. That does seem to be the actual class name. Do you want to do some more testing on that? Are users usually instantiated as wp_User if it’s integrated? Or is it just if you set up the current user as bbSync does, from wp, that you get the user as a wp_User object? It’s up to you, if you could check that and arising questions out I’d be grateful as I’m all over the place right now.
Thanks for your post, really! I feel a lot more confident about finding the solution now.
The fix that I made to that function has been tested now and it seems to work, but the fact of the matter is that it could have very well just broke that function all together. I think everything works to my satisfaction now though, so I probably wont worry about it until I run into some more problems. The only thing that gives me hope in that respect is that previously, that if statement
was failing. meaning that the user was not a bb_user:
if ( !( is_object($user) && is_a($user, 'BB_User') ) )
so it would create new capabilities for the user (incorrectly at that). But when I changed it to wp_User, for some reason that if statement
catches and just returns without creating the new capabilities that break access permissions. I don’t know why this works after looking into the code, but until I see negative side effects, I might turn a shy eye (<— i dont think thats a real saying…).
Also, on the topic of redundant database entries, I think since we have the integration set up from the WP comment box, it wouldnt be incredibly difficult to simply take out the one database call (somewhere in the wordpress code never-never-land) that actually posts the comment to the database. So we’re not inputting a box from bbpress, but we would effectively stop wordpress comments from being saved to the database since we never actually look at them. This of course wouldn’t work if you were merely copying database entries in order to post the comments as posts in bbPress, but I dont think thats what you’re doing. It probably is two separate database INSERT
calls, and I bet we can take the wordpress one out, and have identical functionality (assuming we took out wordpress comments and exclusively use felbbreplies()). It’s merely an optimization though, and unless the user base is larger than any of us probably are going to have it might not matter… I’ll look into it tonight when I get home, and let you know.
sorry for the long post
-Alex