michel v Site Admin
Joined: 25 Jan 2002 Posts: 799 Location: Corsica
|
Posted: Mon Sep 30, 2002 1:39 am Post subject: if you downloaded 0.6 before 01:36 GMT |
|
|
If you downloaded b2 0.6 before 01:36 GMT, you'll see the counts for comments/trackbacks/pingbacks are wrong.
This is because of a last-minute bug in b2template.functions.php
Here's the fix.
Open b2template.functions.php, find these lines:
[php:1:f936180722] while($row = mysql_fetch_object($result)) {
if (stristr($row->comment_text, '<trackback />')) {
$ctp_number['trackbacks']++;
} elseif (stristr($row->comment_text, '<pingback />')) {
$ctp_number['pingbacks']++;
} else {
$ctp_number['comments']++;
}
$ctp_number['ctp']++;
}
$cache_ctp_number[$post_id] = $ctp_number;
} else {
$ctp_number = $cache_ctp_number[$post_id][$mode];
}[/php:1:f936180722]
Replace them with these lines:
[php:1:f936180722] while($row = mysql_fetch_object($result)) {
if (substr($row->comment_content, 0, 13) == '<trackback />') {
$ctp_number['trackbacks']++;
} elseif (substr($row->comment_content, 0, 12) == '<pingback />') {
$ctp_number['pingbacks']++;
} else {
$ctp_number['comments']++;
}
$ctp_number['ctp']++;
}
$cache_ctp_number[$post_id] = $ctp_number;
} else {
$ctp_number = $cache_ctp_number[$post_id];
}[/php:1:f936180722]
And your counts shall be right  |
|