Welcome to Geeklog Tuesday, November 21 2017 @ 08:50 am EST


Status: offline

::Ben

Forum User
Full Member
Registered: 14/01/2005
Posts: 1569
Location:la rochelle, France
I'm working on a monitor plugin upgrade and I want to allow admins to edit (silently) or delete any comment. Basicaly, it is a complete list of all the comment.

I delete comments with:
PHP Formatted Code

$sql = "DELETE FROM {$_TABLES['comments']} "
                 . "WHERE cid = '{$cid}'";
DB_query ($sql);
 


but I wonder if there is a best way, a cleanest way, an api... to take care of sub-comment, comment feed, etc... ?

Ben
I'm available to customise your themes or plugins for your Geeklog CMS

Status: offline

Dirk

Site Admin
Admin
Registered: 12/01/2002
Posts: 13073
Location:Stuttgart, Germany
Please don't delete comments directly. The comments are kept in a tree structure for faster access and that tree needs to be re-balanced when a comment is removed.

Use CMT_deleteComment() from system/lib-comment.php

bye, Dirk

Status: offline

::Ben

Forum User
Full Member
Registered: 14/01/2005
Posts: 1569
Location:la rochelle, France
Dirk, thank you for reminding me the lib-comment.php file Smile
Everything I need is within.

Ben
I'm available to customise your themes or plugins for your Geeklog CMS

All times are EST. The time is now 08:50 am.

  • 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