A static page is one that physically exists on your website as an HTML or PHP file. The URL for the page points to a physical file.
If you are adding comments to an existing page you must change the file extension from .html to .php. Note that there is an alternative to changing the file extension. Read File Extensions for more information.
Insert this line anywhere after the links to your stylesheet and javascript:
<?php include 'path/head-inc.php'; ?>
head-inc.php contains the links to javascripts and stylesheets required by TalkBack. path is the path to your TalkBack directory from the directory in which your guestbook or comments page resides. You need to edit it and insert the actual relative or absolute path to the TalkBack directory. If you are not familiar with HTML paths, read this tutorial.
There are some optional parameters:
<?php // insert these only if, for this page, you want to override the defaults $tb_closed = 'Y'; // 'Y' means no more comments can be entered for this page // empty or absent means comments are open $tb_language = 'french'; // overrides default language // these override the normal templates $tb_comments_display_tpl = '/talkback/filename.php'; $tb_comments_form_tpl = '/talkback/filename.php'; $tb_comments_preview_tpl = '/talkback/filename.php'; $tb_comments_reply_tpl = '/talkback/filename.php'; // this is used if captcha is enabled, otherwise it is ignored // if absent, theme defaults to 'custom' // choices are: custom, white, red, clean, blackglass $tb_captcha_theme = 'white'; include 'relative path/head-inc.php'; ?>
$captcha_theme
is only used if you have enabled captcha checking. In that case enter the name of the theme you want to use. The choices are: custom, red, white, clean, blackglass. Example: $captcha_theme = 'custom'
$tb_closed
allows you to disallow any new comments for that page while still displaying existing comments. To do so, set it to: $tb_closed='Y'
$tb_language
is applicable only if you have more than one language file in the language directory. See using multiple language files.template file names
allow you to override the default template (as set in the configuration setting) and display a different template for this page only. Enter the path (from your root HTML directory) into the variable. Don’t forget the first slash. Example: $tb_template = '/talkback/guestbook-tpl.php'
The template does not have to reside in the TalkBack directory. It can be in your web root directory or any directory beneath it. For more information about using other templates see customizing templates.
images/wait_animation.gif is displayed when the user clicks on submit or preview. After an error or preview if the user returns to the entry page by using the browser back button, waiting.gif will still be displayed. To stop it from being displayed in those circustances insert this in your body tag: <body onunload="unsetWaitGif();">
.
At the point in the page that you want comments to appear, insert:
<?php require 'path/comments.php'; ?>
Do not use a URL. This will cause an error when a comment is submitted:
<?php require 'http://yoursite.com/talkback/comments.php'; ?>
If you do not know the relative path, use this:
<?php include $_SERVER['DOCUMENT_ROOT'] . '/talkback/comments.php'; ?>