Well what I dont understand is that THIS works:
<li><a <?php if (is_front() || is_forum() || is_tag() || is_topic() || is_bb_feed() || is_bb_profile() || is_bb_favorites() || is_view())
{
echo "id="current"";
}?> href="index.php">Forums</a></li>
And this aint:
$current = ($rw['location']) ? ' id="current"' : '';
echo '<li ' . $first . '><a href="' . $rw['page'] . '"' . $current . '>' . $rw['item'] . '</a></li>';
Cause ($rw) will give: (is_front() || is_forum() || is_tag() || is_topic() || is_bb_feed() || is_bb_profile() || is_bb_favorites() || is_view()) too
The source code looks fine now, but it’s plugin page turned everything in the readme file into a tag!
Note: using id="current"
in this way is dodgy because plugins have to generate content that co-operates with other plugins.
If another plugin also uses id="current"
the page will not validate (because each ID (identity) should be unique).
You could just say id="X8VQm2_current"
but (a) it would look ugly and (b) regardless, you’re not changing the identity of the row, you’re just saying something about it, so using ID is still wrong.
The solution is easy: use class="current"
instead and adjust your css so that instead of #current {}
you use .current {}
The example I wrote for you before shows how to do it.
There is a painful habit of mis-using the id attribute among many theme designers and that makes it difficult to know what to do or why to do it
Okay, I changed the location value with:
is_front() || is_forum() || is_tag() || is_topic()
And changed the code with:
function get_bb_menu() {
global $bbdb;
$menutest = mysql_query("SELECT * FROM $bbdb->menu WHERE
set = 'active' ORDER BY
order ASC");
And re-written the li part with php:
<li><a <?php if ('location')
{
echo " id="current";
?>
href="<?php ('page'); ?>"><?php ('item'); ?></a>
<?php
}
?></li>
So technically I need to put this in a foreach and it wil be like:
<li><a <?php if (is_front() || is_forum() || is_tag() || is_topic())
echo " id="current"; ?>href="index.php">Forums</a> </li>
<li> <a href="search.php"> Search</a></li>
(the is_front() etc will not be shown ofcourse, but it’s to make it clear)
But how to make such a foreach?
Yes, it’s been uploaded to the repository. However, when I went and browsed the source code all of the formating is gone and it’s all on one line. I will update it now.
Graphic Display Ranks has been updated. Here are the changes:
- Added the ability to display a “special” graphic for Key Master and Moderator
- Added the text “#Posts: {n}” to the alt and title of the image that is displayed.
- Cleaned up some of the code.
Read all about it here.
Could it be related to the extra closing </li>
around line 181 in the rendered source of the front page? (I doubt it, but just taking another look.)
Anonymous User 96400Inactive
i tried that already, but the problem is that this </div>
is needed. if i remove it, then it breaks the frontpage. look here.
I don’t know anything about your plugin, but why not put the OR in the PHP, similar to how WordPress checks for pages or posts:
<?php if(is_home() || is_single() || is_page()) {
whatever;
} ?>
Maybe you could put the logic in the PHP? I don’t understand what the plugin does, but the value in the database seems odd to me.
so, for your application:
<?php if ((bb_get_location == front-page) || (bb_get_location == topic-page)) {
give the ID;
} ?>
You have an extra </div>
before <div id="sidebar">
. Remove that and I think it will be fine.
Hi,
I have made a new plugin, works great, but I have one little problem with it.
Here is the php code/query/function and how the table looks:
http://www.sourceskins.com/problem.jpg
What does it do?
Well it checks if the page id == location. If so, give a id named current. This works. The problem is the first line (see the db table in the jpg). Look at location. I have entered 2 values in location: front-page || topic-page
I have used || in it the split them.
The idea was: if bb_get_location == front-page OR topic-page give the id. So it had to look if it matches a record from that row.
Problem is, it aint working cause it will spit out: front-page || topic-page and the code isn’t able to look for a match.
How can I solve this? Any ideas?
I don’t think you want a hook, you want get_user_type($id)
I am fleshing out my plugin Graphic-display-ranks and I’m looking for the right hook to use to do the following:
I want to find out if a topic author is the Key Master or a moderator. Here is what I have so far —
function get_special_rank () {
global $special_rank, $use_special_rank, $bbdb;
if ($use_special_rank==1)
{$title_for_rank=<strong>I NEED THIS HOOK</strong>( get_post_author_id() );
switch ($title_for_rank) {
case "keymaster" :
$special_rank=1;
break;
case "moderator" :
$special_rank=2;
break;
default :
$special_rank=0;
}
}
else
{
$special_rank = 0;
}
return $special_rank;
}
Can anyone point me in the right directon?
Hello, I would like the function to send newsletter by email to members in my bbpress forum! I know the emails is saved in the database (or?) so this would not be any problems to integrate or make an plugin, i think. The only problem is that I’m not the man for this job
BBPress seems to use the kind of cookie that resides on the user’s machine unless they actively log out.
Can anyone help me modify/ add custom code (or point me to a useful plug-in
) so that its lifetime is limited to the session only?
Also, should I be using something like session_cache_limiter(‘nocache’) for further privacy, or is this already taken care of?
I have recently installed the excellent Private Forums plug-in as an alternative to using the more cumbersome HTTP authentication method, which has prompted me to think about this potential security issue. Private Forums is only truly secure if the user remembers to log out.
You mean ascending? ^^
It think currently this can only be done by hardcoding. Look at functions.php
around line 44-66 and you can change
$bb_last_countable_query = "SELECT * FROM $bbdb->topics $where ORDER BY topic_time DESC LIMIT $limit";
to
$bb_last_countable_query = "SELECT * FROM $bbdb->topics $where ORDER BY topic_time ASC LIMIT $limit";
But then every post-listing will be ordered as ascending.
This is the only way I can figure out at the moment…
I just wish they’d include the Forum Categories enhancement into .80 though lol. It sure Would Be NICE!!! LoL 
/It IS working just great by the way, I didn’t see any flaws with it..

spencerp
I was having the same issue at Forums4Bauer I am using a modified version of the bbPress forum template. One thing I did was widen the whole thing, but to get rid of the hidden long names I made the following changes to the style.css file in my-templates:
#thread {
background: #eee;
list-style: none;
margin: 0 0 0 110px;
padding: 0;
}
#thread li {
padding: 1.5em 1.0em;
line-height: 1.5em;
height:100%;
}
#thread li ol, #thread li ul {
margin-left: 60px;
height:100%;
}
.threadauthor {
margin-left: -140px;
overflow: hidden;
position: absolute;
width: 100%;
}
I also added:
.threadpost {min-height:120px;}
Unfortunately that doesn’t work in IE. I’m looking for a way around a problem I’m having where short replies overlap. That’s not typically a problem, but I’m using my Graphic Display Ranks plugin, and images that are taller than some of the replies.
Hope this helps.
In style.css, can you do something like this:
.threadauthor {
margin-top: -20px;
margin-left: -110px;
/* overflow: hidden;*/
position: absolute;
width: 95px;
}
So, no more hidden overflow and move the threadauthor up 20px, which lets it bleed over to the right into the post area, but it doesn’t overwrite any text.
For the few instances where the author is too long, this might be a good solution. In my forum, less than 5% of the users have used a long name.
Another solution would be to make the font smaller or tighten up the font spacing, or even jigger the widths of the columns, but those are more major surgery for a simple display problem.
If you edit your style.css sheet in /bb-templates/ and go down to the portion that says:
/* Topic Page
=================================== */
That is where you will need to edit your file. I am not sure, but changing this one might be what you are looking for:
.threadauthor small { font: 11px Verdana, Arial, Helvetica, sans-serif; }
Trent
No problem zapata. To get rid of the register link, you need to download login-form.php from /bb-templates/ and then edit it as follows:
Change this part from:
<p><?php printf(__('<a href="%1$s">Register</a> or log in'), bb_get_option('uri').'register.php') ?>:</p>
to get rid of the register, you could just comment out this line or change the wording:
<! -- <p><?php printf(__('<a href="%1$s">Register</a> or log in'), bb_get_option('uri').'register.php') ?>:</p> -->
Once you have edited that file, upload it to a new folder (if it doesn’t exist already in root) /my-templates/ as bbPress will use that file first and if it doesn’t exist, go back to the one in /bb-templates/
As for the registering with WordPress, I was only referring to the abilitity to turn on or off registration in WP admin. If you turn it off, then you can add the members you want through the admin.
That should get you going!
Trent
Trent,
WOEEEZZZZZZZZZAAAAAAAAAAA…. sorry for the excitement… the code works!!!!!
Gurus… one request… how can I completely “Eliminate” anonymous user registration… the goal of my forum is for a private discussion of authors who write on the main blog to communicate with each other. Hence all users of the forum will be actually authors of the blog.
From Ardentfrost.
<?php
/*
Plugin Name: Force Login
Description: No one can see your forums unless they are logged in.
Plugin URI: https://bbpress.org/forums/topic/117
Author: Michael D Adams
Author URI: http://blogwaffe.com/
Version: 0.7
*/
function force_login_init() {
if ( !bb_is_user_logged_in() && false === strpos($_SERVER['REQUEST_URI'], 'bb-login.php') ) {
if ( file_exists( BBPATH . 'my-templates/login.php' ) ) {
require( BBPATH . 'my-templates/front-page.php' );
} else {
require( BBPATH . 'bb-templates/front-page.php' );
}
exit;
}
}
add_action( 'bb_init', 'force_login_init' );
?>
That will work.
Trent
Usually those “cannot modify header” errors are due to whitespace before the <?php
or at the end after the ?>
Is that possible?
Trent, Thanks for the quick reply. There are no errors. The objective was to hide the forums from everyone who is not logged in. For this the mdawaffe’s plugin (code posted in his post above) was working on my initial install (0.74)… but I’ve installed the 0.75 yesterday and reinstalled the plugin, but upon logging out, I’m still able to browse the forums…
the url: passionforcinema.com/club