a site about nothing
Share



In this section:

Main Tips Windows
PHP-HTML-Unix
Running 16-Bit
Linux @ Windows
Modular Website
Optimize Website
Expiring Domains
Optimize Dial-Up
Decode URL

Apps
Firefox
Indesign
Photoshop
Illustrator
Shortcuts

PHP
Top PHP Scripts
SMF 1.1
SMF 2.x
PhpList
Talkback
Sphider
EditThisPagePHP

Other
Storage
Top 3 SEO Tips
SEO Traps
Spam Revenge
Holy Apple
Links


Awesome book


Best Talkback Tips, Tricks and Tutorials

Page copy protected against web site content infringement by Copyscape

Talkback is the best free comment script out there. On this page, I would like to assemble the best tips and resources for Talkback.

How to customize Talkback

At the bottom of this page, you can see a great script in action: Talkback, by a gentleman who calls himself Old Guy. I installed the script in 2009. It installed easily, but, as most scripts, required a bit of work to get the look just right for my site. In case you're on the same trail, I share my tips here. Please note that I am by no means an expert. That's what the talkback forum is for.

If you like the look of my form (check the bottom of this page), as as starting point you can download my talkback configuration files (my-styles.css, three php files and a pdf showing my admin panel choices). Be aware that my talkback version is 2.3.13 and the files may not be compatible with later versions. In my settings, emoticons are enabled, so if someone types ":)" it will show as a smiley even though I took out the smiley icons from the form. Since my first install, I have made several speed tweaks combining and compressing three js files and two css files to make your pages load faster: you can read the details by following the link, and download the whole thing on my talkback 2.3.13 mirror including speed mods.

Talkback comments: how to change the sort order

I am not letting users sort comments, but I want to sort the comments in ascending date order (the default is descending). Open comments-display-prep.php, look around line 95, change DESC to ASC in the appropriate place. (For all tips, if you want to make sure what I mean, see above about downloading my files.)

How to keep Talkback fonts consistent with your site

Open my-style.css, comment out any font-family entry.

How to edit Talkback styles

Use the Firefox Firebug extension to see what line of the CSS you want to change.

Talkback Tip: How to change labels such as "Your email address" on the comment form

In the "language" folder, open english.php and my-english.php. In english.php, copy the lines you want to change. Paste them to my-english.php and change the label there.

Talkback Trick: How to remove "Remember Me" buttons, remove BB code tags & more

Open comments-form-tpl.php, look around line 63 for "Remember me", and a bit lower to comment out require 'comments-display-quick-tags.php';. Print BR tags there if you need space in the form. I printed a bit of text to explain recaptcha just before the recaptcha box.

How to Remove the Author Link from the Talkback Form or set the NoFollow Attribute

I used to like letting people put in their site link. But I found that it was just too tempting for link scammers. There are two solutions. You can either take out the link functionality entirely. Or you can set the "nofollow" attribute with the link so that Google will ignore the link spammer.

Solution #1: Taking out the functionality
Open comments-form-tpl.php. Find this section and comment it out:
if ($config['author_website']) 
print "
<!-- Website field -->
<input class='tb-field' type='text' name='form_website' value=\"
{$_REQUEST['form_website']}\" /> 
<label class='tb-label'>{$lang['comform5']}</label><br />";

Solution #2: Setting the "nofollow attribute"
Open comments-display-prep.php. Find the section entitled "Format the author field". In the ten lines below, you will find three lines containing
<a href='{$website[$ccount]}'
Change that to
<a rel=\"nofollow\" href='{$website[$ccount]}'

Display emoticons in Talkback comments but Kill the emoticons line on the form

Open comments-form-tpl.php, comment out the if ($config['comments_emoticons']) section.

Using the red recaptcha with Talkback

At the moment the install instructions have a slight error. In the html head, the name of the variable should be $captcha_theme, not $tb_captcha_theme.

Talkback Trick: How to Target the "Powered by TalkBack" link to a new page

In languages/my-english.php, add target='_blank' (mind the SINGLE quote) to the $lang['powered_by1'] line, copied from english.php. Old Guy says you can take the link out if you donate. I donated a little but the link is small and I'm happy to advertise.

Talkback Tip: Why are there flags on my page?

You must have played in the "languages" folder. The script counts the number of php files in the folder. If you have a backup file called, say, "english.php.bak", the scripts counts that as multiple languages, and the flas appear.

Talkback Problem: Empty Lines

Why, on a certain page, are there empty lines at the top of the first comment? I spent hours on that one—looking in the CSS, the database, the php, the html…

Actually, it's quite simple: there is not enough content before the script on that particular page. Add a few carriage returns before the place where the script starts, and it will look normal.

Talkback Problem: uncentered footer

Why is is the "powered by" uncentered on some pages, and why is there a "1"?
You just forgot to include these lines at the top of the page:
<?php
$captcha_theme = 'clean';
include 'talk/head-inc.php';
?>


Security Fixes for Talkback

As any script, Talkback has several security holes that should be addressed. Here are a few I know about. You can follow the directions or download my mirrored talkback version 2.3.13 which also includes speed improvements.

First, users can write html code in a comment. Through that code, who knows what they could "inject" on your page? A simple solution is to disallow any instance of the "<" symbol used to mark tags. Open comments-validate.php. Find these lines:
if (stristr($test,"<script>") || preg_match($pattern, $test)) {
$display_message = '&lt;script&gt; tag and Javascript code are not allowed in any field.';

Replace with:
if (stristr($test,"<") || preg_match($pattern, $test)) {
$display_message = 'No HTML Please.';

According to a post on the Talkback forum, there are holes allowing non-admin users to edit comments. Sven has suggested the following patch. Open comments-edit-prep.php. Find these lines:
defined('IS_VALID_INCLUDE') or exit('This page cannot be accessed directly');

Replace it with:
$admin = get_admin_cookie();
if (!$admin) { die('You are not logged in as an administrator'); }


I have also read that it is good to delete (rather than rename) the "addons" and "install" folders.

Speed Up Talkback

If you diagnose a talkback site with YSlow, you will see that YSlow complains about too many javascript and CSS files being called by Talkback.

In the head-inc.php file, Talkback calls three JS files from the includes folder: talkback.js, thickbox.js and jquery-c.js. This is inefficient: three http requests slow down your page. The solution is to copy-paste the three scrits into one big script, then to call that single script from line 31 of head-inc.php. You can even compress the single JS file using bananascript.

For the CSS (further down in head-inc.php), you can copy-paste styleThickbox.css and my-styles.css into a single file, and compress it by two-thirds in YSlow.

These speed improvements are included in my mirrored talkback version 2.3.13 which also includes security fixes.

Other awesome PHP scripts

I document all the scripts I use. Go to the top of the page and have a look at my other PHP articles in the right column!

Smiles,

Andy

ps: If you have enjoyed this page, I would be immensely grateful if you would link to it, bookmark it or share it. You can also comment using the form below.


There are 12 comments
Barry – Melbourne, Australia
October 13, 2009 - 07:18
Subject: Is this what I'm looking for?

I am writing a comment.
How does it look?
Will it preserve lines?

Lee
December 09, 2009 - 12:01
Subject: Thanks!

Thanks for the info. I have just installed this cript and it looks great!

Lee
December 10, 2009 - 14:38
Subject: sorting comments

You mentioned that you were sorting the comments in ascending date order. This makes sense but what about the most current comments in a list of two or more pages? That would mean that you would have to go to the last page and work backward, right?

Reply to Lee
Andy
December 12, 2009 - 00:47
Subject: Re: sorting comments

Greetings, Lee!

Yes, you are right. I don't have that problem at the moment. Really a matter of preference. Wishing you a beautiful day,

Andy

Simon Roskrow – Yorkshire
February 16, 2010 - 06:08
Subject: Great stuff

Hi Andy

Very, very helpful. A few months after installing talkback, I finally got around to customising the look a bit. I managed some on my own, but so glad I found your blog here...massively helpful.

Cheers, Simon.

Jürgen
March 02, 2010 - 07:19
Subject: Umlaut characters

Most scripts I tested sofar screw up umlaut characters etc, lets try this one

Reply to Jürgen
Andy
March 02, 2010 - 16:39
Subject: Re: Umlaut characters

Hi Jürgen!
Okay, let's try the ü and the ö for germanic languages...
And the é, ç, à for French.
Looks good to me, what do you think?
Smiles,
-Andy

Jürgen
March 13, 2010 - 11:09
Subject: Umlaut characters

It works if you set the right encoding, I had iso on one site with the script embedded which had an issue - I set udf, now its working (worked, it was just a test).
I like the way you integrated recaptcha.
Talkback occasionally run into a strange php error saying something like "deprecated ..." when running on php5 machines (which all of mine are in the meantime), so its questionable if its worth working it up for productive sites.
I have tried about 25 php comment scripts, also commercial ones, and for the purpose for people to use "third party" comment scripts, this is the only way out - mind the purpose part, before throwing stones at me. Basically a brilliant sollution for homogenic enviroments
I just might bother the support of talkback, I think there was one...

amit
April 26, 2010 - 10:21
Subject:

hello

Liero-Israel – israel
June 16, 2010 - 11:18
Subject: Styling the talkback

i had some trouble trying to style the talkback in my site =\ its in the ABOUT link anyway
i did as the very nice instructions told me
i copied the my-style.css and my-comments-display-tpl.php files into the /talkback directory
also i chaged the file name in the ADMIN settings
into my-comments-display-tpl.php
but it did nothing
also tried to EDIT manually the style.css file but the chages didet happen
i realy like this code and your web site but i seem to have failed with this one =\
what can i do ? what did i do wrong?
should i try to reinstall the whole thing?

thanks from head
liero-israel team

Reply to Liero-Israel
Andy
June 16, 2010 - 16:40
Subject: Re: Styling the talkback

Hi liero! TB is so easy to install that I would start over, so that you have a working baseline. Maybe try the zip I have on the site. And be careful renaming files. Good luck! Best wishes, -Andy

Liero-Israel – israel
June 17, 2010 - 09:43
Subject: thx

im using your zip file
ill try reinstalling and ill tell you whats up!
thx man u rock

Leave a Comment






To prevent automatic spam, we require that you type the two words below before you submit your comment.

Powered by TB

(c) Copyright asiteaboutnothing.net