Jump to content


Photo
- - - - -

[BUG FIX] - Siteadmin : Delete Video Comment


  • Please log in to reply
No replies to this topic

#1 theone

theone

    Senior Member

  • Members
  • PipPipPipPip
  • 368 posts

Posted 03 February 2013 - 03:08 AM

If you delete a comment via the Siteadmin panel, it does not update the com_num value in the database.

The com_num is used by Siteadmin to inform you of how many comments a video has.

If a video has 10 comments and you delete one of them via the Siteadmin panel then it will still show the video as having 10 comments, when in fact, it should be only 9.

Here is how to fix this problem.

Open ../siteadmin/modules/videos/comments.php

Find....

        $sql = "DELETE FROM video_comments WHERE CID = '" .mysql_real_escape_string($COMID). "' LIMIT 1";
$conn->execute($sql);


Add this below.....

	    $sql            = "UPDATE video SET com_num = com_num-1 WHERE VID = " .$VID. " LIMIT 1";
$conn->execute($sql);


This will now update the com_num field in the database when the administrator deletes a video from the Siteadmin panel and the correct number of remaining comments will be displayed.

Edited by theone, 03 February 2013 - 03:10 AM.