bb_update_option( 'forum_restriction_db', array( "1" => "David Bessler,testman", "3" => "David Bessler" ) );
$value = bb_get_option( 'forum_restriction_db' );
That’s how it should work.
Anonymous User 96400Inactive
yeah, i’m using polyglot for my wp blog. now, having something like this for bbpress would be just awesome. users being able to post in different languages. but maybe that’s wanting a bit too much right now.
i had a look at the code aready, but it’s just too complicated for me. all this php code…
I’m not absolutely sure about this, but it seems that SQL will want you to be more explicit. You need to break up the list (4 and 1) and add different strings to the where. So, for the first add WHERE forum_id = 4
then do OR forum_id = 1
. Every subsequent forum id query should also start with an OR.
That’s what I think at least. It’s worth a shot
When I use the following code in a plugin:
function forum_restriction_get_topics_where_plugin( $where ) {
if ( is_front() ) {
$list_of_allowed_forums = "4,1";
$where = "WHERE forum_id IN ('$list_of_allowed_forums') ";
$where .= " AND topic_sticky <> 2 ";
return $where;
} else {
return $where;
}
}
add_filter ( 'get_latest_topics_where', 'forum_restriction_get_topics_where_plugin' );
I expect it to list the topics belonging to forums with ID 4 and ID 1. Instead, it is only listing topics with forum 4. When I change them to (1,4) it only lists 1. It seems it is only seeing the first value in the string. Any ideas why?
Still no luck 
I have this:
<?php
global $bbdb;
$r = mysql_query("SELECT * FROM $bbdb->menu WHERE
set = 'active' ORDER BY
order ASC");
while($rw = mysql_fetch_array($r))
{
$class="";
if ($rw['is']) { $class .=" current" }
echo '<li><a class="$current" href="'.$rw['page'].'">'.$rw['item'].'</a></li>';
}
?>
Which is the same code as yours, but I still get the error:
Parse error: parse error, unexpected '}' on header.php on line 84
And line 84 contains the if:
if ($rw['is']) { $class .=" current" }
I am totally lost here :S
I would try the cookie sharing stuff in both bbPress config.php:
$bb->cookiedomain = '.lumanation.com';
$bb->cookiepath = '/';
And then maybe the cookie stuff that you can put in WordPress wp-config.php (can’t remember the format) if the first stuff just doesn’t work out straight away.
If the users are there it is because the integration is working, just the cookies are not sharing. Try that out and let me know.
Trent
hey guys,
i have followed the instructions on the forums/extend for intgegrating bbpress and wordpress.
It all seems to work – bbpress knows about the wordpress users.
Only problem is that i have to login to both wordpress & bbpress seperately – I thought it was supposed to support 1 login for both – using the same cookie or something?
the test site is:
blog.lumanation.com
the forums link at the top takes you to the bbpress install
any help would be greatly appreciated! 
also – any ideas on how to embed the bbpress install into wordpress – is it just a matter of hacking up the bbpress templates or is there a more elegant way similar to the wordpress rs-discuss/xdforum plugins?
Cheers!
Adam
You’re welcome Startribe..

spencerp
<?php
global $bbdb;
$r = mysql_query("SELECT * FROM $bbdb->menu WHERE set = 'active' ORDER BY order ASC");
while($rw = mysql_fetch_array($r)) <strong>{</strong>
$class="";
if ($rw['is']) { $class .=" current" }
echo '<li><a class="$current" href="'.$rw['page'].'">'.$rw['item'].'</a></li>';
}
?>
Can you give me a code example, cause i keep getting the error
the while looks like it needs curly brackets adding to it or you’re just going to repeatedly set $class=""
then remove the curly bracket above the echo
.
Hmm got this now:
<?php
global $bbdb;
$r = mysql_query("SELECT * FROM $bbdb->menu WHERE
set = 'active' ORDER BY
order ASC");
while($rw = mysql_fetch_array($r))
$class="";
if ($rw['is']) { $class .=" current" }
{
echo '<li><a class="$current" href="'.$rw['page'].'">'.$rw['item'].'</a></li>';
}
?>
But this gives me an error:
Parse error: parse error, unexpected ‘}’ on line 71
Think I have misplaced something here?
Greetz
ps I didn’t include $uri=option("uri").$rw["page"];
at all cause I wanted to test this first. So I keep it out for now…
I left Ardentfrost/Josh know of this thread via GoogleTalk, but he hasn’t replied. He must be AFK at the moment. He’ll be in to see this though..

@Trent, can you fix my grammar error in the “Forum Catagories” thread. In the title change: Catagories to: Categories please? That grammar mistake is driving me nuts!
*EDITED: Thanks Trent for editing it!

spencerp
So I have stored an option called forum_restriction_db. It has the value of:
“1” => “David Bessler,testman”, “3” => “David Bessler”,
When I try to assign that array to a varaiable as follows:
$forum_restriction_allowed_in_forum = array(bb_get_option(‘forum_restriction_db’));
It tells me the value of $forum_restriction_allowed_in_forum is just array
.
I tried setting the value of the option forum_restriction_db to array("1" => "David Bessler,testman", "3" => "David Bessler",)
but then it spits back the members of the array as a,r,r,a,y etc … so the allowed memebrs of the forum_id 3 is “r”.
How can I get this to work?
Hmm… last night, the bbpress “latest discussion” links did not have the “replies” bit. This morning they sure do though.
Interesting point about the RSS feeds. Because each post does not have its own URL, I guess this is a way to simulate it. Still, it seems there should be a “pretty” option for that as well. Something like:
http://example.com/topic/1/post/3
Instead of:
http://example.com/topic/1?replies=3
I may explore this with some mod_redirect rules and a little code hacking. Any bbpress devs around that can chime in? In my experience with Google (and others), it’s notably easier to get URLs like the first example above indexed.
Hello! I’ve noticed that when I delete a user in the plugin it doesn’t delete it in the database. I can still see the users in the memberlist in admin-pages!
Does this happen for everybody or just for me?
When I looking in the code where it should delete the user it says:
if ( $bb->wp_table_prefix )
$delteeded = $bbdb->query("DELETE FROM ".$bb->wp_table_prefix."users WHERE ID = $d");
else
$delteeded = $bbdb->query("UPDATE $bbdb->users SET user_status = 1 WHERE ID = $d");
Shouldn’t it say DELETE user instead of UPDATE after the ‘else’??
Works like a charm now!! WOOT WOOT!!
http://spencerp.net/forums/category/1
Now, I just gotta do some customizing of this, and I’ll be all set! Thanks a million Sam, and So1o for this!! 
spencerp
Alright, I’ve just uploaded it all, and even applied the new .htaccess rules, but I’m still getting a 404.. By the way, I still have to adjust the colors of the Category itself though!!

http://spencerp.net/forums/category/1
Any thoughts?
spencerp
P.S. Trent, can you adjust my thread’s title please? My grammar mistake is bugging me lol! Catagories => Categories Thanks in advance!
Good tutorial from Podz! Seen it before, but forgot about it! Thanks for posting Spencer!
Yep! I don’t think I could live without his guides lol! You’re welcome by the way.
And I just like how he uses images to show people what, and where to do things.. 
spencerp
As a note to others as well, make sure you READ the documentation for this! If you don’t run your plugins through the readme validator and correct all the errors, the plugin will not show up correctly. As well, the plugin code must be in the same format for system to create post in plugin page with the right name, author, version, etc.
If you do make a mistake, upload a new one and the system will automatically change when it runs the script again (every hour or 2).
Hope that helps out as well.
Trent
Just compute the computable stuff beforehand and it becomes a lot more maintainable/readable.
// setup the basic data
$uri=option("uri").$rw["page"];
$class="";
// compute the computable data
if ($rw['is']) { $class="current" }
// write the line
echo "<li><a class='$current' href='$uri'>".$rw['item']."</a>"
Note that I’ve used class
rather than id
for semantic purposes – the ID of an element shouldn’t change, but it’s class can change and can be multiple, so you could even do:
$class="item";
if ($rw['is']) { $class .=" current" }
Ands how does one change the time from
2007-01-16 18:23:58
to
January 16, 2007
So no time, only date. I have added <?php topic_time(); ?>
to my frontpage and it shows: 2007-01-16 18:23:58, but on the fronpage (only there) I want to show it like: January 16, 2007
Thx
I did that but you can’t use php in an echo:
<?php
global $bbdb;
$r = mysql_query("SELECT * FROM $bbdb->menu WHERE
set = 'active' ORDER BY
order ASC");
while($rw = mysql_fetch_array($r))
{
echo '<li><a href="'.$rw['page'].'">'.$rw['item'].'</a></li>';
}
?>
This works perfectly, but now I want to add some php code into <a
!here the php code!>...</a>
so it will look like this (i only show the echo now):
{
echo<li><a <?php if ('.$rw['is'].')
{
echo "id="current"";
}?> href="<?php option('uri'); ?>'.$rw['page'].'">'.$rw['item'].'</a></li>;
}`
But this aint working cause you cant do php in an echo. Any suggestions?
Hi. I just got bbPress up and running this evening, and I’m really liking it so far. I have it configured for “pretty permalinks”, and I’m seeing a strange “replies” argument in the topic URLs. For instance:
http://example.com/topic/2?replies=1
This makes pretty permalinks not quite so pretty after all. I thought the whole idea was to minimize the arguments to be more search-engine friendly.
After looking through the source code, it doesn’t appear that this argument is actually used for anything functional. My best guess is that “replies” is an attempt at a cache-buster, so that the URL changes each time a new reply is posted. Wouldn’t it be preferable to simply set the “Last-Modified” header to the time of the most recent post?
It seems like this would achieve the same thing without ruining the pretty permalinks. Also, I notice that the bbpress.org support forums don’t have this extra argument. Can you share the magic?
Thanks.