FIXED!!!
My problem was in the portion of code you place in the top of your
HTML template.
This is how the script is now, and the counts are working.
If you have problems copy/pasting this from this page, email me and
I'll send you the code in a .txt file.
<?
function commentCount($n) {
// set the same values from comments.php
$bannedIP = array("200.206.239.236","200.18.97.113");
$banIPMode = "0";
$comments_path = "";
// Don't edit from this point
if($file = @fopen($comments_path . "comments/$n.comment", 'r')) {
$thisFile = fread($file, '1000000');
$thisFile = explode("\n", trim($thisFile));
fclose($file);
$comments = sizeof($thisFile);
if($banIPMode)
for($i = 0; $i < sizeof($thisFile); $i++) {
$thisComment = explode('[+]', $thisFile[$i]);
if($thisComment[6] || $banIPMode != 4 &&
in_array($thisComment[5], $bannedIP)) $comments--;
}
if($comments == 1) {$comments .= " comment";} else {$comments .= "
comments";}
} else
$comments = "0 comments";
return $comments;
}
?>
(put this above your <head> tag, at the very top of your html
document)
--- In dotcomments-support@yahoogroups.com, "peromedic"
<peromedic@y...> wrote:
> I am still trying to work on a solution for this. I am weary of the
> problem by now. I have checked the first section of code and
re-placed
> it twice. I have checked the bit of code in the <head of the
document.
> I have checked the script that opens the comment window. I don't
know
> enough about PHP to know if that file has an error.
>
> I am at a loss. If I manage to find the solution I will document it
> here (and keep the information for future problems people have since
> it is common).
>
> The count used to work. The comments post - the only thing not
working
> is the count. ANY help or suggestions is appreciated - many people
are
> stuck on 0 waiting for assistance.
>
> Thank you.
>
> --- In dotcomments-support@yahoogroups.com, "caldha" <mick@f...>
wrote:
> > I am still having some issues with comments being recorded and
> > showing on the comments page. I have went over and over it all.
> >
> > http://www.bastardinc.com
> >
> > Who knows, could be like usual, I skipped something once again.
> > Any help would be greatly appreciated.
> >
> > --Mick
> >
> >
> >
> >
> > --- In dotcomments-support@yahoogroups.com, "peromedic"
> > <peromedic@y...> wrote:
> > >
> > > I realize that this post is old, but the number count problem
seems
> > to be a common issue.
> > >
> > > in the past I have used FTP to upload comments to old posts
(like I
> > did when I switched
> > > hosts). And it worked great.
> > >
> > > I am wondering how well this wil work if I attempt it again
> > (deleting and uploading the
> > > comments files and folder again), then changing the permissions
to
> > 777.
> > >
> > > I don't really want to lose all of the comments, and wondered
how
> > much luck anyone else
> > > has had with this process. (thanks)
> > >
> > > --- In dotcomments-support@y
> ahoogroups.com, "boltyboy69"
> > <matthew@m...> wrote:
> > > > This works fine BUT you MUST delete the old comments files
first.
> > > >
> > > > matthew Holt
> > > > --- In dotcomments-support@yahoogroups.com, Listas
<listas@o...>
> > > > wrote:
> > > > > Hello dotcomments-support,
> > > > >
> > > > > i was almost pulling my hair out, because the countcomments
was
> > not
> > > > > working.
> > > > >
> > > > > then i discovered that the problem is on the readme file,
line
> > 204
> > > > >
> > > > > when you read:
> > > > > <a href="javascript:viewComments(<$BlogItemNumber$>)"><?
echo
> > > > commentCount(<$BlogItemNumber$>); ?></a>
> > > > >
> > > > > should be:
> > > > > <a href="javascript:viewComments('<$BlogItemNumber$>')"><?
echo
> > > > commentCount('<$BlogItemNumber$>'); ?></a>
> > > > >
> > > > > what's the big deal, you might ask.
> > > > >
> > > > > The big deal are the single quotes. If you use this line
without
> > > > > quotes, javascript will convert the huge number to another
one,
> > and
> > > > > when PHP tries to open the file javascript funcion as
passing
> > to
> > > > it,
> > > > > the file doesn't exist.
> > > > >
> > > > > example: my postid was: javascript:viewComments
> > > > (106147597912476108).
> > > > > when the first user created a comment, PHP
recorded a
> > file
> > > > > called "106147597912476110.comment". Since You use
a
> > > > nonquoted
> > > > > number through javascript, you comment engine will
> > work.
> > > > But
> > > > > not the counter. PHP will try to open the file
> > > > > 1.0614759791248E+017.comment, and get a 404.
> > > > >
> > > > > But i could post and read, because javascript was
> > passing
> > > > > 106147597912476110 to the file comments.php.
> > > > >
> > > > > Then, when i figured out (after a bunch of alert()
> > > > debugs), i
> > > > > quoted the numbers and everything started to work.
but
> > i
> > > > had
> > > > > to rename my old comment files.
> > > > >
> > > > > It's a great comment system, simple and powerfull, with
only a
> > bug
> > > > on
> > > > > the installation instructions. great work.
> > > > >
> > > > > Oh; i also made the form a little more beatiful adding a
line
> > in
> > > > the
> > > > > style section (line 93), comments.php:
> > > > >
> > > > > input, textarea {font-family: <?php echo $font_face; ?>;
font-
> > > > size: <?echo $font_size; ?>}
> > > > >
> > > > > that's all folks. happy coding.
> > > > >
> > > > > system: msie 5.5, mozilla firebird, win2k sp4