Please post entire front-page.php.
bbPress support forums » Installation
How Do I Do This?
(63 posts)-
Posted 9 months ago #
-
<?php bb_get_header(); ?> <?php if ( $forums ) : ?> <div id="hottags"> <h2><?php _e('Hot Tags'); ?></h2> <p class="frontpageheatmap"><?php bb_tag_heat_map(); ?></p> </div> <div id="discussions"> <?php if ( 0 > 1 ) : ?> <h2><?php _e('Latest Discussions'); ?></h2> <table id="latest"> <tr> <th><?php _e('Topic'); ?> — <?php new_topic(); ?></th> <th><?php _e('Posts'); ?></th> <th><?php _e('Last Poster'); ?></th> <th><?php _e('Freshness'); ?></th> </tr> <?php if ( $super_stickies ) : foreach ( $super_stickies as $topic ) : ?> <tr<?php topic_class(); ?>> <td><?php _e('Sticky:'); ?> <big><a href="<?php topic_link(); ?>"><?php topic_title(); ?></a></big></td> <td class="num"><?php topic_posts(); ?></td> <td class="num"><?php topic_last_poster(); ?></td> <td class="num"><small><?php topic_time(); ?></small></td> </tr> <?php endforeach; endif; // $super_stickies ?> <?php if ( $topics ) : foreach ( $topics as $topic ) : ?> <tr<?php topic_class(); ?>> <td><a href="<?php topic_link(); ?>"><?php topic_title(); ?></a></td> <td class="num"><?php topic_posts(); ?></td> <td class="num"><?php topic_last_poster(); ?></td> <td class="num"><small><?php topic_time(); ?></small></td> </tr> <?php endforeach; endif; // $topics ?> </table> <?php endif; // $topics or $super_stickies ?> <?php if ( bb_forums() ) : global $bb_forums_loop; $_loop =& $bb_forums_loop; bb_forum(); $skipForum = false; while ($_loop) : if ($_loop->walker->depth == 1) { if (in_array(get_forum_id(), array(2, 3, 4, 5, 6, 7, 18, 19, 20, 101))) $skipForum = true; if ($skipForum) { ?> <h2<?php bb_forum_class?>><a href="<?php forum_link(); ?>">Click Here To Go To the <?php forum_name(); ?> Forums</a></h2> <?php } else { ?> <h2<?php bb_forum_class?>><?php forum_name(); ?></h2> <table id="forumlist"> <tr> <th><?php _e('Main Theme'); ?></th> <th><?php _e('Topics'); ?></th> <th><?php _e('Posts'); ?></th> </tr> <?php } } elseif (!$skipForum) { ?> <tr<?php bb_forum_class(); ?>> <td><?php bb_forum_pad( '<div class="nest">' ); ?><a href="<?php forum_link(); ?>"><?php forum_name(); ?></a><small><?php forum_description(); ?></small><?php bb_forum_pad( '</div>' ); ?></td> <td class="num"><?php forum_topics(); ?></td> <td class="num"><?php forum_posts(); ?></td> </tr> <?php } bb_forum(); if ($_loop === null || $_loop->walker->depth == 1) { if (!$skipForum) echo '</table>'; $skipForum = false; } endwhile; ?> <?php endif; // bb_forums() ?> <?php if ( bb_is_user_logged_in() ) : ?> <div id="viewdiv"> <h2><?php _e('Views'); ?></h2> <ul id="views"> <?php foreach ( bb_get_views() as $view => $title ) : ?> <li class="view"><a href="<?php view_link(); ?>"><?php view_name(); ?></a></li> <?php endforeach; ?> </ul> </div> <?php endif; // bb_is_user_logged_in() ?> </div> <?php else : // $forums ?> <h3 class="bbcrumb"><a href="<?php bb_option('uri'); ?>"><?php bb_option('name'); ?></a></h3> <?php post_form(); endif; // $forums ?> <?php bb_get_footer(); ?>Posted 9 months ago # -
Thats works on my server. Are you sure you edited right
front-page.php? Do you have more than one template?Posted 9 months ago # -
You were right...I'm an idiot and uploaded my backup front page.
It works now, but it's not exactly what I was trying to do.
I was trying to do something like that on my main WP site. You know, build a "Page" with those links on it. But, I might leave it as is...if I do, however, can I take out the "New Topic In This Forum" underneath all of the sub-forums?
I don't want people posting things outside the individual sub-forums.
BTW, thanks for all of your help. I never could have made this thing work without you and ChrisPosted 9 months ago # -
Comment out third line from bottom in
forum.phplike
<?php // post_form(); ?>Posted 9 months ago # -
Oh, BTW, what just to make sure I explained it clearly...
On my main WP site, in my navigation bar, I was going to have Page called forums. If someone clicked on that "Forum" Page button they would see a list of cities. I just thought it would be easier for them to be transported directly to their city of choice rather than having to scroll down the page once reaching the bbpress forums.Posted 9 months ago # -
Just grab the links to the individual forum pages then, and insert them into a WordPress page. You'll have to maintain it manually, so if you add a new city you would need to add a new link to that WordPress page. I imagine there is probably a way with integration to use the bbPress functions in a WordPress page but I think that's more work than it's worth, especially if your list of cities is pretty much set.
Your WordPress page would be titled "Forum" then, and in that page would be the links to the individual forums. Then you might not even need front-page.php since you'd be navigating directly to the parent forums for each city. I think you would probably leave it there so if anyone navigated in the breadcrumbs to the next level 'up' they would still get a list of all cities, either links to the parents, or the way you had it set up initially with the long front page.
Posted 9 months ago # -
Ok, so I now know how to link the individual cities. I can use Livibetter's new code and do it from the front page of the forum or I can do it from the Forum Page on our main site. Thanks to both of you...I'm really learning a lot!
So, now I've added the logo with a "Click Here" statement to direct people back to the main site. As you can see www.theangrywaiter.com/forum
it sits on top of the title.
I was thinking maybe I could move the title up higher and center it.
Don't know how to do this.
Then I could make the logo and "Click Here" words clickable to the main site. (The main site and forum are not integrated if that makes a difference. They both reside in their own sub-directories.)
Don't know how to do this either.
I have to go out for a while, but I'll be back around 11:00 Chicago time.
Talk to you later.Posted 9 months ago # -
Integration doesn't matter at all if you're just linking one to the other, they're just simple html links. You can link anything to anywhere, no integration required.
Not sure what you mean about "on top of" - the new logo is a background image over to the bottom/right of the header div. The problem with making it a background image, rather than just an image in your code, is that to make it clickable back to the main site, you'd have to make the whole header a link back to the main site. If you look at the source for the page, you'll see there is no img tag for awforumlogo2.jpg that you can wrap in an
<a href="tag to link back to the main site. I don't think you want that image as a background image for the header if you're going to make a link out of it.I would remove the background image from your style.css and put the img tag in header.php somewhere in the
<div id="header">section (around line 34 in a stock installation).Once you have an image in header.php, you can work on positioning it where you want it and linking it to what you want as well. Then you can figure out where you want your forum title as well.
Posted 9 months ago # -
I was able to move the forum Title up and to the center just by adding some padding. I think it looks good there.
I removed the logo from the background in the style sheet.
Now, I've been trying to add the image to the header.php, but I don't know how to do it.Posted 9 months ago # -
In header.php, in the header div (where the login_form() is) put this:
<img id="headerlogo" src="http://www.theangrywaiter.com/wordpress/wp-content/uploads/awbanner.jpg" alt="The Angry Waiter" />Right now though, the image is taller than the header div (the header is 106px, the image is 131px, I think.)
So, to make it all work, you'll need to make the header div taller, or the image less tall. Then you'll need to apply some styling to the image you just placed in the header. Something like this:
#header img { whatever: here; }That just gets the image into the header. Then you need to wrap an
<a href="http://www.theangrywaiter.com/" alt="go home"></a>around that image tag you just added, to link the image to the destination.Posted 9 months ago # -
OK...I have it positioned and clickable, but somehow I've made the entire banner clickable and added a border.
To position the logo/Click here I added a left-padding in the style sheet.
I also had to add change the header php from src= to img src= to get the logo to display after I added href.Posted 9 months ago # -
The whole header is clickable now...could this be because I positioned it with padding?
Posted 9 months ago # -
so now I changed style sheet put floated the image right and it's postioned fine, but there's a bortder around it.
I think I should replace that image with a smaller oneEdit: Ok, I think it's related to what you said before about the image being too large. I kind of blew that off because I was using a different image. The new one is 280x100. I think what I'm going to do is make a smaller image, upload that and change the header.php ing src.
Then, try to hide the border.Posted 9 months ago # -
This needs to be removed. It's right after the header div in header.php
<img id="headerlogo"That is doing you no good. Actually, my message was a combination of a couple messages. Initially I was going to say give the image an id so you could position it, then I said to just style it with
#header img- in any case, you need to remove the above since it's not valid and is causing weird things.And you must be working on it since there is no border.
Posted 9 months ago # -
Yes! It works!
I was having trouble in IE (it worked fine in Firefox). Now, after removing img id, it works in both.
Thanks.
I think, though, I might make a slightly smaller logo/click here so it fits better into the header.Posted 9 months ago # -
47 posts later and I think I'm done!
Check it out and let me know what you thinkPosted 9 months ago # -
Only 47 posts? Piece of cake.
I did notice, in Firefox 2.0.0.10 the logo is not entirely clickable. Certain parts of it are, if you hit it just right, but not the whole thing. Odd. In IE7, it's all clickable.
Oh, and I probably told you this incorrectly as well (although not intentionally.) The
<a hrefshould have a <strong>title attribute, not an alt attribute. The<imgshould have an alt. So<a href="http://www.theangrywaiter.com/" title="go home">and
<img src="http://www.theangrywaiter.com/forum/bb-templates/awbbtheme/images/awforumlogo3.jpg" alt="the angry waiter logo" />Sorry about that.
And, to keep your page valid XHTML, you're going to have to give each forumlist a different ID by appending the name or number of the forum to it. So it would be
<table id="forumlist-chicago">
and<table id="forumlist-atlanta">or
<table id="forumlist-4">
and<table id="forumlist-11">Posted 9 months ago # -
I changed the title to alt=
As far as the table ids...are you talking about the code I got from Livibetter?
And about anchoring each forum?
After all that work (by you guys, not so much me) I took that out and decided to just let people scroll down the page. I just think the page looks better and I kind of like that they can see all the other cities.
I know, I'm a pain in the ass.
So, on the front-page.php and the forum.php I see nothing like that anymore, but if I right-click page source when at the actual forums page I see what you mean.Edit: I see what you mean too when I run it through a valadator
Posted 9 months ago # -
table ids, yes, the code from livibetter would need a tiny modification to create unique ids for each table. :)
And for the anchoring, do you mean something like a list up top on the page, then each of those link further down the page to a named anchor? Like this?
http://www.vestacompanies.com/properties/(click a for sale or for rent category and it just scrolls down the page a little bit to the proper table)
Posted 9 months ago # -
Yes, remember I was going to try to have a list of the cities so people could just click on say "Miami" and then be taken directly to the "Miami" part of the page? Well, livibetter's code created a list of all the cities and took them directly to the sub-forum for each city. If I create a link on the main WP Page for the Chicago board using an address like http://theangrywaiter.com/forum/forum.php?id=2
it also takes them directly to the sub-forum. I didn't really like that, so I figure I'll just offer one link from the main WP site to the forums and let the visitor scroll past the other cities until they find their's.
It might actually be better because then they can see the other cities and more easily go and read posts in those cities as well as in their own city.Oh, and if they go to a sub-forum they can enter a post outside of the child forums. I tried to comment that comment form out, but it took them out of all the forums as well. So, now I think it was all a waist of time, but at least I learned something.
Posted 9 months ago # -
So? I think I'm done for now, right?
Posted 9 months ago # -
I hope so - now go get some members!
Where you going to fix the ids to make them unique for each city table?
Posted 9 months ago # -
Hey Guys,
Chris, sorry I didn't answer sooner, I had to work this weekend and I also had to deal with a WP issue.First, I'd again like to thank all of you who helped me. Especially Chris and livibetter.
Second, to answer your question Chris, no I haven't fixed the table ID issue yet. I see what you mean and when I try to validate at W3Schools it says exactly what you said. Problem is I'm still trying to find where in my files to change the ID's. Basic question I know, but I've looked at everything I think might apply. Ideas?
Posted 9 months ago # -
I'm not sure which version of front-page.php you're using (couldn't make my site look like yours using the last front-page.php code that was posted) but I THINK all you need to do is change the line that looks like this:
<table id="forumlist">
to this:
<table id="forumlist-<?php forum_id(); ?>">That just adds a dash and the forum number to the table id. That should validate. But I think that will affect the CSS in a bad way. There will no longer be an id of "forumlist", they'll all be "forumlist-something" which the CSS will have trouble with.
Maybe it would be better to do something like this:
<table class="forumlist" id="forumlist-<?php forum_id(); ?>">Then you would need to change your style.css to make any references to #forumlist look like .forumlist (change from applying the forumlist styling to ids and make it apply to classes.)
That's a lot of work, but ids are supposed to be unique on a page, where classes are not. This is actually a better application of a class since all the tables should look the same and use the same styling. You're not referencing them with javascript or something where the ids matter.
I just tried this and it worked on mine and validated properly. There were 6 instances of #forumlist that needed to be changed to .forumlist in my style.css
Hopefully that will work for you.
Posted 9 months ago # -
Hey All,
I've been away for a while...I got an assignment so I had to put my site on hold. But, I'm back.
I'm only writing today because I really wanted to thank a few people for their help. I would never have gotten as far as I have with my forums if not for them.
So...fel64, livibetter and, especially Chrishajer, thank you all for your help. Since starting this whole WP and bbPress venture, I've constantly been surprised and impressed with just how generous people in this community are with their time and their knowledge.
Thanks again...I'm sure I'll be hitting you up again soon.
Posted 7 months ago # -
Hey Chris...still around?
I'm continuing this thread because so much on the info is here.
I've been trying to validate my html and css by trying the various methods listed above.
This didn't validate <table class="forumlist" id="forumlist-<?php forum_id(); ?>">
But, this did <table id="forumlist-<?php forum_id(); ?>">
Both the html and the css are perfect with the last one, but I lost some of my styling, namely the colors. Any ideas?
Posted 7 months ago # -
There is a difference between id and class. Maybe you're using one or the other.
This is a class:
.forumlist { font: whatever; }This is an id:
#forumlist { font: whatever; }You're using
<table id="forumlist-1">but your css doesn't contain markup for that (it has forumlist, not forumlist-anything. There is markup for #forumlist, but without numbers. Maybe you could do something like<table id="1" class="forumlist">or something? That way, the forumlist class doesn't need to be unique, since each city will sort of look the same, and the id is unique to each city. You still need to add the proper tags in your CSS, #1, #2, #3 for the ids and .forumlist (which is already there I believe.)Hope this advice is accurate. Let us know if it works.
Posted 7 months ago # -
I' m not sure, but I think the id needs to come before the class. Did you try your one example with the id first, then the class?
I've always seen them in that order (id first) but I'm not sure if that's required or not. What was the error exactly?
Posted 7 months ago # -
Hey Chris,
Thanks for answering. If you're still up, well, I have to go to bed. But, I'll try it again in the morning and let you know how it goes.
Thanks again
Posted 7 months ago #
Reply »
You must log in to post.