Here is a simple and complete example, let's call it demo.php
:
<?php
require 'blof.php';
blof_set('passwd', 'mypass');
blof_init();
?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>My blog</title>
<link rel="stylesheet" href="blof.css" />
</head>
<body>
<?php blof_main(); ?>
</body>
</html>
Explanations for every item:
require
. In
this example, blof.php
is in the same folder as demo.php
.blof_init()
before sending any header.blof_main()
to embed the blog anywhere in the HTML body.Here is a default stylesheet (referred as blof.css
in the previous example):
div.blof_thread { margin-top: 1em; margin-bottom: 2em; } div.blof_thread div.blof_title { font-size: 1.25em; font-weight: bold; border-bottom: solid black 1px; } div.blof_thread div.blof_header { } div.blof_comment { margin-bottom: 0.5em; padding: 0.25em; background-color: #e0e0e0; border: solid black 1px; } div.blof_commentalt { margin-bottom: 0.5em; padding: 0.25em; background-color: #d0d0d0; border: solid black 1px; } div.blof_comment div.blof_header, div.blof_commentalt div.blof_header { font-weight: bold; } div.blof_body { text-align: justify; margin-top: 1em; } div.blof_body p { margin: 0.5em; } div.blof_action { text-align: center; } div.blof_footer { text-align: center; margin-top: 2em; border-top: dotted gray 1px; } div.blof_error { background-color: #f0b0b0; } span.blof_from { font-style: italic; } span.blof_date { } span.blof_u { text-decoration: underline; } span.blof_i { font-style: italic; } span.blof_b { font-weight: bold; } pre.blof_code { margin: 1em; background-color: #d0d0d0; }
Blof can be customised with blof_set('param', 'value')
where param
is:
store
: folder where thread data is stored. Defaults to the name of the embedder
with its file extension removed (ie. embedding in demo.php
will store data
in the demo/
folder).author
: sets the default author's name, can be changed while posting.passwd
: sets the author's password, mandatory.email
: set the author's email for posting notifications.brag
: add a 'powered by Blof' link in the footer (set to 0 or 1).validate
: add 'Valid XHTML' and 'Valid CSS' links to W3C validator in the footer (set to 0 or 1).footer
: custom footer note, appears on the left.per_page
: number of threads per page.cap_fold
: number of characters displayed by a folded thread.