Comments Compare + Count

16 posts by 2 authors in: Forums > CMS Builder
Last Post: July 16, 2010   (RSS)

Ok. The error is gone. I had to at @ before $count, but it doesn't reflect an accurate comment count, and somehow leaves the first article out. If you load this link, http://www.illumemag.com/zine/categoryIndex.php you can see.

Thanks.

Re: [Illume Magazine] Comments Compare + Count

I updated with this and it works well. Thanks for all your help Jason!

<?php
$trans = array("-" => "", " " => "-", ";" => "", "'" => "", ":" => "");
$commentValue = "/zine/articleDetail.php?".strtr($record['title'], $trans)."-".$record['num'];
@$count = mysql_select_count_from("comments","commentValue='$commentValue'");
?><?php echo @$count; ?>

Re: [Illume Magazine] Comments Compare + Count

hmm...still skipping out on url format...misses some article titles..

Re: [Illume Magazine] Comments Compare + Count

By Jason - July 15, 2010

Hi,

I just added to the array to remove question marks. It seems to be working now. If you run into any other problems, just let me know.

Thanks
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Illume Magazine] Comments Compare + Count

By Jason - July 16, 2010

Hi,

You can try adding the single and double quotes to your array that's used to remove characters from the string.
Something like this:
$trans = array("-" => "", " " => "-", ";" => "", "'" => "-", ":" => "","?"=>"","\'"=>"","\""=>"");

This should strip out single and double quotes completely.

Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/