Make your own free website on Tripod.com


0.6.1
20021102

weblog / news publishing tool

requirements - installation - template(s) - querystring usage - xmlrpc (Blogger API) - post via email - notes

requirements:

PHP4 (version 4.0.5 or higher)
MySQL (version 3.23.23 or higher)
Perl (optional - only for the spellchecker)
...and a link to http://cafelog.com on your site.

The link will help promoting b2, since this is its only mean of promotion.
If you like b2, you can help me with a donation (even if it's only 2 or 3 dollars, every donation helps), or you can buy me stuff from my wishlist :)

 

installation:

New users:

1. Unzip the package in an empty directory.

2. Open b2config.php in a text editor, and modify the variables as explained in the comments. Comments are lines that start with # or /* or //

3. Upload everything. This release is designed to sit in your root folder, IE the folder where your b2-powered page will reside.

4. a. This isn't necessary but ensures your security: With your FTP program, do a CHMOD 644 on the file b2config.php, so no-one can overwrite it except you. If your server is on Windows NT, then set the file on "read-only" mode.
   b. if you want to use the spellchecker, do a CHMOD 755 on sproxy.pl

5. Launch b2install.php in your browser. This should setup the MySQL database for your blog. If there is an error, double check your b2config.php file, and try again. If it fails again, please go to the support forums there: http://tidakada.com/board, and make a post with all the information about the failure (error messages, etc), and your setup (the PHP and MySQL versions on your server, and the browser you were using).

6. Delete b2install.php - this is not necessary since v0.5, because there's no "drop table" instructions in the install script anymore, but it's better to delete it anyway (or rename it to a random name in case you need it again in the future).

7. Go to b2login.php and log in with the login "admin" and the pass "admin". Then click on the menu 'My Profile', and change the password. Note: you need javascript enabled to launch the profile popup window.

8. Do this if you don't want to blog as "admin": log out, create an user account on b2register.php, then re-log in as "admin", and update the level of the new user to 5 or more, so that you have all the admin rights. Logout, then log in as the new user.

Whenever you want to post something, just open a browser and go to b2login.php to log in and post.
You can also use a bookmarklet and/or a sidebar (IE5+/NS6+) to post.
You can also post through the Blogger API, click here for more info.
Your site's blog is on b2.php (simple template) and index.php (CSS template), you can rename this file to index.php or any other name you fancy (provided it bears the php extension or is interpreted as a php file by your server).
You can also copy b2.php into a new file and modify that new file, it will work too ;)

Users upgrading from v0.5.x to v0.6.1:

1. Unzip the package in an empty directory, to avoid deleting your existing b2config.php file.

2. Open the new b2config.php file and your existing b2config.php file. Modify the new b2config.php file in order to use your existing settings there, in addition to the new settings. (There are a lot of additionnal settings, so it's best to edit the new config file than adding on the exisitng one.)

3. if you want to use the new spellchecker, do a CHMOD 755 on sproxy.pl

4. Edit all your templates and update your template tags to follow the changes to the template tags here, because there have been some modifications, and it would cause some errors if you didn't edit the templates. Tags noted with an orange asterisk * are tags that were added or modified in v0.6, these are those you got to update in your templates.
5. Upload the new files, and you're done. :)

Users upgrading from v0.6preX to v0.6.1:

1. Unzip the package in an empty directory, to avoid deleting your existing b2config.php file.

2. Open the new b2config.php file and your existing b2config.php file. Modify the new b2config.php file in order to use your existing settings there, in addition to the new settings. (There are a lot of additionnal settings, so it's best to edit the new config file than adding on the existing one.)
3. Upload the new files, and you're done. :) (Generally, this means every file but your template file index.php/b2.php)
4. To add support of the new TrackBack and Pingback functionnalities, you may want to check the Template tags section for the appropriate new tags, and the default index.php to see how they are used :)

 

template(s):

First notes:

Enclosed is an example of a template, in the file b2.php. You can rename this file to "index.php"or something else (recent b2 versions have a default index.php, which is an elaborate CSS-based template).
You can have any number of template files, since all they do is extract the posts from the database.
Pseudo-template for the comments is in b2comments.php. You needn't rename this file, but you can edit it.
The only thing to remember is that it's not actually a template, but a PHP file that you're manipulating. So when you see "don't delete this line", you know you mustn't, unless you want to have a broken page.
Required lines are: the first lines that call blog.header.php, the lines with the "while" statement, and the ones with just "}" (it ends the while loop).
Between the "while" line and the "}", is the template for your posts.

Notes about parameters:

1. Some template tags can accept optional parameters between the parenthesis ().

2. To add a parameter to a tag, enclose it between quotes and put it between the ().
Example: <?php my_tag("my parameter"); ?>

3. You may have to put several parameters, for that you separate them with commas.
Example: <?php my_tag("first param","second param"); ?>

4. The order of parameters is important. If a function accepts 2 parameters and you only want to set the second one, you still have to provide the first one, and so on for any number of parameters.
Example: <?php my_tag("","second param"); ?>

5. Some template tags, like the_date(), display something only if in some conditions. They generally accept parameters to display something before and after them only when they display something.
Example: <?php the_title("<h1>","</h1>"); ?> would display <h1>title of the post</h1> only if the post has a title

Template tags are these:

<?php the_date() ?> *
the date of the post. example: 03.07.01 (default is dd.mm.yy).
the date is displayed only on new days. for example if you got 10 posts on the same day, the date for this day is displayed only once.
Parameters:
  • format string (default: "d.m.y")
  • string to display before the date (default is blank)
  • string to display after the date (default is blank)

<?php the_time() ?>
the time of the post. example: 18:37:00 (default is hh:mm:ss)
Parameters:
  • format string (default: "H:i:s")

Note: you can change the way the date & time are displayed in the Options page.
once you understand the format strings for the date & time (explained in the Options page), you can change the display right on the template: for example, the_date("d.m.Y") to have dates like 25.12.2001, the_time("B") to have Swatch Internet Time.
If you change the display of the date on the template, changing it from the options page won't have any effect.br />
Note about the_date(): if you want all your posts to bear the date, you'll have to use the_time() instead, with a date format string. for example, to have all your posts show like "25.12.2001 @ 8:04:50 AM" you'll have the_time("d.m.Y @ g:i:s A"). you can also repeat this template tag 2 times with 2 different formats: the_time("d.m.Y") for the date, and then later the_time("g:i:s A") for the time of the day.

<?php the_weekday() ?>
This displays the day of the week when the post was made. It works like the_time(), in that it would appear at every post. Weekdays can be obtained with a custom date format string in the_time() or the_date(), but for non-english weekdays you have to edit b2config.php
Note: this tag is OBSOLETE, the_time() and the_date() now use weekdays/months from b2config.php

<?php the_weekday_date() ?> *
Like the_weekday(), but works like the_date(), in that it would appear only on new days.
Note: this tag is OBSOLETE, the_time() and the_date() now use weekdays/months from b2config.php
Parameters:
  • string to display before the weekday_date (default is blank)
  • string to display after the weekday_date (default is blank)


<?php the_ID() ?>
the ID (number) of the post.

<?php the_title() ?>
The title of the post.
Parameters:
  • string to display before the title (default is blank)
  • string to display after the title (default is blank)


<?php the_content() ?> *
The text of the post.
Parameters:
  • text to display for the link to the complete entry (default is '(more...)')
  • 0 or 1, whether you want to show the teaser message or not, when showing the complete text (default is 1)
  • a filename of another template, if you want the 'more' link to link to a different template for the complete text of the extended entry (default is the current template)

For example <?php the_content("read more","0","blah.php") ?> would display a link to blah.php, with the link text read more, and won't display the teaser message.

* To enter an extended entry, just type <!--more--> in your entry. The part before that comment is the teaser, the part after it is the extended entry. To force the extended entry not to show the teaser message, type <!--noteaser--> somewhere in your entry.

* To enter an entry with several pages, just type <!--nextpage--> in your entry to start a new page.


<?php next_post() ?> *
Displays a link to the next post(s). (Generally you might want to use that tag only in single-post templates)
Parameters:
  • format string for the link (default is "%", where % is replaced with the title of the next post)
  • text to display to announce the link (default is "next post: ")
  • "yes" or "no": display the title of the post, or no (default is "yes")
  • "yes" or "no": display a link to the next post only if the next post is in the same category (default is "no")
  • number: which next post ? if you make it '2', the 2nd next post is linked instead of the 1st next one (default is "1", which means first next post)


<?php previous_post() ?> *
Displays a link to the previous post(s). (Generally you might want to use that tag only in single-post templates)
Parameters:
  • format string for the link (default is "%", where % is replaced with the title of the previous post)
  • text to display to announce the lin