コード例 #1
0
ファイル: ajax.php プロジェクト: evanfarrar/opensprints.org
            }
        }
        $r = 1;
    } while (0);
    /*
    	find comment and gather info about it and the discussion (are they whispered, for instance?)
    if commentID = firstcommentID, then delete discussion and all associated comments
    else simply remove the comment, and update discussion
    to update discussion:
    		if discussion is a whisper, set last active and last user values to latest comment; don't bother with whispered details
    		if not, set last active and last user values to latest non-whispered comment; set last whisper date/to user/from user to last whispered comment
    		finally reset user discussion watch if comment is not a whisper
    */
    return $r;
}
if (($r = RemoveComment(ForceIncomingInt('CommentID', -1))) == 1) {
    echo 'itwasasuccess';
} else {
    switch ($r) {
        case -1:
            echo 'That comment does not exist';
            break;
        case -2:
            echo 'Insufficient privileges';
            break;
        case 0:
        default:
            echo strip_tags(implode("\n", $Context->ErrorManager->Errors));
            break;
    }
}
コード例 #2
0
<?php

session_name('reglogin');
session_start();
$commentid = $_GET['commentid'];
include "/export/home/mclaug67/source_html/public_html/awp/PhotoSite/Connect-webuser.php";
include "DB_Functions.php";
$dbh = ConnectDB();
echo RemoveComment($dbh, $commentid);
?>