Kayako logo
Developers & Code Interested in customizing your Kayako products? Discuss modifications and develop your own mods with the community.

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  (#1) Old
NC Software Offline
Member
 
NC Software's Avatar
 
Posts: 527
Join Date: Dec 2005
Location: Sitting
Exclamation SQL Query to clear comments please - 01-03-2007, 07:27 PM

As you have yet to provide a feature to disable comments, please provide a SQL Query I can run that removes ALL comments from my database please.


Neal Culiner
NC Software, Inc.
Visual Basic .NET Forums
3.30.02 STABLE
   
Reply With Quote
  (#2) Old
eiden Offline
Member
 
Posts: 234
Join Date: Apr 2006
Location: Norway
01-03-2007, 09:35 PM

Have you tried disabling the comments in the code?
Deleting comments in batch

The comments are stored in the swcommentdata and swcomments tables.
   
Reply With Quote
  (#3) Old
bear Offline
Community Moderator
 
Posts: 713
Join Date: Jan 2005
01-03-2007, 09:42 PM

Had my answer done....board is still flipping back to the closed older version and I couldn't reply. Here is what I wrote:

Yes, it needs fixing so it's optional or locked to registered users. Meanwhile, just use PHPmyadmin to truncate two tables: `swcomments` and `swcommentdata`.
   
Reply With Quote
  (#4) Old
AllureHost Offline
Member
 
Posts: 33
Join Date: Jun 2005
Location: USA
02-03-2007, 02:37 PM

Quote:
Originally Posted by NC Software View Post
As you have yet to provide a feature to disable comments, please provide a SQL Query I can run that removes ALL comments from my database please.
This feature should have been added in 3.10. I am sorry but why was it not? Disable and comment pruner would have been great features and have been discussed multiple times on these forums and in feature tracker. Is there anyone willing to create a mod for this particular purpose. I would have a friend of mine make one, but I do not have an owned license :-(.

- John


John Lewis | Web Hosting & Reseller Hosting Services | AllureHost
Yes, we do accept PayPal payments!
cPanel/WHM | RVSkin | Fantastico | Ruby on Rails | PHP5 Support | Site Builder | Free Site Transfer
   
Reply With Quote
  (#5) Old
handsonweb Offline
Member
 
Posts: 34
Join Date: Aug 2003
Location: Fullerton, CA
06-03-2007, 02:04 AM

Here's some SQL code for you, we run it every night;

Code:
DELETE FROM swcommentdata, swcomments USING swcommentdata, swcomments
WHERE swcomments.commentid = swcommentdata.commentid
AND
swcommentdata.contents like '%http%'
AND
swcomments.isapproved = 0
Basically the code above checks the COMMENTS section for any unapproved comments with an http link in them and if it does, it blows it out.

One of my staff memebers at Hands-on Web Hosting wrote the code for me - works like a charm.
   
Reply With Quote
  (#6) Old
atDev Offline
Member
 
Posts: 91
Join Date: Jan 2007
06-03-2007, 07:28 AM

Quote:
Originally Posted by handsonweb View Post
Here's some SQL code for you, we run it every night;

Code:
DELETE FROM swcommentdata, swcomments USING swcommentdata, swcomments
WHERE swcomments.commentid = swcommentdata.commentid
AND
swcommentdata.contents like '%http%'
AND
swcomments.isapproved = 0
Basically the code above checks the COMMENTS section for any unapproved comments with an http link in them and if it does, it blows it out.

One of my staff memebers at Hands-on Web Hosting wrote the code for me - works like a charm.
This still leaves the comments count the same.
   
Reply With Quote
  (#7) Old
bear Offline
Community Moderator
 
Posts: 713
Join Date: Jan 2005
06-03-2007, 12:20 PM

I made a post about how to disable comments completely:
Disabling comments and stopping comment spam

If you want them completely disabled as I did, this post's for you.
   
Reply With Quote
  (#8) Old
tjbaker Offline
New Member
 
Posts: 11
Join Date: Feb 2007
10-06-2008, 07:45 PM

Quote:
Originally Posted by atDev View Post
This still leaves the comments count the same.
sorry... don't understand...what does that mean?

Does this query work or no, please?

I would really like to delete the 2000+ spam entries - and I really don't want to have to disable comments as I think it a nice feature....

Last edited by tjbaker; 10-06-2008 at 08:06 PM.
   
Reply With Quote
  (#9) Old
bear Offline
Community Moderator
 
Posts: 713
Join Date: Jan 2005
10-06-2008, 09:24 PM

Quote:
Originally Posted by tjbaker View Post
sorry... don't understand...what does that mean?
Does this query work or no, please?
The query should remove the actual comments, but not the "counter" that says how many there are. I'd disabled mine completely, then truncated the comment spams, but it still shows me as having a few hundred comments, when there are definitely none.
   
Reply With Quote
  (#10) Old
NC Software Offline
Member
 
NC Software's Avatar
 
Posts: 527
Join Date: Dec 2005
Location: Sitting
10-06-2008, 09:48 PM

It's a shame Kayako can't build in a simple switch to disable comments! I'm sure their help desk has a gazillion of them, assuming they use Kayako!


Neal Culiner
NC Software, Inc.
Visual Basic .NET Forums
3.30.02 STABLE
   
Reply With Quote
  (#11) Old
craigbrass Offline
Senior Member
 
Posts: 5,933
Join Date: Jun 2005
Location: Cumbria, UK
11-06-2008, 09:10 AM

I think it is planned for V4.


Craig Brass - Kayako Forum Squatter (Note: I am NOT a staff member)

Icon Headquarters - Its Elixir - Web2Messenger
   
Reply With Quote
Reply

Tags
clear, comments, query, sql

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
Help desk software by Kayako.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48