Search Results for 'code'
-
Search Results
-
This is going to be complex to explain but I’m going to try.
This is from front-page.php
<?php if ( bb_forums() ) : ?>
<h2><?php _e('Forums'); ?></h2>
<table id="forumlist">
<tr>
<th><?php _e('Main Theme'); ?></th>
<th><?php _e('Topics'); ?></th>
<th><?php _e('Posts'); ?></th>
</tr>
<?php while ( bb_forum() ) : ?>
<?php if (bb_get_forum_is_category()) : ?>
<tr<?php bb_forum_class('bb-category'); ?>>
<td colspan="3"><?php bb_forum_pad( '<div class="nest">' ); ?><a href="<?php forum_link(); ?>"><?php forum_name(); ?></a><?php forum_description( array( 'before' => '<small> – ', 'after' => '</small>' ) ); ?><?php bb_forum_pad( '</div>' ); ?></td>
</tr>
<?php continue; endif; ?>
<tr<?php bb_forum_class(); ?>>
<td><?php bb_forum_pad( '<div class="nest">' ); ?><a href="<?php forum_link(); ?>"><?php forum_name(); ?></a><?php forum_description( array( 'before' => '<small> – ', 'after' => '</small>' ) ); ?><?php bb_forum_pad( '</div>' ); ?></td>
<td class="num"><?php forum_topics(); ?></td>
<td class="num"><?php forum_posts(); ?></td>
</tr>
<?php endwhile; ?>
</table>
<?php endif; // bb_forums() ?>This basic says the table headings are Main Theme, Topics, and Post. I wanted each category to be in it’s own table.
So if you have a category, let’s say category “Welcome” and a child forum “Welcome to Our Site” and a category “Support” and child forum “PHP Help” it will display: (the dashes are spaces, ignore them)
-Main Theme
Topic–Post-Welcome
—Welcome to Our Site
0
0-Support
—PHP Help
0
0but I wanted:
–Welcome
Topic–Post—Welcome to Our Site
0
0-Support
Topic–Post—PHP Help
0
0SO I thought it was easy so I did this:
<?php if ( bb_forums() ) : ?>
<h2><?php _e('Forums'); ?></h2>
<?php while ( bb_forum() ) : ?>
<?php if (bb_get_forum_is_category()) : ?>
<table id="forumlist">
<tr<?php bb_forum_class('bb-category'); ?>>
<th><?php bb_forum_pad( '<div class="nest">' ); ?><a href="<?php forum_link(); ?>"><?php forum_name(); ?></a><br /><?php forum_description( array( 'before' => '<small>', 'after' => '</small>' ) ); ?><?php bb_forum_pad( '</div>' ); ?> <th><?php _e('Topics'); ?></th>
<th><?php _e('Posts'); ?></th></td>
</tr>
<?php continue; endif; ?>
<tr<?php bb_forum_class(); ?>>
<td><?php bb_forum_pad( '<div class="nest">' ); ?><a href="<?php forum_link(); ?>"><?php forum_name(); ?></a><br /><?php forum_description( array( 'before' => '<small>', 'after' => '</small>' ) ); ?><?php bb_forum_pad( '</div>' ); ?></td>
<td class="num"><?php forum_topics(); ?></td>
<td class="num"><?php forum_posts(); ?></td>
</tr>
<?php endwhile; ?>
</table>
<?php endif; // bb_forums() ?>Which works great but I have to have every title under a category now. If I have a forum title “Websites” not under a category, this is what I get:
Websites00
–Welcome
Topic–Post—Welcome to Our Site
0
0-Support
Topic–Post—PHP Help
0
0Or it latches itself to another category
–Welcome
Topic–Post—Welcome to Our Site
0
0—PHP Help
0
0-Support
Topic–Post—PHP Help
0
0So I need a statement that says if it’s not in a category it will print the title ONCE
<tr>
<th><?php _e('Main Theme'); ?></th>
<th><?php _e('Topics'); ?></th>
<th><?php _e('Posts'); ?></th>
</tr>So it will print:
–Welcome
Topic–Post—Welcome to Our Site
0
0-Support
Topic–Post—PHP Help
0
0-Main Theme
Topic–Post—PHP Help
0
0Make sense?
I have a similar challenge to the earlier topic “Linking back to main website”. It is for a site I have configured for someone, who has asked for the same ability for their logo to have a link associated to it, that will take the user back to the home page of site that pointed them to the blog / forum.
I have installed bbpress 1.02
You suggested the following;
in header.php where the body tag starts.
===========================
<body id=”<?php bb_location(); ?>”>
<div id=”wrapper”>
How do I locate this logo in the top right hand corner of the header where the default bb_emblem was located?
“<a’x’ href=”http://www.reflexology-uk.net/site”><img src=”images/iior.jpg” alt=”ITEC” /><‘x’/a>”
===Note===== ‘x’ === added in string above to break code so it will print =====
At presentI have a logo situated in the CSS file as a background, which you suggest is not the right way to go about achieving this.
Any pointers will be useful. Thanks.
Topic: Templates for 1.x ???
. Because I need your thoughts that what should add more functionality in this plugin.