Nintendo Wii forums Forum for writers phpBB mods Essays on copyright Dating advice Narnia forums

phpBB Blog
Readme

Overview
Contributors
Features
Requirements
License
Installation
Upgrade
Howto
Troubleshooting
Changelog
Feedback
Mascot

Overview

This is phpBB Blog, version 2.3, released January 11, 2006.  Copyright © 2006 by Tony Boyd.

This is a blog tool for phpBB.  The basic idea is this: you have a phpBB installation already running, you've set up a forum for your posts, and now you want to have a blog-ish page and RSS file to show off each post.

There are 3 major ways to use this product.  You'll have to decide which one you want to pursue.  First, there is the default setup, which uses the provided index.php file to display the blog.  If you wish to use that, see the Installation heading, below.  Second, there is the option to bypass the provided index.php file, and simply embed the blog display into your pre-existing home page.  To do that, see the Howto section, below.  The third option is to embed a mini-blog into your pre-existing home page.  All this displays is the title of recent posts.  If you're interested in that, see the Howto section, below.

Contributors

Thanks to aetolus & wileyD. The extra features are appreciated! UPDATE for 2.3: new blog comment interface thanks to MissP! Also, the RSS feed should now be iTunes compatible, thanks to Boum.

Features

Features include an RSS 2.0 feed for syndication; full support for BBCode, smileys, and avatars; permalinks with first/next/previous navigation; trackbacks; 7 different stylesheets to choose from; and as many Geo-URL settings as possible (so you can get listed in all those blog indexes that categorize you by location and/or language). Oh, and it integrates with phpBB Podcast, too.

Requirements

PHP 4.10 or greater.  Apache 1.3.x or 2.0.36+ on Unix or Linux.  It might run on IIS and/or Windows – I don't know.  A working phpBB 2 installation is needed.  While this will work with any database that phpBB can use, MySQL support is the most extensive.

License

My code is licensed to you under a GPL license, which should have been included with all these files.  The general summary of the GPL license is that you can use my code for free, even in a commerical business.  And you can modify my code.  But you must keep the license, keep the attribution, and any changes you sell or give away must also be GPL.  It is not public domain.  Do not remove license.txt.

Installation

  1. Before anything else, you should have a working installation of phpBB. In addition, you should have set up a forum for your blogs.
  2. Unzip the file you downloaded. If you're reading this, you've already done it. After unzipping, you should have 2 folders: blog & docs.
  3. One of the files in the blog folder is called settings.php. Open that in a text editor. You'll need to give attention to the first 220 lines or so. Change each setting, using the comments as a guide.
  4. Save settings.php, and upload the entire "blog" folder to your Web server. If an existing folder named "blog" already exists, be careful. I'm not liable for stupidity, so don't overwrite your important stuff.
  5. Note that you should change the extension (the .php part) of each PHP file to match what you use in phpBB. So if you changed all your phpBB files to use .php4 for the file extension, then you need to change phpBB Blog similarly. HOWEVER, do NOT change settings.php.
  6. Pull up the blog/createtable.php (or .php4, or whatever you named it :) page in your Web browser. If you get an error message, check that you typed in the correct URL, and then check your settings.php file to be sure you entered the URLs & paths correctly. If you get stuck, try dropping the included pwd.php file into your phpBB directory, and view it in a browser. Does the setting it recommends match with your settings.php file? Once everything is OK, if you are using a MySQL database, you should get a message that a table has been created for you. If you are using any other database (or if the MySQL code didn't work) you will get some instructions on how to create the new database table manually, which you should do. Once the table is ready, remove the createtable.php file from the blog directory on the server.
  7. Finally, pull up the blog/index.php page in your Web browser. Do the entries appear as you expected? If so, you're done. If not, see the Troubleshooting section, below.
  8. OPTIONAL: If you already have a home page and want the blog to appear as part of it, see the Howto section, below.

Upgrading to 2.3

Many, many lines changed. There is no quick patch for this. So we'll basically reload the files. This only works for a normal install. If you custom-integrated the blog into your existing home page, you may have to review these steps and adapt them to your situation.

  1. Open your pre-existing settings.php file, and transfer/copy any settings you wish to keep to the new settings.php file.
  2. Review the new settings.php file for all the new fields that have been added. Change whatever you like.
  3. Save the new settings.php file.
  4. Backup the blog directory on your Web server. You can just make a copy of it somewhere, nothing fancy.
  5. Upload everything in the new blog directory to your server. In other words, overwrite your pre-existing, working phpBB Blog directory with the new blog directory.
  6. Delete createtable.php from the server (you already ran that file during the original install, don't need it now).
  7. Change the extension (the .php part) of each PHP file to match what you use in phpBB. So if you changed all your phpBB files to use .php4 for the file extension, then you need to change phpBB Blog similarly. HOWEVER, do NOT change settings.php.
  8. Test the blog. If it works, you're done. If not, see Troubleshooting, or smile happily and take advantage of that backup you just made. :)

Howto

I saw in the changelog that it's possible to delete spam trackbacks. How?
Go to your phpBB forum, and login. Then go to your blog, and click a trackback link. You will see checkboxes by each trackback listed, and a "delete" button at the bottom of the list. The option to delete should only appear if you wrote the blog entry. I tried to make it very secure, so you can't switch logins before hitting the delete button, or spoof. Hopefully. :)
How do I embed the blog in my existing home page?
First go through the Installation steps. Then come back here. OK. Ready? Often this is very easy. There are two steps. First, you must include the settings file at the very top of your page, before any HTML or other code appears. To do so, just place this one line at the top of your page:

<?php include_once('blog/settings.php'); ?>

Second, you need to include the file blog.php. This should be placed wherever you want the blog listing to appear:

<?php include_once('blog/blog.php'); ?>

If it doesn't seem to work, make sure you put that line after the <body> tag. If you've done that, make sure your home page is also PHP. So if your home page was index.html, rename it to index.php. The page should continue to work just fine, but now it should grab the blog file and display the entries. If you still have problems, check the path. For example, if you renamed the blog folder to "journal" then the correct path might be "journal/blog.php". Finally, the blog listing will probably be ugly until you add a stylesheet. You can just copy the stylesheet line in the index.php file I've provided.
How can I have multiple blogs on a single page?
Assuming you have a single blog working already, making the jump to multiple blogs is easy. First, embed as many blogs as you want, but don't use the "include_once" command. Use "include" like this:

<?php include('blog/blog.php'); ?>

Sprinkle that throughout your page, wherever you want it. If you try viewing the page at this point, you should have many blogs all showing the same entries. To get each to show a different set of entries, you just need to override the $forum variable with a new number. Like this:

<?php $forum=5; include('blog/blog.php'); ?>

So if you add $forum=# (where # is the number of a forum) right before each include command, you'll be able to have many different blogs on a page.
How am I supposed to send out pings if you haven't built it into phpBB Blog?
http://pingomatic.com/
How do I queue up posts/blog entries for future release?
You do it manually for now. I suggest creating a private forum that only you have access to, and work on them there. When an entry is ready, you can post to the "real" blog forum.
How do I make the blog show only my posts?
You have to set up a forum that allows only you to post (don't worry, people will still be able to reply). To do this, log in to phpBB as the admin, and go to the administration panel. Under Forum Admin you'll see a Management link. Go there and create a new forum. Next, also under Forum Admin, you'll see a Permissions link. Go there and select your new forum. On the page that appears, use the Advanced Mode link. Now you'll see a page with lots of settings to change. Under "Post" change it to Admin. You might also want to change "Sticky," "Announce," and "Poll create." Save your changes. Now you have a forum that will contain only your posts. Set up the blog to use it.
How do I stop people from replying to my posts/blog entries?
Same as the previous answer, but when you get into the Advanced Mode area, change the "Reply" option to admin.
What is the blog_mini.php file for?
It just displays a simple list of blog titles. Although it was planned for version 2.0, it didn't make it into any of the betas. So I'm happy to sneak it in, and I feel that (as it is very simple) it is stable. But without testing, it seemed right not to mention it anywhere but here. To use it, just add two lines to your index.php (or whatever file you want the list to appear in). First line includes the settings file, and it should be at the tip-top of the page (first thing):

<?php include_once('blog/settings.php'); ?>

If you already have that line at the top of your page, you don't need to double-up. Second, you need to include blog_mini.php. This should be placed wherever you want the list to appear:

<?php include_once('blog/blog_mini.php'); ?>

Note that you can also include one of the provided stylesheets to style the list. However, it's just one style, blog_box. You could just copy that one item to your existing stylesheet. In settings.php, "$max_blogs" controls how many titles to show.

 

Troubleshooting

I'm getting LOTS of errors. What do I do?
First, you ARE using phpBB forums, right? This program requires phpBB to be installed and running first. If everything is OK with phpBB, the next thing to review is your settings.php file. Double-check everything you entered. Did you escape the single-quotes in any data you entered? Did you put trailing slashes on the URLs you entered? Is the path to phpBB correct? The settings file mentions putting pwd.php into your phpBB directory and running it. Have you done that? Does your settings file match the results? Make your fixes and try again.
Still getting errors. Any other ideas?
Yes. If you're using a custom/tweaked index.php file, did you include both the settings.php file AND the blog.php file?
I get this error: "Warning: Cannot modify header information - headers already sent..."
This means that you didn't include settings.php at the very top of your page. This PHP code:

<?php include_once('settings.php'); ?>

MUST BE THE FIRST LINE. Of course, be sure that the correct path to settings.php is listed. For example, a common path is include_once('blog/settings.php').
I get this error: "SQL Error: 1146, Table doesn't exist."
You closed the database connection, or changed the default connection. This happens a lot if you've integrated multiple PHP projects on your page. The solution is to re-establish the phpBB database connection. Or hunt down the offending code and eliminate it. For example, if code from another project uses mysql_select_db() to change the default database, phpBB won't be able to talk to the database it expects. Remove the conflicting code, and the problem is solved.
I get "404 file-not-found" errors with the trackback feature. Why?
If you're running a non-Apache web server, then your guess is as good as mine. If you're running Apache 2, you need to use version 2.0.36 or above. Also, trackback relies on Apache's AcceptPathInfo directive. Be sure that is enabled. See here: http://httpd.apache.org/docs-2.0/mod/core.html
Trackback says, "no trackbacks found." What's wrong?
Nothing. It's working and waiting for trackbacks to come in.
How come I don't get archive links like everyone else?
The SQL query for the archive is MySQL only (it's tricky). If you use PostgreSQL or MS SQL, the archive feature won't appear. If you can give me sample SQL that works for non-MySQL databases, I'll add it.
Why is the blog page showing lots of posts I don't want?
It's possible you set the variable $forum to the wrong number. In that case, just go back into the forum you want, and scrutinize the URL. You should find the correct forum number there. Change $forum and try again.
I think some of your blog variables and stylesheet names are stomping on my pre-existing stuff! For example, you applied a style to the <table> tag & it's affecting ALL my other tables! Do you plan to fix this?
Yes, although I do not find it urgent. If you're smart enough to be doing PHP or CSS work on your own, you're smart enough to rename things. But I agree that this is less than desirable. I plan to use a single, uniquely- named array for everything in a future release. UPDATE for 2.3: the table, th, and td tags are no longer styled.

 

Changelog

CHANGES FROM 2.2.2 TO 2.3
  • The $phpEx variable is (mostly) respected now. This is a setting in phpBB's extension.inc file, which controls what extension your files use for PHP. However, settings.php should not have its file extension changed.
  • Trackbacks can now be disabled via the settings.php file.
  • A comment system has been integrated with phpBB Blog. This allows you to show comments right in the blog, rather than sending the reader into the forum itself. This feature is optional. Thanks MissP!
  • Stylesheets no longer try to style all your TABLE, TD, and TH tags.
  • When doing a fresh install on top of phpBB 2.0.18 and 2.0.19, there was a bug that prevented createtable.php from creating the table. Fixed.
  • The RSS feed should now be iTunes compatible. Thanks Boum!
  • The RSS feed now properly links to the permalink.
  • Fixed a calendar bug – the months Jan 2006 & May 2005 now display properly.
CHANGES FROM 2.2.1 TO 2.2.2
  • Smileys weren't showing for people who used absolute paths in the config. Fixed. Thanks to isaacr for the bug report!
  • Minor corrections to this file.
CHANGES FROM 2.2 TO 2.2.1
  • Added a calendar. This feature was entirely implemented by wileyD. Thanks!
  • Added pwd.php – a tool to help those having trouble with $phpbb_root_path in the settings file.
CHANGES FROM 2.0.1 TO 2.2
  • Integration with phpBB Podcast. Install phpBB Podcast, and phpBB Blog will automagically start podcasting.
  • Added a new stylesheet called museum. It looks more like a Moveable Type style.
  • Fixed the GEO meta tags, they were all plain HTML, but I prefer XHTML.
  • Added meta tags for author, geo.country, and dc.language. See settings.php.
  • Cool! Figured out a system to remove spam trackbacks.
  • Added Google's nofollow attribute to the trackback links. This means that even if a spammer manages to get listed in your trackback page, their spammy little link will be IGNORED by Google.
  • Got rid of every single "php short open tag" – replaced with normal tags. This gets rid of the requirement to have short open tags enabled.
  • Rewrote the documentation as a single HTML file.
  • Fixed typo ("Transistional") in index.php and trackback.php.
  • Various fixes.
  • Laid claim to some of my own artwork so that phpBB Blog could have a mascot.
CHANGES FROM 2.0 TO 2.0.1
  • Changed the meta tag in index.php, it should display international characters better this way (I still don't know why – UTF8 should be the true international character set – but everyone told me otherwise, so it's changed).
  • Removed the optional super-shorten function, as no-one appeared to be using it.
  • Added avatars as an optional feature. This is mostly just incorporating the mod from aetolus. I made tiny changes to make the code XHTML compliant. See settings.php if you wish to enable this. Thanks aetolus!
  • Revised the help file, added some entries for database connectivity problems.
CHANGES FROM 1.0.1 TO 2.0
  • Changed license from BSD to GPL.
  • Added trackbacks! This enables your blog to GET trackbacks. I have not built anything to SEND trackbacks.
  • Fixed trackbacks! Thanks to erikbjohn for the bug report!
  • Added option (in settings.php) to hide stickies & announcements.
  • Added GEO features. Your blog can now appear on the map at "World as a Blog."
  • Added LINK tag in index.php to point to rss.php.
  • Moved many variables to settings.php, so they can be reused.
  • In order to closely match whatever phpBB does, I now include() phpBB's "common" file. This adds overhead, but it allowed me to make 3 changes: dropped my $quick_config stuff, standardized on phpBB's $board_config; dropped my MySQL code, standardized on phpBB's database abstraction layer. My system should now handle any database that phpBB handles; my system now uses phpBB's naughty-word filter & smiley function.
  • I also pull in phpBB's bbcode file, so phpBB Blog now handles bbcode. Hoo-hah!
  • RSS 0.91 is limited to 15 entries, and 500 characters per entry. None of you guys followed that. :) So I upgraded rss.php to output RSS 0.92. No limits.
  • RSS 0.92 offers no date field. Bloglines was listing ALL blog entries with the current time. So I upgraded rss.php again, to use the RSS 2.0 "pubDate" tag.
  • Since it was already using RSS 2.0 features, I added ttl to rss.php. Helps aggregators to know how often to check your site.
  • Added permalinks to blog.php. After the first beta, I changed permalinks to point at the phpBB Blog page, and included extra navigation goodies (previous entry, next entry, and first entry). In this way someone could come into the blog and read through everything in chronological order.
  • I added the guid tag (also a permalink) to rss.php.
  • Changed the rss.php file to output UTF-8. I had to. I can't predict what character set each person might be using. UTF-8 is a good catch-all.
  • Added keywords. I can't believe I didn't have this before.
  • Made cleanup function case-insensitive. Previously, tags with miXEd CasE were parsed improperly. Now phpBB Blog "understands" more, and is harder to fool.
  • Changed the way I built the image/logo tag, so it shouldn't display a broken image icon if you choose to leave the image settings blank, and if you DO have an image, it now uses the height and width tags for faster display.
  • Dropped support for scattering the blog files anywhere and renaming them. Now the blog system expects the files to remain as named, and to all be grouped together in the same directory – although you can still name the directory whatever you want, or even drop all the files into your top-level directory. This allowed me to remove a few variables that hardly anyone used.
  • Created a new index.php with a new layout.
  • Added archives in the sidebar. This only displays if you use a MySQL backend, but eventually other databases will get to join in the fun.
  • Added TONS of stylesheets for the new layout.
CHANGES FROM 1.0 TO 1.0.1
  • mookie found a bug: old blog entries were re-appearing at the top of the blog page whenever comments were added. Fixed. Thanks mookie!
CHANGES FROM 0.9 TO 1.0
  • Updated the docs.
  • Split blog.php into index.php, blogstyle.css, and blog.php. This should allow for templating.
  • Create settings.php and move all config options there. Add lots of extras.
  • Split the dot function into shorten & cleanup functions. Give both more awareness of HTML to avoid broken tags, add space where needed, etc. Add a super_shorten function as an alternative for the adventurous.
  • Add settings to allow for # of blogs displayed, as well as options to truncate long entries.
  • Add # of comments, timestamps, parting shots, and profile links.
  • Various other little improvements.

Feedback

Please note that no support is provided by the developer.  However, there is a community-based forum for discussion.  If you have questions, bug reports, code improvements to share, feedback, and/or feature requests, go here:

http://www.outshine.com/forums/

Mascot

The mascot's name is Bob.  He is an orca.  I originally created him for NetBSD, but I didn't win their logo contest.  For a while, I left Bob for any other BSD project that needed a mascot, but no one claimed him.  On March 3rd, 2005, I finally decided to claim him for myself!  I like him.  He's happy.

Bob is Copyright © 2004 by Tony Boyd. Please do not use him for anything other than phpBB Blog. Thanks!

-Tony Boyd