two hopefully simple issues (force login & topic author)
Hey all –
Just started playing with bbpress last night & I am both totally hooked and somewhat frustrated, which seems to be my standard reaction to new software. I’m fluent in HTML, conversational in CSS and have worked with WordPress code before so I’m not completely in the dark, but there’s enough of a learning curve here that I have a few things I’d love some help with, if someone had a moment. Here’s the first two:
1. I would like my forum to be completely private – i.e., people would have to register or login on some sort of splash page before they reached the forum. In searching around these boards I found this plugin, but I just get a big ol’ 404 Not Found when I try to download it (and it looks like it’s a ways behind bbpress v1.0.2 anyway). Is this what I should be using instead? And if so, where exactly would it go, and on what page(s)?
2. I’m trying to add a “topic started by” field to the list of threads; I can get it to show up in the header row but I can’t get the fields in the actual table to show up. See what I mean? That’s no good. It’s probably some stupid PHP thing missing a thing (man, PHP is unforgiving) but I just can’t find it. Here’s the code I’m using:
<?php if ( $topics || $stickies ) : ?>
<th><?php _e('topic'); ?> — <?php new_topic(); ?></th>
<th><?php _e('started by'); ?></th>
<th><?php _e('posts'); ?></th>
<th><?php _e('last poster'); ?></th>
<th><?php _e('last post'); ?></th>
<?php if ( $stickies ) : foreach ( $stickies as $topic ) : ?>
<tr<?php topic_class(); ?>>
<td><?php bb_topic_labels(); ?><a href="<?php topic_link(); ?>"><?php topic_title(); ?></a></td>
<td class="num"><?php topic_author(); ?></td>
<td class="num"><?php topic_posts(); ?></td>
<td class="num"><?php topic_last_poster(); ?></td>
<td class="num"><a href="<?php topic_last_post_link(); ?>"><?php topic_time(); ?></a></td>
<?php endforeach; endif; ?>
Lord knows I have more questions, but let’s start with those. Any help would be very much appreciated…thanks!!
For issue # 1, you might want to try hidden forums:
For # 2, in the “started by” data column, just use this in your template’s
<?php topic_author(); ?>
You said “started by” right, since “last poster” is already there, right?
Hey, thanks for the tip re: hidden forums plugin; I’ll give that a shot.
And yeah, I’m trying to add first poster/author since, as you said, last poster is already there. And I did find that
<?php topic_author(); ?>code, but for some reason I can’t get it to work – if you look at the code I put in the first post, you should see it there, but for some reason it’s not working. Do you see anything there I should change? </p>
<p>Thanks for your help…`
ok, stuff just got a lot weirder. i made the original post sticky and made a new topic, and the “topic author” code is working for the sticky one but not the regular one. (screenshot.) how the hell did i do THAT?
You have to add it in two places in front-page.php. If you look closely, you will see where. It’s just another row in the same table. You changed the header of the table already, and you changed the sticky portion of the table (and if you changed that before but didn’t have a sticky post, you would not have known you changed it because there was nothing to display there, so your change would not have been used for anything) you just have to change the next row, a little further down in front-page.php in your template. You’ll see it if you take a look.
Beautiful. I KNEW it was some stupid thing. Thanks for finding it.
- You must be logged in to reply to this topic.