Search the web
Sign In
New User? Sign Up
dotcomments-support · dotcomments
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
My Solution for "0 comments". the simplest.   Message List  
Reply | Forward Message #740 of 928 |
Re: Solution for "0 comments".??

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





Sat May 28, 2005 5:31 pm

peromedic
Offline Offline
Send Email Send Email

Forward
Message #740 of 928 |
Expand Messages Author Sort by Date

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...
Listas
mauwolff
Offline Send Email
Aug 25, 2003
5:43 pm

This works fine BUT you MUST delete the old comments files first. matthew Holt ... commentCount(<$BlogItemNumber$>); ?></a> ... ...
boltyboy69
Offline Send Email
Sep 8, 2003
9:45 pm

Hello boltyboy69, Monday, September 8, 2003, 6:42:36 PM, you wrote: b> This works fine BUT you MUST delete the old comments files first. i renamed them to...
Listas
mauwolff
Offline Send Email
Sep 17, 2003
2:14 am

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...
peromedic
Offline Send Email
Mar 18, 2005
5:42 pm

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...
caldha
Offline Send Email
May 18, 2005
4:31 pm

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...
peromedic
Offline Send Email
May 22, 2005
4:47 pm

Double-check your server's PHP configuration. In php.ini, dotcomments requires register_globals to be On. Found this out the hard way, after using a custom...
Angela Allen
usaf_angela
Offline Send Email
May 22, 2005
6:53 pm

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...
peromedic
Offline Send Email
May 28, 2005
5:31 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help