Welcome to Geeklog, Anonymous Wednesday, November 27 2024 @ 05:50 pm EST
Geeklog Forums
Inaccurate Trackback Count
Nathan Burke
Anonymous
I'm experiencing something strange. On my blog's homepage, there are no trackbacks listed, instead it says: Comments (5) Trackbacks (0)
However, when you click through to the story, there's actually one trackback there.
When I look at other stories that have trackbacks listed on the blog's home page, the numbers do match. For instance, on one story I see:
Comments (7) Trackbacks (12)
And when I click through, there are exactly 12 trackbacks.
Any ideas?
Thanks so much!
However, when you click through to the story, there's actually one trackback there.
When I look at other stories that have trackbacks listed on the blog's home page, the numbers do match. For instance, on one story I see:
Comments (7) Trackbacks (12)
And when I click through, there are exactly 12 trackbacks.
Any ideas?
Thanks so much!
16
15
Quote
Status: offline
Dirk
Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Is this only true for this one story or do you have several such cases?
Geeklog keeps a trackback counter in the story so that it doesn't have to count the trackbacks every time. It appears that counter is out of sync. You could fix it manually in the database if it's just the one story.
bye, Dirk
Geeklog keeps a trackback counter in the story so that it doesn't have to count the trackbacks every time. It appears that counter is out of sync. You could fix it manually in the database if it's just the one story.
bye, Dirk
8
16
Quote
Nathan Burke
Anonymous
Thanks so much for your reply. It does seem that there are a few other occurrences of this issue. In addition, there are two or three places where the comment count is incorrect. For instance, on the home page, I see comments (1) and when I click through, there are zero comments.
Any ideas how I could prevent this from happening in the future?
Thank you.
Any ideas how I could prevent this from happening in the future?
Thank you.
12
10
Quote
Status: offline
Dirk
Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Geeklog will save the comment or trackback first and then update the counter. So, on rare occasions, something may happen between those two steps and the counter would not be updated. But that should only be very rare things, like the MySQL server crashing or being restarted.
bye, Dirk
bye, Dirk
14
9
Quote
Status: offline
tmarquez
Forum User
Regular Poster
Registered: 06/17/03
Posts: 70
I've noticed the same problem on my site, but I haven't done any troubleshooting to isolate the issue or provide more details for the people who are much smarter than me on this geeklog. Hell, to be honest, I can't even seem to grasp how do trackbacks! I just know I have seen the incorrect trackback numbers on my stories. I'll will hopefully look into soon.
T.Marquez Jr. -
Webmaster -
www.indianapolisfilm.net - Geeklog 1.4.0sr5-1
T.Marquez Jr. -
Webmaster -
www.indianapolisfilm.net - Geeklog 1.4.0sr5-1
16
16
Quote
Status: offline
tmarquez
Forum User
Regular Poster
Registered: 06/17/03
Posts: 70
Ok... I figured out what the problem was on my site, so maybe this will help some people.
Example: I have a story that has a trackbacks in it. The trackback field in gl_stories for this story shows 1. I then go to edit the file, setting the comments to disable. Now the story shows on the main site indicating (0)trackbacks and the tracbacks filed in the gl_stories is at 0 as well. If I turn comments back on (enable comments) for the article, the trackback number of course does not return, and I then have to edit the field in the database indicating the correct number of trackbacks for that story. Then everything is fine.
Hope this helps.
T.Marquez Jr. -
Webmaster -
www.indianapolisfilm.net - Geeklog 1.4.0sr5-1
Example: I have a story that has a trackbacks in it. The trackback field in gl_stories for this story shows 1. I then go to edit the file, setting the comments to disable. Now the story shows on the main site indicating (0)trackbacks and the tracbacks filed in the gl_stories is at 0 as well. If I turn comments back on (enable comments) for the article, the trackback number of course does not return, and I then have to edit the field in the database indicating the correct number of trackbacks for that story. Then everything is fine.
Hope this helps.
T.Marquez Jr. -
Webmaster -
www.indianapolisfilm.net - Geeklog 1.4.0sr5-1
8
16
Quote
Status: offline
Dirk
Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Actually, every time you edit a story, the trackback count is reset to 0. Now that's quite some bug ...
In admin/story.php, find this line (line 901 in 1.4.0sr5-1):
and replace it with these lines:
array ($sid, 'article'));
$trackbacks = DB_count ($_TABLES['trackback'], array ('sid', 'type'),
array ($sid, 'article'));
To fix your trackback count, you can simply edit the story and save it again unchanged and it will update the trackback and comment counters for you.
This also fixes a potentially wrong comment count in case some plugin that supports comments used an id that's identical to one of your story ids (not very likely, but it could happen).
bye, Dirk
In admin/story.php, find this line (line 901 in 1.4.0sr5-1):
Text Formatted Code
$comments = DB_count($_TABLES['comments'],'sid',$sid);and replace it with these lines:
Text Formatted Code
$comments = DB_count ($_TABLES['comments'], array ('sid', 'type'),array ($sid, 'article'));
$trackbacks = DB_count ($_TABLES['trackback'], array ('sid', 'type'),
array ($sid, 'article'));
To fix your trackback count, you can simply edit the story and save it again unchanged and it will update the trackback and comment counters for you.
This also fixes a potentially wrong comment count in case some plugin that supports comments used an id that's identical to one of your story ids (not very likely, but it could happen).
bye, Dirk
18
14
Quote
Status: offline
Dazzy
Forum User
Full Member
Registered: 07/19/03
Posts: 200
Location:N. Ireland
This also fixes a potentially wrong comment count in case some plugin that supports comments used an id that's identical to one of your story ids (not very likely, but it could happen).
I had an incorrect comment count when I first launched our site, the featured story and poll seemed to be linked, every time a comment was added to the poll, it would be added to the story comment count. Must have been an isolated incident hasn't happened since (using version 1.4.0sr5).
Dazzy
17
19
Quote
Status: offline
Dirk
Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by: Dazzy
I had an incorrect comment count when I first launched our site, the featured story and poll seemed to be linked, every time a comment was added to the poll, it would be added to the story comment count. Must have been an isolated incident hasn't happened since (using version 1.4.0sr5).
I assume that featured story and poll used the same id. I just found several other places in the code where comments were counted but the 'type' wasn't taken into account
bye, Dirk
14
11
Quote
All times are EST. The time is now 05:50 pm.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content