Skip to:

Re: Some general questions!



I guess after re-reading, you are not sure what files to modify. Each of the php files in the template folder are used to display SOMETHING. When I first started out, I had no idea what file was used to display each page, or view, or whatever. So, I usually found a page I didn’t like the look of, just by looking at it in the browser, then I found a word on that page that seemed distinct enough that I could grep through all the template files for that word. In a lot of cases, I would find one file or maybe 3 files where that word occurred. That’s how I knew what page to modify. I’m sure someone with more knowledge could tell you that forum.php is used to display a single forum, or that topic.php is used to display a single topic.

One thing I did right off the bat to see which php pages were actually displayed and not called from other php files was to look in the template folder for something called header.php. There’s always a header.php and a footer.php, it seems. So, there is indeed a header.php. Now, since that is the header for each page, that has to be called from any page that is displayed in the browser. So, I grepped through all the php files in the template folder for header.php and found there are no files called header.php. I know they have to call header.php somehow, maybe it’s a function. So, I grepped through all the files for header without the php, and it returned a ton of files with header in them.

shell:~/forum/my-templates/mytheme > grep -i header *php
edit-post.php:<?php bb_get_header(); ?>
favorites.php:<?php bb_get_header(); ?>
forum.php:<?php bb_get_header(); ?>
front-page.php:<?php bb_get_header(); ?>
header.php: <div id="header">
login.php:<?php bb_get_header(); ?>
memberlist.php:<?php bb_get_header(); ?>
password-reset.php:<?php bb_get_header(); ?>
profile-base.php:<?php bb_get_header(); ?>
profile-edit.php:<?php bb_get_header(); ?>
profile.php:<?php bb_get_header(); ?>
register-success.php:<?php bb_get_header(); ?>
register.php:<?php bb_get_header(); ?>
rss2.php:<?php header('Content-type: text/xml'); ?>
search-stock.php:<?php bb_get_header(); ?>
search.php:<?php bb_get_header(); ?>
stats.php:<?php bb_get_header(); ?>
tag-single.php:<?php bb_get_header(); ?>
tags.php:<?php bb_get_header(); ?>
topic.php:<?php bb_get_header(); ?>
view.php:<?php bb_get_header(); ?>

OK, so they call the header with a function called bb_get_header. I grepped again for that, to eliminate the other places the word header appears (div id=”header” for example.)

Now, I have a list of every page, I think, that’s used to display some content to the user in a browser. If you are trying to change the structure of a certain page, it’s going to be one of those php files listed there.

If you’re just trying to modify the look (not the actual structure) you might just be able to make a change to the style.css. Find the id or class of the element you want to change (view source in your browser to see what’s being used currently) then change that element in the style.css.

One thing I did right off the bat was styled the blockquote. By default (when I installed a year ago) there were no styling rules for blockquote. No indent, no different font, no border, no color change, nothing. So, I added a definition to the style.css for blockquote.

In some cases you’ll be modifying existing rules, in others you’ll be created new ones for things that might be unstyled.

I find Chris Pederick’s Web Developer Toolbar add on for Firefox invaluable for modifying CSS.

You can make a change while viewing the page and see the effect right away. Then, you can make the change permanent by modifying the style.css. The changes made in with the web developer toolbar are local only, they’re not saved. Play all you want there, you won’t break anything. Make a change you like, then make it permanent in the style.css.

Skip to toolbar