Search Results for 'code'
-
AuthorSearch Results
-
December 2, 2008 at 7:36 pm #69488
John James Jacoby
KeymasterWe’re all experiencing the same issue.
Integration appears to be a little broken still.
If you need to use the WP functions in your bbPress, that will break it further by not allowing you to access your bbPress admin panel at all.
The problem looks like the bb_map_meta_cap filter is ignored when the WordPress functions are loaded in place of the bbPress ones.
Some users have been able to resolve this by using a .htaccess file to redirect to the bbPress login and register page whenever an attempt to register or login is made through WordPress. That is the best fix at the moment if you do not require access to the WP functions.
If you do require that access, then you will need to wait until a fix comes out for the issue I mentioned above. That’s where I am.
December 2, 2008 at 7:29 pm #69459In reply to: Messed up WP and BB integration
mithrandir321
MemberYes, I installed WP first, then BB and integrated from the beginning, so BB is using wp_users. In fact, there’s no bb_users table according to my phpMyAdmin. Somehow, it seems that BB cannot access that wp_users table for one reason or another. But what exactly it is, is a mystery to me
December 2, 2008 at 7:17 pm #68219In reply to: bbPress 1.0-alpha-2 released
mvds
MemberNo issues so far, just wanted you to know that
Runs fine on my (live) site!
December 2, 2008 at 7:01 pm #69443In reply to: “Advanced” search options — where and what are they?
block
MemberInteresting. There any code from there you can release in the mean time? Pretty disappointed that bbPress has such poor search, but not surprising given how little information and documentation there is.
December 2, 2008 at 6:56 pm #69047In reply to: Integrate wp2.7 and bbp1.0a2
John James Jacoby
KeymasterIt seems like there are several issues here, and I’m not sure which is really the issue or which is a bug…
Firstly, when integrated, bbPress wants to use the WordPress classes and functions where possible. Namely, the problem with capabilities lies currently with the difference in the
WP_User->has_capfunction.On the WordPress side of it, it is missing the
global $wp_roles;and the corresponding check of those roles against the current capability to check.$caps = call_user_func_array( array(&$wp_roles, 'map_meta_cap'), $args );So I’m not sure if this is just a case of bbPress not keeping up with the WordPress user/role classes, or if this is WordPress not properly carrying over bbPress capabilities.
Ugh…
December 2, 2008 at 4:35 pm #69472peuter
MemberThanks for trying to help on this Chris. Here is what my htaccess file looks like at the moment:
Options +MultiViews
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Keep in mind this is in my root directory. (so both WP and BBpress are both using it?)
Am I supposed to have a seperate htaccess file in the bbpress directory too?
I got access to the code you sent me. Do I delete the above code and replace it with this code you sent?
December 2, 2008 at 11:47 am #69456In reply to: Messed up WP and BB integration
mithrandir321
MemberIt worked alright before I started moving around with the directories.
If you’re talking about the params from config.php they stay untouched as they were before so BBDB_NAME, BBDB_USER etc. are correct….
Dont’t know what a socket connection is or how it differs
December 1, 2008 at 12:22 pm #68986In reply to: Email link to a topic ???
mithrandir321
MemberYeah, found the bb_mail function and will use a couple spam protection functions from WP-Mail to hardcode it for my site but won’t be able to make a plugin out of it
December 1, 2008 at 10:49 am #68984In reply to: Email link to a topic ???
mithrandir321
MemberOh, that’s a little too complex
I don’t think I can get my head around this one lest it was stripped down to the core functionality. The best part of my PHP days is unfortunately numbered but I’ll try to look for something easier.
December 1, 2008 at 7:01 am #49661In reply to: Emoticons For bbPress?
_ck_
ParticipantSee this part of the plugin, you need to change the
bb_add_filterandbb_add_actionto justadd_filterandadd_action`/******************************************************************************
* - Define for bbPress interface
*****************************************************************************/
$bbemoticons = & new bbEmoticons();
bb_add_filter('post_text', array(&$bbemoticons, 'convert_smilies'));
//bb_head is not called always.
//bb_add_action('bb_head', array(&$bbemoticons, 'bb_grins_head'));
bb_add_action('bb_feed_head', array(&$bbemoticons, 'bb_grins_head'));
bb_add_action('bb_grins', array(&$bbemoticons, 'bb_grins'));December 1, 2008 at 7:00 am #49660In reply to: Emoticons For bbPress?
_ck_
ParticipantSee this part of the plugin, you need to change the
bb_add_filterandbb_add_actionto justadd_filterandadd_action`/******************************************************************************
* - Define for bbPress interface
*****************************************************************************/
$bbemoticons = & new bbEmoticons();
bb_add_filter('post_text', array(&$bbemoticons, 'convert_smilies'));
//bb_head is not called always.
//bb_add_action('bb_head', array(&$bbemoticons, 'bb_grins_head'));
bb_add_action('bb_feed_head', array(&$bbemoticons, 'bb_grins_head'));
bb_add_action('bb_grins', array(&$bbemoticons, 'bb_grins'));December 1, 2008 at 1:12 am #68982In reply to: Email link to a topic ???
mithrandir321
MemberI can see there’s no plugin like that yet, however can anybody just hint as to what backpress functions I can use in order to hardcode this myself? I’m learning the php + bbpress stuff quite fast so I’d give it a whirl with a little help.
Think it may come useful for others as well.
November 30, 2008 at 7:59 pm #57729In reply to: One profile page to rule them all
chrissydunno
Memberwhere in the code do you add your redirect hook exactly?
November 30, 2008 at 6:15 pm #69416In reply to: bbpress smilies plugin questions
_ck_
ParticipantThere is no
bb_do_action, onlydo_action.bb_do_actionhas been removed.Are you talking about the plugin created in this thread:
https://bbpress.org/forums/topic/emoticons-for-bbpress
Why not post your question there, where it will actually be relevant?
November 30, 2008 at 3:20 pm #69411_ck_
ParticipantbbPress Plugin Index, A – M
– A –
- Accurate Post Time
- Add Titles to Replies
- Admin add user
- Admin Can Post Anything
- Admin Drop Menus
- Admin Instant Menus
- Ajaxed Quote
- All Settings
- Allow Images
- Approve User Registration
- Automated Forum Moderation
- Avatar
- Avatar Upload
– B –
- BB Anonymous Posting
- bb Gzip
- BB Moderation Hold
- BB Scrippets
- bb SVN Tracker
- bb Topic Views
- bb-avatars
- bb-emoticons
- bb-Lightbox2
- bb-myAvatars
- bb-NoSpamUser
- bb-Scripture-Links
- bb-twitter
- BBcode Buttons
- BBcode Lite for bbPress
- bbFlickr 0.1
- bbPages
- bbPress Attachments
- bbPress Benchmark
- Bbpress Latest Discussion
- bbPress Polls
- bbPress Signatures
- bbPress Sitemap Generator
- bbPress Smilies
- bbPress Theme Switcher
- bbPress Username Extended
- bbPress-Mobile
- BBPress:Live Comment
- BBPress:Syntax Hiliter
- bbRatings
- bbRusToLat
- bbSocialize
- bbSync
- bbVideo
– C –
– D –
– E –
– F –
- Fix Admin Access
- Fix bbPress
- Force Login
- Forum is category
- Forum Last Poster
- Forum Redirector
- Forum Restriction
- Forums Moderators
- Front Page Topics
– G –
– H –
– I –
– L –
– M –
November 30, 2008 at 8:21 am #69315In reply to: Locked Out of Forum!
_ck_
ParticipantChange the bbpress tables prefixs to
bb_via phpmyadmin and then fix the prefix setting in bb-config.phpNovember 30, 2008 at 7:05 am #69222travelsuperlink
MemberI tried to understand the new database structure by checking the upgrade-schema.php. I found one thing could cause problem:
$bb_queries = “CREATE TABLE IF NOT EXISTS
$bbdb->users(IDbigint(20) unsigned NOT NULL auto_increment,user_loginvarchar(60) NOT NULL default ”,user_passvarchar(64) NOT NULL default ”,user_nicenamevarchar(50) NOT NULL default ”,user_emailvarchar(100) NOT NULL default ”,user_urlvarchar(100) NOT NULL default ”,user_registereddatetime NOT NULL default ‘0000-00-00 00:00:00’,user_statusint(11) NOT NULL default 0,display_namevarchar(250) NOT NULL default ”,PRIMARY KEY (
ID),UNIQUE KEY
user_login(user_login),UNIQUE KEY
user_nicename(user_nicename));”;
my old database table bb_users the user_nicename does not have unique key on it, but now upgrade try to setup as unique key. will it be the reason for the upgrade timeout?
Unfortunately for my cpanel host I could not access the mysql log, but please help me solve this. any inputs are welcome.
thanks.
November 30, 2008 at 6:09 am #69221travelsuperlink
MemberI follow the steps. After extract the new bbpress files and rename the config.php (v0.
to bb-config.php, I could see all my previous posts.However, when I login to the Admin, it displays:
It looks like your database is out-of-date.
You can update it here.
After click the Upgrade Database button, after a few seconds, the http://www.travelsuperlink.com/forum/bb-admin/upgrade.php page just display a blank webpage (timeout?)
I am stuck here, please help.
November 29, 2008 at 11:11 am #69354_ck_
ParticipantSince bbPress-Live also does a list of forums, here’s how to do that too:
<h2>Forum List</h2>
<ul>
<?php
global $wpdb;
$query="SELECT * FROM bb_forums WHERE topics!=0 ORDER BY forum_order ASC LIMIT 10";
$results=$wpdb->get_results($query);
foreach ($results as $result) {
echo "<li><a href='/forums/forum.php?id=".$result->forum_id."'>".$result->forum_name."</a></li>";
}
?>
</ul>of course this example doesn’t take into account nested forums and will just display them flat.
November 29, 2008 at 10:57 am #69353_ck_
ParticipantAnd you can just keep making it fancier and fancier.
Let’s say you want to also show how many posts each topic has.
echo "<li><a href='/forums/topic.php?id=".$result->topic_id."'>".$result->topic_title."</a> (".$result->topic_posts." posts)</li>";or how old the last reply is
echo "<li><a href='/forums/topic.php?id=".$result->topic_id."'>".$result->topic_title."</a> (".human_time_diff(strtotime($result->topic_time." GMT"))." ago)</li>";November 29, 2008 at 10:45 am #69352_ck_
ParticipantLet’s put that all together – this should work right inside any wordpress template:
<h2>Latest Forum Discussions</h2>
<ul>
<?php
global $wpdb;
$query="SELECT * FROM bb_topics WHERE topic_status=0 ORDER BY topic_time DESC LIMIT 10";
$results=$wpdb->get_results($query);
foreach ($results as $result) {
echo "<li><a href='/forums/topic.php?id=".$result->topic_id."'>".$result->topic_title."</a></li>";
}
?>
</ul>November 29, 2008 at 10:37 am #69351_ck_
ParticipantSo we have the $results, how do we make a pretty list of them, say inside of our sidebar?
We have to loop through them and print them out. This is where that list of fields inside of bb_topics comes in handy.
Here’s just a list of titles to start with:
foreach ($results as $result) {
echo "<li>".$result->topic_title."</li>";
}Of course that’s not very useful, because they aren’t clickable. To make them clickable will take a little bit more work:
foreach ($results as $result) {
echo "<li><a href='/forums/topic.php?id=".$result->topic_id."'>".$result->topic_title."</a></li>";
}That example uses quite a few shortcuts to get the job done, it hardcoded the path to your forums (change /forums/ if needed) and even if your bbPress uses pretty permalinks, it simply uses the topic id number to get there – bbPress will redirect back to permalinks. If you absolutely know you have permalinks and want to use them, you could have done something like this instead:
<a href='/forums/topic/".$result->topic_slug."'>"November 29, 2008 at 10:28 am #69350_ck_
ParticipantNow we need to put together a correct mysql query.
Let’s try something simple.
SELECT * FROM bb_topics WHERE topic_status=0 ORDER BY topic_time DESC LIMIT 10SELECT means “grab the following”
the asterisk means “all the fields in the table”
FROM bb_topics is kinda obvious, it’s the table we want
topic_status=0 means it’s topics not deleted
ORDER BY topic_time DESC means put the newest topics on top
LIMIT 10 means we want only the first 10
Let’s say we also wanted to exclude topics that were closed, since people can’t reply, we don’t want to tease them. In that case you would change the
WHERE topic_status=0to
WHERE topic_status=0 AND topic_open=1or let’s say you only wanted “stickies”
WHERE topic_status=0 AND topic_sticky!=0Okay now to use that in WordPress we do the following:
global $wpdb;
$query="SELECT * FROM bb_topics WHERE topic_status=0 ORDER BY topic_time DESC LIMIT 10";
$results=$wpdb->get_results($query);If all goes well, WordPress will then execute the query and then fill
$resultswith the answers.Now comes the output part.
November 29, 2008 at 10:24 am #69349_ck_
ParticipantBoth bbPress and WordPress have a very simple way of fetching data.
WordPress uses
$wpdbbbPress uses
$bbdb(the db part means database, very simple)
Then there’s the good old “get_results”. They both use that.
bbpress:
$results=$bbdb->get_results("mysql query goes here");wordpress:
$results=$wpdb->get_results("mysql query goes here");Many times you can use the same query in either bbpress or wordpress by just changing $bbdb to $wpdb or visa-versa.
Then you have to figure out what you are asking for.
Let’s use the really simple bbPress Topics table as an example. Unless you’ve customized your install, the Topics table is probably called
bb_topicsHere are all the fields available inside of
bb_topics.topic_id
topic_title
topic_slug
topic_poster
topic_poster_name
topic_last_poster
topic_last_poster_name
topic_start_time
topic_time
forum_id
topic_status
topic_open
topic_last_post_id
topic_sticky
topic_posts
tag_countNovember 29, 2008 at 10:18 am #4344_ck_
ParticipantI’m not sure if this has been addressed elsewhere already or a plugin already exists but for novices that have even just a beginner’s knowledge of how php+mysql works I want to show you how easy it is to show bbPress info inside of WordPress and vise-versa.
You should NOT be using overly complex plugins like bbPress-Live or parsing RSS feeds if you have WordPress and bbPress sharing the same database but different tables. Instead, it’s a piece-of-cake to grab info from each other directly and display it. You don’t even need a plugin, you can code it right into your templates (as long as you know they will remain working together).
So I’ll give some examples here and then if anyone has questions feel free to ask.
-
AuthorSearch Results