home *** CD-ROM | disk | FTP | other *** search
/ PC World 2001 March / PCWorld_2001-03_cd.bin / KOMUNIK / progweb / progweb.exe / phpnuke / html / admin / comments.php < prev    next >
PHP Script  |  2000-12-05  |  2KB  |  62 lines

  1. <?PHP
  2.  
  3. ######################################################################
  4. # PHP-NUKE: Web Portal System
  5. # ===========================
  6. #
  7. # Copyright (c) 2000 by Francisco Burzi (fburzi@ncc.org.ve)
  8. # http://phpnuke.org
  9. #
  10. # This modules is the main administration part
  11. #
  12. # This program is free software. You can redistribute it and/or modify
  13. # it under the terms of the GNU General Public License as published by
  14. # the Free Software Foundation; either version 2 of the License.
  15. ######################################################################
  16.  
  17. if (!eregi("admin.php", $PHP_SELF)) { die ("Access Denied"); }
  18. $result = mysql_query("select radminsuper from authors where aid='$aid'");
  19. list($radminsuper) = mysql_fetch_row($result);
  20. if ($radminsuper==1) {
  21.  
  22. /*********************************************************/
  23. /* Comments Delete Function                              */
  24. /*********************************************************/
  25.  
  26. // This function is a big crap. I need to delete all babies comments
  27. // maybe by setting a unique number for each Parent comment?
  28. // Anyone, please help me to do this!
  29.  
  30. function removeComment ($tid, $sid) {
  31.     global $ultramode;
  32.     mysql_query("update stories set comments=comments-1 where sid='$sid'");
  33.     mysql_query("DELETE FROM comments where tid=$tid");
  34.     mysql_query("DELETE FROM comments where pid=$tid");
  35.     if ($ultramode) {
  36.     ultramode();
  37.     }
  38.     Header("Location: article.php?sid=$sid");
  39. }
  40.  
  41. function RemovePollComment ($tid, $pollID) {
  42.     mysql_query("DELETE FROM pollcomments where tid=$tid and pollID=$pollID");
  43.     mysql_query("DELETE FROM pollcomments where pid=$tid");    
  44.     Header("Location: pollBooth.php?op=results&pollID=$pollID");
  45. }
  46.  
  47. switch ($op) {
  48.  
  49.         case "RemoveComment":
  50.             removeComment($tid, $sid);
  51.             break;
  52.  
  53.         case "RemovePollComment":
  54.             RemovePollComment($tid, $pollID);
  55.             break;
  56.  
  57. }
  58.  
  59. } else {
  60.     echo "Access Denied";
  61. }
  62. ?>